summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2009-06-11 11:12:51 -0700
committerRomain Guy <romainguy@android.com>2009-06-11 11:12:51 -0700
commitae4f575911d0c17de8d687a8fa092b0aa8360243 (patch)
treee22935f73a9ea82377679fa8fb44a29d803c0a96
parent70729e7a0c4614502cd59adde0928191ae59916f (diff)
downloadandroid_packages_apps_Trebuchet-ae4f575911d0c17de8d687a8fa092b0aa8360243.tar.gz
android_packages_apps_Trebuchet-ae4f575911d0c17de8d687a8fa092b0aa8360243.tar.bz2
android_packages_apps_Trebuchet-ae4f575911d0c17de8d687a8fa092b0aa8360243.zip
Improve the threading model in the gestures settings activity.
This change checks for isCancelled() inside the loop to be able to terminate the thread as early as possible.
-rw-r--r--src/com/android/launcher/GesturesActivity.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/launcher/GesturesActivity.java b/src/com/android/launcher/GesturesActivity.java
index a112e1b5d..c93657621 100644
--- a/src/com/android/launcher/GesturesActivity.java
+++ b/src/com/android/launcher/GesturesActivity.java
@@ -209,7 +209,7 @@ public class GesturesActivity extends ListActivity {
adapter.sort(mSorter);
checkForEmpty();
adapter.notifyDataSetChanged();
-
+
LauncherModel.deleteGestureFromDatabase(this, info);
Toast.makeText(this, R.string.gestures_delete_success, Toast.LENGTH_SHORT).show();
@@ -239,6 +239,8 @@ public class GesturesActivity extends ListActivity {
final LauncherModel model = Launcher.getModel();
for (String name : store.getGestureEntries()) {
+ if (isCancelled()) break;
+
final Gesture gesture = store.getGestures(name).get(0);
final Bitmap bitmap = gesture.toBitmap(mThumbnailSize, mThumbnailSize,
mThumbnailInset, mPathColor);