mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Use Build.MANUFACTURER
instead of Util
alias in AudioCapabilities
It seems that changes via Robolectric's `ShadowBuild.setManufacturer()` and similar methods don't propagate correctly (or quickly?) to these aliases. This change resolves a failure caused by different test ordering in `AudioCapabilitiesTest` in order to unblock the 1.6.0-alpha01 release. A follow-up change will migrate other usages from `Util.XXX` to `Build.XXX`. PiperOrigin-RevId: 707125446
This commit is contained in:
parent
3dede2415d
commit
32ab258c43
@ -163,18 +163,24 @@ public final class Util {
|
||||
* Like {@link Build#DEVICE}, but in a place where it can be conveniently overridden for local
|
||||
* testing.
|
||||
*/
|
||||
// TODO: b/384699964 - Deprecate this and migrate usages to Build.DEVICE which works better with
|
||||
// Robolectric's ShadowBuild.setDevice().
|
||||
@UnstableApi public static final String DEVICE = Build.DEVICE;
|
||||
|
||||
/**
|
||||
* Like {@link Build#MANUFACTURER}, but in a place where it can be conveniently overridden for
|
||||
* local testing.
|
||||
*/
|
||||
// TODO: b/384699964 - Deprecate this and migrate usages to Build.MANUFACTURER which works better
|
||||
// with Robolectric's ShadowBuild.setManufacturer().
|
||||
@UnstableApi public static final String MANUFACTURER = Build.MANUFACTURER;
|
||||
|
||||
/**
|
||||
* Like {@link Build#MODEL}, but in a place where it can be conveniently overridden for local
|
||||
* testing.
|
||||
*/
|
||||
// TODO: b/384699964 - Deprecate this and migrate usages to Build.MODEL which works better with
|
||||
// Robolectric's ShadowBuild.setModel().
|
||||
@UnstableApi public static final String MODEL = Build.MODEL;
|
||||
|
||||
/** A concise description of the device that it can be useful to log for debugging purposes. */
|
||||
|
@ -29,6 +29,7 @@ import android.media.AudioFormat;
|
||||
import android.media.AudioManager;
|
||||
import android.media.AudioTrack;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings.Global;
|
||||
import android.util.Pair;
|
||||
import android.util.SparseArray;
|
||||
@ -368,7 +369,7 @@ public final class AudioCapabilities {
|
||||
}
|
||||
|
||||
private static boolean deviceMaySetExternalSurroundSoundGlobalSetting() {
|
||||
return "Amazon".equals(Util.MANUFACTURER) || "Xiaomi".equals(Util.MANUFACTURER);
|
||||
return Build.MANUFACTURER.equals("Amazon") || Build.MANUFACTURER.equals("Xiaomi");
|
||||
}
|
||||
|
||||
private static int getChannelConfigForPassthrough(int channelCount) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user