• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

Revisionae98d39253ba54ddf6091ec8c3120076a6807899 (tree)
Time2015-10-28 02:38:35
AuthorDan Sandler <dsandler@andr...>
CommiterThe Android Automerger

Log Message

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

Change Summary

Incremental Difference

--- 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 {
106106 }
107107 };
108108
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+
109117 public PhoneStatusBarPolicy(Context context, CastController cast, HotspotController hotspot) {
110118 mContext = context;
111119 mCast = cast;
@@ -304,11 +312,17 @@ public class PhoneStatusBarPolicy {
304312 }
305313 }
306314 if (DEBUG) Log.v(TAG, "updateCast: isCasting: " + isCasting);
315+ mHandler.removeCallbacks(mRemoveCastIconRunnable);
307316 if (isCasting) {
308317 mService.setIcon(SLOT_CAST, R.drawable.stat_sys_cast, 0,
309318 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);
310325 }
311- mService.setIconVisibility(SLOT_CAST, isCasting);
312326 }
313327
314328 private final HotspotController.Callback mHotspotCallback = new HotspotController.Callback() {