27 lines
692 B
Java
27 lines
692 B
Java
package o;
|
|
|
|
import android.hardware.Camera;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class oBF {
|
|
public static int e(int i) {
|
|
int numberOfCameras = Camera.getNumberOfCameras();
|
|
if (numberOfCameras == 0) {
|
|
return -1;
|
|
}
|
|
boolean z = i >= 0;
|
|
if (!z) {
|
|
i = 0;
|
|
while (i < numberOfCameras) {
|
|
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
|
|
Camera.getCameraInfo(i, cameraInfo);
|
|
if (cameraInfo.facing == 0) {
|
|
break;
|
|
}
|
|
i++;
|
|
}
|
|
}
|
|
return i < numberOfCameras ? i : z ? -1 : 0;
|
|
}
|
|
}
|