Merge "Rename ACCESS_FM_RADIO to ACCESS_BROADCAST_RADIO permission." into oc-mr1-dev
diff --git a/api/system-current.txt b/api/system-current.txt
index c8f907a..27d3ee4 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -6,12 +6,13 @@
public static final class Manifest.permission {
ctor public Manifest.permission();
+ field public static final java.lang.String ACCESS_BROADCAST_RADIO = "android.permission.ACCESS_BROADCAST_RADIO";
field public static final java.lang.String ACCESS_CACHE_FILESYSTEM = "android.permission.ACCESS_CACHE_FILESYSTEM";
field public static final java.lang.String ACCESS_CHECKIN_PROPERTIES = "android.permission.ACCESS_CHECKIN_PROPERTIES";
field public static final java.lang.String ACCESS_COARSE_LOCATION = "android.permission.ACCESS_COARSE_LOCATION";
field public static final java.lang.String ACCESS_DRM_CERTIFICATES = "android.permission.ACCESS_DRM_CERTIFICATES";
field public static final java.lang.String ACCESS_FINE_LOCATION = "android.permission.ACCESS_FINE_LOCATION";
- field public static final java.lang.String ACCESS_FM_RADIO = "android.permission.ACCESS_FM_RADIO";
+ field public static final deprecated java.lang.String ACCESS_FM_RADIO = "android.permission.ACCESS_FM_RADIO";
field public static final java.lang.String ACCESS_LOCATION_EXTRA_COMMANDS = "android.permission.ACCESS_LOCATION_EXTRA_COMMANDS";
field public static final java.lang.String ACCESS_MOCK_LOCATION = "android.permission.ACCESS_MOCK_LOCATION";
field public static final java.lang.String ACCESS_MTP = "android.permission.ACCESS_MTP";
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index f36e1ad..d175422 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1527,7 +1527,12 @@
<permission android:name="android.permission.HARDWARE_TEST"
android:protectionLevel="signature" />
- <!-- @SystemApi Allows access to FM
+ <!-- @SystemApi Allows access to Broadcast Radio
+ @hide This is not a third-party API (intended for system apps).-->
+ <permission android:name="android.permission.ACCESS_BROADCAST_RADIO"
+ android:protectionLevel="signature|privileged" />
+
+ <!-- @deprecated @SystemApi Allows access to FM
@hide This is not a third-party API (intended for system apps).-->
<permission android:name="android.permission.ACCESS_FM_RADIO"
android:protectionLevel="signature|privileged" />
diff --git a/core/tests/BroadcastRadioTests/AndroidManifest.xml b/core/tests/BroadcastRadioTests/AndroidManifest.xml
index 0f7d4c7..d9b5522 100644
--- a/core/tests/BroadcastRadioTests/AndroidManifest.xml
+++ b/core/tests/BroadcastRadioTests/AndroidManifest.xml
@@ -17,7 +17,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.hardware.radio.tests">
- <uses-permission android:name="android.permission.ACCESS_FM_RADIO" />
+ <uses-permission android:name="android.permission.ACCESS_BROADCAST_RADIO" />
<application>
<uses-library android:name="android.test.runner" />
diff --git a/core/tests/BroadcastRadioTests/src/android/hardware/radio/tests/functional/RadioTunerTest.java b/core/tests/BroadcastRadioTests/src/android/hardware/radio/tests/functional/RadioTunerTest.java
index 82abbf5..ee40c48 100644
--- a/core/tests/BroadcastRadioTests/src/android/hardware/radio/tests/functional/RadioTunerTest.java
+++ b/core/tests/BroadcastRadioTests/src/android/hardware/radio/tests/functional/RadioTunerTest.java
@@ -91,8 +91,8 @@
assumeTrue(isRadioSupported);
// Check radio access permission
- int res = mContext.checkCallingOrSelfPermission(Manifest.permission.ACCESS_FM_RADIO);
- assertEquals("ACCESS_FM_RADIO permission not granted",
+ int res = mContext.checkCallingOrSelfPermission(Manifest.permission.ACCESS_BROADCAST_RADIO);
+ assertEquals("ACCESS_BROADCAST_RADIO permission not granted",
PackageManager.PERMISSION_GRANTED, res);
mRadioManager = (RadioManager)mContext.getSystemService(Context.RADIO_SERVICE);
diff --git a/data/etc/platform.xml b/data/etc/platform.xml
index 19007f9..26741fe 100644
--- a/data/etc/platform.xml
+++ b/data/etc/platform.xml
@@ -107,7 +107,7 @@
<group gid="audio" />
</permission>
- <permission name="android.permission.ACCESS_FM_RADIO" >
+ <permission name="android.permission.ACCESS_BROADCAST_RADIO" >
<!-- /dev/fm is gid media, not audio -->
<group gid="media" />
</permission>
diff --git a/services/core/java/com/android/server/broadcastradio/BroadcastRadioService.java b/services/core/java/com/android/server/broadcastradio/BroadcastRadioService.java
index 914f034..8fdbcf6c 100644
--- a/services/core/java/com/android/server/broadcastradio/BroadcastRadioService.java
+++ b/services/core/java/com/android/server/broadcastradio/BroadcastRadioService.java
@@ -64,8 +64,8 @@
private class ServiceImpl extends IRadioService.Stub {
private void enforcePolicyAccess() {
if (PackageManager.PERMISSION_GRANTED != getContext().checkCallingPermission(
- Manifest.permission.ACCESS_FM_RADIO)) {
- throw new SecurityException("ACCESS_FM_RADIO permission not granted");
+ Manifest.permission.ACCESS_BROADCAST_RADIO)) {
+ throw new SecurityException("ACCESS_BROADCAST_RADIO permission not granted");
}
}