summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2010-04-22 18:40:53 +0800
committerChih-Chung Chang <chihchung@google.com>2010-04-23 14:55:43 +0800
commitf86e6af0b8833f5f8a4b03fefba54b1922280d28 (patch)
tree1b96fb6a07a51d0c507e9320226b92f263688126 /src
parent18a0b5bb13b9dc9cdb01d03e901c0836742f7a3a (diff)
downloadLegacyCamera-f86e6af0b8833f5f8a4b03fefba54b1922280d28.zip
LegacyCamera-f86e6af0b8833f5f8a4b03fefba54b1922280d28.tar.gz
LegacyCamera-f86e6af0b8833f5f8a4b03fefba54b1922280d28.tar.bz2
Startup time improvements.
Bug: 2430326 Change-Id: I36dde4cee9f086e468caf87378ce1f2fd0d011c7
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/Camera.java24
-rw-r--r--src/com/android/camera/ImageManager.java15
-rw-r--r--src/com/android/camera/ui/GLRootView.java1
3 files changed, 19 insertions, 21 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index f3a658c..f59e020 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -46,6 +46,7 @@ import android.os.Debug;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
+import android.os.MessageQueue;
import android.os.SystemClock;
import android.preference.PreferenceManager;
import android.provider.MediaStore;
@@ -357,8 +358,6 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
mFocusRectangle = (FocusRectangle) findViewById(R.id.focus_rectangle);
updateFocusIndicator();
- ImageManager.ensureOSXCompatibleFolder();
-
initializeScreenBrightness();
installIntentFilter();
initializeFocusTone();
@@ -367,6 +366,17 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
mFirstTimeInitialized = true;
changeHeadUpDisplayState();
+ addIdleHandler();
+ }
+
+ private void addIdleHandler() {
+ MessageQueue queue = getMainLooper().myQueue();
+ queue.addIdleHandler(new MessageQueue.IdleHandler() {
+ public boolean queueIdle() {
+ ImageManager.ensureOSXCompatibleFolder();
+ return false;
+ }
+ });
}
private void updateThumbnailButton() {
@@ -904,6 +914,9 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
mQuickCapture = getQuickCaptureSettings();
+ // comment out -- unused now.
+ //mQuickCapture = getQuickCaptureSettings();
+
// we need to reset exposure for the preview
resetExposureCompensation();
/*
@@ -981,8 +994,8 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
finalizeHeadUpDisplay();
}
}
-
- private void overrideHudSettings(final String flashMode,
+
+ private void overrideHudSettings(final String flashMode,
final String whiteBalance, final String focusMode) {
mGLRootView.queueEvent(new Runnable() {
public void run() {
@@ -1287,10 +1300,9 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
mZoomValue = 0;
mImageCapture = new ImageCapture();
- resetExposureCompensation();
-
// Start the preview if it is not started.
if (!mPreviewing && !mStartPreviewFail) {
+ resetExposureCompensation();
try {
startPreview();
} catch (CameraHardwareException e) {
diff --git a/src/com/android/camera/ImageManager.java b/src/com/android/camera/ImageManager.java
index 3f437f2..7251af8 100644
--- a/src/com/android/camera/ImageManager.java
+++ b/src/com/android/camera/ImageManager.java
@@ -366,20 +366,7 @@ public class ImageManager {
return false;
}
}
- File f = new File(directoryName, ".probe");
- try {
- // Remove stale file if any
- if (f.exists()) {
- f.delete();
- }
- if (!f.createNewFile()) {
- return false;
- }
- f.delete();
- return true;
- } catch (IOException ex) {
- return false;
- }
+ return directory.canWrite();
}
public static boolean hasStorage() {
diff --git a/src/com/android/camera/ui/GLRootView.java b/src/com/android/camera/ui/GLRootView.java
index 4f3c8a4..10981b1 100644
--- a/src/com/android/camera/ui/GLRootView.java
+++ b/src/com/android/camera/ui/GLRootView.java
@@ -161,7 +161,6 @@ public class GLRootView extends GLSurfaceView
setEGLConfigChooser(8, 8, 8, 8, 0, 4);
getHolder().setFormat(PixelFormat.TRANSLUCENT);
setZOrderOnTop(true);
- setDebugFlags(DEBUG_CHECK_GL_ERROR);
setRenderer(this);