Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc8049aa authored by Ravneet Dhanjal's avatar Ravneet Dhanjal
Browse files

Camera: Catch SecurityException for UID state changes

- AppOps might send the notification of a UID change faster
than a camera app can execute a release sequence leading to
an exception

Bug: 368768937
Test: Camera CTS
Flag: EXEMPT Bug fix
Change-Id: I958ab4a1c5017891178eeaf1b960da2a7ad820e7
parent 4f5b9059
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1028,6 +1028,9 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession
                    // Camera is already closed, so nothing left to do
                    if (DEBUG) Log.v(TAG, mIdString +
                            "Camera was already closed or busy, skipping unconfigure");
                } catch (SecurityException e) {
                    // UID state change revoked camera permission
                    Log.e(TAG, mIdString + "Exception while unconfiguring outputs: ", e);
                }
            }
        }