Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +44 −44 Original line number Diff line number Diff line Loading @@ -187,10 +187,10 @@ public class KeyguardService extends Service { final IRemoteAnimationRunner runner, final boolean lockscreenLiveWallpaperEnabled) { return new IRemoteTransition.Stub() { @GuardedBy("mLeashMap") private final ArrayMap<SurfaceControl, SurfaceControl> mLeashMap = new ArrayMap<>(); private final CounterRotator mCounterRotator = new CounterRotator(); @GuardedBy("mLeashMap") private IRemoteTransitionFinishedCallback mFinishCallback = null; Loading @@ -200,12 +200,14 @@ public class KeyguardService extends Service { throws RemoteException { Slog.d(TAG, "Starts IRemoteAnimationRunner: info=" + info); synchronized (mLeashMap) { final RemoteAnimationTarget[] apps = wrap(info, false /* wallpapers */, t, mLeashMap, mCounterRotator); final RemoteAnimationTarget[] wallpapers = wrap(info, true /* wallpapers */, t, mLeashMap, mCounterRotator); final RemoteAnimationTarget[] apps; final RemoteAnimationTarget[] wallpapers; final RemoteAnimationTarget[] nonApps = new RemoteAnimationTarget[0]; synchronized (mLeashMap) { apps = wrap(info, false /* wallpapers */, t, mLeashMap, mCounterRotator); wallpapers = wrap(info, true /* wallpapers */, t, mLeashMap, mCounterRotator); mFinishCallback = finishCallback; } // Set alpha back to 1 for the independent changes because we will be animating // children instead. Loading @@ -219,21 +221,17 @@ public class KeyguardService extends Service { initAlphaForAnimationTargets(t, wallpapers); } t.apply(); mFinishCallback = finishCallback; runner.onAnimationStart( getTransitionOldType(info.getType(), info.getFlags(), apps), apps, wallpapers, nonApps, new IRemoteAnimationFinishedCallback.Stub() { @Override public void onAnimationFinished() throws RemoteException { synchronized (mLeashMap) { Slog.d(TAG, "Finish IRemoteAnimationRunner."); finish(); } } } ); } }); } public void mergeAnimation(IBinder candidateTransition, TransitionInfo candidateInfo, Loading @@ -247,10 +245,8 @@ public class KeyguardService extends Service { } try { synchronized (mLeashMap) { runner.onAnimationCancelled(); finish(); } } catch (RemoteException e) { // nothing, we'll just let it finish on its own I guess. } Loading @@ -264,18 +260,22 @@ public class KeyguardService extends Service { } } @GuardedBy("mLeashMap") private void finish() throws RemoteException { IRemoteTransitionFinishedCallback finishCallback = null; SurfaceControl.Transaction finishTransaction = null; synchronized (mLeashMap) { if (mCounterRotator.getSurface() != null && mCounterRotator.getSurface().isValid()) { finishTransaction = new SurfaceControl.Transaction(); mCounterRotator.cleanUp(finishTransaction); } mLeashMap.clear(); final IRemoteTransitionFinishedCallback finishCallback = mFinishCallback; if (finishCallback != null) { finishCallback = mFinishCallback; mFinishCallback = null; } if (finishCallback != null) { finishCallback.onTransitionFinished(null /* wct */, finishTransaction); } else if (finishTransaction != null) { finishTransaction.apply(); Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +44 −44 Original line number Diff line number Diff line Loading @@ -187,10 +187,10 @@ public class KeyguardService extends Service { final IRemoteAnimationRunner runner, final boolean lockscreenLiveWallpaperEnabled) { return new IRemoteTransition.Stub() { @GuardedBy("mLeashMap") private final ArrayMap<SurfaceControl, SurfaceControl> mLeashMap = new ArrayMap<>(); private final CounterRotator mCounterRotator = new CounterRotator(); @GuardedBy("mLeashMap") private IRemoteTransitionFinishedCallback mFinishCallback = null; Loading @@ -200,12 +200,14 @@ public class KeyguardService extends Service { throws RemoteException { Slog.d(TAG, "Starts IRemoteAnimationRunner: info=" + info); synchronized (mLeashMap) { final RemoteAnimationTarget[] apps = wrap(info, false /* wallpapers */, t, mLeashMap, mCounterRotator); final RemoteAnimationTarget[] wallpapers = wrap(info, true /* wallpapers */, t, mLeashMap, mCounterRotator); final RemoteAnimationTarget[] apps; final RemoteAnimationTarget[] wallpapers; final RemoteAnimationTarget[] nonApps = new RemoteAnimationTarget[0]; synchronized (mLeashMap) { apps = wrap(info, false /* wallpapers */, t, mLeashMap, mCounterRotator); wallpapers = wrap(info, true /* wallpapers */, t, mLeashMap, mCounterRotator); mFinishCallback = finishCallback; } // Set alpha back to 1 for the independent changes because we will be animating // children instead. Loading @@ -219,21 +221,17 @@ public class KeyguardService extends Service { initAlphaForAnimationTargets(t, wallpapers); } t.apply(); mFinishCallback = finishCallback; runner.onAnimationStart( getTransitionOldType(info.getType(), info.getFlags(), apps), apps, wallpapers, nonApps, new IRemoteAnimationFinishedCallback.Stub() { @Override public void onAnimationFinished() throws RemoteException { synchronized (mLeashMap) { Slog.d(TAG, "Finish IRemoteAnimationRunner."); finish(); } } } ); } }); } public void mergeAnimation(IBinder candidateTransition, TransitionInfo candidateInfo, Loading @@ -247,10 +245,8 @@ public class KeyguardService extends Service { } try { synchronized (mLeashMap) { runner.onAnimationCancelled(); finish(); } } catch (RemoteException e) { // nothing, we'll just let it finish on its own I guess. } Loading @@ -264,18 +260,22 @@ public class KeyguardService extends Service { } } @GuardedBy("mLeashMap") private void finish() throws RemoteException { IRemoteTransitionFinishedCallback finishCallback = null; SurfaceControl.Transaction finishTransaction = null; synchronized (mLeashMap) { if (mCounterRotator.getSurface() != null && mCounterRotator.getSurface().isValid()) { finishTransaction = new SurfaceControl.Transaction(); mCounterRotator.cleanUp(finishTransaction); } mLeashMap.clear(); final IRemoteTransitionFinishedCallback finishCallback = mFinishCallback; if (finishCallback != null) { finishCallback = mFinishCallback; mFinishCallback = null; } if (finishCallback != null) { finishCallback.onTransitionFinished(null /* wct */, finishTransaction); } else if (finishTransaction != null) { finishTransaction.apply(); Loading