mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-25 08:32:38 -06:00
36 lines
1.3 KiB
Java
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;
|
|
}
|
|
}
|
|
}
|