private void cancelAutoFocus() { Log.e(TAG, "cancelAutofocus"); // Note: CameraController.getFocusMode(); will return // 'FOCUS_MODE_AUTO' if actual // mode is in fact FOCUS_MODE_CONTINUOUS_PICTURE or // FOCUS_MODE_CONTINUOUS_VIDEO int fm = CameraController.getFocusMode(); if (fm != CameraParameters.AF_MODE_UNSUPPORTED) { if (fm != preferenceFocusMode && preferenceFocusMode != CameraParameters.MF_MODE) { CameraController.cancelAutoFocus(); CameraController.setCameraFocusMode(preferenceFocusMode); } } // Reset the tap area before calling mListener.cancelAutofocus. // Otherwise, focus mode stays at auto and the tap area passed to the // driver is not reset. CameraController.setCameraFocusAreas(null); ApplicationScreen.instance.setCameraMeteringMode(ApplicationScreen.getMeteringMode()); resetTouchFocus(); mState = STATE_IDLE; CameraController.setFocusState(CameraController.FOCUS_STATE_IDLE); updateFocusUI(); mHandler.removeMessages(RESET_TOUCH_FOCUS); }
public void setFocusParameters() { if (mFocusAreaSupported || CameraController.isRemoteCamera()) CameraController.setCameraFocusAreas(getFocusAreas()); }