Commit 9926a8f6 by Oliver Woodman

Merge pull request #9498 from DolbyLaboratories:dev-v2-direct-automotive

PiperOrigin-RevId: 400134426
parents ce0cf23a 732fc3ef
......@@ -2306,6 +2306,17 @@ public final class Util {
}
/**
* Returns whether the app is running on an automotive device.
*
* @param context Any context.
* @return Whether the app is running on an automotive device.
*/
public static boolean isAutomotive(Context context) {
return Util.SDK_INT >= 23
&& context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE);
}
/**
* Gets the size of the current mode of the default display, in pixels.
*
* <p>Note that due to application UI scaling, the number of pixels made available to applications
......
......@@ -90,8 +90,9 @@ public final class AudioCapabilities {
}
// AudioTrack.isDirectPlaybackSupported returns true for encodings that are supported for audio
// offload, as well as for encodings we want to list for passthrough mode. Therefore we only use
// it on TV devices, which generally shouldn't support audio offload for surround encodings.
if (Util.SDK_INT >= 29 && Util.isTv(context)) {
// it on TV and automotive devices, which generally shouldn't support audio offload for surround
// encodings.
if (Util.SDK_INT >= 29 && (Util.isTv(context) || Util.isAutomotive(context))) {
return new AudioCapabilities(
Api29.getDirectPlaybackSupportedEncodings(), DEFAULT_MAX_CHANNEL_COUNT);
}
......
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 sign in to comment