diff options
| author | 2017-07-19 11:45:50 +0000 | |
|---|---|---|
| committer | 2017-07-19 11:45:50 +0000 | |
| commit | 790e3ff6e3b040ce5ef0779b13aa93f270b826a5 (patch) | |
| tree | a997027b38c671db125c78b1ba27a8e78c16788f | |
| parent | f5304ad7be35a42b41a4e1e79ce2c62747e67bfc (diff) | |
| parent | dbaad384bb79579eb3dfff965b344073ee193572 (diff) | |
Merge "Send app transition starting event at right time" into oc-dr1-dev
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowSurfacePlacer.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java index 82c862f6a6a8..690989251f61 100644 --- a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java +++ b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java @@ -233,7 +233,7 @@ class WindowSurfacePlacer { */ int handleAppTransitionReadyLocked() { int appsCount = mService.mOpeningApps.size(); - if (!transitionGoodToGo(appsCount)) { + if (!transitionGoodToGo(appsCount, mTempTransitionReasons)) { return 0; } Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "AppTransitionReady"); @@ -375,6 +375,9 @@ class WindowSurfacePlacer { true /*updateInputWindows*/); mService.mFocusMayChange = false; + mService.mH.obtainMessage(NOTIFY_APP_TRANSITION_STARTING, + mTempTransitionReasons.clone()).sendToTarget(); + Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER); return layoutRedo | FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_CONFIG; @@ -499,7 +502,7 @@ class WindowSurfacePlacer { } } - private boolean transitionGoodToGo(int appsCount) { + private boolean transitionGoodToGo(int appsCount, SparseIntArray outReasons) { if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Checking " + appsCount + " opening apps (frozen=" + mService.mDisplayFrozen + " timeout=" @@ -508,7 +511,7 @@ class WindowSurfacePlacer { mService.mAnimator.getScreenRotationAnimationLocked( Display.DEFAULT_DISPLAY); - final SparseIntArray reasons = mTempTransitionReasons; + outReasons.clear(); if (!mService.mAppTransition.isTimeout()) { // Imagine the case where we are changing orientation due to an app transition, but a previous // orientation change is still in progress. We won't process the orientation change @@ -542,10 +545,10 @@ class WindowSurfacePlacer { final TaskStack stack = wtoken.getStack(); final int stackId = stack != null ? stack.mStackId : INVALID_STACK_ID; if (allDrawn) { - reasons.put(stackId, drawnBeforeRestoring ? APP_TRANSITION_WINDOWS_DRAWN + outReasons.put(stackId, drawnBeforeRestoring ? APP_TRANSITION_WINDOWS_DRAWN : APP_TRANSITION_SAVED_SURFACE); } else { - reasons.put(stackId, wtoken.startingData instanceof SplashScreenStartingData + outReasons.put(stackId, wtoken.startingData instanceof SplashScreenStartingData ? APP_TRANSITION_SPLASH_SCREEN : APP_TRANSITION_SNAPSHOT); } @@ -569,13 +572,10 @@ class WindowSurfacePlacer { boolean wallpaperReady = !mWallpaperControllerLocked.isWallpaperVisible() || mWallpaperControllerLocked.wallpaperTransitionReady(); if (wallpaperReady) { - mService.mH.obtainMessage(NOTIFY_APP_TRANSITION_STARTING, reasons.clone()) - .sendToTarget(); return true; } return false; } - mService.mH.obtainMessage(NOTIFY_APP_TRANSITION_STARTING, reasons.clone()).sendToTarget(); return true; } |