Merge "Fix concurrent modification error in ShortcutService" into sc-dev

This commit is contained in:
Pinyao Ting
2021-05-17 23:29:39 +00:00
committed by Android (Google) Code Review

View File

@@ -1213,7 +1213,9 @@ public class ShortcutService extends IShortcutService.Stub {
final String pkg = shortcutInfo.getPackage();
final int userId = shortcutInfo.getUserId();
final String id = shortcutInfo.getId();
getPackageShortcutsLocked(pkg, userId).mutateShortcut(id, shortcutInfo, cb);
synchronized (mLock) {
getPackageShortcutsLocked(pkg, userId).mutateShortcut(id, shortcutInfo, cb);
}
}
/** Return the last reset time. */