summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2010-09-08 12:28:04 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-08 12:28:04 -0700
commit77b6c6a8ef32eeca4c527ca52b04451e7458599e (patch)
treea5ff8c12e9eca5cd342bb8d2d3d053a3493e22e1
parent3cc5642c8dbf23e24b5f311cc96b2c0a37cf6bac (diff)
parent4714a1cf1d211aad2d8cf1802f85f649e744beb0 (diff)
downloadLegacyCamera-77b6c6a8ef32eeca4c527ca52b04451e7458599e.zip
LegacyCamera-77b6c6a8ef32eeca4c527ca52b04451e7458599e.tar.gz
LegacyCamera-77b6c6a8ef32eeca4c527ca52b04451e7458599e.tar.bz2
am 4714a1cf: Use SharedPreferences.apply to reduce latency.
Merge commit '4714a1cf1d211aad2d8cf1802f85f649e744beb0' * commit '4714a1cf1d211aad2d8cf1802f85f649e744beb0': Use SharedPreferences$Editor.apply to reduce latency.
-rw-r--r--src/com/android/camera/Camera.java2
-rw-r--r--src/com/android/camera/CameraSettings.java8
-rw-r--r--src/com/android/camera/ui/HeadUpDisplay.java2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index a256e3b..e2820fb 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -278,7 +278,7 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
if (!CameraSettings.EXPOSURE_DEFAULT_VALUE.equals(value)) {
Editor editor = mPreferences.edit();
editor.putString(CameraSettings.KEY_EXPOSURE, "0");
- editor.commit();
+ editor.apply();
if (mHeadUpDisplay != null) {
mHeadUpDisplay.reloadPreferences();
}
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 9345029..fa05aa7 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -112,7 +112,7 @@ public class CameraSettings {
SharedPreferences.Editor editor = ComboPreferences
.get(context).edit();
editor.putString(KEY_PICTURE_SIZE, candidate);
- editor.commit();
+ editor.apply();
return;
}
}
@@ -284,7 +284,7 @@ public class CameraSettings {
if (version == CURRENT_LOCAL_VERSION) return;
SharedPreferences.Editor editor = pref.edit();
editor.putInt(KEY_LOCAL_VERSION, CURRENT_LOCAL_VERSION);
- editor.commit();
+ editor.apply();
}
public static void upgradeGlobalPreferences(SharedPreferences pref) {
@@ -329,7 +329,7 @@ public class CameraSettings {
editor.remove("pref_camera_video_duration_key");
}
editor.putInt(KEY_VERSION, CURRENT_VERSION);
- editor.commit();
+ editor.apply();
}
public static void upgradeAllPreferences(ComboPreferences pref) {
@@ -373,6 +373,6 @@ public class CameraSettings {
int cameraId) {
Editor editor = pref.edit();
editor.putInt(KEY_CAMERA_ID, cameraId);
- editor.commit();
+ editor.apply();
}
}
diff --git a/src/com/android/camera/ui/HeadUpDisplay.java b/src/com/android/camera/ui/HeadUpDisplay.java
index 98e885e..05d575d 100644
--- a/src/com/android/camera/ui/HeadUpDisplay.java
+++ b/src/com/android/camera/ui/HeadUpDisplay.java
@@ -405,7 +405,7 @@ public class HeadUpDisplay extends GLView {
Context context = getGLRootView().getContext();
Editor editor = mSharedPrefs.edit();
editor.clear();
- editor.commit();
+ editor.apply();
CameraSettings.upgradeAllPreferences(mSharedPrefs);
CameraSettings.initialCameraPictureSize(context, param);
reloadPreferences();