diff options
| author | 2020-02-05 17:02:10 -0500 | |
|---|---|---|
| committer | 2020-02-05 17:10:29 -0500 | |
| commit | 9c7100a9164abed33d4ff1c4522a023df19e11f4 (patch) | |
| tree | 5e5f589cfee6123ed5f5eba8274ca32bfdf910ac | |
| parent | 374ba3fcff8c3fa6cd6f8f5b58ddcbdb96584d72 (diff) | |
Ensure chip view updates on main thread
This was causing a crash sometimes when the device list was changed
Fixes: 148963732
Test: manual
Change-Id: I2fecbfff2d254784ac3831fbe75aee3369b1ec91
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/QSMediaPlayer.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSMediaPlayer.java b/packages/SystemUI/src/com/android/systemui/qs/QSMediaPlayer.java index 9e3e94ce4186..6c697184f082 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSMediaPlayer.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSMediaPlayer.java @@ -36,6 +36,7 @@ import android.media.MediaMetadata; import android.media.session.MediaController; import android.media.session.MediaSession; import android.media.session.PlaybackState; +import android.os.Handler; import android.util.Log; import android.view.KeyEvent; import android.view.LayoutInflater; @@ -370,6 +371,13 @@ public class QSMediaPlayer { if (mSeamless == null) { return; } + Handler handler = mSeamless.getHandler(); + handler.post(() -> { + updateChipInternal(device); + }); + } + + private void updateChipInternal(MediaDevice device) { ColorStateList fgTintList = ColorStateList.valueOf(mForegroundColor); // Update the outline color |