From f43777149016910b73018eada0a217fe3c687c1a Mon Sep 17 00:00:00 2001 From: srowen Date: Sun, 5 Feb 2012 10:04:05 +0000 Subject: [PATCH] Force workaround on for Optimus git-svn-id: https://zxing.googlecode.com/svn/trunk@2164 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- .../android/camera/CameraConfigurationManager.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java b/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java index 3ded19d1c..c04bc49d1 100644 --- a/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java +++ b/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java @@ -20,6 +20,7 @@ import android.content.Context; import android.content.SharedPreferences; import android.graphics.Point; import android.hardware.Camera; +import android.os.Build; import android.preference.PreferenceManager; import android.util.Log; import android.view.Display; @@ -150,6 +151,17 @@ final class CameraConfigurationManager { Point bestSize = null; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + + // Force this on every time for Optimus, since we know it has this problem + if (Build.MODEL.contains("optimus") || Build.MODEL.contains("Optimus") || + Build.DEVICE.contains("optimus") || Build.DEVICE.contains("Optimus")) { + if (!prefs.getBoolean(PreferencesActivity.KEY_FORCE_PREVIEW_TO_SCREEN_SIZE, false)) { + SharedPreferences.Editor editor = prefs.edit(); + editor.putBoolean(PreferencesActivity.KEY_FORCE_PREVIEW_TO_SCREEN_SIZE, true); + editor.commit(); + } + } + if (prefs.getBoolean(PreferencesActivity.KEY_FORCE_PREVIEW_TO_SCREEN_SIZE, false)) { Log.i(TAG, "Forcing to screen size");