Loading tests/radio/Android.mk +2 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ include $(CLEAR_VARS) LOCAL_PACKAGE_NAME := RadioTests LOCAL_PRIVILEGED_MODULE := true LOCAL_CERTIFICATE := platform LOCAL_MODULE_TAGS := tests # TODO(b/13282254): uncomment when b/13282254 is fixed # LOCAL_SDK_VERSION := current Loading tests/radio/AndroidManifest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="android.hardware.radio.tests"> <uses-permission android:name="android.permission.ACCESS_FM_RADIO" /> <application> <uses-library android:name="android.test.runner" /> </application> Loading tests/radio/src/android/hardware/radio/tests/RadioTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package android.hardware.radio.tests; import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.hardware.radio.RadioManager; Loading Loading @@ -83,6 +84,11 @@ public class RadioTest { boolean isRadioSupported = packageManager.hasSystemFeature(PackageManager.FEATURE_RADIO); assumeTrue(isRadioSupported); // Check radio access permission int res = mContext.checkCallingOrSelfPermission(Manifest.permission.ACCESS_FM_RADIO); assertEquals("ACCESS_FM_RADIO permission not granted", PackageManager.PERMISSION_GRANTED, res); mRadioManager = (RadioManager)mContext.getSystemService(Context.RADIO_SERVICE); assertNotNull(mRadioManager); Loading Loading
tests/radio/Android.mk +2 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ include $(CLEAR_VARS) LOCAL_PACKAGE_NAME := RadioTests LOCAL_PRIVILEGED_MODULE := true LOCAL_CERTIFICATE := platform LOCAL_MODULE_TAGS := tests # TODO(b/13282254): uncomment when b/13282254 is fixed # LOCAL_SDK_VERSION := current Loading
tests/radio/AndroidManifest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="android.hardware.radio.tests"> <uses-permission android:name="android.permission.ACCESS_FM_RADIO" /> <application> <uses-library android:name="android.test.runner" /> </application> Loading
tests/radio/src/android/hardware/radio/tests/RadioTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package android.hardware.radio.tests; import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.hardware.radio.RadioManager; Loading Loading @@ -83,6 +84,11 @@ public class RadioTest { boolean isRadioSupported = packageManager.hasSystemFeature(PackageManager.FEATURE_RADIO); assumeTrue(isRadioSupported); // Check radio access permission int res = mContext.checkCallingOrSelfPermission(Manifest.permission.ACCESS_FM_RADIO); assertEquals("ACCESS_FM_RADIO permission not granted", PackageManager.PERMISSION_GRANTED, res); mRadioManager = (RadioManager)mContext.getSystemService(Context.RADIO_SERVICE); assertNotNull(mRadioManager); Loading