commit | 88c874299e6e303c814b246a802b0b39d9396a71 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | Mon Jul 31 13:53:52 2023 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Mon Jul 31 13:53:52 2023 +0000 |
tree | 0dbf9e132397192e987cc2a2c80f50c7f50d09e1 | |
parent | 40383d7977e6e611fa619af2add08bbef7eb7e53 [diff] | |
parent | 45a6bab552795074a93e681018232d0d6abc0e1a [diff] |
Merge "Make onVirtualDisplayRemoved callback idempotent." into udc-qpr-dev
diff --git a/services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java b/services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java index 254e6ce..cf7eb51 100644 --- a/services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java +++ b/services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java
@@ -983,8 +983,9 @@ } if (virtualDisplayWrapper == null) { - throw new IllegalStateException( - "Virtual device doesn't have a virtual display with ID " + displayId); + Slog.w(TAG, "Virtual device " + mDeviceId + " doesn't have a virtual display with ID " + + displayId); + return; } final long ident = Binder.clearCallingIdentity();
diff --git a/services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceManagerServiceTest.java index 8884dba..2336374 100644 --- a/services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceManagerServiceTest.java +++ b/services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceManagerServiceTest.java
@@ -789,13 +789,6 @@ } @Test - public void onVirtualDisplayRemovedLocked_unknownDisplayId_throwsException() { - final int unknownDisplayId = 999; - assertThrows(IllegalStateException.class, - () -> mDeviceImpl.onVirtualDisplayRemoved(unknownDisplayId)); - } - - @Test public void onVirtualDisplayRemovedLocked_wakeLockIsReleased() throws RemoteException { addVirtualDisplay(mDeviceImpl, DISPLAY_ID_1); ArgumentCaptor<IBinder> wakeLockCaptor = ArgumentCaptor.forClass(IBinder.class);