summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2014-11-06 23:56:56 (GMT)
committerRajesh Yengisetty <rajesh@cyngn.com>2014-11-11 22:57:30 (GMT)
commit67e30486bddc230a64bf84c265127e584a6d7096 (patch)
tree1fb8ce40aaf981c79d62fdea2e3e991c82cd275a
parentb2c862c2b69636b5c23b6cac96febdd5efe6e7ad (diff)
downloadandroid_packages_apps_Trebuchet-67e30486bddc230a64bf84c265127e584a6d7096.zip
android_packages_apps_Trebuchet-67e30486bddc230a64bf84c265127e584a6d7096.tar.gz
android_packages_apps_Trebuchet-67e30486bddc230a64bf84c265127e584a6d7096.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 54d2793..1b9d745 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -1245,7 +1245,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 78e8c3a..5ea5ee9 100644
--- a/src/com/android/launcher3/FolderIcon.java
+++ b/src/com/android/launcher3/FolderIcon.java
@@ -690,7 +690,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 1d1208f..1eb918c 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -456,10 +456,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 b9ea057..9f89b3a 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -2445,17 +2445,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);
}
}