diff options
| author | 2021-04-02 08:08:27 +0000 | |
|---|---|---|
| committer | 2021-04-02 08:08:27 +0000 | |
| commit | 3f45860e705d8350f276ed1c6af6e96e23c91546 (patch) | |
| tree | 6155cb66d6d136b8a7d9df9f992b0b61054cf40b | |
| parent | 1d7abf0d62cefa6aefcda314e0e1c43c6d343ad7 (diff) | |
| parent | bedb9950c8c32e6a5c3a3215c4c886d17720bde9 (diff) | |
Merge "getCameraIdListNoLazy : remove system cameras from mTorchStatus as well." into sc-dev
| -rw-r--r-- | core/java/android/hardware/camera2/CameraManager.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/java/android/hardware/camera2/CameraManager.java b/core/java/android/hardware/camera2/CameraManager.java index 726bca4d1cd2..1e62a15772e9 100644 --- a/core/java/android/hardware/camera2/CameraManager.java +++ b/core/java/android/hardware/camera2/CameraManager.java @@ -1382,6 +1382,8 @@ public final class CameraManager { // devices going offline (in real world scenarios, these permissions aren't // changeable). Future calls to getCameraIdList() will reflect the changes in // the camera id list after getCameraIdListNoLazy() is called. + // We need to remove the torch ids which may have been associated with the + // devices removed as well. This is the same situation. cameraStatuses = mCameraService.addListener(testListener); mCameraService.removeListener(testListener); for (CameraStatus c : cameraStatuses) { @@ -1400,6 +1402,7 @@ public final class CameraManager { } for (String id : deviceIdsToRemove) { onStatusChangedLocked(ICameraServiceListener.STATUS_NOT_PRESENT, id); + mTorchStatus.remove(id); } } catch (ServiceSpecificException e) { // Unexpected failure |