Camera2: Do not throw unexpected runtime exception to app

Use a generic CameraAccessException DEVICE_ERROR exception instead

Bug: 21869917
Change-Id: I73581b817cbdcbb4b876c234f050f725a459a29b
This commit is contained in:
Eino-Ville Talvala
2015-06-17 11:18:43 -07:00
parent dd862aebda
commit d3e39d16cb

View 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));
}
}