Fix animations home

- To prevent surface thrashing, we no longer hide the home activity before
  starting the transition home. This prevents the launcher from being added
  to the remote animation target list, which means that we default to
  skipping the launcher animation. As a workaround, we special case the
  flow and force the animation to run when starting the recents animation.

Bug: 74405472
Test: Go home from an app, ensure there is an animation.
Change-Id: Ifd2b39444fdeab323ee79a368b580a6264c3e5b9
This commit is contained in:
Winson Chung
2018-04-04 13:33:23 -07:00
parent bc5bfc1119
commit 9800e730a2
3 changed files with 36 additions and 1 deletions

View File

@@ -39,6 +39,9 @@ public abstract class BaseActivity extends Activity {
protected SystemUiController mSystemUiController;
private boolean mStarted;
// When the recents animation is running, the visibility of the Launcher is managed by the
// animation
private boolean mForceInvisible;
private boolean mUserActive;
public DeviceProfile getDeviceProfile() {
@@ -100,6 +103,7 @@ public abstract class BaseActivity extends Activity {
@Override
protected void onStop() {
mStarted = false;
mForceInvisible = false;
super.onStop();
}
@@ -125,6 +129,22 @@ public abstract class BaseActivity extends Activity {
}
}
/**
* Used to set the override visibility state, used only to handle the transition home with the
* recents animation.
* @see LauncherAppTransitionManagerImpl.getWallpaperOpenRunner()
*/
public void setForceInvisible(boolean invisible) {
mForceInvisible = invisible;
}
/**
* @return Wether this activity should be considered invisible regardless of actual visibility.
*/
public boolean isForceInvisible() {
return mForceInvisible;
}
/**
* Sets the device profile, adjusting it accordingly in case of multi-window
*/