am ed9d3494: Merge "Fix Flashlight tile animation" into mnc-dev

* commit 'ed9d3494a8d8495b83b0cc216549ee37e39ef04d':
  Fix Flashlight tile animation
This commit is contained in:
Jason Monk
2015-06-04 18:43:33 +00:00
committed by Android Git Automerger

View File

@@ -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);