summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2020-03-20 11:07:17 -0700
committer Winson Chung <winsonc@google.com> 2020-03-24 20:56:29 -0700
commitb478e576adc3b77bbda23a63833d58bc450e44da (patch)
treebf23df38d5c267e632c1fd22959f5460d7934c79
parent09b95708628b34df20b219c15c1e60f4bcca481b (diff)
Account for stopping activities when determining whether to restart
- We were seeing a flakey issue with gesture nav, when swiping immediately after launching an app, the system would stop launcher, but shortly after, we would start the recents animation for the next gesture. The recents animation calls: [RWC->DC->AS].ensureActivitiesVisible() -> EnsureActivitiesVisibleHelper.setActivityVisibilityState() -> AR.makeActiveIfNeeded() -> AR.shouldStartActivity() and the visible is requested, but we are currently still stopping because the client hasn't called back. This results in the animation continuing, but the system silently not scheduling launcher to be started, which prevents a draw-callback to finish on the client side, which then prevents us from finishing the recents animation (we are waiting for the draw to update the task view with the snapshot). Bug: 151788100 Test: Manual, it's hard to repro but you just have to swipe up after launching apps really quickly to get stuck in a state where you can't swipe up at all Change-Id: I32628f1e532764fc1ef962c6d4602214ca7c36c4
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 6d53786ddf41..3477d82f4d71 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -4618,6 +4618,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
} catch (Exception e) {
Slog.w(TAG, "Exception thrown sending start: " + intent.getComponent(), e);
}
+ // The activity may be waiting for stop, but that is no longer appropriate if we are
+ // starting the activity again
+ mStackSupervisor.mStoppingActivities.remove(this);
}
return false;
}
@@ -4667,7 +4670,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
* and {@link #shouldPauseActivity(ActivityRecord)}.
*/
private boolean shouldStartActivity() {
- return mVisibleRequested && isState(STOPPED);
+ return mVisibleRequested && (isState(STOPPED) || isState(STOPPING));
}
/**