diff options
author | Jason Monk <jmonk@google.com> | 2015-07-14 18:04:46 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-07-14 18:04:46 +0000 |
commit | d7f12b05dc799daed325d000f6e19a14619cc6c9 (patch) | |
tree | a931851e3719c7c9956ae2af101a1230f4b5a87c /packages | |
parent | f12612c8e24cdccc390e69e7623af793c79b4c36 (diff) | |
parent | 1b75e6391a271c8bf6105c71877dd583beca7a91 (diff) | |
download | frameworks_base-d7f12b05dc799daed325d000f6e19a14619cc6c9.zip frameworks_base-d7f12b05dc799daed325d000f6e19a14619cc6c9.tar.gz frameworks_base-d7f12b05dc799daed325d000f6e19a14619cc6c9.tar.bz2 |
am 1b75e639: am 5086a970: am fe03a84b: Merge "Fix QS labels on language change" into mnc-dev
* commit '1b75e6391a271c8bf6105c71877dd583beca7a91':
Fix QS labels on language change
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/QSPanel.java | 3 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/QSTile.java | 17 |
2 files changed, 18 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java index 2ded919..94d5170 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java @@ -158,6 +158,9 @@ public class QSPanel extends ViewGroup { mColumns = columns; postInvalidate(); } + for (TileRecord r : mRecords) { + r.tile.clearState(); + } if (mListening) { refreshAllTiles(); } diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java index 38fade2..b330582 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java @@ -61,8 +61,8 @@ public abstract class QSTile<TState extends State> implements Listenable { protected final Handler mUiHandler = new Handler(Looper.getMainLooper()); private Callback mCallback; - protected final TState mState = newTileState(); - private final TState mTmpState = newTileState(); + protected TState mState = newTileState(); + private TState mTmpState = newTileState(); private boolean mAnnounceNextStateChange; abstract protected TState newTileState(); @@ -139,6 +139,10 @@ public abstract class QSTile<TState extends State> implements Listenable { mHandler.obtainMessage(H.REFRESH_STATE, arg).sendToTarget(); } + public final void clearState() { + mHandler.sendEmptyMessage(H.CLEAR_STATE); + } + public void userSwitch(int newUserId) { mHandler.obtainMessage(H.USER_SWITCH, newUserId, 0).sendToTarget(); } @@ -178,6 +182,11 @@ public abstract class QSTile<TState extends State> implements Listenable { // optional } + protected void handleClearState() { + mTmpState = newTileState(); + mState = newTileState(); + } + protected void handleRefreshState(Object arg) { handleUpdateState(mTmpState, arg); final boolean changed = mTmpState.copyTo(mState); @@ -246,6 +255,7 @@ public abstract class QSTile<TState extends State> implements Listenable { private static final int TOGGLE_STATE_CHANGED = 8; private static final int SCAN_STATE_CHANGED = 9; private static final int DESTROY = 10; + private static final int CLEAR_STATE = 11; private H(Looper looper) { super(looper); @@ -286,6 +296,9 @@ public abstract class QSTile<TState extends State> implements Listenable { } else if (msg.what == DESTROY) { name = "handleDestroy"; handleDestroy(); + } else if (msg.what == CLEAR_STATE) { + name = "handleClearState"; + handleClearState(); } else { throw new IllegalArgumentException("Unknown msg: " + msg.what); } |