Rabbit-R1/original r1/java/sources/androidx/media3/exoplayer/drm/WidevineUtil.java
2024-05-21 17:08:36 -04:00

36 lines
1.3 KiB
Java

package androidx.media3.exoplayer.drm;
import android.util.Pair;
import java.util.Map;
/* loaded from: classes2.dex */
public final class WidevineUtil {
public static final String PROPERTY_LICENSE_DURATION_REMAINING = "LicenseDurationRemaining";
public static final String PROPERTY_PLAYBACK_DURATION_REMAINING = "PlaybackDurationRemaining";
private WidevineUtil() {
}
public static Pair<Long, Long> getLicenseDurationRemainingSec(DrmSession drmSession) {
Map<String, String> queryKeyStatus = drmSession.queryKeyStatus();
if (queryKeyStatus == null) {
return null;
}
return new Pair<>(Long.valueOf(getDurationRemainingSec(queryKeyStatus, "LicenseDurationRemaining")), Long.valueOf(getDurationRemainingSec(queryKeyStatus, "PlaybackDurationRemaining")));
}
private static long getDurationRemainingSec(Map<String, String> map, String str) {
if (map == null) {
return -9223372036854775807L;
}
try {
String str2 = map.get(str);
if (str2 != null) {
return Long.parseLong(str2);
}
return -9223372036854775807L;
} catch (NumberFormatException unused) {
return -9223372036854775807L;
}
}
}