Merge "[wm] fix npe when removing trusted task overlays" into udc-qpr-dev

This commit is contained in:
Vishnu Nair
2023-05-31 21:41:34 +00:00
committed by Android (Google) Code Review

View File

@@ -8270,6 +8270,13 @@ public class WindowManagerService extends IWindowManager.Stub
@Override
public void addTrustedTaskOverlay(int taskId,
SurfaceControlViewHost.SurfacePackage overlay) {
if (overlay == null) {
throw new IllegalArgumentException("Invalid overlay passed in for task=" + taskId);
} else if (overlay.getSurfaceControl() == null
|| !overlay.getSurfaceControl().isValid()) {
throw new IllegalArgumentException(
"Invalid overlay surfacecontrol passed in for task=" + taskId);
}
synchronized (mGlobalLock) {
final Task task = mRoot.getRootTask(taskId);
if (task == null) {
@@ -8282,6 +8289,13 @@ public class WindowManagerService extends IWindowManager.Stub
@Override
public void removeTrustedTaskOverlay(int taskId,
SurfaceControlViewHost.SurfacePackage overlay) {
if (overlay == null) {
throw new IllegalArgumentException("Invalid overlay passed in for task=" + taskId);
} else if (overlay.getSurfaceControl() == null
|| !overlay.getSurfaceControl().isValid()) {
throw new IllegalArgumentException(
"Invalid overlay surfacecontrol passed in for task=" + taskId);
}
synchronized (mGlobalLock) {
final Task task = mRoot.getRootTask(taskId);
if (task == null) {