diff options
author | Daniel Sandler <dsandler@android.com> | 2015-10-21 23:14:50 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-10-21 23:14:50 +0000 |
commit | cb10c09f0a6c0750d79bf4f681a623fa35f4cef7 (patch) | |
tree | d4ec080654207956b09cd45ccdfc6d8ba7eeba4e /packages | |
parent | b8cfc12c3f0b83e9d00b1f324be4ff5c977645ce (diff) | |
parent | 8fd25bf7711aabffe73213ba1f9056f285270695 (diff) | |
download | frameworks_base-cb10c09f0a6c0750d79bf4f681a623fa35f4cef7.zip frameworks_base-cb10c09f0a6c0750d79bf4f681a623fa35f4cef7.tar.gz frameworks_base-cb10c09f0a6c0750d79bf4f681a623fa35f4cef7.tar.bz2 |
Merge "Delay hiding the cast icon for 3 seconds." into mnc-dr-dev
Diffstat (limited to 'packages')
-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 540b9d0..fa9c4bb 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) { |