summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/allapps
diff options
context:
space:
mode:
authorMario Bertschler <bmario@google.com>2017-08-08 16:26:18 -0700
committerMario Bertschler <bmario@google.com>2017-08-24 12:23:06 -0700
commit8ff9e1d6790d64eb5f8ad9e9721e607978b50583 (patch)
tree20f615100c3abb597c7946baf546eaaa667fde7e /src/com/android/launcher3/allapps
parent9b745a82bf5cf8bf9383b63179d0a750e9ab9ab6 (diff)
downloadandroid_packages_apps_Trebuchet-8ff9e1d6790d64eb5f8ad9e9721e607978b50583.tar.gz
android_packages_apps_Trebuchet-8ff9e1d6790d64eb5f8ad9e9721e607978b50583.tar.bz2
android_packages_apps_Trebuchet-8ff9e1d6790d64eb5f8ad9e9721e607978b50583.zip
Integrating suggested app by handling new status flags for shortcut items.
Guarded via feature flag SUGGESTED_APP. Bug: 62483883 Change-Id: I7e0c8a9875bc37c435aa4316b44322a628cd4826
Diffstat (limited to 'src/com/android/launcher3/allapps')
-rw-r--r--src/com/android/launcher3/allapps/AllAppsContainerView.java3
-rw-r--r--src/com/android/launcher3/allapps/AlphabeticalAppsList.java33
2 files changed, 19 insertions, 17 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 97a87c16c..5cd072223 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -50,6 +50,7 @@ import com.android.launcher3.folder.Folder;
import com.android.launcher3.keyboard.FocusedItemDecorator;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import com.android.launcher3.util.ComponentKey;
+import com.android.launcher3.util.ComponentKeyMapper;
import com.android.launcher3.util.PackageUserKey;
import java.util.List;
@@ -116,7 +117,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
/**
* Sets the current set of predicted apps.
*/
- public void setPredictedApps(List<ComponentKey> apps) {
+ public void setPredictedApps(List<ComponentKeyMapper<AppInfo>> apps) {
mApps.setPredictedApps(apps);
}
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index 5e7a5cac5..6bbe3ea55 100644
--- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -29,6 +29,7 @@ import com.android.launcher3.discovery.AppDiscoveryAppInfo;
import com.android.launcher3.discovery.AppDiscoveryItem;
import com.android.launcher3.discovery.AppDiscoveryUpdateState;
import com.android.launcher3.util.ComponentKey;
+import com.android.launcher3.util.ComponentKeyMapper;
import com.android.launcher3.util.LabelComparator;
import java.util.ArrayList;
@@ -173,7 +174,7 @@ public class AlphabeticalAppsList {
// The set of sections that we allow fast-scrolling to (includes non-merged sections)
private final List<FastScrollSectionInfo> mFastScrollerSections = new ArrayList<>();
// The set of predicted app component names
- private final List<ComponentKey> mPredictedAppComponents = new ArrayList<>();
+ private final List<ComponentKeyMapper<AppInfo>> mPredictedAppComponents = new ArrayList<>();
// The set of predicted apps resolved from the component names and the current set of apps
private final List<AppInfo> mPredictedApps = new ArrayList<>();
private final List<AppDiscoveryAppInfo> mDiscoveredApps = new ArrayList<>();
@@ -298,20 +299,20 @@ public class AlphabeticalAppsList {
updateAdapterItems();
}
- private List<AppInfo> processPredictedAppComponents(List<ComponentKey> components) {
+ private List<AppInfo> processPredictedAppComponents(List<ComponentKeyMapper<AppInfo>> components) {
if (mComponentToAppMap.isEmpty()) {
// Apps have not been bound yet.
return Collections.emptyList();
}
List<AppInfo> predictedApps = new ArrayList<>();
- for (ComponentKey ck : components) {
- AppInfo info = mComponentToAppMap.get(ck);
+ for (ComponentKeyMapper<AppInfo> mapper : components) {
+ AppInfo info = mapper.getItem(mComponentToAppMap);
if (info != null) {
predictedApps.add(info);
} else {
if (FeatureFlags.IS_DOGFOOD_BUILD) {
- Log.e(TAG, "Predicted app not found: " + ck);
+ Log.e(TAG, "Predicted app not found: " + mapper);
}
}
// Stop at the number of predicted apps
@@ -331,7 +332,7 @@ public class AlphabeticalAppsList {
* If the number of predicted apps is the same as the previous list of predicted apps,
* we can optimize by swapping them in place.
*/
- public void setPredictedApps(List<ComponentKey> apps) {
+ public void setPredictedApps(List<ComponentKeyMapper<AppInfo>> apps) {
mPredictedAppComponents.clear();
mPredictedAppComponents.addAll(apps);
@@ -472,14 +473,14 @@ public class AlphabeticalAppsList {
if (DEBUG_PREDICTIONS) {
if (mPredictedAppComponents.isEmpty() && !mApps.isEmpty()) {
- mPredictedAppComponents.add(new ComponentKey(mApps.get(0).componentName,
- Process.myUserHandle()));
- mPredictedAppComponents.add(new ComponentKey(mApps.get(0).componentName,
- Process.myUserHandle()));
- mPredictedAppComponents.add(new ComponentKey(mApps.get(0).componentName,
- Process.myUserHandle()));
- mPredictedAppComponents.add(new ComponentKey(mApps.get(0).componentName,
- Process.myUserHandle()));
+ mPredictedAppComponents.add(new ComponentKeyMapper<AppInfo>(new ComponentKey(mApps.get(0).componentName,
+ Process.myUserHandle())));
+ mPredictedAppComponents.add(new ComponentKeyMapper<AppInfo>(new ComponentKey(mApps.get(0).componentName,
+ Process.myUserHandle())));
+ mPredictedAppComponents.add(new ComponentKeyMapper<AppInfo>(new ComponentKey(mApps.get(0).componentName,
+ Process.myUserHandle())));
+ mPredictedAppComponents.add(new ComponentKeyMapper<AppInfo>(new ComponentKey(mApps.get(0).componentName,
+ Process.myUserHandle())));
}
}
@@ -644,8 +645,8 @@ public class AlphabeticalAppsList {
return result;
}
- public AppInfo findApp(ComponentKey key) {
- return mComponentToAppMap.get(key);
+ public AppInfo findApp(ComponentKeyMapper<AppInfo> mapper) {
+ return mapper.getItem(mComponentToAppMap);
}
/**