The new advanced protection support intent will be launched by the existing ActionDisabledByAdminDialog if the enforcing admin of a certain restriction is advanced protection. To determine that, Change-Id If931dcddad508f88aac1280b587da4767b937875 introduces an API to query the enforcing admin. In addition, this change updates ExternalSourcesDetails to display a disabled by advanced protection string in the preference summary. Tests will be written in a follow up change. Bug: 358229113 Bug: 369361373 Test: manual Test: atest ActionDisabledByAdminDialogTest Test: atest ExternalSourcesDetailsTest Test: atest LocationInjectedServicesPreferenceControllerTest Flag: android.security.aapm_api Flag: android.security.aapm_feature_disable_install_unknown_sources Change-Id: Icedef421d65f7ccde6562734e39a87d4458567ff
Running Settings Robolectric tests
The full suite
$ croot
$ atest SettingsRoboTests
Running a single test class
With a filter
$ croot
$ atest SettingsRoboTests:com.android.settings.display.AdaptiveSleepPreferenceControllerTest
You can also run any single test class with atest (it will try to find the correct path)
$ atest AdaptiveSleepPreferenceControllerTest