Merge "Merge "Call legacy apptransition callbacks on shell transition events" into sc-v2-dev am: eed7b2eb8c" into sc-v2-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
84c83d8a31
@@ -1008,6 +1008,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
|||||||
|
|
||||||
mAppTransition = new AppTransition(mWmService.mContext, mWmService, this);
|
mAppTransition = new AppTransition(mWmService.mContext, mWmService, this);
|
||||||
mAppTransition.registerListenerLocked(mWmService.mActivityManagerAppTransitionNotifier);
|
mAppTransition.registerListenerLocked(mWmService.mActivityManagerAppTransitionNotifier);
|
||||||
|
mAtmService.getTransitionController().registerLegacyListener(
|
||||||
|
mWmService.mActivityManagerAppTransitionNotifier);
|
||||||
mAppTransition.registerListenerLocked(mFixedRotationTransitionListener);
|
mAppTransition.registerListenerLocked(mFixedRotationTransitionListener);
|
||||||
mAppTransitionController = new AppTransitionController(mWmService, this);
|
mAppTransitionController = new AppTransitionController(mWmService, this);
|
||||||
mUnknownAppVisibilityController = new UnknownAppVisibilityController(mWmService, this);
|
mUnknownAppVisibilityController = new UnknownAppVisibilityController(mWmService, this);
|
||||||
|
|||||||
@@ -613,6 +613,8 @@ public class DisplayPolicy {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
displayContent.mAppTransition.registerListenerLocked(mAppTransitionListener);
|
displayContent.mAppTransition.registerListenerLocked(mAppTransitionListener);
|
||||||
|
mService.mAtmService.getTransitionController().registerLegacyListener(
|
||||||
|
mAppTransitionListener);
|
||||||
mImmersiveModeConfirmation = new ImmersiveModeConfirmation(mContext, looper,
|
mImmersiveModeConfirmation = new ImmersiveModeConfirmation(mContext, looper,
|
||||||
mService.mVrModeEnabled);
|
mService.mVrModeEnabled);
|
||||||
|
|
||||||
|
|||||||
@@ -304,6 +304,9 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
|
|||||||
" Commit activity becoming invisible: %s", ar);
|
" Commit activity becoming invisible: %s", ar);
|
||||||
ar.commitVisibility(false /* visible */, false /* performLayout */);
|
ar.commitVisibility(false /* visible */, false /* performLayout */);
|
||||||
}
|
}
|
||||||
|
if (ar != null) {
|
||||||
|
mController.dispatchLegacyAppTransitionFinished(ar);
|
||||||
|
}
|
||||||
final WallpaperWindowToken wt = mParticipants.valueAt(i).asWallpaperToken();
|
final WallpaperWindowToken wt = mParticipants.valueAt(i).asWallpaperToken();
|
||||||
if (wt != null && !wt.isVisibleRequested()) {
|
if (wt != null && !wt.isVisibleRequested()) {
|
||||||
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
|
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
|
||||||
@@ -321,6 +324,7 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
|
|||||||
if (mState != STATE_COLLECTING) {
|
if (mState != STATE_COLLECTING) {
|
||||||
throw new IllegalStateException("Too late to abort.");
|
throw new IllegalStateException("Too late to abort.");
|
||||||
}
|
}
|
||||||
|
mController.dispatchLegacyAppTransitionCancelled();
|
||||||
mState = STATE_ABORT;
|
mState = STATE_ABORT;
|
||||||
// Syncengine abort will call through to onTransactionReady()
|
// Syncengine abort will call through to onTransactionReady()
|
||||||
mSyncEngine.abort(mSyncId);
|
mSyncEngine.abort(mSyncId);
|
||||||
@@ -389,6 +393,7 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
|
|||||||
mFinishTransaction = mController.mAtm.mWindowManager.mTransactionFactory.get();
|
mFinishTransaction = mController.mAtm.mWindowManager.mTransactionFactory.get();
|
||||||
buildFinishTransaction(mFinishTransaction, info.getRootLeash());
|
buildFinishTransaction(mFinishTransaction, info.getRootLeash());
|
||||||
if (mController.getTransitionPlayer() != null) {
|
if (mController.getTransitionPlayer() != null) {
|
||||||
|
mController.dispatchLegacyAppTransitionStarting(info);
|
||||||
try {
|
try {
|
||||||
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
|
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
|
||||||
"Calling onTransitionReady: %s", info);
|
"Calling onTransitionReady: %s", info);
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ package com.android.server.wm;
|
|||||||
|
|
||||||
import static android.view.WindowManager.TRANSIT_CLOSE;
|
import static android.view.WindowManager.TRANSIT_CLOSE;
|
||||||
import static android.view.WindowManager.TRANSIT_FLAG_IS_RECENTS;
|
import static android.view.WindowManager.TRANSIT_FLAG_IS_RECENTS;
|
||||||
|
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION;
|
||||||
|
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_SUBTLE_ANIMATION;
|
||||||
|
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_TO_SHADE;
|
||||||
|
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER;
|
||||||
|
import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
|
||||||
import static android.view.WindowManager.TRANSIT_OPEN;
|
import static android.view.WindowManager.TRANSIT_OPEN;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
@@ -25,6 +30,7 @@ import android.annotation.Nullable;
|
|||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
|
import android.os.SystemClock;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.window.IRemoteTransition;
|
import android.window.IRemoteTransition;
|
||||||
@@ -48,6 +54,9 @@ class TransitionController {
|
|||||||
private ITransitionPlayer mTransitionPlayer;
|
private ITransitionPlayer mTransitionPlayer;
|
||||||
final ActivityTaskManagerService mAtm;
|
final ActivityTaskManagerService mAtm;
|
||||||
|
|
||||||
|
private final ArrayList<WindowManagerInternal.AppTransitionListener> mLegacyListeners =
|
||||||
|
new ArrayList<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Currently playing transitions (in the order they were started). When finished, records are
|
* Currently playing transitions (in the order they were started). When finished, records are
|
||||||
* removed from this list.
|
* removed from this list.
|
||||||
@@ -95,6 +104,7 @@ class TransitionController {
|
|||||||
mCollectingTransition = new Transition(type, flags, this, mAtm.mWindowManager.mSyncEngine);
|
mCollectingTransition = new Transition(type, flags, this, mAtm.mWindowManager.mSyncEngine);
|
||||||
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS, "Creating Transition: %s",
|
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS, "Creating Transition: %s",
|
||||||
mCollectingTransition);
|
mCollectingTransition);
|
||||||
|
dispatchLegacyAppTransitionPending();
|
||||||
return mCollectingTransition;
|
return mCollectingTransition;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,4 +321,40 @@ class TransitionController {
|
|||||||
}
|
}
|
||||||
transition.legacyRestoreNavigationBarFromApp();
|
transition.legacyRestoreNavigationBarFromApp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void registerLegacyListener(WindowManagerInternal.AppTransitionListener listener) {
|
||||||
|
mLegacyListeners.add(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
void dispatchLegacyAppTransitionPending() {
|
||||||
|
for (int i = 0; i < mLegacyListeners.size(); ++i) {
|
||||||
|
mLegacyListeners.get(i).onAppTransitionPendingLocked();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dispatchLegacyAppTransitionStarting(TransitionInfo info) {
|
||||||
|
final boolean keyguardGoingAway = info.getType() == TRANSIT_KEYGUARD_GOING_AWAY
|
||||||
|
|| (info.getFlags() & (TRANSIT_FLAG_KEYGUARD_GOING_AWAY_TO_SHADE
|
||||||
|
| TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION
|
||||||
|
| TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER
|
||||||
|
| TRANSIT_FLAG_KEYGUARD_GOING_AWAY_SUBTLE_ANIMATION)) != 0;
|
||||||
|
for (int i = 0; i < mLegacyListeners.size(); ++i) {
|
||||||
|
mLegacyListeners.get(i).onAppTransitionStartingLocked(keyguardGoingAway,
|
||||||
|
0 /* durationHint */, SystemClock.uptimeMillis(),
|
||||||
|
AnimationAdapter.STATUS_BAR_TRANSITION_DURATION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dispatchLegacyAppTransitionFinished(ActivityRecord ar) {
|
||||||
|
for (int i = 0; i < mLegacyListeners.size(); ++i) {
|
||||||
|
mLegacyListeners.get(i).onAppTransitionFinishedLocked(ar.token);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dispatchLegacyAppTransitionCancelled() {
|
||||||
|
for (int i = 0; i < mLegacyListeners.size(); ++i) {
|
||||||
|
mLegacyListeners.get(i).onAppTransitionCancelledLocked(
|
||||||
|
false /* keyguardGoingAway */);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7582,6 +7582,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
public void registerAppTransitionListener(AppTransitionListener listener) {
|
public void registerAppTransitionListener(AppTransitionListener listener) {
|
||||||
synchronized (mGlobalLock) {
|
synchronized (mGlobalLock) {
|
||||||
getDefaultDisplayContentLocked().mAppTransition.registerListenerLocked(listener);
|
getDefaultDisplayContentLocked().mAppTransition.registerListenerLocked(listener);
|
||||||
|
mAtmService.getTransitionController().registerLegacyListener(listener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user