Removing ShortcutInfoCompat and directly using ShortcutInfo

Change-Id: I2842689e192a206c0d31558c8126eae1c7904598
This commit is contained in:
Sunny Goyal
2019-04-17 18:38:52 -07:00
parent 8b0cb4113f
commit 6bbf6004f8
25 changed files with 153 additions and 295 deletions

View File

@@ -16,6 +16,7 @@
package com.android.launcher3.model;
import android.content.Context;
import android.content.pm.ShortcutInfo;
import android.os.UserHandle;
import android.text.TextUtils;
import android.util.Log;
@@ -34,7 +35,6 @@ import com.android.launcher3.model.nano.LauncherDumpProto;
import com.android.launcher3.model.nano.LauncherDumpProto.ContainerType;
import com.android.launcher3.model.nano.LauncherDumpProto.DumpTarget;
import com.android.launcher3.shortcuts.DeepShortcutManager;
import com.android.launcher3.shortcuts.ShortcutInfoCompat;
import com.android.launcher3.shortcuts.ShortcutKey;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.IntArray;
@@ -366,7 +366,7 @@ public class BgDataModel {
* Clear all the deep shortcut counts for the given package, and re-add the new shortcut counts.
*/
public synchronized void updateDeepShortcutCounts(
String packageName, UserHandle user, List<ShortcutInfoCompat> shortcuts) {
String packageName, UserHandle user, List<ShortcutInfo> shortcuts) {
if (packageName != null) {
Iterator<ComponentKey> keysIter = deepShortcutMap.keySet().iterator();
while (keysIter.hasNext()) {
@@ -379,7 +379,7 @@ public class BgDataModel {
}
// Now add the new shortcuts to the map.
for (ShortcutInfoCompat shortcut : shortcuts) {
for (ShortcutInfo shortcut : shortcuts) {
boolean shouldShowInContainer = shortcut.isEnabled()
&& (shortcut.isDeclaredInManifest() || shortcut.isDynamic());
if (shouldShowInContainer) {