summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSenpo Hu <senpo@google.com>2014-09-24 00:15:46 (GMT)
committerSenpo Hu <senpo@google.com>2014-09-24 17:28:39 (GMT)
commit70a82d9d9a59c2a0b9241fdb0b8b0f1a61d0d5a0 (patch)
tree373cf744fd6567c82a7c7df7155b3736b6888a0a
parent2eed7ab0e5d81c0025737c6ce9931f3d8b57b418 (diff)
downloadandroid_frameworks_ex-70a82d9d9a59c2a0b9241fdb0b8b0f1a61d0d5a0.zip
android_frameworks_ex-70a82d9d9a59c2a0b9241fdb0b8b0f1a61d0d5a0.tar.gz
android_frameworks_ex-70a82d9d9a59c2a0b9241fdb0b8b0f1a61d0d5a0.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);