Fix typo in sensor privacy init
Should be getting the value at index i, not using int i as a key. Also when iterating over the state we should be holding the lock. Test: Push sensor_privacy.xml file and reboot Fixes: 185881144 Change-Id: I09823d888b05b674b32254d39ab030ce0e6c2acf
This commit is contained in:
@@ -197,16 +197,16 @@ public final class SensorPrivacyService extends SystemService {
|
||||
if (readPersistedSensorPrivacyStateLocked()) {
|
||||
persistSensorPrivacyStateLocked();
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < mIndividualEnabled.size(); i++) {
|
||||
int userId = mIndividualEnabled.keyAt(i);
|
||||
SparseBooleanArray userIndividualEnabled =
|
||||
mIndividualEnabled.get(i);
|
||||
for (int j = 0; j < userIndividualEnabled.size(); j++) {
|
||||
int sensor = userIndividualEnabled.keyAt(i);
|
||||
boolean enabled = userIndividualEnabled.valueAt(j);
|
||||
setUserRestriction(userId, sensor, enabled);
|
||||
for (int i = 0; i < mIndividualEnabled.size(); i++) {
|
||||
int userId = mIndividualEnabled.keyAt(i);
|
||||
SparseBooleanArray userIndividualEnabled =
|
||||
mIndividualEnabled.valueAt(i);
|
||||
for (int j = 0; j < userIndividualEnabled.size(); j++) {
|
||||
int sensor = userIndividualEnabled.keyAt(i);
|
||||
boolean enabled = userIndividualEnabled.valueAt(j);
|
||||
setUserRestriction(userId, sensor, enabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user