summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sandler <dsandler@android.com>2015-10-20 16:01:27 -0700
committerDaniel Sandler <dsandler@android.com>2015-10-23 01:38:51 +0000
commit1044e162c3dc4169b79112fc1a2de14757bca8c3 (patch)
tree21c8bfca9a77e4d7723a633f1fa09f3b43ce999e
parentc9f7abe3705f7c74ad768e0a8e093f6f11e70e1c (diff)
downloadbase-1044e162c3dc4169b79112fc1a2de14757bca8c3.tar.gz
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. Bug: 19121797 (cherry picked from commit 8fd25bf7711aabffe73213ba1f9056f285270695) Change-Id: I14d9fb54521dc6d60822e7c683e4e92fd62cdc6a
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java16
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 47e1ab5193cd..2947258ae9f7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
@@ -102,6 +102,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) {
mContext = context;
mCast = cast;
@@ -293,11 +301,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 CastController.Callback mCastCallback = new CastController.Callback() {