Fix incorrect index usage in SensorPrivacyService init

TODO: Add test coverage for service init

Merged-In: I0ce26eda21035a34f1cb09a71c94ee84301aef84
Change-Id: I0ce26eda21035a34f1cb09a71c94ee84301aef84
Test: None yet
Bug: 186578100
(cherry picked from commit adb86329d8)
This commit is contained in:
Evan Severson
2021-04-28 00:27:37 +00:00
parent 5dbfd93d4b
commit c786cbe92a

View File

@@ -203,7 +203,7 @@ public final class SensorPrivacyService extends SystemService {
SparseBooleanArray userIndividualEnabled =
mIndividualEnabled.valueAt(i);
for (int j = 0; j < userIndividualEnabled.size(); j++) {
int sensor = userIndividualEnabled.keyAt(i);
int sensor = userIndividualEnabled.keyAt(j);
boolean enabled = userIndividualEnabled.valueAt(j);
setUserRestriction(userId, sensor, enabled);
}