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

Commit 82cb9076 authored by Jing Ji's avatar Jing Ji Committed by Android (Google) Code Review
Browse files

Merge "Update the FGS special use permission to normal|appop"

parents 33f36e06 ccd59411
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import android.compat.annotation.Disabled;
import android.compat.annotation.EnabledAfter;
import android.compat.annotation.Overridable;
import android.content.Context;
import android.content.PermissionChecker;
import android.content.pm.PackageManager;
import android.content.pm.ServiceInfo;
import android.content.pm.ServiceInfo.ForegroundServiceType;
@@ -879,7 +880,8 @@ public abstract class ForegroundServiceTypePolicy {
        int checkPermission(@NonNull Context context, @NonNull String name, int callerUid,
                int callerPid, String packageName, boolean allowWhileInUse) {
            // Simple case, check if it's already granted.
            if (context.checkPermission(name, callerPid, callerUid) == PERMISSION_GRANTED) {
            if (PermissionChecker.checkPermissionForPreflight(context, name,
                    callerPid, callerUid, packageName) == PERMISSION_GRANTED) {
                return PERMISSION_GRANTED;
            }
            if (allowWhileInUse) {
+2 −2
Original line number Diff line number Diff line
@@ -6287,12 +6287,12 @@

    <!-- Allows a regular application to use {@link android.app.Service#startForeground
         Service.startForeground} with the type "specialUse".
         <p>Protection level: signature|appop|instant
         <p>Protection level: normal|appop|instant
    -->
    <permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"
        android:description="@string/permdesc_foregroundServiceSpecialUse"
        android:label="@string/permlab_foregroundServiceSpecialUse"
        android:protectionLevel="signature|appop|instant" />
        android:protectionLevel="normal|appop|instant" />

    <!-- @SystemApi Allows to access all app shortcuts.
         @hide -->