summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorJason Monk <jmonk@google.com>2015-06-04 13:36:14 -0400
committerJason Monk <jmonk@google.com>2015-06-04 13:36:14 -0400
commit9128b1e2415a251d4cf197a9cd9833285275bb71 (patch)
tree6bc82c8d748097074b9c3846112d930482c7a44b /packages/SystemUI/src
parent18d669dc597dc4997ee8d96f38cf138ae31a0cdf (diff)
downloadframeworks_base-9128b1e2415a251d4cf197a9cd9833285275bb71.zip
frameworks_base-9128b1e2415a251d4cf197a9cd9833285275bb71.tar.gz
frameworks_base-9128b1e2415a251d4cf197a9cd9833285275bb71.tar.bz2
Fix Flashlight tile animation
Don't refresh the state if its not different. (This way setAllowAnimation won't get called when it shouldn't) Bug: 21335624 Change-Id: Id6f8961b32d12141db5ac0bb847e4751b8a159b8
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java6
1 files changed, 5 insertions, 1 deletions
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 0369ab5..5d74604 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java
@@ -74,7 +74,11 @@ public class FlashlightTile extends QSTile<QSTile.BooleanState> implements
state.visible = mFlashlightController.isAvailable();
state.label = mHost.getContext().getString(R.string.quick_settings_flashlight_label);
if (arg instanceof UserBoolean) {
- state.value = ((UserBoolean) arg).value;
+ boolean value = ((UserBoolean) arg).value;
+ if (value == state.value) {
+ return;
+ }
+ state.value = value;
}
final AnimationIcon icon = state.value ? mEnable : mDisable;
icon.setAllowAnimation(arg instanceof UserBoolean && ((UserBoolean) arg).userInitiated);