Loading src/com/android/launcher3/LauncherModel.java +10 −6 Original line number Diff line number Diff line Loading @@ -2782,7 +2782,7 @@ public class LauncherModel extends BroadcastReceiver for (UserHandleCompat user : mUserManager.getUserProfiles()) { List<ShortcutInfoCompat> shortcuts = mDeepShortcutManager .queryForAllShortcuts(user); updateDeepShortcutMap(null, shortcuts); updateDeepShortcutMap(null, user, shortcuts); } synchronized (LoaderTask.this) { if (mStopped) { Loading @@ -2804,13 +2804,17 @@ public class LauncherModel extends BroadcastReceiver } } // Clear all the shortcuts for the given package, and re-add the new shortcuts. private void updateDeepShortcutMap(String packageName, List<ShortcutInfoCompat> shortcuts) { // Remove all keys associated with the given package. /** * Clear all the shortcuts for the given package, and re-add the new shortcuts. */ private void updateDeepShortcutMap( String packageName, UserHandleCompat user, List<ShortcutInfoCompat> shortcuts) { if (packageName != null) { Iterator<ComponentKey> keysIter = mBgDeepShortcutMap.keySet().iterator(); while (keysIter.hasNext()) { if (keysIter.next().componentName.getPackageName().equals(packageName)) { ComponentKey next = keysIter.next(); if (next.componentName.getPackageName().equals(packageName) && next.user.equals(user)) { keysIter.remove(); } } Loading Loading @@ -3336,7 +3340,7 @@ public class LauncherModel extends BroadcastReceiver bindUpdatedShortcuts(updatedShortcutInfos, mUser); // Update the deep shortcut map, in case the list of ids has changed for an activity. updateDeepShortcutMap(mPackageName, mShortcuts); updateDeepShortcutMap(mPackageName, mUser, mShortcuts); bindDeepShortcuts(); } } Loading src/com/android/launcher3/allapps/AlphabeticalAppsList.java +1 −1 Original line number Diff line number Diff line Loading @@ -440,7 +440,7 @@ public class AlphabeticalAppsList { mPredictedApps.add(info); } else { if (ProviderConfig.IS_DOGFOOD_BUILD) { Log.e(TAG, "Predicted app not found: " + ck.flattenToString(mLauncher)); Log.e(TAG, "Predicted app not found: " + ck); } } // Stop at the number of predicted apps Loading src/com/android/launcher3/shortcuts/ShortcutKey.java +0 −6 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ package com.android.launcher3.shortcuts; import android.content.ComponentName; import com.android.launcher3.LauncherAppState; import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.util.ComponentKey; Loading @@ -22,9 +21,4 @@ public class ShortcutKey extends ComponentKey { return new ShortcutKey(shortcutInfo.getPackage(), shortcutInfo.getUserHandle(), shortcutInfo.getId()); } @Override public String toString() { return flattenToString(LauncherAppState.getInstance().getContext()); } } src/com/android/launcher3/util/ComponentKey.java +9 −11 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.util; import android.content.ComponentName; import android.content.Context; import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.compat.UserManagerCompat; Loading Loading @@ -60,17 +61,6 @@ public class ComponentKey { mHashCode = Arrays.hashCode(new Object[] {componentName, user}); } /** * Encodes a component key as a string of the form [flattenedComponentString#userId]. */ public String flattenToString(Context context) { String flattened = componentName.flattenToString(); if (user != null) { flattened += "#" + UserManagerCompat.getInstance(context).getSerialNumberForUser(user); } return flattened; } @Override public int hashCode() { return mHashCode; Loading @@ -81,4 +71,12 @@ public class ComponentKey { ComponentKey other = (ComponentKey) o; return other.componentName.equals(componentName) && other.user.equals(user); } /** * Encodes a component key as a string of the form [flattenedComponentString#userId]. */ @Override public String toString() { return componentName.flattenToString() + "#" + user; } } No newline at end of file Loading
src/com/android/launcher3/LauncherModel.java +10 −6 Original line number Diff line number Diff line Loading @@ -2782,7 +2782,7 @@ public class LauncherModel extends BroadcastReceiver for (UserHandleCompat user : mUserManager.getUserProfiles()) { List<ShortcutInfoCompat> shortcuts = mDeepShortcutManager .queryForAllShortcuts(user); updateDeepShortcutMap(null, shortcuts); updateDeepShortcutMap(null, user, shortcuts); } synchronized (LoaderTask.this) { if (mStopped) { Loading @@ -2804,13 +2804,17 @@ public class LauncherModel extends BroadcastReceiver } } // Clear all the shortcuts for the given package, and re-add the new shortcuts. private void updateDeepShortcutMap(String packageName, List<ShortcutInfoCompat> shortcuts) { // Remove all keys associated with the given package. /** * Clear all the shortcuts for the given package, and re-add the new shortcuts. */ private void updateDeepShortcutMap( String packageName, UserHandleCompat user, List<ShortcutInfoCompat> shortcuts) { if (packageName != null) { Iterator<ComponentKey> keysIter = mBgDeepShortcutMap.keySet().iterator(); while (keysIter.hasNext()) { if (keysIter.next().componentName.getPackageName().equals(packageName)) { ComponentKey next = keysIter.next(); if (next.componentName.getPackageName().equals(packageName) && next.user.equals(user)) { keysIter.remove(); } } Loading Loading @@ -3336,7 +3340,7 @@ public class LauncherModel extends BroadcastReceiver bindUpdatedShortcuts(updatedShortcutInfos, mUser); // Update the deep shortcut map, in case the list of ids has changed for an activity. updateDeepShortcutMap(mPackageName, mShortcuts); updateDeepShortcutMap(mPackageName, mUser, mShortcuts); bindDeepShortcuts(); } } Loading
src/com/android/launcher3/allapps/AlphabeticalAppsList.java +1 −1 Original line number Diff line number Diff line Loading @@ -440,7 +440,7 @@ public class AlphabeticalAppsList { mPredictedApps.add(info); } else { if (ProviderConfig.IS_DOGFOOD_BUILD) { Log.e(TAG, "Predicted app not found: " + ck.flattenToString(mLauncher)); Log.e(TAG, "Predicted app not found: " + ck); } } // Stop at the number of predicted apps Loading
src/com/android/launcher3/shortcuts/ShortcutKey.java +0 −6 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ package com.android.launcher3.shortcuts; import android.content.ComponentName; import com.android.launcher3.LauncherAppState; import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.util.ComponentKey; Loading @@ -22,9 +21,4 @@ public class ShortcutKey extends ComponentKey { return new ShortcutKey(shortcutInfo.getPackage(), shortcutInfo.getUserHandle(), shortcutInfo.getId()); } @Override public String toString() { return flattenToString(LauncherAppState.getInstance().getContext()); } }
src/com/android/launcher3/util/ComponentKey.java +9 −11 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.util; import android.content.ComponentName; import android.content.Context; import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.compat.UserManagerCompat; Loading Loading @@ -60,17 +61,6 @@ public class ComponentKey { mHashCode = Arrays.hashCode(new Object[] {componentName, user}); } /** * Encodes a component key as a string of the form [flattenedComponentString#userId]. */ public String flattenToString(Context context) { String flattened = componentName.flattenToString(); if (user != null) { flattened += "#" + UserManagerCompat.getInstance(context).getSerialNumberForUser(user); } return flattened; } @Override public int hashCode() { return mHashCode; Loading @@ -81,4 +71,12 @@ public class ComponentKey { ComponentKey other = (ComponentKey) o; return other.componentName.equals(componentName) && other.user.equals(user); } /** * Encodes a component key as a string of the form [flattenedComponentString#userId]. */ @Override public String toString() { return componentName.flattenToString() + "#" + user; } } No newline at end of file