Loading services/people/java/com/android/server/people/data/DataManager.java +8 −5 Original line number Diff line number Diff line Loading @@ -129,7 +129,6 @@ public class DataManager { private final List<PeopleService.ConversationsListener> mConversationsListeners = new ArrayList<>(1); private final Handler mHandler; private ContentObserver mCallLogContentObserver; private ContentObserver mMmsSmsContentObserver; Loading Loading @@ -1106,6 +1105,7 @@ public class DataManager { @NonNull List<ShortcutInfo> shortcuts, @NonNull UserHandle user) { mInjector.getBackgroundExecutor().execute(() -> { PackageData packageData = getPackage(packageName, user.getIdentifier()); boolean hasCachedShortcut = false; for (ShortcutInfo shortcut : shortcuts) { if (ShortcutHelper.isConversationShortcut( shortcut, mShortcutServiceInternal, user.getIdentifier())) { Loading @@ -1114,15 +1114,18 @@ public class DataManager { ? packageData.getConversationInfo(shortcut.getId()) : null; if (conversationInfo == null || !conversationInfo.isShortcutCachedForNotification()) { // This is a newly cached shortcut. Clean up the existing cached // shortcuts to ensure the cache size is under the limit. cleanupCachedShortcuts(user.getIdentifier(), MAX_CACHED_RECENT_SHORTCUTS - 1); hasCachedShortcut = true; } } addOrUpdateConversationInfo(shortcut); } } // Added at least one new conversation. Uncache older existing cached // shortcuts to ensure the cache size is under the limit. if (hasCachedShortcut) { cleanupCachedShortcuts(user.getIdentifier(), MAX_CACHED_RECENT_SHORTCUTS); } }); } Loading Loading
services/people/java/com/android/server/people/data/DataManager.java +8 −5 Original line number Diff line number Diff line Loading @@ -129,7 +129,6 @@ public class DataManager { private final List<PeopleService.ConversationsListener> mConversationsListeners = new ArrayList<>(1); private final Handler mHandler; private ContentObserver mCallLogContentObserver; private ContentObserver mMmsSmsContentObserver; Loading Loading @@ -1106,6 +1105,7 @@ public class DataManager { @NonNull List<ShortcutInfo> shortcuts, @NonNull UserHandle user) { mInjector.getBackgroundExecutor().execute(() -> { PackageData packageData = getPackage(packageName, user.getIdentifier()); boolean hasCachedShortcut = false; for (ShortcutInfo shortcut : shortcuts) { if (ShortcutHelper.isConversationShortcut( shortcut, mShortcutServiceInternal, user.getIdentifier())) { Loading @@ -1114,15 +1114,18 @@ public class DataManager { ? packageData.getConversationInfo(shortcut.getId()) : null; if (conversationInfo == null || !conversationInfo.isShortcutCachedForNotification()) { // This is a newly cached shortcut. Clean up the existing cached // shortcuts to ensure the cache size is under the limit. cleanupCachedShortcuts(user.getIdentifier(), MAX_CACHED_RECENT_SHORTCUTS - 1); hasCachedShortcut = true; } } addOrUpdateConversationInfo(shortcut); } } // Added at least one new conversation. Uncache older existing cached // shortcuts to ensure the cache size is under the limit. if (hasCachedShortcut) { cleanupCachedShortcuts(user.getIdentifier(), MAX_CACHED_RECENT_SHORTCUTS); } }); } Loading