Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6760eb5a authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/22381002',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/22381002', 'googleplex-android-review.googlesource.com/23661867'] into sparse-10317220-L65500000961600299.
SPARSE_CHANGE: I7b3dcd06e7483fde745a1d56dfee7c4efc262ed7
SPARSE_CHANGE: Ifcdac241bfe33f44f5f03f1a6db682c57f0cd388

Change-Id: I1bb3331bf5553f9a1984dd7eb2c29d94651e8a14
parents 7c8d5d55 a7e27bc0
Loading
Loading
Loading
Loading
+8 −10
Original line number Diff line number Diff line
@@ -260,22 +260,20 @@ public class KeyguardService extends Service {
                );
            }

            public void mergeAnimation(IBinder transition, TransitionInfo info,
                    SurfaceControl.Transaction t, IBinder mergeTarget,
                    IRemoteTransitionFinishedCallback finishCallback) {
            public void mergeAnimation(IBinder candidateTransition, TransitionInfo candidateInfo,
                    SurfaceControl.Transaction candidateT, IBinder currentTransition,
                    IRemoteTransitionFinishedCallback candidateFinishCallback) {
                try {
                    final IRemoteTransitionFinishedCallback origFinishCB;
                    final IRemoteTransitionFinishedCallback currentFinishCB;
                    synchronized (mFinishCallbacks) {
                        origFinishCB = mFinishCallbacks.remove(transition);
                        currentFinishCB = mFinishCallbacks.remove(currentTransition);
                    }
                    info.releaseAllSurfaces();
                    t.close();
                    if (origFinishCB == null) {
                        // already finished (or not started yet), so do nothing.
                    if (currentFinishCB == null) {
                        Slog.e(TAG, "Called mergeAnimation, but finish callback is missing");
                        return;
                    }
                    runner.onAnimationCancelled(false /* isKeyguardOccluded */);
                    origFinishCB.onTransitionFinished(null /* wct */, null /* t */);
                    currentFinishCB.onTransitionFinished(null /* wct */, null /* t */);
                } catch (RemoteException e) {
                    // nothing, we'll just let it finish on its own I guess.
                }
+8 −16
Original line number Diff line number Diff line
@@ -958,14 +958,12 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,

                @Override
                public void onAnimationCancelled(boolean isKeyguardOccluded) {
                    mContext.getMainExecutor().execute(() -> {
                        if (mOccludeByDreamAnimator != null) {
                            mOccludeByDreamAnimator.cancel();
                        }
                    setOccluded(isKeyguardOccluded /* isOccluded */, false /* animate */);
                    if (DEBUG) {
                        Log.d(TAG, "Occlude by Dream animation cancelled. Occluded state is now: "
                                + mOccluded);
                    }
                    });
                    Log.d(TAG, "Occlude by Dream animation cancelled.");
                }

                @Override
@@ -1071,10 +1069,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
                        }
                    });

                    setOccluded(isKeyguardOccluded /* isOccluded */, false /* animate */);
                    Log.d(TAG, "Unocclude animation cancelled. Occluded state is now: "
                            + mOccluded);

                    Log.d(TAG, "Unocclude animation cancelled.");
                    mInteractionJankMonitor.cancel(CUJ_LOCKSCREEN_OCCLUSION);
                }

@@ -3441,10 +3436,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
        public void onAnimationCancelled(boolean isKeyguardOccluded) throws RemoteException {
            super.onAnimationCancelled(isKeyguardOccluded);

            Log.d(TAG, "Occlude animation cancelled by WM. "
                    + "Setting occluded state to: " + isKeyguardOccluded);
            setOccluded(isKeyguardOccluded /* occluded */, false /* animate */);

            Log.d(TAG, "Occlude animation cancelled by WM.");
            mInteractionJankMonitor.cancel(CUJ_LOCKSCREEN_OCCLUSION);
        }
    }
+16 −2
Original line number Diff line number Diff line
@@ -2134,10 +2134,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }

        mWindowManagerInternal.registerAppTransitionListener(new AppTransitionListener() {
            private boolean mOccludeChangingInTransition = false;

            @Override
            public int onAppTransitionStartingLocked(boolean keyguardGoingAway,
                    boolean keyguardOccluding, long duration, long statusBarAnimationStartTime,
                    long statusBarAnimationDuration) {
                mOccludeChangingInTransition = keyguardGoingAway || keyguardOccluding;

                // When remote animation is enabled for KEYGUARD_GOING_AWAY transition, SysUI
                // receives IRemoteAnimationRunner#onAnimationStart to start animation, so we don't
                // need to call IKeyguardService#keyguardGoingAway here.
@@ -2153,6 +2157,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                        0 /* duration */);

                synchronized (mLock) {
                    if (mOccludeChangingInTransition) {
                        mKeyguardOccludedChanged = true;
                        mOccludeChangingInTransition = false;
                    }
                    applyKeyguardOcclusionChange(false);
                    mLockAfterAppTransitionFinished = false;
                }
            }
@@ -2160,12 +2169,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            @Override
            public void onAppTransitionFinishedLocked(IBinder token) {
                synchronized (mLock) {
                    if (mOccludeChangingInTransition) {
                        mKeyguardOccludedChanged = true;
                        mOccludeChangingInTransition = false;
                    }
                    applyKeyguardOcclusionChange(false /* transitionStarted */);
                    if (!mLockAfterAppTransitionFinished) {
                        return;
                    }
                    mLockAfterAppTransitionFinished = false;
                }

                lockNow(null);
            }
        });
@@ -3355,7 +3368,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        if (mKeyguardOccludedChanged) {
            if (DEBUG_KEYGUARD) Slog.d(TAG, "transition/occluded changed occluded="
                    + mPendingKeyguardOccluded);
            if (setKeyguardOccludedLw(mPendingKeyguardOccluded, false /* force */,
            if (setKeyguardOccludedLw(mPendingKeyguardOccluded, true /* force */,
                    transitionStarted)) {
                return FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_WALLPAPER;
            }
@@ -3616,6 +3629,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private boolean setKeyguardOccludedLw(boolean isOccluded, boolean force,
            boolean transitionStarted) {
        if (DEBUG_KEYGUARD) Slog.d(TAG, "setKeyguardOccluded occluded=" + isOccluded);
        mPendingKeyguardOccluded = isOccluded;
        mKeyguardOccludedChanged = false;
        if (isKeyguardOccluded() == isOccluded && !force) {
            return false;