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

Commit 53f6963d authored by Ruben Brunk's avatar Ruben Brunk Committed by Android Git Automerger
Browse files

am fba543e3: am b38a6f80: am 56bd6a6b: am 30306d89: Merge "camera2: Update...

am fba543e3: am b38a6f80: am 56bd6a6b: am 30306d89: Merge "camera2: Update EACCES to throw correct exception in LEGACY." into lmp-dev

* commit 'fba543e3d7afce12bc656d53e836fd61d520f05e':
  camera2: Update EACCES to throw correct exception in LEGACY.
parents 6f77dd84 37af0bee
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -87,6 +87,15 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
        mSurfaceIdCounter = 0;
    }

    private static int translateErrorsFromCamera1(int errorCode) {
        switch (errorCode) {
            case CameraBinderDecorator.EACCES:
                return CameraBinderDecorator.PERMISSION_DENIED;
            default:
                return errorCode;
        }
    }

    /**
     * Create a separate looper/thread for the camera to run on; open the camera.
     *
@@ -130,8 +139,7 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
            // Save the looper so that we can terminate this thread
            // after we are done with it.
            mLooper = Looper.myLooper();
            mInitErrors = mCamera.cameraInitUnspecified(mCameraId);

            mInitErrors = translateErrorsFromCamera1(mCamera.cameraInitUnspecified(mCameraId));
            mStartDone.open();
            Looper.loop();  // Blocks forever until #close is called.
        }