Merge "AppOpsService: Fix de-dup for change records on OpModeWatchers." into rvc-dev

This commit is contained in:
Narayan Kamath
2020-05-04 08:02:20 +00:00
committed by Android (Google) Code Review

View File

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