summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W <baddaemon87@gmail.com>2016-10-22 12:47:09 (GMT)
committerAdrian DC <radian.dc@gmail.com>2016-12-03 21:12:10 (GMT)
commitaaa46baf1c12d63b16d3449f02341824f25589eb (patch)
treef0cfa391d6eef4a6bd02365f9348cbc0ede8f882
parent7d16fdb5979cdf1e829c52fcdad2ec3391cd76bf (diff)
downloadandroid_packages_apps_Snap-stable/cm-13.0-ZNH5Y.zip
android_packages_apps_Snap-stable/cm-13.0-ZNH5Y.tar.gz
android_packages_apps_Snap-stable/cm-13.0-ZNH5Y.tar.bz2
Snap: Fix possible NPEstable/cm-13.0-ZNH5Y
Seems like getSupportedFocusModes() can return null. Check for null before using it further RM-290 Change-Id: I46860f780b99970cbe9857c8ba73691d69321488 Reference: BugDumps 20161014-20 L#131
-rw-r--r--src/com/android/camera/PhotoModule.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index e12ffc5..33892dd 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -4615,8 +4615,10 @@ public class PhotoModule
mAeLockSupported = CameraUtil.isAutoExposureLockSupported(mInitialParams);
mAwbLockSupported = CameraUtil.isAutoWhiteBalanceLockSupported(mInitialParams);
- if (mInitialParams.getSupportedFocusModes().contains(CameraUtil.FOCUS_MODE_CONTINUOUS_PICTURE) ||
- mInitialParams.getSupportedFocusModes().contains(CameraUtil.FOCUS_MODE_MW_CONTINUOUS_PICTURE)) {
+ List<String> focusModes = mInitialParams.getSupportedFocusModes();
+ if (focusModes != null &&
+ (focusModes.contains(CameraUtil.FOCUS_MODE_CONTINUOUS_PICTURE) ||
+ focusModes.contains(CameraUtil.FOCUS_MODE_MW_CONTINUOUS_PICTURE))) {
mContinuousFocusSupported = true;
} else {
mContinuousFocusSupported = false;