summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherModel.java
diff options
context:
space:
mode:
authorBjorn Bringert <bringert@google.com>2013-09-06 12:50:05 +0100
committerBjorn Bringert <bringert@google.com>2013-09-06 12:52:24 +0100
commit85f418d0f5607c66efef1673075a6d3486e5af83 (patch)
treea6dc7ae661fed6458fb5dc06e83001253904858f /src/com/android/launcher3/LauncherModel.java
parentc07a0dc6dd5b9243774dc999181ece155fdf3f46 (diff)
downloadandroid_packages_apps_Trebuchet-85f418d0f5607c66efef1673075a6d3486e5af83.tar.gz
android_packages_apps_Trebuchet-85f418d0f5607c66efef1673075a6d3486e5af83.tar.bz2
android_packages_apps_Trebuchet-85f418d0f5607c66efef1673075a6d3486e5af83.zip
Allow Launcher class to hide activities from All Apps
There are a few questions for the launcher team embedded in comments. Bug: 10645210 Bug: 10551568 Change-Id: I67ad10da0d0f0f0885f8b14d329231c37aa6779b
Diffstat (limited to 'src/com/android/launcher3/LauncherModel.java')
-rw-r--r--src/com/android/launcher3/LauncherModel.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index a76378ebf..18e1c85ba 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -156,6 +156,7 @@ public class LauncherModel extends BroadcastReceiver {
public void bindFolders(HashMap<Long,FolderInfo> folders);
public void finishBindingItems(boolean upgradePath);
public void bindAppWidget(LauncherAppWidgetInfo info);
+ public boolean shouldShowApp(ResolveInfo app);
public void bindAllApplications(ArrayList<AppInfo> apps);
public void bindAppsAdded(ArrayList<Long> newScreens,
ArrayList<ItemInfo> addNotAnimated,
@@ -2427,6 +2428,7 @@ public class LauncherModel extends BroadcastReceiver {
private void loadAllApps() {
final long loadTime = DEBUG_LOADERS ? SystemClock.uptimeMillis() : 0;
+ // "two variables"?
// Don't use these two variables in any of the callback runnables.
// Otherwise we hold a reference to them.
final Callbacks oldCallbacks = mCallbacks.get();
@@ -2466,11 +2468,15 @@ public class LauncherModel extends BroadcastReceiver {
// Create the ApplicationInfos
for (int i = 0; i < apps.size(); i++) {
- // This builds the icon bitmaps.
- mBgAllAppsList.add(new AppInfo(packageManager, apps.get(i),
- mIconCache, mLabelCache));
+ ResolveInfo app = apps.get(i);
+ if (oldCallbacks.shouldShowApp(app)) {
+ // This builds the icon bitmaps.
+ mBgAllAppsList.add(new AppInfo(packageManager, app,
+ mIconCache, mLabelCache));
+ }
}
+ // Huh? Shouldn't this be inside the Runnable below?
final Callbacks callbacks = tryGetCallbacks(oldCallbacks);
final ArrayList<AppInfo> added = mBgAllAppsList.added;
mBgAllAppsList.added = new ArrayList<AppInfo>();