diff options
| author | 2016-10-04 14:50:11 -0400 | |
|---|---|---|
| committer | 2016-10-04 14:50:11 -0400 | |
| commit | ad32c550c0feebf60d1f18d09222d0e8b880cb01 (patch) | |
| tree | d8795d5f6cbd06b1ac8398003f7e0924d21457a9 | |
| parent | a92006ef6c66b6c704032d14c574ffb40807ce51 (diff) | |
QS: Don't set flashlight state when we don't have an id
Also add a dump to FlashlightController for better visibility.
Change-Id: I7e826c58598ccc18e211aaab31a2e4d039234fc1
Fixes: 31352536
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 3 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/FlashlightController.java | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 26a85275c618..04124b5c28ad 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -3405,6 +3405,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (KeyguardUpdateMonitor.getInstance(mContext) != null) { KeyguardUpdateMonitor.getInstance(mContext).dump(fd, pw, args); } + if (mFlashlightController != null) { + mFlashlightController.dump(fd, pw, args); + } FalsingManager.getInstance(mContext).dump(pw); FalsingLog.dump(pw); 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 91b21ed322a0..4e9fc76f7059 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/FlashlightController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/FlashlightController.java @@ -27,6 +27,8 @@ import android.os.Process; import android.text.TextUtils; import android.util.Log; +import java.io.FileDescriptor; +import java.io.PrintWriter; import java.lang.ref.WeakReference; import java.util.ArrayList; @@ -80,6 +82,7 @@ public class FlashlightController { public void setFlashlight(boolean enabled) { boolean pendingError = false; synchronized (this) { + if (mCameraId == null) return; if (mFlashlightEnabled != enabled) { mFlashlightEnabled = enabled; try { @@ -235,6 +238,17 @@ public class FlashlightController { } }; + public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { + pw.println("FlashlightController state:"); + + pw.print(" mCameraId="); + pw.println(mCameraId); + pw.print(" mFlashlightEnabled="); + pw.println(mFlashlightEnabled); + pw.print(" mTorchAvailable="); + pw.println(mTorchAvailable); + } + public interface FlashlightListener { /** |