summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2014-11-06 23:56:56 (GMT)
committerAbhisek Devkota <ciwrl@cyanogenmod.com>2014-12-02 01:15:44 (GMT)
commit9dfd36ede6585aeea7857113215c877309b70f1a (patch)
tree8b66d9836dee6f1905e0a1b933cdbb156e64122b
parent0cc69dd11fb5015bf2a77bba0363bbd8e047b9b3 (diff)
downloadandroid_packages_apps_Trebuchet-9dfd36ede6585aeea7857113215c877309b70f1a.zip
android_packages_apps_Trebuchet-9dfd36ede6585aeea7857113215c877309b70f1a.tar.gz
android_packages_apps_Trebuchet-9dfd36ede6585aeea7857113215c877309b70f1a.tar.bz2
Protected Apps: Delay Protected Apps changed reload till onResume
Change-Id: I54724187c3ab168a3beb0791852a1c842bdbabf9
-rw-r--r--src/com/android/launcher3/Folder.java2
-rw-r--r--src/com/android/launcher3/FolderIcon.java2
-rw-r--r--src/com/android/launcher3/Launcher.java11
-rw-r--r--src/com/android/launcher3/LauncherModel.java16
4 files changed, 26 insertions, 5 deletions
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index 7d3fcba..ae67b97 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -1314,7 +1314,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
if (finalChild != null) {
mFolderIcon.performDestroyAnimation(finalChild, onCompleteRunnable);
} else {
- onCompleteRunnable.run();
+ mLauncher.runOnUiThread(onCompleteRunnable);
}
mDestroyed = true;
}
diff --git a/src/com/android/launcher3/FolderIcon.java b/src/com/android/launcher3/FolderIcon.java
index ef31bcf..561ad0d 100644
--- a/src/com/android/launcher3/FolderIcon.java
+++ b/src/com/android/launcher3/FolderIcon.java
@@ -696,7 +696,7 @@ public class FolderIcon extends FrameLayout implements FolderListener {
public void onAnimationEnd(Animator animation) {
mAnimating = false;
if (onCompleteRunnable != null) {
- onCompleteRunnable.run();
+ mLauncher.runOnUiThread(onCompleteRunnable);
}
}
});
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 2ad14fb..2103c39 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -432,10 +432,21 @@ public class Launcher extends Activity
return Log.isLoggable(propertyName, Log.VERBOSE);
}
+ Runnable mUpdateDynamicGridRunnable = new Runnable() {
+ @Override
+ public void run() {
+ updateDynamicGrid();
+ }
+ };
+
private BroadcastReceiver protectedAppsChangedReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// Update the workspace
+ if (waitUntilResume(mUpdateDynamicGridRunnable, true)) {
+ return;
+ }
+
updateDynamicGrid();
}
};
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index abd41b0..17c5ddd 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -2710,17 +2710,27 @@ public class LauncherModel extends BroadcastReceiver
int NN = shortcuts.size() - 1;
for (int j = NN; j >= 0; j--) {
- ShortcutInfo sci = shortcuts.get(j);
+ final ShortcutInfo sci = shortcuts.get(j);
if (sci.intent != null && sci.intent.getComponent() != null) {
if (!folder.hidden){
if (mHiddenApps.contains(sci.intent.getComponent())) {
LauncherModel.deleteItemFromDatabase(mContext, sci);
- folder.remove(sci);
+ Runnable r = new Runnable() {
+ public void run() {
+ folder.remove(sci);
+ }
+ };
+ runOnMainThread(r, MAIN_THREAD_BINDING_RUNNABLE);
}
} else {
if (!mHiddenApps.contains(sci.intent.getComponent())) {
LauncherModel.deleteItemFromDatabase(mContext, sci);
- folder.remove(sci);
+ Runnable r = new Runnable() {
+ public void run() {
+ folder.remove(sci);
+ }
+ };
+ runOnMainThread(r, MAIN_THREAD_BINDING_RUNNABLE);
}
}