diff options
| author | srowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57> | 2012-02-05 14:04:05 +0400 |
|---|---|---|
| committer | srowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57> | 2012-02-05 14:04:05 +0400 |
| commit | 117e8608d98460eebf911ee4124fa320f15b83eb (patch) | |
| tree | 7a3dad2482694affc612a6fa2b2d85e43f09875a | |
| parent | 5632d985666f53e7ae4def42c95690b6730d7fe9 (diff) | |
| download | zxing-android-embedded-117e8608d98460eebf911ee4124fa320f15b83eb.tar.xz | |
Force workaround on for Optimus
git-svn-id: http://zxing.googlecode.com/svn/trunk/android@2164 59b500cc-1b3d-0410-9834-0bbf25fbcc57
| -rw-r--r-- | src/com/google/zxing/client/android/camera/CameraConfigurationManager.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java b/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java index 3ded19d1..c04bc49d 100644 --- a/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java +++ b/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"); |
