Reset wait for transition state to false when recents goes invisible
From ag/2572257, this change will ensure the transition wait flag to be false when recents runs "onStop" or when it becomes invisible. This should fix edge cases when a user goes from Recents to somewhere that is not a fullscreen app (like home). Resetting the state should allow users to use the recents button without getting blocked. There is only two locations where the flag is set to true, when user starts recents and when an app is started from recents. When a user goes from recents to home with the recents button (when the phone gets into a wierd state), then the flag is true but home does not reset the flag because the old change expects a non-home app to start. Now whenever recents is dismissed, the flag will be reset. Fixes: 37277853 Bug: 64098508 Test: start recents with apps in it, go to guest account, start apps in recents, go back to main account, unlock keyguard, press recents button to dismiss recents (do not press home or back), it will go to home, press recents again Change-Id: I07c292d701a621685c836a4f6040864377f0a3dd
This commit is contained in:
@@ -54,6 +54,7 @@ import com.android.systemui.plugins.PluginActivityManager;
|
||||
import com.android.systemui.recents.events.EventBus;
|
||||
import com.android.systemui.recents.events.activity.ConfigurationChangedEvent;
|
||||
import com.android.systemui.recents.events.activity.DockedTopTaskEvent;
|
||||
import com.android.systemui.recents.events.activity.LaunchTaskFailedEvent;
|
||||
import com.android.systemui.recents.events.activity.RecentsActivityStartingEvent;
|
||||
import com.android.systemui.recents.events.component.RecentsVisibilityChangedEvent;
|
||||
import com.android.systemui.recents.events.component.ScreenPinningRequestEvent;
|
||||
@@ -612,6 +613,14 @@ public class Recents extends SystemUI
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// This will catch the cases when a user launches from recents to another app
|
||||
// (and vice versa) that is not in the recents stack (such as home or bugreport) and it
|
||||
// would not reset the wait for transition flag. This will catch it and make sure that the
|
||||
// flag is reset.
|
||||
if (!event.visible) {
|
||||
mImpl.setWaitingForTransitionStart(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -684,6 +693,11 @@ public class Recents extends SystemUI
|
||||
}
|
||||
}
|
||||
|
||||
public final void onBusEvent(LaunchTaskFailedEvent event) {
|
||||
// Reset the transition when tasks fail to launch
|
||||
mImpl.setWaitingForTransitionStart(false);
|
||||
}
|
||||
|
||||
public final void onBusEvent(ConfigurationChangedEvent event) {
|
||||
// Update the configuration for the Recents component when the activity configuration
|
||||
// changes as well
|
||||
|
||||
Reference in New Issue
Block a user