Merge "Set toggle state for profile group" into sc-dev am: 405fac1ca0 am: 8a1461a212

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15362614

Change-Id: Id015925230ad1cea4063edc0cb197b54bbf2950c
This commit is contained in:
Evan Severson
2021-07-29 20:15:42 +00:00
committed by Automerger Merge Worker
3 changed files with 129 additions and 25 deletions

View File

@@ -59,7 +59,8 @@ public abstract class SensorToggleController extends TogglePreferenceController
@Override
public boolean setChecked(boolean isChecked) {
mSensorPrivacyManagerHelper.setSensorBlocked(SETTINGS, getSensor(), !isChecked);
mSensorPrivacyManagerHelper.setSensorBlockedForProfileGroup(SETTINGS, getSensor(),
!isChecked);
return true;
}

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.