Fixing PendingArgs not cleared when going home

Bug: 174781600
Test: manual
Change-Id: I2f192b0f60d843b49b290fa70b76f562fca81e36
This commit is contained in:
Sunny Goyal
2020-12-14 12:30:38 -08:00
parent e1358149fc
commit fee1b25fee
2 changed files with 10 additions and 8 deletions
@@ -167,9 +167,14 @@ public abstract class BaseQuickstepLauncher extends Launcher
}
@Override
protected void handlePendingActivityRequest() {
super.handlePendingActivityRequest();
if (mPendingActivityRequestCode != -1 && isInState(NORMAL)) {
public void onStateSetEnd(LauncherState state) {
super.onStateSetEnd(state);
handlePendingActivityRequest();
}
private void handlePendingActivityRequest() {
if (mPendingActivityRequestCode != -1 && isInState(NORMAL)
&& ((getActivityFlags() & ACTIVITY_STATE_DEFERRED_RESUMED) != 0)) {
// Remove any active ProxyActivityStarter task and send RESULT_CANCELED to Launcher.
onActivityResult(mPendingActivityRequestCode, RESULT_CANCELED, null);
// ProxyActivityStarter is started with clear task to reset the task after which it
+2 -5
View File
@@ -961,8 +961,6 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
DiscoveryBounce.showForHomeIfNeeded(this);
}
protected void handlePendingActivityRequest() { }
private void logStopAndResume(boolean isResume) {
if (mPendingExecutor != null) return;
int pageIndex = mWorkspace.isOverlayShown() ? -1 : mWorkspace.getCurrentPage();
@@ -1053,7 +1051,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
@Override
public void onStateSetEnd(LauncherState state) {
super.onStateSetStart(state);
super.onStateSetEnd(state);
getAppWidgetHost().setResumed(state == LauncherState.NORMAL);
getWorkspace().setClipChildren(!state.hasFlag(FLAG_MULTI_PAGE));
@@ -1479,8 +1477,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
if (!isInState(NORMAL)) {
// Only change state, if not already the same. This prevents cancelling any
// animations running as part of resume
mStateManager.goToState(NORMAL, mStateManager.shouldAnimateStateChange(),
this::handlePendingActivityRequest);
mStateManager.goToState(NORMAL, mStateManager.shouldAnimateStateChange());
}
// Reset the apps view