Loading core/java/android/view/SurfaceControl.java +13 −1 Original line number Diff line number Diff line Loading @@ -786,8 +786,12 @@ public final class SurfaceControl implements Parcelable { mReleaseStack = null; } setUnreleasedWarningCallSite(callsite); if (nativeObject != 0) { // Only add valid surface controls to the registry. This is called at the end of this // method since its information is dumped if the process threshold is reached. addToRegistry(); } } /** * @hide Loading Loading @@ -893,6 +897,10 @@ public final class SurfaceControl implements Parcelable { "Only buffer layers can set a valid buffer size."); } if (mName == null) { Log.w(TAG, "Missing name for SurfaceControl", new Throwable()); } if ((mFlags & FX_SURFACE_MASK) == FX_SURFACE_NORMAL) { setBLASTLayer(); } Loading Loading @@ -1254,6 +1262,9 @@ public final class SurfaceControl implements Parcelable { } /** * Note: Most callers should use {@link SurfaceControl.Builder} or one of the other constructors * to build an instance of a SurfaceControl. This constructor is mainly used for * unparceling and passing into an AIDL call as an out parameter. * @hide */ public SurfaceControl() { Loading Loading @@ -2495,6 +2506,7 @@ public final class SurfaceControl implements Parcelable { public static SurfaceControl mirrorSurface(SurfaceControl mirrorOf) { long nativeObj = nativeMirrorSurface(mirrorOf.mNativeObject); SurfaceControl sc = new SurfaceControl(); sc.mName = mirrorOf.mName + " (mirror)"; sc.assignNativeObject(nativeObj, "mirrorSurface"); return sc; } Loading core/java/android/view/SurfaceControlViewHost.java +1 −2 Original line number Diff line number Diff line Loading @@ -171,8 +171,7 @@ public class SurfaceControlViewHost { public SurfacePackage(@NonNull SurfacePackage other) { SurfaceControl otherSurfaceControl = other.mSurfaceControl; if (otherSurfaceControl != null && otherSurfaceControl.isValid()) { mSurfaceControl = new SurfaceControl(); mSurfaceControl.copyFrom(otherSurfaceControl, "SurfacePackage"); mSurfaceControl = new SurfaceControl(otherSurfaceControl, "SurfacePackage"); } mAccessibilityEmbeddedConnection = other.mAccessibilityEmbeddedConnection; mInputToken = other.mInputToken; Loading core/tests/coretests/src/android/view/SurfaceControlRegistryTests.java +12 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,18 @@ public class SurfaceControlRegistryTests { assertEquals(hash0, SurfaceControlRegistry.getProcessInstance().hashCode()); } @Test public void testInvalidSurfaceControlNotAddedToRegistry() { int hash0 = SurfaceControlRegistry.getProcessInstance().hashCode(); // Verify no changes to the registry when dealing with invalid surface controls SurfaceControl sc0 = new SurfaceControl(); SurfaceControl sc1 = new SurfaceControl(sc0, "test"); assertEquals(hash0, SurfaceControlRegistry.getProcessInstance().hashCode()); sc0.release(); sc1.release(); assertEquals(hash0, SurfaceControlRegistry.getProcessInstance().hashCode()); } @Test public void testThresholds() { SurfaceControlRegistry registry = SurfaceControlRegistry.getProcessInstance(); Loading services/core/java/com/android/server/wm/Transition.java +2 −0 Original line number Diff line number Diff line Loading @@ -2249,8 +2249,10 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { while (leashReference.getParent() != ancestor) { leashReference = leashReference.getParent(); } final SurfaceControl rootLeash = leashReference.makeAnimationLeash().setName( "Transition Root: " + leashReference.getName()).build(); rootLeash.setUnreleasedWarningCallSite("Transition.calculateTransitionRoots"); startT.setLayer(rootLeash, leashReference.getLastLayer()); outInfo.addRootLeash(endDisplayId, rootLeash, ancestor.getBounds().left, ancestor.getBounds().top); Loading Loading
core/java/android/view/SurfaceControl.java +13 −1 Original line number Diff line number Diff line Loading @@ -786,8 +786,12 @@ public final class SurfaceControl implements Parcelable { mReleaseStack = null; } setUnreleasedWarningCallSite(callsite); if (nativeObject != 0) { // Only add valid surface controls to the registry. This is called at the end of this // method since its information is dumped if the process threshold is reached. addToRegistry(); } } /** * @hide Loading Loading @@ -893,6 +897,10 @@ public final class SurfaceControl implements Parcelable { "Only buffer layers can set a valid buffer size."); } if (mName == null) { Log.w(TAG, "Missing name for SurfaceControl", new Throwable()); } if ((mFlags & FX_SURFACE_MASK) == FX_SURFACE_NORMAL) { setBLASTLayer(); } Loading Loading @@ -1254,6 +1262,9 @@ public final class SurfaceControl implements Parcelable { } /** * Note: Most callers should use {@link SurfaceControl.Builder} or one of the other constructors * to build an instance of a SurfaceControl. This constructor is mainly used for * unparceling and passing into an AIDL call as an out parameter. * @hide */ public SurfaceControl() { Loading Loading @@ -2495,6 +2506,7 @@ public final class SurfaceControl implements Parcelable { public static SurfaceControl mirrorSurface(SurfaceControl mirrorOf) { long nativeObj = nativeMirrorSurface(mirrorOf.mNativeObject); SurfaceControl sc = new SurfaceControl(); sc.mName = mirrorOf.mName + " (mirror)"; sc.assignNativeObject(nativeObj, "mirrorSurface"); return sc; } Loading
core/java/android/view/SurfaceControlViewHost.java +1 −2 Original line number Diff line number Diff line Loading @@ -171,8 +171,7 @@ public class SurfaceControlViewHost { public SurfacePackage(@NonNull SurfacePackage other) { SurfaceControl otherSurfaceControl = other.mSurfaceControl; if (otherSurfaceControl != null && otherSurfaceControl.isValid()) { mSurfaceControl = new SurfaceControl(); mSurfaceControl.copyFrom(otherSurfaceControl, "SurfacePackage"); mSurfaceControl = new SurfaceControl(otherSurfaceControl, "SurfacePackage"); } mAccessibilityEmbeddedConnection = other.mAccessibilityEmbeddedConnection; mInputToken = other.mInputToken; Loading
core/tests/coretests/src/android/view/SurfaceControlRegistryTests.java +12 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,18 @@ public class SurfaceControlRegistryTests { assertEquals(hash0, SurfaceControlRegistry.getProcessInstance().hashCode()); } @Test public void testInvalidSurfaceControlNotAddedToRegistry() { int hash0 = SurfaceControlRegistry.getProcessInstance().hashCode(); // Verify no changes to the registry when dealing with invalid surface controls SurfaceControl sc0 = new SurfaceControl(); SurfaceControl sc1 = new SurfaceControl(sc0, "test"); assertEquals(hash0, SurfaceControlRegistry.getProcessInstance().hashCode()); sc0.release(); sc1.release(); assertEquals(hash0, SurfaceControlRegistry.getProcessInstance().hashCode()); } @Test public void testThresholds() { SurfaceControlRegistry registry = SurfaceControlRegistry.getProcessInstance(); Loading
services/core/java/com/android/server/wm/Transition.java +2 −0 Original line number Diff line number Diff line Loading @@ -2249,8 +2249,10 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { while (leashReference.getParent() != ancestor) { leashReference = leashReference.getParent(); } final SurfaceControl rootLeash = leashReference.makeAnimationLeash().setName( "Transition Root: " + leashReference.getName()).build(); rootLeash.setUnreleasedWarningCallSite("Transition.calculateTransitionRoots"); startT.setLayer(rootLeash, leashReference.getLastLayer()); outInfo.addRootLeash(endDisplayId, rootLeash, ancestor.getBounds().left, ancestor.getBounds().top); Loading