summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon McAnsh <brandon.mcansh@gmail.com>2016-09-14 10:54:21 -0400
committerBrandon McAnsh <brandon.mcansh@gmail.com>2016-09-14 07:56:11 -0700
commit5745350be1522fed1d16bdca218227c749f4ddd9 (patch)
treebdf69e24331b42de7ed92b788b345e6fa3566362
parentda86a759b322d8032f434d60bb09e7accce2fd1e (diff)
downloadandroid_packages_apps_Snap-5745350be1522fed1d16bdca218227c749f4ddd9.zip
android_packages_apps_Snap-5745350be1522fed1d16bdca218227c749f4ddd9.tar.gz
android_packages_apps_Snap-5745350be1522fed1d16bdca218227c749f4ddd9.tar.bz2
Snap: SettingsManager: Properly assert CameraCharacteristics.LENS_FACING value
Change-Id: Id4e94e926cfb5a5185227789762269b594537e85 Signed-off-by: Brandon McAnsh <brandon.mcansh@gmail.com>
-rw-r--r--src/com/android/camera/SettingsManager.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java
index 1380a5e..3c3f90d 100644
--- a/src/com/android/camera/SettingsManager.java
+++ b/src/com/android/camera/SettingsManager.java
@@ -146,8 +146,9 @@ public class SettingsManager implements ListMenu.SettingsListener {
CaptureModule.MONO_ID = i;
mIsMonoCameraPresent = true;
}
- int facing = characteristics.get(CameraCharacteristics.LENS_FACING);
- if (facing == CameraCharacteristics.LENS_FACING_FRONT) {
+ Integer facing = characteristics.get(CameraCharacteristics.LENS_FACING);
+ if (facing != null &&
+ facing.intValue() == CameraCharacteristics.LENS_FACING_FRONT) {
CaptureModule.FRONT_ID = i;
mIsFrontCameraPresent = true;
}