CastTile: UX fixes for media projection.
- Long clicks on the tile are handled the same way as clicks
regardless of whether the tile is indicating an active media
projection session or not.
- Regular clicks on the tile when a media projection session is
active and the device is locked with a secure keyguard should
stop the session (and not prompt the user to unlock).
Test: manual
Bug: 124753835
Change-Id: I4009563a49377734850b3da0ead3215721de7d22
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
index 0b1e9c3..bdebf79 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
@@ -88,7 +88,9 @@
@Override
public BooleanState newTileState() {
- return new BooleanState();
+ BooleanState state = new BooleanState();
+ state.handlesLongClick = false;
+ return state;
}
@Override
@@ -116,20 +118,25 @@
}
@Override
+ protected void handleLongClick() {
+ handleClick();
+ }
+
+ @Override
protected void handleClick() {
if (getState().state == Tile.STATE_UNAVAILABLE) {
return;
}
- if (mKeyguard.isSecure() && !mKeyguard.canSkipBouncer()) {
- mActivityStarter.postQSRunnableDismissingKeyguard(() -> {
- showDetail(true);
- });
- return;
- }
CastDevice activeProjection = getActiveDeviceMediaProjection();
if (activeProjection == null) {
- showDetail(true);
+ if (mKeyguard.isSecure() && !mKeyguard.canSkipBouncer()) {
+ mActivityStarter.postQSRunnableDismissingKeyguard(() -> {
+ showDetail(true);
+ });
+ } else {
+ showDetail(true);
+ }
} else {
mController.stopCasting(activeProjection);
}