summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adrian Roos <roosa@google.com> 2014-10-27 16:55:36 +0100
committer Zach Riggle <riggle@google.com> 2014-12-15 22:48:19 +0000
commit54eb845d9f16b6c42f379965e65ebc0629e4bd3b (patch)
treeb5423f8fce49d14571e8106742d199407458616e
parentaaa37da8e0d358317d85e3bc7bfa363c644f5ef1 (diff)
Fix NPE in FlashlightController
Bug: 18007548 Change-Id: Iecd1303feeb8062741752862312043ecd75cebbe (cherry picked from commit fa81d2126aae262a60b194877daadfb9ed1d50da)
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/FlashlightController.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/FlashlightController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/FlashlightController.java
index 6f021aca15f1..33f7affe892f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/FlashlightController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/FlashlightController.java
@@ -308,7 +308,11 @@ public class FlashlightController {
new CameraCaptureSession.StateListener() {
@Override
public void onConfigured(CameraCaptureSession session) {
- mSession = session;
+ if (session.getDevice() == mCameraDevice) {
+ mSession = session;
+ } else {
+ session.close();
+ }
postUpdateFlashlight();
}