Set toggle state for profile group

The toggle state should be set for all users in the current profile
group; for example a profile user.

Test: make RunSettingsRoboTests ROBOTEST_FILTER=SensorToggleControllerTest
Fixes: 194280328
Change-Id: Ib0b74e7b27722b44b116e614dc960bff72983a38
This commit is contained in:
Evan Severson
2021-07-22 10:14:19 -07:00
parent d7753f4c23
commit 7d1835a319
3 changed files with 129 additions and 25 deletions

View File

@@ -172,6 +172,27 @@ public class SensorPrivacyManagerHelper {
mSensorPrivacyManager.setSensorPrivacy(source, sensor, blocked, userId);
}
/**
* Sets the sensor privacy for the current profile group.
* @param source The source with which sensor privacy is toggled.
* @param sensor The sensor to set for
* @param blocked The state to set to
*/
public void setSensorBlockedForProfileGroup(int source, int sensor, boolean blocked) {
mSensorPrivacyManager.setSensorPrivacyForProfileGroup(source, sensor, blocked);
}
/**
* Sets the sensor privacy for the given user's profile group.
* @param source The source with which sensor privacy is toggled.
* @param sensor The sensor to set for
* @param blocked The state to set to
*/
public void setSensorBlockedForProfileGroup(int source, int sensor, boolean blocked,
int userId) {
mSensorPrivacyManager.setSensorPrivacyForProfileGroup(source, sensor, blocked, userId);
}
/**
* Adds a listener for the state of the current user. If the current user changes and the state
* of the new user is different, a callback will be received.