OSDN Git Service

Camera2: Do not throw unexpected runtime exception to app
authorEino-Ville Talvala <etalvala@google.com>
Wed, 17 Jun 2015 18:18:43 +0000 (11:18 -0700)
committerEino-Ville Talvala <etalvala@google.com>
Wed, 17 Jun 2015 18:18:43 +0000 (11:18 -0700)
Use a generic CameraAccessException DEVICE_ERROR exception instead

Bug: 21869917
Change-Id: I73581b817cbdcbb4b876c234f050f725a459a29b

core/java/android/hardware/camera2/utils/CameraBinderDecorator.java

index d461bca..1aee794 100644 (file)
@@ -138,8 +138,8 @@ public class CameraBinderDecorator {
          * errors, then add them to the top switch statement
          */
         if (errorFlag < 0) {
-            throw new UnsupportedOperationException(String.format("Unknown error %d",
-                    errorFlag));
+            throw new CameraRuntimeException(CAMERA_ERROR,
+                    String.format("Unknown camera device error %d", errorFlag));
         }
     }