Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 477a11de authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Reset assistant role after package force stop."

parents 73fde4b2 7f1b8f6c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1389,6 +1389,16 @@ public class VoiceInteractionManagerService extends SystemService {
                        resetCurAssistant(userHandle);
                        initForUser(userHandle);
                        switchImplementationIfNeededLocked(true);

                        Context context = getContext();
                        context.getSystemService(RoleManager.class).clearRoleHoldersAsUser(
                                RoleManager.ROLE_ASSISTANT, 0, UserHandle.of(userHandle),
                                context.getMainExecutor(), successful -> {
                                    if (!successful) {
                                        Slog.e(TAG,
                                                "Failed to clear default assistant for force stop");
                                    }
                                });
                    }
                } else if (hitRec && doit) {
                    // We are just force-stopping the current recognizer, which is not