diff options
| author | 2024-08-21 01:43:40 +0200 | |
|---|---|---|
| committer | 2024-11-20 18:23:19 +0000 | |
| commit | dff8afc723c3d4aedcd1eff8bb0dcd8b1a10ee56 (patch) | |
| tree | 24a7a4a0d49d6ddfa7a5ff37ac0d98b5c7a0e7d5 | |
| parent | e5d7a587f7c2d9114973cd595d9b9199d97492ef (diff) | |
Add MediaDevice getter for route type
TV needs to differentiate between outputs that are all grouped under
MediaDeviceType.TYPE_USB_C_AUDIO_DEVICE and TYPE_3POINT5_MM_AUDIO_DEVICE
to show some additional settings in the audio output switcher.
Bug: 360215561
Test: builds successfully
Flag: EXEMPT bugfix
Change-Id: I91251bbbfd069d65968b5499d87e6c9fb952f590
| -rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java b/packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java index 2321097d42d7..b01b7c9048ba 100644 --- a/packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java @@ -390,6 +390,16 @@ public abstract class MediaDevice implements Comparable<MediaDevice> { } /** + * Get the {@link MediaRoute2Info.Type} of the device. + */ + public int getRouteType() { + if (mRouteInfo == null) { + return TYPE_UNKNOWN; + } + return mRouteInfo.getType(); + } + + /** * Checks if route's volume is fixed, if true, we should disable volume control for the device. * * @return route for this device is fixed. |