How can I lock my camera's autoExposure, whiteBalance and focus distance and then store their current settings and restore them at a later point?
The API only seems to lock the current state but does not allow to query the state let alone serialize it to restore it when the app is restarted. I can only query the state of the lock, but not the value itself.
My use case is computer vision where I want to configure the camera once and then always load the settings from the app's preferences.
Since I also have to support 4.4.x devices I am looking for a solution which would ideally work with all API > 4.4..
Camera.Parameters parameters = cameraView.getCameraParameters();
if (parameters == null) {
return;
}
if (!parameters.isAutoExposureLockSupported()) {
Log.w(TAG, "Device " + Devices.getModel() + " does not support exposure lock");
return;
}
parameters.setAutoExposureLock(true);
Log.i(TAG, "Lock: " + parameters.getAutoExposureLock());
// getAutoExposureLock only returns true/false, not the exposure value itself