diff --git a/core/java/android/app/ForegroundServiceTypePolicy.java b/core/java/android/app/ForegroundServiceTypePolicy.java index 20d19c16f8d1f..ec17edf6196bf 100644 --- a/core/java/android/app/ForegroundServiceTypePolicy.java +++ b/core/java/android/app/ForegroundServiceTypePolicy.java @@ -107,9 +107,8 @@ public abstract class ForegroundServiceTypePolicy { * * @hide */ - // TODO (b/254661666): Change to @EnabledAfter(T) @ChangeId - @Disabled + @EnabledAfter(targetSdkVersion = android.os.Build.VERSION_CODES.TIRAMISU) @Overridable public static final long FGS_TYPE_NONE_DISABLED_CHANGE_ID = 255038118L; @@ -142,9 +141,8 @@ public abstract class ForegroundServiceTypePolicy { * * @hide */ - // TODO (b/254661666): Change to @EnabledAfter(T) @ChangeId - @Disabled + @EnabledAfter(targetSdkVersion = android.os.Build.VERSION_CODES.TIRAMISU) @Overridable public static final long FGS_TYPE_PERMISSION_CHANGE_ID = 254662522L; @@ -286,10 +284,7 @@ public abstract class ForegroundServiceTypePolicy { new ForegroundServiceTypePermissions(new ForegroundServiceTypePermission[] { new RegularPermission(Manifest.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION) }, true), - new ForegroundServiceTypePermissions(new ForegroundServiceTypePermission[] { - new RegularPermission(Manifest.permission.CAPTURE_VIDEO_OUTPUT), - new AppOpPermission(AppOpsManager.OP_PROJECT_MEDIA) - }, false) + null ); /** @@ -1059,7 +1054,7 @@ public abstract class ForegroundServiceTypePolicy { if (policy.isTypeDisabled(callerUid)) { return FGS_TYPE_POLICY_CHECK_DISABLED; } - int permissionResult = PERMISSION_DENIED; + int permissionResult = PERMISSION_GRANTED; // Do we have the permission to start FGS with this type. if (policy.mAllOfPermissions != null) { permissionResult = policy.mAllOfPermissions.checkPermissions(context,