From 8d616b450604b85049e4529064f09a7f37285151 Mon Sep 17 00:00:00 2001 From: Zim Date: Tue, 2 Feb 2021 09:57:46 +0000 Subject: [PATCH] Add PROPERTY_MEDIA_CAPABILITIES API This string allows apps add a media_capabilities.xml resource to the AndroidManifest.xml The media_capabilities.xml file will in turn allow apps declare the media capabilities they support, so the OS can transcode unsupported formats to compatible formats for the app Note, that the hard-coded string is already in use in MediaProvider and is covered by TranscodeTest mentioned below Test: atest TranscodeTest Bug: 178187121 Change-Id: I46cfaefe8fb7f0bbd14896efdee61dcc4da19783 --- core/api/current.txt | 1 + core/java/android/content/pm/PackageManager.java | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/core/api/current.txt b/core/api/current.txt index d1b9716b4cd38..a73e1d25998d3 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -12471,6 +12471,7 @@ package android.content.pm { field public static final long MAXIMUM_VERIFICATION_TIMEOUT = 3600000L; // 0x36ee80L field public static final int PERMISSION_DENIED = -1; // 0xffffffff field public static final int PERMISSION_GRANTED = 0; // 0x0 + field public static final String PROPERTY_MEDIA_CAPABILITIES = "android.media.PROPERTY_MEDIA_CAPABILITIES"; field public static final int SIGNATURE_FIRST_NOT_SIGNED = -1; // 0xffffffff field public static final int SIGNATURE_MATCH = 0; // 0x0 field public static final int SIGNATURE_NEITHER_SIGNED = 1; // 0x1 diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 9085ed2be8b10..72fb1cae3871a 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -124,6 +124,19 @@ public abstract class PackageManager { } } + /** + * <application> level {@link android.content.pm.PackageManager.Property} tag specifying + * the XML resource ID containing an application's media capabilities XML file + * + * For example: + * <application> + * <property android:name="android.media.PROPERTY_MEDIA_CAPABILITIES" + * android:resource="@xml/media_capabilities"> + * <application> + */ + public static final String PROPERTY_MEDIA_CAPABILITIES = + "android.media.PROPERTY_MEDIA_CAPABILITIES"; + /** * A property value set within the manifest. *