Skip to content

Commit

Permalink
Map SDK_INT for dev devices.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112162208
  • Loading branch information
ojw28 committed Jan 14, 2016
1 parent e3da2cf commit df7a96a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ public static synchronized Pair<String, CodecCapabilities> getMediaCodecInfo(
MediaCodecListCompat mediaCodecList = Util.SDK_INT >= 21
? new MediaCodecListCompatV21(secure) : new MediaCodecListCompatV16();
Pair<String, CodecCapabilities> codecInfo = getMediaCodecInfo(key, mediaCodecList);
// TODO: Verify this cannot occur on v22, and change >= to == [Internal: b/18678462].
if (secure && codecInfo == null && Util.SDK_INT >= 21) {
// Some devices don't list secure decoders on API level 21. Try the legacy path.
if (secure && codecInfo == null && 21 <= Util.SDK_INT && Util.SDK_INT <= 23) {
// Some devices don't list secure decoders on API level 21 [Internal: b/18678462]. Try the
// legacy path. We also try this path on API levels 22 and 23 as a defensive measure.
// TODO: Verify that the issue cannot occur on API levels 22 and 23, and tighten this block
// to execute on API level 21 only if confirmed.
mediaCodecList = new MediaCodecListCompatV16();
codecInfo = getMediaCodecInfo(key, mediaCodecList);
if (codecInfo != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,27 @@ public final class Util {
* Like {@link android.os.Build.VERSION#SDK_INT}, but in a place where it can be conveniently
* overridden for local testing.
*/
public static final int SDK_INT = android.os.Build.VERSION.SDK_INT;
public static final int SDK_INT =
(Build.VERSION.SDK_INT == 23 && Build.VERSION.CODENAME.charAt(0) == 'N') ? 24
: Build.VERSION.SDK_INT;

/**
* Like {@link android.os.Build#DEVICE}, but in a place where it can be conveniently overridden
* Like {@link Build#DEVICE}, but in a place where it can be conveniently overridden
* for local testing.
*/
public static final String DEVICE = android.os.Build.DEVICE;
public static final String DEVICE = Build.DEVICE;

/**
* Like {@link android.os.Build#MANUFACTURER}, but in a place where it can be conveniently
* Like {@link Build#MANUFACTURER}, but in a place where it can be conveniently
* overridden for local testing.
*/
public static final String MANUFACTURER = android.os.Build.MANUFACTURER;
public static final String MANUFACTURER = Build.MANUFACTURER;

/**
* Like {@link android.os.Build#MODEL}, but in a place where it can be conveniently overridden for
* Like {@link Build#MODEL}, but in a place where it can be conveniently overridden for
* local testing.
*/
public static final String MODEL = android.os.Build.MODEL;
public static final String MODEL = Build.MODEL;

/**
* Value returned by {@link #inferContentType(String)} for DASH manifests.
Expand Down

0 comments on commit df7a96a

Please sign in to comment.