Commit df7a96a7 by olly Committed by Oliver Woodman

Map SDK_INT for dev devices.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112162208
parent e3da2cfb
...@@ -110,9 +110,11 @@ public final class MediaCodecUtil { ...@@ -110,9 +110,11 @@ public final class MediaCodecUtil {
MediaCodecListCompat mediaCodecList = Util.SDK_INT >= 21 MediaCodecListCompat mediaCodecList = Util.SDK_INT >= 21
? new MediaCodecListCompatV21(secure) : new MediaCodecListCompatV16(); ? new MediaCodecListCompatV21(secure) : new MediaCodecListCompatV16();
Pair<String, CodecCapabilities> codecInfo = getMediaCodecInfo(key, mediaCodecList); Pair<String, CodecCapabilities> codecInfo = getMediaCodecInfo(key, mediaCodecList);
// TODO: Verify this cannot occur on v22, and change >= to == [Internal: b/18678462]. if (secure && codecInfo == null && 21 <= Util.SDK_INT && Util.SDK_INT <= 23) {
if (secure && codecInfo == null && Util.SDK_INT >= 21) { // Some devices don't list secure decoders on API level 21 [Internal: b/18678462]. Try the
// Some devices don't list secure decoders on API level 21. Try the legacy path. // 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(); mediaCodecList = new MediaCodecListCompatV16();
codecInfo = getMediaCodecInfo(key, mediaCodecList); codecInfo = getMediaCodecInfo(key, mediaCodecList);
if (codecInfo != null) { if (codecInfo != null) {
......
...@@ -62,25 +62,27 @@ public final class Util { ...@@ -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 * Like {@link android.os.Build.VERSION#SDK_INT}, but in a place where it can be conveniently
* overridden for local testing. * 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. * 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. * 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. * 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. * Value returned by {@link #inferContentType(String)} for DASH manifests.
......
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