Merge "Enable WM remote occlude flag; fix occlude state issues." into tm-dev
This commit is contained in:
@@ -849,7 +849,8 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLaunchAnimationCancelled() {
|
public void onLaunchAnimationCancelled() {
|
||||||
setOccluded(true /* occluded */, false /* animate */);
|
Log.d(TAG, "Occlude launch animation cancelled. "
|
||||||
|
+ "Occluded state is now: " + mOccluded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@@ -894,7 +895,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
|
|||||||
};
|
};
|
||||||
|
|
||||||
private IRemoteAnimationRunner mOccludeAnimationRunner =
|
private IRemoteAnimationRunner mOccludeAnimationRunner =
|
||||||
new ActivityLaunchRemoteAnimationRunner(mOccludeAnimationController);
|
new OccludeActivityLaunchRemoteAnimationRunner(mOccludeAnimationController);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Animation controller for activities that unocclude the keyguard. This does not use the
|
* Animation controller for activities that unocclude the keyguard. This does not use the
|
||||||
@@ -919,13 +920,17 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
|
|||||||
RemoteAnimationTarget[] wallpapers,
|
RemoteAnimationTarget[] wallpapers,
|
||||||
RemoteAnimationTarget[] nonApps,
|
RemoteAnimationTarget[] nonApps,
|
||||||
IRemoteAnimationFinishedCallback finishedCallback) throws RemoteException {
|
IRemoteAnimationFinishedCallback finishedCallback) throws RemoteException {
|
||||||
final RemoteAnimationTarget primary = apps[0];
|
if (apps == null || apps.length == 0 || apps[0] == null) {
|
||||||
|
Log.d(TAG, "No apps provided to unocclude runner; "
|
||||||
|
+ "skipping animation and unoccluding.");
|
||||||
|
|
||||||
if (primary == null) {
|
|
||||||
finishedCallback.onAnimationFinished();
|
finishedCallback.onAnimationFinished();
|
||||||
|
setOccluded(false /* isOccluded */, true /* animate */);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final RemoteAnimationTarget primary = apps[0];
|
||||||
|
|
||||||
final SyncRtSurfaceTransactionApplier applier =
|
final SyncRtSurfaceTransactionApplier applier =
|
||||||
new SyncRtSurfaceTransactionApplier(
|
new SyncRtSurfaceTransactionApplier(
|
||||||
mKeyguardViewControllerLazy.get().getViewRootImpl().getView());
|
mKeyguardViewControllerLazy.get().getViewRootImpl().getView());
|
||||||
@@ -965,6 +970,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
|
|||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
try {
|
try {
|
||||||
|
setOccluded(false /* isOccluded */, true /* animate */);
|
||||||
finishedCallback.onAnimationFinished();
|
finishedCallback.onAnimationFinished();
|
||||||
mUnoccludeAnimator = null;
|
mUnoccludeAnimator = null;
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
@@ -3125,4 +3131,36 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
|
|||||||
mRunner.onAnimationStart(transit, apps, wallpapers, nonApps, finishedCallback);
|
mRunner.onAnimationStart(transit, apps, wallpapers, nonApps, finishedCallback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Subclass of {@link ActivityLaunchRemoteAnimationRunner} that calls {@link #setOccluded} when
|
||||||
|
* onAnimationStart is called.
|
||||||
|
*/
|
||||||
|
private class OccludeActivityLaunchRemoteAnimationRunner
|
||||||
|
extends ActivityLaunchRemoteAnimationRunner {
|
||||||
|
|
||||||
|
OccludeActivityLaunchRemoteAnimationRunner(
|
||||||
|
ActivityLaunchAnimator.Controller controller) {
|
||||||
|
super(controller);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationStart(int transit, RemoteAnimationTarget[] apps,
|
||||||
|
RemoteAnimationTarget[] wallpapers, RemoteAnimationTarget[] nonApps,
|
||||||
|
IRemoteAnimationFinishedCallback finishedCallback) throws RemoteException {
|
||||||
|
super.onAnimationStart(transit, apps, wallpapers, nonApps, finishedCallback);
|
||||||
|
|
||||||
|
// This is the first signal we have from WM that we're going to be occluded. Set our
|
||||||
|
// internal state to reflect that immediately, vs. waiting for the launch animator to
|
||||||
|
// begin. Otherwise, calls to setShowingLocked, etc. will not know that we're about to
|
||||||
|
// be occluded and might re-show the keyguard.
|
||||||
|
setOccluded(true /* isOccluded */, false /* animate */);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationCancelled() throws RemoteException {
|
||||||
|
super.onAnimationCancelled();
|
||||||
|
Log.d(TAG, "Occlude launch animation cancelled. Occluded state is now: " + mOccluded);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1747,6 +1747,23 @@ public class CentralSurfaces extends CoreStartable implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLaunchAnimationStart(boolean isExpandingFullyAbove) {
|
||||||
|
super.onLaunchAnimationStart(isExpandingFullyAbove);
|
||||||
|
|
||||||
|
// Double check that the keyguard is still showing and not going away, but if so
|
||||||
|
// set the keyguard occluded. Typically, WM will let KeyguardViewMediator know
|
||||||
|
// directly, but we're overriding that to play the custom launch animation, so
|
||||||
|
// we need to take care of that here. The unocclude animation is not overridden,
|
||||||
|
// so WM will call KeyguardViewMediator's unocclude animation runner when the
|
||||||
|
// activity is exited.
|
||||||
|
if (mKeyguardStateController.isShowing()
|
||||||
|
&& !mKeyguardStateController.isKeyguardGoingAway()) {
|
||||||
|
mKeyguardViewMediator.setOccluded(true /* isOccluded */,
|
||||||
|
true /* animate */);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLaunchAnimationEnd(boolean isExpandingFullyAbove) {
|
public void onLaunchAnimationEnd(boolean isExpandingFullyAbove) {
|
||||||
// Set mIsLaunchingActivityOverLockscreen to false before actually finishing the
|
// Set mIsLaunchingActivityOverLockscreen to false before actually finishing the
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
"persist.wm.enable_remote_keyguard_animation";
|
"persist.wm.enable_remote_keyguard_animation";
|
||||||
|
|
||||||
private static final int sEnableRemoteKeyguardAnimation =
|
private static final int sEnableRemoteKeyguardAnimation =
|
||||||
SystemProperties.getInt(ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY, 1);
|
SystemProperties.getInt(ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY, 2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see #ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY
|
* @see #ENABLE_REMOTE_KEYGUARD_ANIMATION_PROPERTY
|
||||||
|
|||||||
Reference in New Issue
Block a user