import com.android.camera.one.OneCameraCharacteristics;
import com.android.camera.one.v2.photo.ImageRotationCalculator;
import com.android.camera.one.v2.photo.ImageRotationCalculatorImpl;
+import com.android.camera.settings.Keys;
import com.android.camera.settings.SettingsManager;
import com.android.camera.util.Size;
import com.google.common.annotations.VisibleForTesting;
private final OneCamera.Facing mCameraFacing;
private final CameraId mCameraId;
private final OneCameraCharacteristics mCameraCharacteristics;
+ private final String mCameraSettingsScope;
/** The desired picture size. */
private Size mPictureSize;
mCameraId = cameraId;
mCameraCharacteristics = cameraCharacteristics;
mIsPaused = false;
+ mCameraSettingsScope = SettingsManager.getCameraSettingScope(mCameraId.getValue());
registerEventHandlers();
}
mPictureSize,
mResourceConstructed.get().getAppController().getSettingsManager(),
getHardwareSpec(),
- SettingsManager.getCameraSettingScope(mCameraId.getValue()),
+ mCameraSettingsScope,
false);
} catch (OneCameraAccessException ex) {
Log.e(TAG, "Failed while open camera", ex);
/** Flash button UI spec. */
bottomBarSpec.enableFlash = mCameraCharacteristics.isFlashSupported();
+ /** Setup exposure compensation */
+ bottomBarSpec.isExposureCompensationSupported = mCameraCharacteristics
+ .isExposureCompensationSupported();
+ bottomBarSpec.enableExposureCompensation = bottomBarSpec.isExposureCompensationSupported;
+ bottomBarSpec.minExposureCompensation =
+ mCameraCharacteristics.getMinExposureCompensation();
+ bottomBarSpec.maxExposureCompensation =
+ mCameraCharacteristics.getMaxExposureCompensation();
+ bottomBarSpec.exposureCompensationStep =
+ mCameraCharacteristics.getExposureCompensationStep();
+ bottomBarSpec.exposureCompensationSetCallback =
+ new CameraAppUI.BottomBarUISpec.ExposureCompensationSetCallback() {
+ @Override
+ public void setExposure(int value) {
+ mResourceConstructed.get().getSettingsManager().set(
+ mCameraSettingsScope, Keys.KEY_EXPOSURE, value);
+ }
+ };
+
/** Intent image review UI spec. */
bottomBarSpec.showCancel = true;
bottomBarSpec.cancelCallback = new View.OnClickListener() {