From 3266f6123056bf74490186e42f850b30026a5cb9 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Fri, 31 Jul 2015 11:37:11 -0400 Subject: QS: Allow Flashlight Tile to handle reset state Bug: 22815987 Change-Id: I3c22760c546c5407495e1e8f09dc402a56817f9d --- .../SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java | 2 ++ .../com/android/systemui/statusbar/policy/FlashlightController.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java index 5d7460460a8b..21cbef21c22a 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java @@ -79,6 +79,8 @@ public class FlashlightTile extends QSTile implements return; } state.value = value; + } else { + state.value = mFlashlightController.isEnabled(); } final AnimationIcon icon = state.value ? mEnable : mDisable; icon.setAllowAnimation(arg instanceof UserBoolean && ((UserBoolean) arg).userInitiated); 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 cd1914c55663..29a8f67e4cfe 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/FlashlightController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/FlashlightController.java @@ -93,6 +93,10 @@ public class FlashlightController { } } + public synchronized boolean isEnabled() { + return mFlashlightEnabled; + } + public synchronized boolean isAvailable() { return mTorchAvailable; } -- cgit v1.2.3-59-g8ed1b