frameworks/base
Revision | ae98d39253ba54ddf6091ec8c3120076a6807899 (tree) |
---|---|
Time | 2015-10-28 02:38:35 |
Author | Dan Sandler <dsandler@andr...> |
Commiter | The Android Automerger |
Delay hiding the cast icon for 3 seconds. DO NOT MERGE
Ensure that the user has had a chance to see it for a few
seconds after screen recording has ended.
(cherry picked from commit 8fd25bf7711aabffe73213ba1f9056f285270695)
Bug: 19121797
Change-Id: I7a5c12b371b735c756ca5a3e8716c385fb3fbfe9
@@ -106,6 +106,14 @@ public class PhoneStatusBarPolicy { | ||
106 | 106 | } |
107 | 107 | }; |
108 | 108 | |
109 | + private Runnable mRemoveCastIconRunnable = new Runnable() { | |
110 | + @Override | |
111 | + public void run() { | |
112 | + if (DEBUG) Log.v(TAG, "updateCast: hiding icon NOW"); | |
113 | + mService.setIconVisibility(SLOT_CAST, false); | |
114 | + } | |
115 | + }; | |
116 | + | |
109 | 117 | public PhoneStatusBarPolicy(Context context, CastController cast, HotspotController hotspot) { |
110 | 118 | mContext = context; |
111 | 119 | mCast = cast; |
@@ -304,11 +312,17 @@ public class PhoneStatusBarPolicy { | ||
304 | 312 | } |
305 | 313 | } |
306 | 314 | if (DEBUG) Log.v(TAG, "updateCast: isCasting: " + isCasting); |
315 | + mHandler.removeCallbacks(mRemoveCastIconRunnable); | |
307 | 316 | if (isCasting) { |
308 | 317 | mService.setIcon(SLOT_CAST, R.drawable.stat_sys_cast, 0, |
309 | 318 | mContext.getString(R.string.accessibility_casting)); |
319 | + mService.setIconVisibility(SLOT_CAST, true); | |
320 | + } else { | |
321 | + // don't turn off the screen-record icon for a few seconds, just to make sure the user | |
322 | + // has seen it | |
323 | + if (DEBUG) Log.v(TAG, "updateCast: hiding icon in 3 sec..."); | |
324 | + mHandler.postDelayed(mRemoveCastIconRunnable, 3000); | |
310 | 325 | } |
311 | - mService.setIconVisibility(SLOT_CAST, isCasting); | |
312 | 326 | } |
313 | 327 | |
314 | 328 | private final HotspotController.Callback mHotspotCallback = new HotspotController.Callback() { |