Hide "Changes made by your organization's admin" when empty

The admin of a manged device can take a number actions that will be
listed in the "Changes made by your organization's admin" section of
Settings. If the admin has not taken any such actions, the section
will be empty and should be hidden. This is accomplished by having a
PreferenceController for the section that observes the state of the
PreferenceControllers inside it.

Bug: 35912953
Test: m RunSettingsRoboTests

Change-Id: Ia95754493ee6c5a19b4aa9731fd56fd558e61849
This commit is contained in:
Bartosz Fabianowski
2017-06-02 10:43:11 +02:00
parent c62ce670c3
commit 55038c0a95
28 changed files with 669 additions and 51 deletions

View File

@@ -61,23 +61,32 @@ public class EnterprisePrivacySettings extends DashboardFragment {
controllers.add(new NetworkLogsPreferenceController(context));
controllers.add(new BugReportsPreferenceController(context));
controllers.add(new SecurityLogsPreferenceController(context));
controllers.add(new EnterpriseInstalledPackagesPreferenceController(context, lifecycle,
async));
controllers.add(new AdminGrantedLocationPermissionsPreferenceController(context, lifecycle,
async));
controllers.add(new AdminGrantedMicrophonePermissionPreferenceController(context, lifecycle,
async));
controllers.add(new AdminGrantedCameraPermissionPreferenceController(context, lifecycle,
async));
controllers.add(new EnterpriseSetDefaultAppsPreferenceController(context, lifecycle));
controllers.add(new AlwaysOnVpnCurrentUserPreferenceController(context, lifecycle));
controllers.add(new AlwaysOnVpnManagedProfilePreferenceController(context, lifecycle));
controllers.add(new GlobalHttpProxyPreferenceController(context, lifecycle));
controllers.add(new CaCertsPreferenceController(context, lifecycle));
final List exposureChangesCategoryControllers = new ArrayList<PreferenceController>();
exposureChangesCategoryControllers.add(new EnterpriseInstalledPackagesPreferenceController(
context, lifecycle, async));
exposureChangesCategoryControllers.add(
new AdminGrantedLocationPermissionsPreferenceController(context, lifecycle, async));
exposureChangesCategoryControllers.add(
new AdminGrantedMicrophonePermissionPreferenceController(context, lifecycle,
async));
exposureChangesCategoryControllers.add(new AdminGrantedCameraPermissionPreferenceController(
context, lifecycle, async));
exposureChangesCategoryControllers.add(new EnterpriseSetDefaultAppsPreferenceController(
context, lifecycle));
exposureChangesCategoryControllers.add(new AlwaysOnVpnCurrentUserPreferenceController(
context, lifecycle));
exposureChangesCategoryControllers.add(new AlwaysOnVpnManagedProfilePreferenceController(
context, lifecycle));
exposureChangesCategoryControllers.add(new ImePreferenceController(context, lifecycle));
exposureChangesCategoryControllers.add(new GlobalHttpProxyPreferenceController(context,
lifecycle));
exposureChangesCategoryControllers.add(new CaCertsPreferenceController(context, lifecycle));
controllers.addAll(exposureChangesCategoryControllers);
controllers.add(new ExposureChangesCategoryPreferenceController(context, lifecycle,
exposureChangesCategoryControllers, async));
controllers.add(new FailedPasswordWipeCurrentUserPreferenceController(context, lifecycle));
controllers.add(new FailedPasswordWipeManagedProfilePreferenceController(context,
lifecycle));
controllers.add(new ImePreferenceController(context, lifecycle));
return controllers;
}