Only invoke for callbacks watching the given package
If a watcher is registered with a packageName, it shouldn't get callbacks for changes to a different package in a different uid. Bug: 272358877 Test: atest CtsAppOpsTestCases Change-Id: I1a00e6019ab20d6b0688707e00c6bcd20be3c409
This commit is contained in:
@@ -1856,6 +1856,10 @@ public class AppOpsService extends IAppOpsService.Stub {
|
||||
for (int i = 0; i < callbackCount; i++) {
|
||||
OnOpModeChangedListener callback = callbacks.valueAt(i);
|
||||
|
||||
if (!callback.isWatchingUid(uid)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (onlyForeground && (callback.getFlags()
|
||||
& WATCH_FOREGROUND_CHANGES) == 0) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user