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

Commit b17c3952 authored by Jackal Guo's avatar Jackal Guo
Browse files

Correct the priority for protected actions

The method adjustPriority doesn't adjust the priority for protected
actions on updated privileged apps after booting. The value should
be capped to '0' for all protected actions regardless of the update.

Bug: 65480939
Test: atest PrivilegedUpdateTests
Change-Id: Iee5f32561f3b3782e62502a228c3fa0b70326d3c
parent b0e58545
Loading
Loading
Loading
Loading
+42 −41
Original line number Diff line number Diff line
@@ -890,8 +890,6 @@ public class ComponentResolver {
            return;
        }

        if (systemActivities == null) {
            // the system package is not disabled; we're parsing the system partition
        if (isProtectedAction(intent)) {
            if (mDeferProtectedFilters) {
                // We can't deal with these just yet. No component should ever obtain a
@@ -911,7 +909,6 @@ public class ComponentResolver {
                            + " activity: " + className
                            + " origPrio: " + intent.getPriority());
                }
                    return;
            } else {
                if (DEBUG_FILTERS && setupWizardPackage == null) {
                    Slog.i(TAG, "No setup wizard;"
@@ -935,9 +932,13 @@ public class ComponentResolver {
                            + " origPrio: " + intent.getPriority());
                }
                intent.setPriority(0);
                    return;
            }
            return;
        }

        if (systemActivities == null) {
            // the system package is not disabled; we're parsing the system partition

            // privileged apps on the system image get whatever priority they request
            return;
        }