diff options
| author | 2015-10-21 23:30:29 +0000 | |
|---|---|---|
| committer | 2015-10-21 23:30:29 +0000 | |
| commit | f5450e1b331bb33cf2c831abba3633fb52038cb8 (patch) | |
| tree | 5519b546628557eef3d13eadc807a935b05876b2 | |
| parent | d6db05e4b1ea2410525f2a3d406d24262e06e7e7 (diff) | |
| parent | f7284546d930583d1f7d6ca50d80bd74be3eeae4 (diff) | |
Merge "Delay hiding the cast icon for 3 seconds." into mnc-dr-dev am: cb10c09f0a am: b4aa8b0c5b
am: f7284546d9
* commit 'f7284546d930583d1f7d6ca50d80bd74be3eeae4':
Delay hiding the cast icon for 3 seconds.
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java index 540b9d003a17..fa9c4bbcb485 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java @@ -109,6 +109,14 @@ public class PhoneStatusBarPolicy implements Callback { } }; + private Runnable mRemoveCastIconRunnable = new Runnable() { + @Override + public void run() { + if (DEBUG) Log.v(TAG, "updateCast: hiding icon NOW"); + mService.setIconVisibility(SLOT_CAST, false); + } + }; + public PhoneStatusBarPolicy(Context context, CastController cast, HotspotController hotspot, UserInfoController userInfoController, BluetoothController bluetooth) { mContext = context; @@ -328,11 +336,17 @@ public class PhoneStatusBarPolicy implements Callback { } } if (DEBUG) Log.v(TAG, "updateCast: isCasting: " + isCasting); + mHandler.removeCallbacks(mRemoveCastIconRunnable); if (isCasting) { mService.setIcon(SLOT_CAST, R.drawable.stat_sys_cast, 0, mContext.getString(R.string.accessibility_casting)); + mService.setIconVisibility(SLOT_CAST, true); + } else { + // don't turn off the screen-record icon for a few seconds, just to make sure the user + // has seen it + if (DEBUG) Log.v(TAG, "updateCast: hiding icon in 3 sec..."); + mHandler.postDelayed(mRemoveCastIconRunnable, 3000); } - mService.setIconVisibility(SLOT_CAST, isCasting); } private void profileChanged(int userId) { |