AppOpsService: Fix de-dup for change records on OpModeWatchers.

Whether a change record is a duplicate or not should be scoped to
a single set of change records.

Test: make
Bug: 153226372
Change-Id: Idb0c281d41002878c5ff25b6171ea525c3b028cd
This commit is contained in:
Narayan Kamath
2020-05-01 15:17:03 +01:00
parent 07fbb63884
commit 1dfc1abe33

View File

@@ -2545,11 +2545,11 @@ public class AppOpsService extends IAppOpsService.Stub {
if (callbacks == null) {
callbacks = new HashMap<>();
}
boolean duplicate = false;
final int N = cbs.size();
for (int i=0; i<N; i++) {
ModeCallback cb = cbs.valueAt(i);
ArrayList<ChangeRec> reports = callbacks.get(cb);
boolean duplicate = false;
if (reports == null) {
reports = new ArrayList<>();
callbacks.put(cb, reports);