Merge "Fixed pinned stack lockscreen interaction" into oc-dev

This commit is contained in:
TreeHugger Robot
2017-04-24 14:58:25 +00:00
committed by Android (Google) Code Review
3 changed files with 32 additions and 15 deletions

View File

@@ -204,12 +204,11 @@ class KeyguardController {
mOccluded = false;
mDismissingKeyguardActivity = null;
final ArrayList<ActivityStack> stacks = mStackSupervisor.getStacksOnDefaultDisplay();
final int topStackNdx = stacks.size() - 1;
for (int stackNdx = topStackNdx; stackNdx >= 0; --stackNdx) {
for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
final ActivityStack stack = stacks.get(stackNdx);
// Only the very top activity may control occluded state
if (stackNdx == topStackNdx) {
// Only the focused stack top activity may control occluded state
if (mStackSupervisor.isFocusedStack(stack)) {
// A dismissing activity occludes Keyguard in the insecure case for legacy reasons.
final ActivityRecord topDismissing = stack.getTopDismissingKeyguardActivity();

View File

@@ -95,6 +95,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
// change.
private boolean mReparenting;
// True if we are current in the process of removing this app token from the display
private boolean mRemovingFromDisplay = false;
// The input dispatching timeout for this application token in nanoseconds.
long mInputDispatchingTimeoutNanos;
@@ -464,6 +467,12 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
return !hidden;
}
@Override
void removeImmediately() {
onRemovedFromDisplay();
super.removeImmediately();
}
@Override
void removeIfPossible() {
mIsExiting = false;
@@ -480,6 +489,11 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
}
void onRemovedFromDisplay() {
if (mRemovingFromDisplay) {
return;
}
mRemovingFromDisplay = true;
if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "Removing app token: " + this);
boolean delayed = setVisibility(null, false, TRANSIT_UNSET, true, mVoiceInteraction);
@@ -512,12 +526,14 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
mService.mNoAnimationNotifyOnTransitionFinished.add(token);
}
final TaskStack stack = getTask().mStack;
final TaskStack stack = getStack();
if (delayed && !isEmpty()) {
// set the token aside because it has an active animation to be finished
if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG_WM,
"removeAppToken make exiting: " + this);
stack.mExitingAppTokens.add(this);
if (stack != null) {
stack.mExitingAppTokens.add(this);
}
mIsExiting = true;
} else {
// Make sure there is no animation running on this token, so any windows associated
@@ -540,6 +556,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
if (!delayed) {
updateReportedVisibilityLocked();
}
mRemovingFromDisplay = false;
}
void clearAnimatingFlags() {
@@ -1558,6 +1576,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
if (getController() != null) {
pw.print(prefix); pw.print("controller="); pw.println(getController());
}
if (mRemovingFromDisplay) {
pw.println(prefix + "mRemovingFromDisplay=" + mRemovingFromDisplay);
}
}
@Override

View File

@@ -5606,22 +5606,19 @@ public class WindowManagerService extends IWindowManager.Stub
WindowState win = mWindowMap.get(client);
if (localLOGV) Slog.v(TAG_WM, "Looking up client " + client + ": " + win);
if (win == null) {
RuntimeException ex = new IllegalArgumentException(
"Requested window " + client + " does not exist");
if (throwOnError) {
throw ex;
throw new IllegalArgumentException(
"Requested window " + client + " does not exist");
}
Slog.w(TAG_WM, "Failed looking up window", ex);
Slog.w(TAG_WM, "Failed looking up window callers=" + Debug.getCallers(3));
return null;
}
if (session != null && win.mSession != session) {
RuntimeException ex = new IllegalArgumentException(
"Requested window " + client + " is in session " +
win.mSession + ", not " + session);
if (throwOnError) {
throw ex;
throw new IllegalArgumentException("Requested window " + client + " is in session "
+ win.mSession + ", not " + session);
}
Slog.w(TAG_WM, "Failed looking up window", ex);
Slog.w(TAG_WM, "Failed looking up window callers=" + Debug.getCallers(3));
return null;
}