Merge "Make onVirtualDisplayRemoved callback idempotent." into udc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
88c874299e
@@ -983,8 +983,9 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virtualDisplayWrapper == null) {
|
if (virtualDisplayWrapper == null) {
|
||||||
throw new IllegalStateException(
|
Slog.w(TAG, "Virtual device " + mDeviceId + " doesn't have a virtual display with ID "
|
||||||
"Virtual device doesn't have a virtual display with ID " + displayId);
|
+ displayId);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final long ident = Binder.clearCallingIdentity();
|
final long ident = Binder.clearCallingIdentity();
|
||||||
|
|||||||
@@ -788,13 +788,6 @@ public class VirtualDeviceManagerServiceTest {
|
|||||||
nullable(String.class), eq(DISPLAY_ID_1), eq(null));
|
nullable(String.class), eq(DISPLAY_ID_1), eq(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void onVirtualDisplayRemovedLocked_unknownDisplayId_throwsException() {
|
|
||||||
final int unknownDisplayId = 999;
|
|
||||||
assertThrows(IllegalStateException.class,
|
|
||||||
() -> mDeviceImpl.onVirtualDisplayRemoved(unknownDisplayId));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onVirtualDisplayRemovedLocked_wakeLockIsReleased() throws RemoteException {
|
public void onVirtualDisplayRemovedLocked_wakeLockIsReleased() throws RemoteException {
|
||||||
addVirtualDisplay(mDeviceImpl, DISPLAY_ID_1);
|
addVirtualDisplay(mDeviceImpl, DISPLAY_ID_1);
|
||||||
|
|||||||
Reference in New Issue
Block a user