RESTRICT AUTOMERGE 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: I77d32cd1d1c5a6c63950961724af7b41f8cdf1e6
This commit is contained in:
@@ -2353,6 +2353,15 @@ public final class CameraManager {
|
|||||||
final AvailabilityCallback callback = mCallbackMap.keyAt(i);
|
final AvailabilityCallback callback = mCallbackMap.keyAt(i);
|
||||||
|
|
||||||
postSingleUpdate(callback, executor, id, null /*physicalId*/, status);
|
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
|
} // onStatusChangedLocked
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user