summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/am/ActivityStack.java
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2013-09-30 10:34:55 -0700
committerCraig Mautner <cmautner@google.com>2013-09-30 10:34:55 -0700
commit19d112d83643c6595d435d41df6b7ff63ded590f (patch)
treeb8ffb5a2efc34c43221bd39761b7e865824dbb24 /services/java/com/android/server/am/ActivityStack.java
parent57d96f0e92e8af842878660a8271e65cec2426d3 (diff)
Don't display hidden activities over home screen.
Fixes jank exposed in 10881705. Specifically background activity animating up along with translucent activity. Repro steps on manta: 1. From home start Settings. 2. Press home. 3. From home start Downloads (translucent activity that takes 85% of screen). 4. Observe that as Downloads zooms up the 15% boundary that should be dimly transparent are showing Settings. The cause was that there is a finishing activity in the Downloads task that was used to launch the DownloadsActivity. The existence of that activity kept the logic from recognizing that the home activity was behind the DownloadsActivity, not the Settings activity. This fix descends through all of the activities in a task sitting on home and makes sure that they only keep home from showing if such activities are not finishing and visible. Change-Id: I607afce6b0000b4db634f2ce40a6c37fcee369d7
Diffstat (limited to 'services/java/com/android/server/am/ActivityStack.java')
-rw-r--r--services/java/com/android/server/am/ActivityStack.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index a7fc99593301..4d669461d35d 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -1083,10 +1083,24 @@ final class ActivityStack {
// At this point, nothing else needs to be shown
if (DEBUG_VISBILITY) Slog.v(TAG, "Fullscreen: at " + r);
behindFullscreen = true;
- } else if (task.mActivities.indexOf(r) == 0 && task.mOnTopOfHome) {
- if (DEBUG_VISBILITY) Slog.v(TAG, "Showing home: at " + r);
- showHomeBehindStack = true;
- behindFullscreen = true;
+ } else if (task.mOnTopOfHome) {
+ // Work our way down from r to bottom of task and see if there are any
+ // visible activities below r.
+ int rIndex = task.mActivities.indexOf(r);
+ for ( --rIndex; rIndex >= 0; --rIndex) {
+ final ActivityRecord blocker = task.mActivities.get(rIndex);
+ if (!blocker.finishing && blocker.visible) {
+ if (DEBUG_VISBILITY) Slog.v(TAG, "Home visibility for " +
+ r + " blocked by " + blocker);
+ break;
+ }
+ }
+ if (rIndex < 0) {
+ // Got to task bottom without finding a visible activity, show home.
+ if (DEBUG_VISBILITY) Slog.v(TAG, "Showing home: at " + r);
+ showHomeBehindStack = true;
+ behindFullscreen = true;
+ }
}
} else {
if (DEBUG_VISBILITY) Slog.v(