From fa81d2126aae262a60b194877daadfb9ed1d50da Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Mon, 27 Oct 2014 16:55:36 +0100 Subject: Fix NPE in FlashlightController Bug: 18007548 Change-Id: Iecd1303feeb8062741752862312043ecd75cebbe --- .../com/android/systemui/statusbar/policy/FlashlightController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 6f021ac..33f7aff 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(); } -- cgit v1.1