Merge "Clear calling identity in finish callback" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-27 16:44:26 +00:00
committed by Android (Google) Code Review

View File

@@ -16,14 +16,15 @@
package com.android.server.wm; package com.android.server.wm;
import static com.android.server.wm.AnimationAdapterProto.REMOTE;
import static com.android.server.wm.RemoteAnimationAdapterWrapperProto.TARGET;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.AnimationAdapterProto.REMOTE;
import static com.android.server.wm.RemoteAnimationAdapterWrapperProto.TARGET;
import android.graphics.Point; import android.graphics.Point;
import android.graphics.Rect; import android.graphics.Rect;
import android.os.Binder;
import android.os.Handler; import android.os.Handler;
import android.os.RemoteException; import android.os.RemoteException;
import android.os.SystemClock; import android.os.SystemClock;
@@ -195,6 +196,8 @@ class RemoteAnimationController {
@Override @Override
public void onAnimationFinished() throws RemoteException { public void onAnimationFinished() throws RemoteException {
final long token = Binder.clearCallingIdentity();
try {
if (mOuter != null) { if (mOuter != null) {
mOuter.onAnimationFinished(); mOuter.onAnimationFinished();
@@ -202,6 +205,9 @@ class RemoteAnimationController {
// RemoteAnimationController which in turn would leak the runner on the client. // RemoteAnimationController which in turn would leak the runner on the client.
mOuter = null; mOuter = null;
} }
} finally {
Binder.restoreCallingIdentity(token);
}
} }
/** /**