Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c94ccfd7 authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk Committed by Android (Google) Code Review
Browse files

Merge "Fix broadcast radio instrumentation tests."

parents 99881dd9 40ce3009
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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>
+6 −0
Original line number Diff line number Diff line
@@ -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;
@@ -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);