summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-03-25 21:29:19 -0700
committerClark Scheff <clark@cyngn.com>2015-10-27 18:29:43 -0700
commitf3d9fdc0e027e69af2855f58c01758a18b2f6d1e (patch)
tree7bbb07f20ecc2159349432899333a76c13b94125 /packages/SystemUI/src/com/android/systemui/qs/QSTile.java
parent5cac74773330b56715bd2fc97fdf36fac91a8bac (diff)
downloadframeworks_base-f3d9fdc0e027e69af2855f58c01758a18b2f6d1e.zip
frameworks_base-f3d9fdc0e027e69af2855f58c01758a18b2f6d1e.tar.gz
frameworks_base-f3d9fdc0e027e69af2855f58c01758a18b2f6d1e.tar.bz2
systemui: Fix ClassCastExceptions
Change-Id: I10a90bd21e4fbf99c6eae1fa6d3ed151f0fc10f7
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/qs/QSTile.java')
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSTile.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
index b330582..3202250 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
@@ -402,13 +402,14 @@ public abstract class QSTile<TState extends State> implements Listenable {
@Override
public Drawable getDrawable(Context context) {
// workaround: get a clean state for every new AVD
- final AnimatedVectorDrawable d = (AnimatedVectorDrawable) context.getDrawable(mResId)
- .getConstantState().newDrawable();
- d.start();
- if (mAllowAnimation) {
- mAllowAnimation = false;
- } else {
- d.stop(); // skip directly to end state
+ final Drawable d = super.getDrawable(context).getConstantState().newDrawable();
+ if (d instanceof AnimatedVectorDrawable) {
+ ((AnimatedVectorDrawable)d).start();
+ if (mAllowAnimation) {
+ mAllowAnimation = false;
+ } else {
+ ((AnimatedVectorDrawable)d).stop(); // skip directly to end state
+ }
}
return d;
}