48 lines
1.6 KiB
Java
48 lines
1.6 KiB
Java
package c.o.a.n.r;
|
|
|
|
import android.hardware.camera2.CameraCharacteristics;
|
|
import android.hardware.camera2.CaptureRequest;
|
|
import android.hardware.camera2.CaptureResult;
|
|
import android.hardware.camera2.TotalCaptureResult;
|
|
import android.hardware.camera2.params.MeteringRectangle;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.RequiresApi;
|
|
import c.o.a.b;
|
|
import c.o.a.n.d;
|
|
import c.o.a.n.o.c;
|
|
/* compiled from: FocusReset */
|
|
@RequiresApi(21)
|
|
public class f extends b {
|
|
public static final b f = new b(f.class.getSimpleName());
|
|
|
|
public f() {
|
|
super(true);
|
|
}
|
|
|
|
@Override // c.o.a.n.r.b
|
|
public void m(@NonNull c cVar, @Nullable MeteringRectangle meteringRectangle) {
|
|
boolean z2;
|
|
int intValue = ((Integer) k(CameraCharacteristics.CONTROL_MAX_REGIONS_AF, 0)).intValue();
|
|
boolean z3 = true;
|
|
if (meteringRectangle == null || intValue <= 0) {
|
|
z2 = false;
|
|
} else {
|
|
((d) cVar).f1482h0.set(CaptureRequest.CONTROL_AF_REGIONS, new MeteringRectangle[]{meteringRectangle});
|
|
z2 = true;
|
|
}
|
|
TotalCaptureResult totalCaptureResult = ((d) cVar).f1483i0;
|
|
Integer num = totalCaptureResult == null ? null : (Integer) totalCaptureResult.get(CaptureResult.CONTROL_AF_TRIGGER);
|
|
f.a(2, "onStarted:", "last focus trigger is", num);
|
|
if (num == null || num.intValue() != 1) {
|
|
z3 = z2;
|
|
} else {
|
|
((d) cVar).f1482h0.set(CaptureRequest.CONTROL_AF_TRIGGER, 2);
|
|
}
|
|
if (z3) {
|
|
((d) cVar).k1();
|
|
}
|
|
l(Integer.MAX_VALUE);
|
|
}
|
|
}
|