Commit aac917a4 authored by ziyangch's avatar ziyangch Committed by Commit Bot

[Chromecast] Add getDevices to CastAudioManager.

Bug: Internal b/147703983

Test: test with eureka-internal/355651.
Change-Id: I86a86df4844f3d6e6103f896061ba6d9c2b7599c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2055425Reviewed-by: default avatarYuchen Liu <yucliu@chromium.org>
Reviewed-by: default avatarSimeon Anfinrud <sanfin@chromium.org>
Commit-Queue: Ziyang Cheng <ziyangch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741745}
parent 48af0642
...@@ -4,10 +4,13 @@ ...@@ -4,10 +4,13 @@
package org.chromium.chromecast.shell; package org.chromium.chromecast.shell;
import android.annotation.TargetApi;
import android.content.Context; import android.content.Context;
import android.media.AudioDeviceInfo;
import android.media.AudioManager; import android.media.AudioManager;
import android.media.audiopolicy.AudioPolicy; import android.media.audiopolicy.AudioPolicy;
import android.os.Build; import android.os.Build;
import android.os.Build.VERSION_CODES;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
...@@ -126,6 +129,11 @@ public class CastAudioManager { ...@@ -126,6 +129,11 @@ public class CastAudioManager {
mInternal.unregisterAudioPolicyAsync(audioPolicy); mInternal.unregisterAudioPolicyAsync(audioPolicy);
} }
@TargetApi(VERSION_CODES.M)
public AudioDeviceInfo[] getDevices(int flags) {
return mInternal.getDevices(flags);
}
// TODO(sanfin): Do not expose this. All needed AudioManager methods can be adapted with // TODO(sanfin): Do not expose this. All needed AudioManager methods can be adapted with
// CastAudioManager. // CastAudioManager.
public AudioManager getInternal() { public AudioManager getInternal() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment