Camera: Fix missing onPhysicalCameraUnavailable
When onCameraAvailable invoked for a logical multi-camera, all of the physical cameras of a logical multi-camera are default available (i.e., no onPhysicalCameraAvailable would be called). So if some specific physical cameras are unavailable, onPhysicalCameraUnavailable should be invoked after onCameraAvailable. Bug: 262979670 Test: atest CameraManagerTest Change-Id: I6ee199ba30fa6f8c44c65d1e1d173fe6fd9ec3fe
This commit is contained in:
@@ -2313,6 +2313,15 @@ public final class CameraManager {
|
||||
final AvailabilityCallback callback = mCallbackMap.keyAt(i);
|
||||
|
||||
postSingleUpdate(callback, executor, id, null /*physicalId*/, status);
|
||||
|
||||
// Send the NOT_PRESENT state for unavailable physical cameras
|
||||
if (isAvailable(status) && mUnavailablePhysicalDevices.containsKey(id)) {
|
||||
ArrayList<String> unavailableIds = mUnavailablePhysicalDevices.get(id);
|
||||
for (String unavailableId : unavailableIds) {
|
||||
postSingleUpdate(callback, executor, id, unavailableId,
|
||||
ICameraServiceListener.STATUS_NOT_PRESENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // onStatusChangedLocked
|
||||
|
||||
|
||||
Reference in New Issue
Block a user