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

Commit 90664488 authored by Marcello Galhardo's avatar Marcello Galhardo
Browse files

Allow System to by-pass `verifyShortcutInfoPackage`

SystemUI needs to be able to modify shortcuts defined by other System Apps. A clear use case is Note Task shortcut which needs to be updated based on the notes role app which is observed from SystemUI.

Test: manual

Fixes: b/278724068
Change-Id: Iaca0e6a13ecb68f856334fd83947ac721d45ff81
parent 5e486046
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1716,6 +1716,11 @@ public class ShortcutService extends IShortcutService.Stub {
        if (si == null) {
            return;
        }

        if (isCallerSystem()) {
            return; // no check
        }

        if (!Objects.equals(callerPackage, si.getPackage())) {
            android.util.EventLog.writeEvent(0x534e4554, "109824443", -1, "");
            throw new SecurityException("Shortcut package name mismatch");