From 5a41e54f43fcb7ef0a2db25d209067e7fa715c6e Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Fri, 8 Mar 2019 13:23:00 +0000 Subject: [PATCH] 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 --- .../android/systemui/qs/tiles/CastTile.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) 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 0b1e9c3994103..bdebf79d823bd 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 @@ public class CastTile extends QSTileImpl { @Override public BooleanState newTileState() { - return new BooleanState(); + BooleanState state = new BooleanState(); + state.handlesLongClick = false; + return state; } @Override @@ -115,21 +117,26 @@ public class CastTile extends QSTileImpl { handleClick(); } + @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); }