Merge "Fix re-entrant issue in Keyguard / Mixed handler" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b4b4f2042d
@@ -156,6 +156,8 @@ public class KeyguardTransitionHandler implements Transitions.TransitionHandler
|
|||||||
"start keyguard %s transition, info = %s", description, info);
|
"start keyguard %s transition, info = %s", description, info);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
mStartedTransitions.put(transition,
|
||||||
|
new StartedTransition(info, finishTransaction, remoteHandler));
|
||||||
remoteHandler.startAnimation(transition, info, startTransaction,
|
remoteHandler.startAnimation(transition, info, startTransaction,
|
||||||
new IRemoteTransitionFinishedCallback.Stub() {
|
new IRemoteTransitionFinishedCallback.Stub() {
|
||||||
@Override
|
@Override
|
||||||
@@ -164,14 +166,13 @@ public class KeyguardTransitionHandler implements Transitions.TransitionHandler
|
|||||||
if (sct != null) {
|
if (sct != null) {
|
||||||
finishTransaction.merge(sct);
|
finishTransaction.merge(sct);
|
||||||
}
|
}
|
||||||
mMainExecutor.execute(() -> {
|
// Post our finish callback to let startAnimation finish first.
|
||||||
|
mMainExecutor.executeDelayed(() -> {
|
||||||
mStartedTransitions.remove(transition);
|
mStartedTransitions.remove(transition);
|
||||||
finishCallback.onTransitionFinished(wct, null);
|
finishCallback.onTransitionFinished(wct, null);
|
||||||
});
|
}, 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mStartedTransitions.put(transition,
|
|
||||||
new StartedTransition(info, finishTransaction, remoteHandler));
|
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.wtf(TAG, "RemoteException thrown from local IRemoteTransition", e);
|
Log.wtf(TAG, "RemoteException thrown from local IRemoteTransition", e);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -589,11 +589,12 @@ public class DefaultMixedHandler implements Transitions.TransitionHandler,
|
|||||||
finishCallback.onTransitionFinished(wct, wctCB);
|
finishCallback.onTransitionFinished(wct, wctCB);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
mixed.mInFlightSubAnimations++;
|
||||||
if (!mKeyguardHandler.startAnimation(
|
if (!mKeyguardHandler.startAnimation(
|
||||||
mixed.mTransition, info, startTransaction, finishTransaction, finishCB)) {
|
mixed.mTransition, info, startTransaction, finishTransaction, finishCB)) {
|
||||||
|
mixed.mInFlightSubAnimations--;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mixed.mInFlightSubAnimations++;
|
|
||||||
// Sync pip state.
|
// Sync pip state.
|
||||||
if (mPipHandler != null) {
|
if (mPipHandler != null) {
|
||||||
// We don't know when to apply `startTransaction` so use a separate transaction here.
|
// We don't know when to apply `startTransaction` so use a separate transaction here.
|
||||||
|
|||||||
Reference in New Issue
Block a user