Loading core/java/android/view/WindowManager.java +7 −1 Original line number Diff line number Diff line Loading @@ -285,11 +285,17 @@ public interface WindowManager extends ViewManager { int TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER = 21; /** * Keyguard is being occluded. * Keyguard is being occluded by non-Dream. * @hide */ int TRANSIT_OLD_KEYGUARD_OCCLUDE = 22; /** * Keyguard is being occluded by Dream. * @hide */ int TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM = 33; /** * Keyguard is being unoccluded. * @hide Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +10 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_OCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_UNOCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_NONE; import static android.view.WindowManager.TRANSIT_OPEN; Loading Loading @@ -160,6 +161,9 @@ public class KeyguardService extends Service { return apps.length == 0 ? TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER : TRANSIT_OLD_KEYGUARD_GOING_AWAY; } else if (type == TRANSIT_KEYGUARD_OCCLUDE) { boolean isOccludeByDream = apps.length > 0 && apps[0].taskInfo.topActivityType == WindowConfiguration.ACTIVITY_TYPE_DREAM; if (isOccludeByDream) return TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM; return TRANSIT_OLD_KEYGUARD_OCCLUDE; } else if (type == TRANSIT_KEYGUARD_UNOCCLUDE) { return TRANSIT_OLD_KEYGUARD_UNOCCLUDE; Loading Loading @@ -271,6 +275,12 @@ public class KeyguardService extends Service { definition.addRemoteAnimation(TRANSIT_OLD_KEYGUARD_OCCLUDE, occludeAnimationAdapter); final RemoteAnimationAdapter occludeByDreamAnimationAdapter = new RemoteAnimationAdapter( mKeyguardViewMediator.getOccludeByDreamAnimationRunner(), 0, 0); definition.addRemoteAnimation(TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM, occludeByDreamAnimationAdapter); final RemoteAnimationAdapter unoccludeAnimationAdapter = new RemoteAnimationAdapter( mKeyguardViewMediator.getUnoccludeAnimationRunner(), 0, 0); Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +84 −0 Original line number Diff line number Diff line Loading @@ -887,6 +887,86 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, private IRemoteAnimationRunner mOccludeAnimationRunner = new OccludeActivityLaunchRemoteAnimationRunner(mOccludeAnimationController); private final IRemoteAnimationRunner mOccludeByDreamAnimationRunner = new IRemoteAnimationRunner.Stub() { @Nullable private ValueAnimator mOccludeByDreamAnimator; @Override public void onAnimationCancelled(boolean isKeyguardOccluded) { 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); } } @Override public void onAnimationStart(int transit, RemoteAnimationTarget[] apps, RemoteAnimationTarget[] wallpapers, RemoteAnimationTarget[] nonApps, IRemoteAnimationFinishedCallback finishedCallback) throws RemoteException { setOccluded(true /* isOccluded */, true /* animate */); if (apps == null || apps.length == 0 || apps[0] == null) { if (DEBUG) { Log.d(TAG, "No apps provided to the OccludeByDream runner; " + "skipping occluding animation."); } finishedCallback.onAnimationFinished(); return; } final RemoteAnimationTarget primary = apps[0]; final boolean isDream = (apps[0].taskInfo.topActivityType == WindowConfiguration.ACTIVITY_TYPE_DREAM); if (!isDream) { Log.w(TAG, "The occluding app isn't Dream; " + "finishing up. Please check that the config is correct."); finishedCallback.onAnimationFinished(); return; } final SyncRtSurfaceTransactionApplier applier = new SyncRtSurfaceTransactionApplier( mKeyguardViewControllerLazy.get().getViewRootImpl().getView()); mContext.getMainExecutor().execute(() -> { if (mOccludeByDreamAnimator != null) { mOccludeByDreamAnimator.cancel(); } mOccludeByDreamAnimator = ValueAnimator.ofFloat(0f, 1f); // Use the same duration as for the UNOCCLUDE. mOccludeByDreamAnimator.setDuration(UNOCCLUDE_ANIMATION_DURATION); mOccludeByDreamAnimator.setInterpolator(Interpolators.LINEAR); mOccludeByDreamAnimator.addUpdateListener( animation -> { SyncRtSurfaceTransactionApplier.SurfaceParams.Builder paramsBuilder = new SyncRtSurfaceTransactionApplier.SurfaceParams .Builder(primary.leash) .withAlpha(animation.getAnimatedFraction()); applier.scheduleApply(paramsBuilder.build()); }); mOccludeByDreamAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { try { finishedCallback.onAnimationFinished(); mOccludeByDreamAnimator = null; } catch (RemoteException e) { e.printStackTrace(); } } }); mOccludeByDreamAnimator.start(); }); } }; /** * Animation controller for activities that unocclude the keyguard. This does not use the * ActivityLaunchAnimator since we're just translating down, rather than emerging from a view Loading Loading @@ -1682,6 +1762,10 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, return mOccludeAnimationRunner; } public IRemoteAnimationRunner getOccludeByDreamAnimationRunner() { return mOccludeByDreamAnimationRunner; } public IRemoteAnimationRunner getUnoccludeAnimationRunner() { return mUnoccludeAnimationRunner; } Loading services/core/java/com/android/server/wm/AppTransition.java +7 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import static android.view.WindowManager.TRANSIT_OLD_DREAM_ACTIVITY_OPEN; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_OCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_UNOCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_NONE; import static android.view.WindowManager.TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE; Loading Loading @@ -746,7 +747,8 @@ public class AppTransition implements Dump { if (isKeyguardGoingAwayTransitOld(transit) && enter) { a = mTransitionAnimation.loadKeyguardExitAnimation(mNextAppTransitionFlags, transit == TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER); } else if (transit == TRANSIT_OLD_KEYGUARD_OCCLUDE) { } else if (transit == TRANSIT_OLD_KEYGUARD_OCCLUDE || transit == TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM) { a = null; } else if (transit == TRANSIT_OLD_KEYGUARD_UNOCCLUDE && !enter) { a = mTransitionAnimation.loadKeyguardUnoccludeAnimation(); Loading Loading @@ -1158,6 +1160,9 @@ public class AppTransition implements Dump { case TRANSIT_OLD_KEYGUARD_OCCLUDE: { return "TRANSIT_OLD_KEYGUARD_OCCLUDE"; } case TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM: { return "TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM"; } case TRANSIT_OLD_KEYGUARD_UNOCCLUDE: { return "TRANSIT_OLD_KEYGUARD_UNOCCLUDE"; } Loading Loading @@ -1413,6 +1418,7 @@ public class AppTransition implements Dump { static boolean isKeyguardOccludeTransitOld(@TransitionOldType int transit) { return transit == TRANSIT_OLD_KEYGUARD_OCCLUDE || transit == TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM || transit == TRANSIT_OLD_KEYGUARD_UNOCCLUDE; } Loading services/core/java/com/android/server/wm/AppTransitionController.java +9 −2 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import static android.view.WindowManager.TRANSIT_OLD_DREAM_ACTIVITY_OPEN; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_OCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_UNOCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_NONE; import static android.view.WindowManager.TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE; Loading Loading @@ -357,8 +358,14 @@ public class AppTransitionController { // When there is a closing app, the keyguard has already been occluded by an // activity, and another activity has started on top of that activity, so normal // app transition animation should be used. return closingApps.isEmpty() ? TRANSIT_OLD_KEYGUARD_OCCLUDE : TRANSIT_OLD_ACTIVITY_OPEN; if (!closingApps.isEmpty()) { return TRANSIT_OLD_ACTIVITY_OPEN; } if (!openingApps.isEmpty() && openingApps.valueAt(0).getActivityType() == ACTIVITY_TYPE_DREAM) { return TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM; } return TRANSIT_OLD_KEYGUARD_OCCLUDE; case TRANSIT_KEYGUARD_UNOCCLUDE: return TRANSIT_OLD_KEYGUARD_UNOCCLUDE; } Loading Loading
core/java/android/view/WindowManager.java +7 −1 Original line number Diff line number Diff line Loading @@ -285,11 +285,17 @@ public interface WindowManager extends ViewManager { int TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER = 21; /** * Keyguard is being occluded. * Keyguard is being occluded by non-Dream. * @hide */ int TRANSIT_OLD_KEYGUARD_OCCLUDE = 22; /** * Keyguard is being occluded by Dream. * @hide */ int TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM = 33; /** * Keyguard is being unoccluded. * @hide Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +10 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_OCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_UNOCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_NONE; import static android.view.WindowManager.TRANSIT_OPEN; Loading Loading @@ -160,6 +161,9 @@ public class KeyguardService extends Service { return apps.length == 0 ? TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER : TRANSIT_OLD_KEYGUARD_GOING_AWAY; } else if (type == TRANSIT_KEYGUARD_OCCLUDE) { boolean isOccludeByDream = apps.length > 0 && apps[0].taskInfo.topActivityType == WindowConfiguration.ACTIVITY_TYPE_DREAM; if (isOccludeByDream) return TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM; return TRANSIT_OLD_KEYGUARD_OCCLUDE; } else if (type == TRANSIT_KEYGUARD_UNOCCLUDE) { return TRANSIT_OLD_KEYGUARD_UNOCCLUDE; Loading Loading @@ -271,6 +275,12 @@ public class KeyguardService extends Service { definition.addRemoteAnimation(TRANSIT_OLD_KEYGUARD_OCCLUDE, occludeAnimationAdapter); final RemoteAnimationAdapter occludeByDreamAnimationAdapter = new RemoteAnimationAdapter( mKeyguardViewMediator.getOccludeByDreamAnimationRunner(), 0, 0); definition.addRemoteAnimation(TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM, occludeByDreamAnimationAdapter); final RemoteAnimationAdapter unoccludeAnimationAdapter = new RemoteAnimationAdapter( mKeyguardViewMediator.getUnoccludeAnimationRunner(), 0, 0); Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +84 −0 Original line number Diff line number Diff line Loading @@ -887,6 +887,86 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, private IRemoteAnimationRunner mOccludeAnimationRunner = new OccludeActivityLaunchRemoteAnimationRunner(mOccludeAnimationController); private final IRemoteAnimationRunner mOccludeByDreamAnimationRunner = new IRemoteAnimationRunner.Stub() { @Nullable private ValueAnimator mOccludeByDreamAnimator; @Override public void onAnimationCancelled(boolean isKeyguardOccluded) { 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); } } @Override public void onAnimationStart(int transit, RemoteAnimationTarget[] apps, RemoteAnimationTarget[] wallpapers, RemoteAnimationTarget[] nonApps, IRemoteAnimationFinishedCallback finishedCallback) throws RemoteException { setOccluded(true /* isOccluded */, true /* animate */); if (apps == null || apps.length == 0 || apps[0] == null) { if (DEBUG) { Log.d(TAG, "No apps provided to the OccludeByDream runner; " + "skipping occluding animation."); } finishedCallback.onAnimationFinished(); return; } final RemoteAnimationTarget primary = apps[0]; final boolean isDream = (apps[0].taskInfo.topActivityType == WindowConfiguration.ACTIVITY_TYPE_DREAM); if (!isDream) { Log.w(TAG, "The occluding app isn't Dream; " + "finishing up. Please check that the config is correct."); finishedCallback.onAnimationFinished(); return; } final SyncRtSurfaceTransactionApplier applier = new SyncRtSurfaceTransactionApplier( mKeyguardViewControllerLazy.get().getViewRootImpl().getView()); mContext.getMainExecutor().execute(() -> { if (mOccludeByDreamAnimator != null) { mOccludeByDreamAnimator.cancel(); } mOccludeByDreamAnimator = ValueAnimator.ofFloat(0f, 1f); // Use the same duration as for the UNOCCLUDE. mOccludeByDreamAnimator.setDuration(UNOCCLUDE_ANIMATION_DURATION); mOccludeByDreamAnimator.setInterpolator(Interpolators.LINEAR); mOccludeByDreamAnimator.addUpdateListener( animation -> { SyncRtSurfaceTransactionApplier.SurfaceParams.Builder paramsBuilder = new SyncRtSurfaceTransactionApplier.SurfaceParams .Builder(primary.leash) .withAlpha(animation.getAnimatedFraction()); applier.scheduleApply(paramsBuilder.build()); }); mOccludeByDreamAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { try { finishedCallback.onAnimationFinished(); mOccludeByDreamAnimator = null; } catch (RemoteException e) { e.printStackTrace(); } } }); mOccludeByDreamAnimator.start(); }); } }; /** * Animation controller for activities that unocclude the keyguard. This does not use the * ActivityLaunchAnimator since we're just translating down, rather than emerging from a view Loading Loading @@ -1682,6 +1762,10 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, return mOccludeAnimationRunner; } public IRemoteAnimationRunner getOccludeByDreamAnimationRunner() { return mOccludeByDreamAnimationRunner; } public IRemoteAnimationRunner getUnoccludeAnimationRunner() { return mUnoccludeAnimationRunner; } Loading
services/core/java/com/android/server/wm/AppTransition.java +7 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import static android.view.WindowManager.TRANSIT_OLD_DREAM_ACTIVITY_OPEN; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_OCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_UNOCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_NONE; import static android.view.WindowManager.TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE; Loading Loading @@ -746,7 +747,8 @@ public class AppTransition implements Dump { if (isKeyguardGoingAwayTransitOld(transit) && enter) { a = mTransitionAnimation.loadKeyguardExitAnimation(mNextAppTransitionFlags, transit == TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER); } else if (transit == TRANSIT_OLD_KEYGUARD_OCCLUDE) { } else if (transit == TRANSIT_OLD_KEYGUARD_OCCLUDE || transit == TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM) { a = null; } else if (transit == TRANSIT_OLD_KEYGUARD_UNOCCLUDE && !enter) { a = mTransitionAnimation.loadKeyguardUnoccludeAnimation(); Loading Loading @@ -1158,6 +1160,9 @@ public class AppTransition implements Dump { case TRANSIT_OLD_KEYGUARD_OCCLUDE: { return "TRANSIT_OLD_KEYGUARD_OCCLUDE"; } case TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM: { return "TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM"; } case TRANSIT_OLD_KEYGUARD_UNOCCLUDE: { return "TRANSIT_OLD_KEYGUARD_UNOCCLUDE"; } Loading Loading @@ -1413,6 +1418,7 @@ public class AppTransition implements Dump { static boolean isKeyguardOccludeTransitOld(@TransitionOldType int transit) { return transit == TRANSIT_OLD_KEYGUARD_OCCLUDE || transit == TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM || transit == TRANSIT_OLD_KEYGUARD_UNOCCLUDE; } Loading
services/core/java/com/android/server/wm/AppTransitionController.java +9 −2 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import static android.view.WindowManager.TRANSIT_OLD_DREAM_ACTIVITY_OPEN; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_GOING_AWAY_ON_WALLPAPER; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_OCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM; import static android.view.WindowManager.TRANSIT_OLD_KEYGUARD_UNOCCLUDE; import static android.view.WindowManager.TRANSIT_OLD_NONE; import static android.view.WindowManager.TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE; Loading Loading @@ -357,8 +358,14 @@ public class AppTransitionController { // When there is a closing app, the keyguard has already been occluded by an // activity, and another activity has started on top of that activity, so normal // app transition animation should be used. return closingApps.isEmpty() ? TRANSIT_OLD_KEYGUARD_OCCLUDE : TRANSIT_OLD_ACTIVITY_OPEN; if (!closingApps.isEmpty()) { return TRANSIT_OLD_ACTIVITY_OPEN; } if (!openingApps.isEmpty() && openingApps.valueAt(0).getActivityType() == ACTIVITY_TYPE_DREAM) { return TRANSIT_OLD_KEYGUARD_OCCLUDE_BY_DREAM; } return TRANSIT_OLD_KEYGUARD_OCCLUDE; case TRANSIT_KEYGUARD_UNOCCLUDE: return TRANSIT_OLD_KEYGUARD_UNOCCLUDE; } Loading