|
|
|
@ -35,18 +35,23 @@ public class FocusLock extends BaseLock { |
|
|
|
|
@Override |
|
|
|
|
protected boolean checkShouldSkip(@NonNull ActionHolder holder) { |
|
|
|
|
CaptureResult lastResult = holder.getLastResult(this); |
|
|
|
|
Integer afState = lastResult.get(CaptureResult.CONTROL_AF_STATE); |
|
|
|
|
boolean afStateOk = afState != null && |
|
|
|
|
(afState == CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED |
|
|
|
|
|| afState == CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED |
|
|
|
|
|| afState == CaptureResult.CONTROL_AF_STATE_INACTIVE |
|
|
|
|
|| afState == CaptureResult.CONTROL_AF_STATE_PASSIVE_FOCUSED |
|
|
|
|
|| afState == CaptureResult.CONTROL_AF_STATE_PASSIVE_UNFOCUSED); |
|
|
|
|
Integer afMode = lastResult.get(CaptureResult.CONTROL_AF_MODE); |
|
|
|
|
boolean afModeOk = afMode != null && afMode == CaptureResult.CONTROL_AF_MODE_AUTO; |
|
|
|
|
boolean result = afStateOk && afModeOk; |
|
|
|
|
LOG.i("checkShouldSkip:", result); |
|
|
|
|
return result; |
|
|
|
|
if (lastResult != null) { |
|
|
|
|
Integer afState = lastResult.get(CaptureResult.CONTROL_AF_STATE); |
|
|
|
|
boolean afStateOk = afState != null && |
|
|
|
|
(afState == CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED |
|
|
|
|
|| afState == CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED |
|
|
|
|
|| afState == CaptureResult.CONTROL_AF_STATE_INACTIVE |
|
|
|
|
|| afState == CaptureResult.CONTROL_AF_STATE_PASSIVE_FOCUSED |
|
|
|
|
|| afState == CaptureResult.CONTROL_AF_STATE_PASSIVE_UNFOCUSED); |
|
|
|
|
Integer afMode = lastResult.get(CaptureResult.CONTROL_AF_MODE); |
|
|
|
|
boolean afModeOk = afMode != null && afMode == CaptureResult.CONTROL_AF_MODE_AUTO; |
|
|
|
|
boolean result = afStateOk && afModeOk; |
|
|
|
|
LOG.i("checkShouldSkip:", result); |
|
|
|
|
return result; |
|
|
|
|
} else { |
|
|
|
|
LOG.i("checkShouldSkip: false - lastResult is null."); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|