Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76ffdafc authored by Winson's avatar Winson
Browse files

Fixing issue with empty Recents screen.

- We did not expect RecentsActivity to be launched without going through
  the normal SystemUI controls, but when the home activity is in the foreground
  and killed (via a normal apk update), the RecentsActivity stores the old
  launch configuration and believes that it was launched from home and awaits
  the animation-complete callback to animate the tasks in.
- This CL adds a workaround where the configuration is reset whenever
  RecentsActivity is stopped, which allows the tasks to be shown immediately
  if the User is kicked back into Recents due to an update.

Bug: 22542869
Change-Id: I2b4168ccecfbf868fa6d544fe89109dfa74f51df
parent 120fc2c7
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -419,8 +419,10 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        updateRecentsTasks();

        // If this is a new instance from a configuration change, then we have to manually trigger
        // the enter animation state
        if (mConfig.launchedHasConfigurationChanged) {
        // the enter animation state, or if recents was relaunched by AM, without going through
        // the normal mechanisms
        boolean wasLaunchedByAm = !mConfig.launchedFromHome && !mConfig.launchedFromAppWithThumbnail;
        if (mConfig.launchedHasConfigurationChanged || wasLaunchedByAm) {
            onEnterAnimationTriggered();
        }

@@ -454,6 +456,16 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView

        // Unregister any broadcast receivers for the task loader
        loader.unregisterReceivers();

        // Workaround for b/22542869, if the RecentsActivity is started again, but without going
        // through SystemUI, we need to reset the config launch flags to ensure that we do not
        // wait on the system to send a signal that was never queued.
        mConfig.launchedFromHome = false;
        mConfig.launchedFromSearchHome = false;
        mConfig.launchedFromAppWithThumbnail = false;
        mConfig.launchedToTaskId = -1;
        mConfig.launchedWithAltTab = false;
        mConfig.launchedHasConfigurationChanged = false;
    }

    @Override