File tree Expand file tree Collapse file tree
core/java/android/hardware/camera2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1363,6 +1363,8 @@ public void onCameraClosed(String id) {
13631363 // devices going offline (in real world scenarios, these permissions aren't
13641364 // changeable). Future calls to getCameraIdList() will reflect the changes in
13651365 // the camera id list after getCameraIdListNoLazy() is called.
1366+ // We need to remove the torch ids which may have been associated with the
1367+ // devices removed as well. This is the same situation.
13661368 cameraStatuses = mCameraService .addListener (testListener );
13671369 mCameraService .removeListener (testListener );
13681370 for (CameraStatus c : cameraStatuses ) {
@@ -1381,6 +1383,7 @@ public void onCameraClosed(String id) {
13811383 }
13821384 for (String id : deviceIdsToRemove ) {
13831385 onStatusChangedLocked (ICameraServiceListener .STATUS_NOT_PRESENT , id );
1386+ mTorchStatus .remove (id );
13841387 }
13851388 } catch (ServiceSpecificException e ) {
13861389 // Unexpected failure
You can’t perform that action at this time.
0 commit comments