summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSenpo Hu <senpo@google.com>2014-09-24 00:15:46 (GMT)
committerThe Android Automerger <android-build@google.com>2014-09-24 22:15:41 (GMT)
commite9ad156438523e5580c698825bc124844102f4ff (patch)
tree373cf744fd6567c82a7c7df7155b3736b6888a0a
parent8d2d5e120effe649c830a83a730c3af4036fd24b (diff)
downloadandroid_frameworks_ex-e9ad156438523e5580c698825bc124844102f4ff.zip
android_frameworks_ex-e9ad156438523e5580c698825bc124844102f4ff.tar.gz
android_frameworks_ex-e9ad156438523e5580c698825bc124844102f4ff.tar.bz2
Add null check in AndroidCameraSettings.
Check Camera.Parameters is null in AndroidCameraSettings ctor. This should also fix the NPE bug b/17620440. Bug: 17555612 Change-Id: Iee5f41b5d47eced3155e31c09f267eaa61c7de39
-rw-r--r--camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraSettings.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraSettings.java b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraSettings.java
index ee69b54..4558fe3 100644
--- a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraSettings.java
+++ b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraSettings.java
@@ -17,15 +17,23 @@
package com.android.ex.camera2.portability;
import android.hardware.Camera;
+import com.android.ex.camera2.portability.debug.Log;
/**
* The subclass of {@link CameraSettings} for Android Camera 1 API.
*/
public class AndroidCameraSettings extends CameraSettings {
+ private static final Log.Tag TAG = new Log.Tag("AndCamSet");
+
private static final String TRUE = "true";
private static final String RECORDING_HINT = "recording-hint";
public AndroidCameraSettings(CameraCapabilities capabilities, Camera.Parameters params) {
+ if (params == null) {
+ Log.w(TAG, "Settings ctor requires a non-null Camera.Parameters.");
+ return;
+ }
+
CameraCapabilities.Stringifier stringifier = capabilities.getStringifier();
setSizesLocked(false);