Skip to content

Commit

Permalink
Drastic measures: make *all* optional camera params disabled by defau…
Browse files Browse the repository at this point in the history
…lt to appease some bad devices. And even make the default disabled in the code, not just XML.
  • Loading branch information
srowen committed Feb 3, 2014
1 parent ac9b799 commit 4411eb5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.zxing.client.android"
android:versionName="4.6.0"
android:versionCode="95"
android:versionName="4.6.1"
android:versionCode="96"
android:installLocation="auto">

<uses-permission android:name="android.permission.CAMERA"/>
Expand Down
2 changes: 1 addition & 1 deletion android/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
android:summary="@string/preferences_disable_continuous_focus_summary"/>
<CheckBoxPreference
android:key="preferences_disable_exposure"
android:defaultValue="false"
android:defaultValue="true"
android:title="@string/preferences_disable_exposure_title"/>
<CheckBoxPreference
android:key="preferences_disable_metering"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void setDesiredCameraParameters(Camera camera, boolean safeMode) {

String focusMode = null;
if (prefs.getBoolean(PreferencesActivity.KEY_AUTO_FOCUS, true)) {
if (safeMode || prefs.getBoolean(PreferencesActivity.KEY_DISABLE_CONTINUOUS_FOCUS, false)) {
if (safeMode || prefs.getBoolean(PreferencesActivity.KEY_DISABLE_CONTINUOUS_FOCUS, true)) {
focusMode = findSettableValue(parameters.getSupportedFocusModes(),
Camera.Parameters.FOCUS_MODE_AUTO);
} else {
Expand Down Expand Up @@ -127,15 +127,15 @@ void setDesiredCameraParameters(Camera camera, boolean safeMode) {
}
}

if (!prefs.getBoolean(PreferencesActivity.KEY_DISABLE_BARCODE_SCENE_MODE, false)) {
if (!prefs.getBoolean(PreferencesActivity.KEY_DISABLE_BARCODE_SCENE_MODE, true)) {
String sceneMode = findSettableValue(parameters.getSupportedSceneModes(),
Camera.Parameters.SCENE_MODE_BARCODE);
if (sceneMode != null) {
parameters.setSceneMode(sceneMode);
}
}

if (!prefs.getBoolean(PreferencesActivity.KEY_DISABLE_METERING, false)) {
if (!prefs.getBoolean(PreferencesActivity.KEY_DISABLE_METERING, true)) {
if (parameters.isVideoStabilizationSupported()) {
Log.i(TAG, "Enabling video stabilization...");
parameters.setVideoStabilization(true);
Expand Down Expand Up @@ -209,7 +209,7 @@ private void doSetTorch(Camera.Parameters parameters, boolean newSetting, boolea
}

SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (!prefs.getBoolean(PreferencesActivity.KEY_DISABLE_EXPOSURE, false)) {
if (!prefs.getBoolean(PreferencesActivity.KEY_DISABLE_EXPOSURE, true)) {
if (!safeMode) {
int minExposure = parameters.getMinExposureCompensation();
int maxExposure = parameters.getMaxExposureCompensation();
Expand Down

0 comments on commit 4411eb5

Please sign in to comment.