Loading services/core/java/com/android/server/wm/TrustedOverlayHost.java +11 −1 Original line number Original line Diff line number Diff line Loading @@ -88,7 +88,17 @@ class TrustedOverlayHost { void addOverlay(SurfaceControlViewHost.SurfacePackage p, SurfaceControl currentParent) { void addOverlay(SurfaceControlViewHost.SurfacePackage p, SurfaceControl currentParent) { requireOverlaySurfaceControl(); requireOverlaySurfaceControl(); boolean hasExistingOverlay = false; for (int i = mOverlays.size() - 1; i >= 0; i--) { SurfaceControlViewHost.SurfacePackage l = mOverlays.get(i); if (l.getSurfaceControl().isSameSurface(p.getSurfaceControl())) { hasExistingOverlay = true; } } if (!hasExistingOverlay) { mOverlays.add(p); mOverlays.add(p); } SurfaceControl.Transaction t = mWmService.mTransactionFactory.get(); SurfaceControl.Transaction t = mWmService.mTransactionFactory.get(); t.reparent(p.getSurfaceControl(), mSurfaceControl) t.reparent(p.getSurfaceControl(), mSurfaceControl) Loading services/core/java/com/android/server/wm/WindowManagerService.java +5 −4 Original line number Original line Diff line number Diff line Loading @@ -8462,12 +8462,13 @@ public class WindowManagerService extends IWindowManager.Stub SurfaceControlViewHost.SurfacePackage overlay) { SurfaceControlViewHost.SurfacePackage overlay) { if (overlay == null) { if (overlay == null) { throw new IllegalArgumentException("Invalid overlay passed in for task=" + taskId); throw new IllegalArgumentException("Invalid overlay passed in for task=" + taskId); } else if (overlay.getSurfaceControl() == null } synchronized (mGlobalLock) { if (overlay.getSurfaceControl() == null || !overlay.getSurfaceControl().isValid()) { || !overlay.getSurfaceControl().isValid()) { throw new IllegalArgumentException( throw new IllegalArgumentException( "Invalid overlay surfacecontrol passed in for task=" + taskId); "Invalid overlay surfacecontrol passed in for task=" + taskId); } } synchronized (mGlobalLock) { final Task task = mRoot.getRootTask(taskId); final Task task = mRoot.getRootTask(taskId); if (task == null) { if (task == null) { throw new IllegalArgumentException("no task with taskId" + taskId); throw new IllegalArgumentException("no task with taskId" + taskId); Loading Loading
services/core/java/com/android/server/wm/TrustedOverlayHost.java +11 −1 Original line number Original line Diff line number Diff line Loading @@ -88,7 +88,17 @@ class TrustedOverlayHost { void addOverlay(SurfaceControlViewHost.SurfacePackage p, SurfaceControl currentParent) { void addOverlay(SurfaceControlViewHost.SurfacePackage p, SurfaceControl currentParent) { requireOverlaySurfaceControl(); requireOverlaySurfaceControl(); boolean hasExistingOverlay = false; for (int i = mOverlays.size() - 1; i >= 0; i--) { SurfaceControlViewHost.SurfacePackage l = mOverlays.get(i); if (l.getSurfaceControl().isSameSurface(p.getSurfaceControl())) { hasExistingOverlay = true; } } if (!hasExistingOverlay) { mOverlays.add(p); mOverlays.add(p); } SurfaceControl.Transaction t = mWmService.mTransactionFactory.get(); SurfaceControl.Transaction t = mWmService.mTransactionFactory.get(); t.reparent(p.getSurfaceControl(), mSurfaceControl) t.reparent(p.getSurfaceControl(), mSurfaceControl) Loading
services/core/java/com/android/server/wm/WindowManagerService.java +5 −4 Original line number Original line Diff line number Diff line Loading @@ -8462,12 +8462,13 @@ public class WindowManagerService extends IWindowManager.Stub SurfaceControlViewHost.SurfacePackage overlay) { SurfaceControlViewHost.SurfacePackage overlay) { if (overlay == null) { if (overlay == null) { throw new IllegalArgumentException("Invalid overlay passed in for task=" + taskId); throw new IllegalArgumentException("Invalid overlay passed in for task=" + taskId); } else if (overlay.getSurfaceControl() == null } synchronized (mGlobalLock) { if (overlay.getSurfaceControl() == null || !overlay.getSurfaceControl().isValid()) { || !overlay.getSurfaceControl().isValid()) { throw new IllegalArgumentException( throw new IllegalArgumentException( "Invalid overlay surfacecontrol passed in for task=" + taskId); "Invalid overlay surfacecontrol passed in for task=" + taskId); } } synchronized (mGlobalLock) { final Task task = mRoot.getRootTask(taskId); final Task task = mRoot.getRootTask(taskId); if (task == null) { if (task == null) { throw new IllegalArgumentException("no task with taskId" + taskId); throw new IllegalArgumentException("no task with taskId" + taskId); Loading