diff options
author | Dan Sandler <dsandler@android.com> | 2015-10-23 23:39:50 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-10-23 23:39:50 +0000 |
commit | 6026b5b17e786c180909d8fe5f6747e446e1d365 (patch) | |
tree | b8b71e7310c73a3e404a0c3bf7f2db0d0a9a2156 | |
parent | 9ceec2f0f007e05ed2842f222b4f652bdd69eb3f (diff) | |
parent | 51c2619c7706575a171cf29819db14e91b815a62 (diff) | |
download | base-6026b5b17e786c180909d8fe5f6747e446e1d365.tar.gz |
Delay hiding the cast icon for 3 seconds. DO NOT MERGE
am: 51c2619c77
* commit '51c2619c7706575a171cf29819db14e91b815a62':
Delay hiding the cast icon for 3 seconds. DO NOT MERGE
-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 5c254a26558d..025a0f981a97 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java @@ -106,6 +106,14 @@ public class PhoneStatusBarPolicy { } }; + 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) { mContext = context; mCast = cast; @@ -304,11 +312,17 @@ public class PhoneStatusBarPolicy { } } 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 final HotspotController.Callback mHotspotCallback = new HotspotController.Callback() { |