Add a new special app access screen for long background tasks.

This new screen shows apps that hold the new RUN_LONG_JOBS permission.

Also add a reference to this screen in an app's info page under the
"Advanced" section for apps that have requested this permission.

Bug: 255821578
Test: atest AppFilterRegistryTest
Test: make -j RunSettingsRoboTests \
ROBOTTEST_FILTER="LongBackgroundTasksDetailsTest|
LongBackgroundTasksDetailsPreferenceControllerTest"
Test: visually via the Settings page

Change-Id: Idc498e52d29abc6df757c35e8bc91f00de92ba4a
This commit is contained in:
Varun Shah
2022-10-30 18:33:52 +00:00
parent 1111e51f2c
commit b33256a0fc
16 changed files with 743 additions and 5 deletions

View File

@@ -215,10 +215,15 @@ public class AppInfoDashboardFragment extends DashboardFragment
alarmsAndReminders.setPackageName(packageName);
alarmsAndReminders.setParentFragment(this);
final LongBackgroundTasksDetailsPreferenceController longBackgroundTasks =
use(LongBackgroundTasksDetailsPreferenceController.class);
longBackgroundTasks.setPackageName(packageName);
longBackgroundTasks.setParentFragment(this);
final AdvancedAppInfoPreferenceCategoryController advancedAppInfo =
use(AdvancedAppInfoPreferenceCategoryController.class);
advancedAppInfo.setChildren(Arrays.asList(writeSystemSettings, drawOverlay, pip,
externalSource, acrossProfiles, alarmsAndReminders));
externalSource, acrossProfiles, alarmsAndReminders, longBackgroundTasks));
advancedAppInfo.setAppEntry(mAppEntry);
final AppLocalePreferenceController appLocale =