From a1e77df7ede200c0b22db47bc45097fc2c26d879 Mon Sep 17 00:00:00 2001 From: Albert Dai Date: Thu, 2 Nov 2023 21:03:25 +0000 Subject: Bind voice interactor as visible foreground service when it is being used. It can help the voice interactor and its binding processes being in at least foreground cpuset instead of restricted when the device is dreaming. When the device is dreaming and the voice interactor is being used, BIND_SCHEDULE_LIKE_TOP_APP can only make voice interactor being in top-app cpuset but does not change the proc state. BIND_TREAT_LIKE_VISIBLE_FOREGROUND_SERVICE can change the proc state of voice interactor to be FOREGROUND_SERVICE. Bug 301613300 Test: invoke Assistant on a docked and locked Pixel Tablet, confirm :search cpuset becomes foreground. Change-Id: I758535824b0d79790f028e19a1e78398233b3389 --- .../server/voiceinteraction/VoiceInteractionSessionConnection.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java index 216f45acd5bd..d722f2f1aa0c 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java @@ -279,6 +279,7 @@ final class VoiceInteractionSessionConnection implements ServiceConnection, mFullyBound = mContext.bindServiceAsUser(mBindIntent, mFullConnection, Context.BIND_AUTO_CREATE | Context.BIND_TREAT_LIKE_ACTIVITY | Context.BIND_SCHEDULE_LIKE_TOP_APP + | Context.BIND_TREAT_LIKE_VISIBLE_FOREGROUND_SERVICE | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS, new UserHandle(mUser)); } -- cgit v1.2.3-59-g8ed1b