Search in sources :

Example 6 with AudioPolicy

use of android.media.audiopolicy.AudioPolicy in project robolectric by robolectric.

the class ShadowAudioManagerTest method isAnyAudioPolicyRegistered_afterPolicyRegistered_returnsTrue.

@Test
@Config(minSdk = P)
public void isAnyAudioPolicyRegistered_afterPolicyRegistered_returnsTrue() {
    AudioPolicy audioPolicy = new AudioPolicy.Builder(appContext).build();
    audioManager.registerAudioPolicy(audioPolicy);
    assertThat(shadowOf(audioManager).isAnyAudioPolicyRegistered()).isTrue();
}
Also used : AudioPolicy(android.media.audiopolicy.AudioPolicy) Test(org.junit.Test) Config(org.robolectric.annotation.Config)

Aggregations

AudioPolicy (android.media.audiopolicy.AudioPolicy)6 Test (org.junit.Test)4 Config (org.robolectric.annotation.Config)4 HiddenApi (org.robolectric.annotation.HiddenApi)2 Implementation (org.robolectric.annotation.Implementation)2 RequiresPermission (android.annotation.RequiresPermission)1