From 4db40fcb7218509f36fb32a398db2ddb60b9e4c0 Mon Sep 17 00:00:00 2001 From: Brian Lindahl Date: Sun, 20 Feb 2022 07:58:07 +0100 Subject: [PATCH] Expose permission MEDIA_RESOURCE_OVERRIDE_PID as a system API and allow vendor services to use it The MEDIA_RESOURCE_OVERRIDE_PID permission is needed to create codecs on behalf of other processes. The protection level is elevated to allow for Vendor and OEM processes, specifically for Vendor/OEM TvInputService which manages inputs for broadcast and cable TV apps. Bug: 217746837 Fixes: 219768766 Test: atest MediaCodecResourceTest Change-Id: I8b2f4da91be120250f6f37c5623a8a0afe0e1c82 --- core/api/system-current.txt | 3 ++- core/res/AndroidManifest.xml | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/api/system-current.txt b/core/api/system-current.txt index ea004c02e2ab9..47ed5d2a9ed7a 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -197,6 +197,7 @@ package android { field public static final String MANAGE_WEAK_ESCROW_TOKEN = "android.permission.MANAGE_WEAK_ESCROW_TOKEN"; field public static final String MANAGE_WIFI_COUNTRY_CODE = "android.permission.MANAGE_WIFI_COUNTRY_CODE"; field public static final String MARK_DEVICE_ORGANIZATION_OWNED = "android.permission.MARK_DEVICE_ORGANIZATION_OWNED"; + field public static final String MEDIA_RESOURCE_OVERRIDE_PID = "android.permission.MEDIA_RESOURCE_OVERRIDE_PID"; field public static final String MODIFY_APPWIDGET_BIND_PERMISSIONS = "android.permission.MODIFY_APPWIDGET_BIND_PERMISSIONS"; field public static final String MODIFY_AUDIO_ROUTING = "android.permission.MODIFY_AUDIO_ROUTING"; field public static final String MODIFY_CELL_BROADCASTS = "android.permission.MODIFY_CELL_BROADCASTS"; @@ -6267,7 +6268,7 @@ package android.media { } public final class MediaCodec { - method @NonNull @RequiresPermission("android.permission.MEDIA_RESOURCE_OVERRIDE_PID") public static android.media.MediaCodec createByCodecNameForClient(@NonNull String, int, int) throws java.io.IOException; + method @NonNull @RequiresPermission(android.Manifest.permission.MEDIA_RESOURCE_OVERRIDE_PID) public static android.media.MediaCodec createByCodecNameForClient(@NonNull String, int, int) throws java.io.IOException; } public class MediaPlayer implements android.media.AudioRouting android.media.VolumeAutomation { diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index b39df2c4db9da..53dba7b6aaa12 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -4318,13 +4318,13 @@ - + android:protectionLevel="signature|privileged|vendorPrivileged" />