diff options
| author | Craig Mautner <cmautner@google.com> | 2013-04-23 11:23:27 -0700 |
|---|---|---|
| committer | Craig Mautner <cmautner@google.com> | 2013-04-23 19:33:27 -0700 |
| commit | cf910b0c714b2ca90ea0013e5695850506a1d36f (patch) | |
| tree | 675cf0274fec4bd86e3664c7826643fec29bbb41 /services/java/com/android/server/am/ActivityStackSupervisor.java | |
| parent | f333327782e14688e1c198c1192172d51308e90b (diff) | |
| download | frameworks_base-cf910b0c714b2ca90ea0013e5695850506a1d36f.zip frameworks_base-cf910b0c714b2ca90ea0013e5695850506a1d36f.tar.gz frameworks_base-cf910b0c714b2ca90ea0013e5695850506a1d36f.tar.bz2 | |
Add tap detector for switching stack focus.
- New InputEventReceiver for detecting taps outside of focused stack
boundaries.
- Fixed bug that wasn't pausing the non-focused window when returning
home.
Change-Id: Ia51d312a7c029abc01eb5df1102814cc29d33b47
Diffstat (limited to 'services/java/com/android/server/am/ActivityStackSupervisor.java')
| -rw-r--r-- | services/java/com/android/server/am/ActivityStackSupervisor.java | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/services/java/com/android/server/am/ActivityStackSupervisor.java b/services/java/com/android/server/am/ActivityStackSupervisor.java index af358c2..89b0ff2 100644 --- a/services/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/java/com/android/server/am/ActivityStackSupervisor.java @@ -216,10 +216,6 @@ public class ActivityStackSupervisor { return !(stack.isHomeStack() ^ getFocusedStack().isHomeStack()); } - boolean homeIsInFront() { - return isFrontStack(mHomeStack); - } - void moveHomeStack(boolean toFront) { final boolean homeInFront = isFrontStack(mHomeStack); if (homeInFront ^ toFront) { @@ -390,6 +386,18 @@ public class ActivityStackSupervisor { return true; } + boolean pauseBackStacks(boolean userLeaving) { + boolean someActivityPaused = false; + for (int stackNdx = mStacks.size() - 1; stackNdx >= 0; --stackNdx) { + final ActivityStack stack = mStacks.get(stackNdx); + if (!isFrontStack(stack) && stack.mResumedActivity != null) { + stack.startPausingLocked(userLeaving, false); + someActivityPaused = true; + } + } + return someActivityPaused; + } + boolean allPausedActivitiesComplete() { for (int stackNdx = mStacks.size() - 1; stackNdx >= 0; --stackNdx) { final ActivityStack stack = mStacks.get(stackNdx); @@ -1983,6 +1991,38 @@ public class ActivityStackSupervisor { return stops; } + void validateTopActivitiesLocked() { + for (int stackNdx = mStacks.size() - 1; stackNdx >= 0; --stackNdx) { + final ActivityStack stack = mStacks.get(stackNdx); + final ActivityRecord r = stack.topRunningActivityLocked(null); + if (isFrontStack(stack)) { + if (r == null) { + Slog.e(TAG, "validateTop...: null top activity, stack=" + stack); + } else { + if (stack.mPausingActivity != null) { + Slog.e(TAG, "validateTop...: top stack has pausing activity r=" + r + + " state=" + r.state); + } + if (r.state != ActivityState.INITIALIZING && + r.state != ActivityState.RESUMED) { + Slog.e(TAG, "validateTop...: activity in front not resumed r=" + r + + " state=" + r.state); + } + } + } else { + if (stack.mResumedActivity != null) { + Slog.e(TAG, "validateTop...: back stack has resumed activity r=" + r + + " state=" + r.state); + } + if (r != null && (r.state == ActivityState.INITIALIZING + || r.state == ActivityState.RESUMED)) { + Slog.e(TAG, "validateTop...: activity in back resumed r=" + r + + " state=" + r.state); + } + } + } + } + public void dump(PrintWriter pw, String prefix) { pw.print(prefix); pw.print("mDismissKeyguardOnNextActivity:"); pw.println(mDismissKeyguardOnNextActivity); |
