Loading core/java/android/view/SurfaceControl.java +0 −11 Original line number Diff line number Diff line Loading @@ -152,7 +152,6 @@ public class SurfaceControl implements Parcelable { private static native void nativeSeverChildren(long transactionObj, long nativeObject); private static native void nativeSetOverrideScalingMode(long transactionObj, long nativeObject, int scalingMode); private static native void nativeDestroy(long transactionObj, long nativeObject); private static native IBinder nativeGetHandle(long nativeObject); private static native boolean nativeGetTransformToDisplayInverse(long nativeObject); Loading Loading @@ -1571,16 +1570,6 @@ public class SurfaceControl implements Parcelable { return this; } /** * Same as {@link #destroy()} except this is invoked in a transaction instead of * immediately. */ public Transaction destroy(SurfaceControl sc) { sc.checkNotReleased(); nativeDestroy(mNativeObject, sc.mNativeObject); return this; } public Transaction setDisplaySurface(IBinder displayToken, Surface surface) { if (displayToken == null) { throw new IllegalArgumentException("displayToken must not be null"); Loading core/jni/android_view_SurfaceControl.cpp +0 −10 Original line number Diff line number Diff line Loading @@ -846,14 +846,6 @@ static void nativeSetOverrideScalingMode(JNIEnv* env, jclass clazz, jlong transa transaction->setOverrideScalingMode(ctrl, scalingMode); } static void nativeDestroyInTransaction(JNIEnv* env, jclass clazz, jlong transactionObj, jlong nativeObject) { auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj); auto ctrl = reinterpret_cast<SurfaceControl*>(nativeObject); transaction->destroySurface(ctrl); } static jobject nativeGetHandle(JNIEnv* env, jclass clazz, jlong nativeObject) { auto ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); return javaObjectForIBinder(env, ctrl->getHandle()); Loading Loading @@ -1005,8 +997,6 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*)nativeSeverChildren } , {"nativeSetOverrideScalingMode", "(JJI)V", (void*)nativeSetOverrideScalingMode }, {"nativeDestroy", "(JJ)V", (void*)nativeDestroyInTransaction }, {"nativeGetHandle", "(J)Landroid/os/IBinder;", (void*)nativeGetHandle }, {"nativeScreenshotToBuffer", Loading services/core/java/com/android/server/wm/AppWindowThumbnail.java +7 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,8 @@ class AppWindowThumbnail implements Animatable { AppWindowThumbnail(Transaction t, AppWindowToken appToken, GraphicBuffer thumbnailHeader) { mAppToken = appToken; mSurfaceAnimator = new SurfaceAnimator(this, this::onAnimationFinished, appToken.mService); mSurfaceAnimator = new SurfaceAnimator(this, this::onAnimationFinished, appToken.mService.mAnimator::addAfterPrepareSurfacesRunnable, appToken.mService); mWidth = thumbnailHeader.getWidth(); mHeight = thumbnailHeader.getHeight(); Loading Loading @@ -143,6 +144,11 @@ class AppWindowThumbnail implements Animatable { mAppToken.commitPendingTransaction(); } @Override public void destroyAfterPendingTransaction(SurfaceControl surface) { mAppToken.destroyAfterPendingTransaction(surface); } @Override public void onAnimationLeashCreated(Transaction t, SurfaceControl leash) { t.setLayer(leash, Integer.MAX_VALUE); Loading services/core/java/com/android/server/wm/Dimmer.java +6 −1 Original line number Diff line number Diff line Loading @@ -54,6 +54,11 @@ class Dimmer { public void onAnimationLeashDestroyed(SurfaceControl.Transaction t) { } @Override public void destroyAfterPendingTransaction(SurfaceControl surface) { mHost.destroyAfterPendingTransaction(surface); } @Override public SurfaceControl.Builder makeAnimationLeash() { return mHost.makeAnimationLeash(); Loading Loading @@ -114,7 +119,7 @@ class Dimmer { if (!mDimming) { mDimLayer.destroy(); } }, mHost.mService); }, mHost.mService.mAnimator::addAfterPrepareSurfacesRunnable, mHost.mService); } } Loading services/core/java/com/android/server/wm/DisplayContent.java +25 −1 Original line number Diff line number Diff line Loading @@ -380,6 +380,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo */ private int mSurfaceSize; /** * A list of surfaces to be destroyed after {@link #mPendingTransaction} is applied. */ private final ArrayList<SurfaceControl> mPendingDestroyingSurfaces = new ArrayList<>(); /** Temporary float array to retrieve 3x3 matrix values. */ private final float[] mTmpFloats = new float[9]; Loading Loading @@ -1930,6 +1935,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } } mService.mAnimator.removeDisplayLocked(mDisplayId); // The pending transaction won't be applied so we should // just clean up any surfaces pending destruction. onPendingTransactionApplied(); } finally { mRemovingDisplay = false; } Loading Loading @@ -3845,6 +3854,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo t.setRelativeLayer(child.getSurfaceControl(), mImeWindowsContainers.getSurfaceControl(), 1); } @Override public void destroyAfterPendingTransaction(SurfaceControl surface) { mPendingDestroyingSurfaces.add(surface); } /** * Destroys any surfaces that have been put into the pending list with * {@link #destroyAfterPendingTransaction}. */ void onPendingTransactionApplied() { for (int i = mPendingDestroyingSurfaces.size() - 1; i >= 0; i--) { mPendingDestroyingSurfaces.get(i).destroy(); } mPendingDestroyingSurfaces.clear(); } @Override void prepareSurfaces() { final ScreenRotationAnimation screenRotationAnimation = Loading @@ -3859,7 +3884,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo mPendingTransaction.setAlpha(mWindowingLayer, screenRotationAnimation.getEnterTransformation().getAlpha()); } super.prepareSurfaces(); } Loading Loading
core/java/android/view/SurfaceControl.java +0 −11 Original line number Diff line number Diff line Loading @@ -152,7 +152,6 @@ public class SurfaceControl implements Parcelable { private static native void nativeSeverChildren(long transactionObj, long nativeObject); private static native void nativeSetOverrideScalingMode(long transactionObj, long nativeObject, int scalingMode); private static native void nativeDestroy(long transactionObj, long nativeObject); private static native IBinder nativeGetHandle(long nativeObject); private static native boolean nativeGetTransformToDisplayInverse(long nativeObject); Loading Loading @@ -1571,16 +1570,6 @@ public class SurfaceControl implements Parcelable { return this; } /** * Same as {@link #destroy()} except this is invoked in a transaction instead of * immediately. */ public Transaction destroy(SurfaceControl sc) { sc.checkNotReleased(); nativeDestroy(mNativeObject, sc.mNativeObject); return this; } public Transaction setDisplaySurface(IBinder displayToken, Surface surface) { if (displayToken == null) { throw new IllegalArgumentException("displayToken must not be null"); Loading
core/jni/android_view_SurfaceControl.cpp +0 −10 Original line number Diff line number Diff line Loading @@ -846,14 +846,6 @@ static void nativeSetOverrideScalingMode(JNIEnv* env, jclass clazz, jlong transa transaction->setOverrideScalingMode(ctrl, scalingMode); } static void nativeDestroyInTransaction(JNIEnv* env, jclass clazz, jlong transactionObj, jlong nativeObject) { auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj); auto ctrl = reinterpret_cast<SurfaceControl*>(nativeObject); transaction->destroySurface(ctrl); } static jobject nativeGetHandle(JNIEnv* env, jclass clazz, jlong nativeObject) { auto ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); return javaObjectForIBinder(env, ctrl->getHandle()); Loading Loading @@ -1005,8 +997,6 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*)nativeSeverChildren } , {"nativeSetOverrideScalingMode", "(JJI)V", (void*)nativeSetOverrideScalingMode }, {"nativeDestroy", "(JJ)V", (void*)nativeDestroyInTransaction }, {"nativeGetHandle", "(J)Landroid/os/IBinder;", (void*)nativeGetHandle }, {"nativeScreenshotToBuffer", Loading
services/core/java/com/android/server/wm/AppWindowThumbnail.java +7 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,8 @@ class AppWindowThumbnail implements Animatable { AppWindowThumbnail(Transaction t, AppWindowToken appToken, GraphicBuffer thumbnailHeader) { mAppToken = appToken; mSurfaceAnimator = new SurfaceAnimator(this, this::onAnimationFinished, appToken.mService); mSurfaceAnimator = new SurfaceAnimator(this, this::onAnimationFinished, appToken.mService.mAnimator::addAfterPrepareSurfacesRunnable, appToken.mService); mWidth = thumbnailHeader.getWidth(); mHeight = thumbnailHeader.getHeight(); Loading Loading @@ -143,6 +144,11 @@ class AppWindowThumbnail implements Animatable { mAppToken.commitPendingTransaction(); } @Override public void destroyAfterPendingTransaction(SurfaceControl surface) { mAppToken.destroyAfterPendingTransaction(surface); } @Override public void onAnimationLeashCreated(Transaction t, SurfaceControl leash) { t.setLayer(leash, Integer.MAX_VALUE); Loading
services/core/java/com/android/server/wm/Dimmer.java +6 −1 Original line number Diff line number Diff line Loading @@ -54,6 +54,11 @@ class Dimmer { public void onAnimationLeashDestroyed(SurfaceControl.Transaction t) { } @Override public void destroyAfterPendingTransaction(SurfaceControl surface) { mHost.destroyAfterPendingTransaction(surface); } @Override public SurfaceControl.Builder makeAnimationLeash() { return mHost.makeAnimationLeash(); Loading Loading @@ -114,7 +119,7 @@ class Dimmer { if (!mDimming) { mDimLayer.destroy(); } }, mHost.mService); }, mHost.mService.mAnimator::addAfterPrepareSurfacesRunnable, mHost.mService); } } Loading
services/core/java/com/android/server/wm/DisplayContent.java +25 −1 Original line number Diff line number Diff line Loading @@ -380,6 +380,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo */ private int mSurfaceSize; /** * A list of surfaces to be destroyed after {@link #mPendingTransaction} is applied. */ private final ArrayList<SurfaceControl> mPendingDestroyingSurfaces = new ArrayList<>(); /** Temporary float array to retrieve 3x3 matrix values. */ private final float[] mTmpFloats = new float[9]; Loading Loading @@ -1930,6 +1935,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } } mService.mAnimator.removeDisplayLocked(mDisplayId); // The pending transaction won't be applied so we should // just clean up any surfaces pending destruction. onPendingTransactionApplied(); } finally { mRemovingDisplay = false; } Loading Loading @@ -3845,6 +3854,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo t.setRelativeLayer(child.getSurfaceControl(), mImeWindowsContainers.getSurfaceControl(), 1); } @Override public void destroyAfterPendingTransaction(SurfaceControl surface) { mPendingDestroyingSurfaces.add(surface); } /** * Destroys any surfaces that have been put into the pending list with * {@link #destroyAfterPendingTransaction}. */ void onPendingTransactionApplied() { for (int i = mPendingDestroyingSurfaces.size() - 1; i >= 0; i--) { mPendingDestroyingSurfaces.get(i).destroy(); } mPendingDestroyingSurfaces.clear(); } @Override void prepareSurfaces() { final ScreenRotationAnimation screenRotationAnimation = Loading @@ -3859,7 +3884,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo mPendingTransaction.setAlpha(mWindowingLayer, screenRotationAnimation.getEnterTransformation().getAlpha()); } super.prepareSurfaces(); } Loading