diff options
author | Wu-cheng Li <wuchengli@google.com> | 2010-09-08 11:12:43 -0700 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2010-09-08 11:23:22 -0700 |
commit | 4714a1cf1d211aad2d8cf1802f85f649e744beb0 (patch) | |
tree | 293e66a21fe7eb612e7494a53ffd4b5dfc978e95 /src | |
parent | 4e5aa452a0e2438f9af1f08c56b1a7b414e561d9 (diff) | |
download | LegacyCamera-4714a1cf1d211aad2d8cf1802f85f649e744beb0.zip LegacyCamera-4714a1cf1d211aad2d8cf1802f85f649e744beb0.tar.gz LegacyCamera-4714a1cf1d211aad2d8cf1802f85f649e744beb0.tar.bz2 |
Use SharedPreferences$Editor.apply to reduce latency.
Replace all commit with apply.
bug:2978683
Change-Id: I6c057fab588aada7c35d03f6237fb850d2a2e856
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/Camera.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/CameraSettings.java | 8 | ||||
-rw-r--r-- | src/com/android/camera/ui/HeadUpDisplay.java | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 565b537..61c66d1 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 3bebb93..29eb187 100644 --- a/src/com/android/camera/CameraSettings.java +++ b/src/com/android/camera/CameraSettings.java @@ -100,7 +100,7 @@ public class CameraSettings { SharedPreferences.Editor editor = ComboPreferences .get(context).edit(); editor.putString(KEY_PICTURE_SIZE, candidate); - editor.commit(); + editor.apply(); return; } } @@ -272,7 +272,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) { @@ -317,7 +317,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) { @@ -347,6 +347,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(); |