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 getLicenseDurationRemainingSec(DrmSession drmSession) { Map 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 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; } } }