package o; import android.hardware.Camera; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.regex.Pattern; import o.Xad; /* loaded from: classes3.dex */ public final class Jmf { static { Pattern.compile(";"); } public static void Ot_(Camera.Parameters parameters, Xad.HBt hBt, boolean z) { String b; List supportedFocusModes = parameters.getSupportedFocusModes(); if (z || hBt == Xad.HBt.AUTO) { b = b(supportedFocusModes, "auto"); } else if (hBt == Xad.HBt.CONTINUOUS) { b = b(supportedFocusModes, "continuous-picture", "continuous-video", "auto"); } else if (hBt == Xad.HBt.INFINITY) { b = b(supportedFocusModes, "infinity"); } else { b = hBt == Xad.HBt.MACRO ? b(supportedFocusModes, "macro") : null; } if (!z && b == null) { b = b(supportedFocusModes, "macro", "edof"); } if (b == null || b.equals(parameters.getFocusMode())) { return; } parameters.setFocusMode(b); } public static void Ou_(Camera.Parameters parameters, boolean z) { String b; List supportedFlashModes = parameters.getSupportedFlashModes(); if (z) { b = b(supportedFlashModes, "torch", "on"); } else { b = b(supportedFlashModes, "off"); } if (b == null || b.equals(parameters.getFlashMode())) { return; } parameters.setFlashMode(b); } private static String b(Collection collection, String... strArr) { Arrays.toString(strArr); if (collection == null) { return null; } for (String str : strArr) { if (collection.contains(str)) { return str; } } return null; } public static void Os_(Camera.Parameters parameters) { int[] iArr; List supportedPreviewFpsRange = parameters.getSupportedPreviewFpsRange(); if (supportedPreviewFpsRange != null && !supportedPreviewFpsRange.isEmpty()) { Iterator it = supportedPreviewFpsRange.iterator(); while (it.hasNext()) { Arrays.toString(it.next()); it.hasNext(); } } if (supportedPreviewFpsRange == null || supportedPreviewFpsRange.isEmpty()) { return; } Iterator it2 = supportedPreviewFpsRange.iterator(); while (true) { if (!it2.hasNext()) { iArr = null; break; } iArr = it2.next(); int i = iArr[0]; int i2 = iArr[1]; if (i >= 10000 && i2 <= 20000) { break; } } if (iArr != null) { int[] iArr2 = new int[2]; parameters.getPreviewFpsRange(iArr2); if (Arrays.equals(iArr2, iArr)) { Arrays.toString(iArr); } else { Arrays.toString(iArr); parameters.setPreviewFpsRange(iArr[0], iArr[1]); } } } }