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

Commit cc6b5bf2 authored by Zhijun He's avatar Zhijun He Committed by Android Git Automerger
Browse files

am e4688207: am 78a1de65: Merge "Camera2: Add MAX_CAMERAS_IN_USE error case handling" into klp-dev

* commit 'e4688207':
  Camera2: Add MAX_CAMERAS_IN_USE error case handling
parents 86f4b37d e4688207
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ package android.hardware.camera2.utils;
import static android.hardware.camera2.CameraAccessException.CAMERA_DISABLED;
import static android.hardware.camera2.CameraAccessException.CAMERA_DISABLED;
import static android.hardware.camera2.CameraAccessException.CAMERA_DISCONNECTED;
import static android.hardware.camera2.CameraAccessException.CAMERA_DISCONNECTED;
import static android.hardware.camera2.CameraAccessException.CAMERA_IN_USE;
import static android.hardware.camera2.CameraAccessException.CAMERA_IN_USE;
import static android.hardware.camera2.CameraAccessException.MAX_CAMERAS_IN_USE;
import static android.hardware.camera2.CameraAccessException.CAMERA_DEPRECATED_HAL;
import static android.hardware.camera2.CameraAccessException.CAMERA_DEPRECATED_HAL;


import android.os.DeadObjectException;
import android.os.DeadObjectException;
@@ -50,6 +51,7 @@ public class CameraBinderDecorator {
    public static final int EBUSY = -16;
    public static final int EBUSY = -16;
    public static final int ENODEV = -19;
    public static final int ENODEV = -19;
    public static final int EOPNOTSUPP = -95;
    public static final int EOPNOTSUPP = -95;
    public static final int EDQUOT = -122;


    private static class CameraBinderDecoratorListener implements Decorator.DecoratorListener {
    private static class CameraBinderDecoratorListener implements Decorator.DecoratorListener {


@@ -83,6 +85,9 @@ public class CameraBinderDecorator {
                    case EBUSY:
                    case EBUSY:
                        UncheckedThrow.throwAnyException(new CameraRuntimeException(
                        UncheckedThrow.throwAnyException(new CameraRuntimeException(
                                CAMERA_IN_USE));
                                CAMERA_IN_USE));
                    case EDQUOT:
                        UncheckedThrow.throwAnyException(new CameraRuntimeException(
                                MAX_CAMERAS_IN_USE));
                    case ENODEV:
                    case ENODEV:
                        UncheckedThrow.throwAnyException(new CameraRuntimeException(
                        UncheckedThrow.throwAnyException(new CameraRuntimeException(
                                CAMERA_DISCONNECTED));
                                CAMERA_DISCONNECTED));