diff options
author | Chih-Chung Chang <chihchung@google.com> | 2010-02-19 12:35:58 -0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2010-02-19 12:36:30 -0800 |
commit | 803afcc7dae35d6a02e8882fc5fcbcdcca4eaad4 (patch) | |
tree | 05498196f7d1f4fda2dd1bc69aedfb769cd2a123 /src | |
parent | ffbbd7f09b8832ce523799eec53753cd3559e53d (diff) | |
download | LegacyCamera-803afcc7dae35d6a02e8882fc5fcbcdcca4eaad4.zip LegacyCamera-803afcc7dae35d6a02e8882fc5fcbcdcca4eaad4.tar.gz LegacyCamera-803afcc7dae35d6a02e8882fc5fcbcdcca4eaad4.tar.bz2 |
Move set screen brightness later so we can start preview earlier.
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/Camera.java | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index f853f8c..0b1155e 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -324,6 +324,8 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, ImageManager.ensureOSXCompatibleFolder(); + initializeScreenBrightness(); + installIntentFilter(); initializeFocusTone(); @@ -918,20 +920,6 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, public void onCreate(Bundle icicle) { super.onCreate(icicle); - Window win = getWindow(); - - // Overright the brightness settings if it is automatic - int mode = Settings.System.getInt( - getContentResolver(), - Settings.System.SCREEN_BRIGHTNESS_MODE, - Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL); - if (mode == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) { - WindowManager.LayoutParams winParams = win.getAttributes(); - winParams.screenBrightness = DEFAULT_CAMERA_BRIGHTNESS; - win.setAttributes(winParams); - } - - win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); setContentView(R.layout.camera); mSurfaceView = (SurfaceView) findViewById(R.id.camera_preview); @@ -1316,6 +1304,20 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, } } + private void initializeScreenBrightness() { + Window win = getWindow(); + // Overright the brightness settings if it is automatic + int mode = Settings.System.getInt( + getContentResolver(), + Settings.System.SCREEN_BRIGHTNESS_MODE, + Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL); + if (mode == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) { + WindowManager.LayoutParams winParams = win.getAttributes(); + winParams.screenBrightness = DEFAULT_CAMERA_BRIGHTNESS; + win.setAttributes(winParams); + } + } + @Override public void onResume() { super.onResume(); |