Loading core/java/android/app/ForegroundServiceTypePolicy.java +3 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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) { Loading core/res/AndroidManifest.xml +2 −2 Original line number Diff line number Diff line Loading @@ -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 --> Loading Loading
core/java/android/app/ForegroundServiceTypePolicy.java +3 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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) { Loading
core/res/AndroidManifest.xml +2 −2 Original line number Diff line number Diff line Loading @@ -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 --> Loading