Loading services/core/java/com/android/server/pm/ShortcutService.java +7 −10 Original line number Diff line number Diff line Loading @@ -320,10 +320,10 @@ public class ShortcutService extends IShortcutService.Stub { private final Handler mHandler; @GuardedBy("itself") @GuardedBy("mServiceLock") private final ArrayList<ShortcutChangeListener> mListeners = new ArrayList<>(1); @GuardedBy("itself") @GuardedBy("mServiceLock") private final ArrayList<LauncherApps.ShortcutChangeCallback> mShortcutChangeCallbacks = new ArrayList<>(1); Loading Loading @@ -1847,10 +1847,8 @@ public class ShortcutService extends IShortcutService.Stub { return; } synchronized (mListeners) { copy = new ArrayList<>(mListeners); } } // Note onShortcutChanged() needs to be called with the system service permissions. for (int i = copy.size() - 1; i >= 0; i--) { copy.get(i).onShortcutChanged(packageName, userId); Loading @@ -1874,10 +1872,9 @@ public class ShortcutService extends IShortcutService.Stub { if (!isUserUnlockedL(userId)) { return; } synchronized (mShortcutChangeCallbacks) { copy = new ArrayList<>(mShortcutChangeCallbacks); } } for (int i = copy.size() - 1; i >= 0; i--) { if (!CollectionUtils.isEmpty(changedList)) { copy.get(i).onShortcutsAddedOrUpdated(packageName, changedList, user); Loading Loading @@ -3432,7 +3429,7 @@ public class ShortcutService extends IShortcutService.Stub { @Override public void addListener(@NonNull ShortcutChangeListener listener) { synchronized (mListeners) { synchronized (mServiceLock) { mListeners.add(Objects.requireNonNull(listener)); } } Loading @@ -3440,7 +3437,7 @@ public class ShortcutService extends IShortcutService.Stub { @Override public void addShortcutChangeCallback( @NonNull LauncherApps.ShortcutChangeCallback callback) { synchronized (mShortcutChangeCallbacks) { synchronized (mServiceLock) { mShortcutChangeCallbacks.add(Objects.requireNonNull(callback)); } } Loading Loading
services/core/java/com/android/server/pm/ShortcutService.java +7 −10 Original line number Diff line number Diff line Loading @@ -320,10 +320,10 @@ public class ShortcutService extends IShortcutService.Stub { private final Handler mHandler; @GuardedBy("itself") @GuardedBy("mServiceLock") private final ArrayList<ShortcutChangeListener> mListeners = new ArrayList<>(1); @GuardedBy("itself") @GuardedBy("mServiceLock") private final ArrayList<LauncherApps.ShortcutChangeCallback> mShortcutChangeCallbacks = new ArrayList<>(1); Loading Loading @@ -1847,10 +1847,8 @@ public class ShortcutService extends IShortcutService.Stub { return; } synchronized (mListeners) { copy = new ArrayList<>(mListeners); } } // Note onShortcutChanged() needs to be called with the system service permissions. for (int i = copy.size() - 1; i >= 0; i--) { copy.get(i).onShortcutChanged(packageName, userId); Loading @@ -1874,10 +1872,9 @@ public class ShortcutService extends IShortcutService.Stub { if (!isUserUnlockedL(userId)) { return; } synchronized (mShortcutChangeCallbacks) { copy = new ArrayList<>(mShortcutChangeCallbacks); } } for (int i = copy.size() - 1; i >= 0; i--) { if (!CollectionUtils.isEmpty(changedList)) { copy.get(i).onShortcutsAddedOrUpdated(packageName, changedList, user); Loading Loading @@ -3432,7 +3429,7 @@ public class ShortcutService extends IShortcutService.Stub { @Override public void addListener(@NonNull ShortcutChangeListener listener) { synchronized (mListeners) { synchronized (mServiceLock) { mListeners.add(Objects.requireNonNull(listener)); } } Loading @@ -3440,7 +3437,7 @@ public class ShortcutService extends IShortcutService.Stub { @Override public void addShortcutChangeCallback( @NonNull LauncherApps.ShortcutChangeCallback callback) { synchronized (mShortcutChangeCallbacks) { synchronized (mServiceLock) { mShortcutChangeCallbacks.add(Objects.requireNonNull(callback)); } } Loading