diff options
| author | 2023-05-12 01:31:35 +0000 | |
|---|---|---|
| committer | 2023-05-12 01:31:35 +0000 | |
| commit | 6b51ff203acf0d3772cb5f8e1032b05f08f27fe0 (patch) | |
| tree | ef185ac3f6add33059caca7676018d4c6fa836b5 /libs | |
| parent | 1f664c79ddfcc69e707b6f64b745f2b61ba1ce00 (diff) | |
| parent | cc5495e93314a79395f883774ade4a4588f4c10b (diff) | |
Merge changes from topic "concurrent-keyguard" into udc-dev am: cc5495e933
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23121840
Change-Id: I07f33a40e2de56e869a44aaea11885af018e9fdf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/WindowManager/Jetpack/src/androidx/window/extensions/area/WindowAreaComponentImpl.java | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/area/WindowAreaComponentImpl.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/area/WindowAreaComponentImpl.java index 658d92cc7489..ff423c2c6e39 100644 --- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/area/WindowAreaComponentImpl.java +++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/area/WindowAreaComponentImpl.java @@ -342,11 +342,22 @@ public class WindowAreaComponentImpl implements WindowAreaComponent, mRearDisplayPresentationController); DeviceStateRequest concurrentDisplayStateRequest = DeviceStateRequest.newBuilder( mConcurrentDisplayState).build(); - mDeviceStateManager.requestState( - concurrentDisplayStateRequest, - mExecutor, - deviceStateCallback - ); + + try { + mDeviceStateManager.requestState( + concurrentDisplayStateRequest, + mExecutor, + deviceStateCallback + ); + } catch (SecurityException e) { + // If a SecurityException occurs when invoking DeviceStateManager#requestState + // (e.g. if the caller is not in the foreground, or if it does not have the required + // permissions), we should first clean up our local state before re-throwing the + // SecurityException to the caller. Otherwise, subsequent attempts to + // startRearDisplayPresentationSession will always fail. + mRearDisplayPresentationController = null; + throw e; + } } } |