From c2beb67c03a8a0a69ef92a741ff43ea4b91d0038 Mon Sep 17 00:00:00 2001 From: Marcello Galhardo Date: Thu, 6 Apr 2023 18:24:57 +0000 Subject: [PATCH] Run update note task shortcut in a service if user is different Shortcut Manager injects the main user, and do not allow us to set what user should have their shortcuts modified. To workaround that until we add support to custom users, we are launching a service and triggering the update task from that user's process. Running a different service may delay the update by a fraction of a second, in case the user jump into the home screen just after. Test: atest NoteTaskControllerTest Fixes: b/276889922 Change-Id: If503df7af038c51829e9267af7a9d0aafd7da986 --- packages/SystemUI/AndroidManifest.xml | 2 + .../systemui/notetask/NoteTaskController.kt | 10 +++- .../NoteTaskControllerUpdateService.kt | 55 +++++++++++++++++++ .../systemui/notetask/NoteTaskModule.kt | 6 ++ .../notetask/NoteTaskControllerTest.kt | 32 +++++++++++ 5 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 packages/SystemUI/src/com/android/systemui/notetask/NoteTaskControllerUpdateService.kt diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index a00f401756f7d..5135bf142aa3b 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -979,6 +979,8 @@ + +