From c9350f831033ab537eee19ec4f5a561cdad084ca Mon Sep 17 00:00:00 2001 From: Beverly Date: Thu, 30 Mar 2023 16:41:27 +0000 Subject: [PATCH] Send user-activity to power manager on lock icon long press MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To reset the screen timeout so the display won’t go to sleep so quickly after a lock icon longpress. Test: Manually swipe on lock icon, screen still timeouts, but if a longpress is detected, the screen timeout resets Fixes: 236930064 Change-Id: Idc799a3e2f06638401acd999d9cce1967f263d9b --- .../NotificationShadeWindowViewController.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java index 0318fa570a787..2f4cc14675173 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java @@ -283,11 +283,15 @@ public class NotificationShadeWindowViewController { } mLockIconViewController.onTouchEvent( ev, - () -> mService.wakeUpIfDozing( - mClock.uptimeMillis(), - mView, - "LOCK_ICON_TOUCH", - PowerManager.WAKE_REASON_GESTURE) + /* onGestureDetectedRunnable */ + () -> { + mService.userActivity(); + mService.wakeUpIfDozing( + mClock.uptimeMillis(), + mView, + "LOCK_ICON_TOUCH", + PowerManager.WAKE_REASON_GESTURE); + } ); // In case we start outside of the view bounds (below the status bar), we need to