Add summary to special app access.

Get the count of apps that has unrestricted data access and add that to
the summary for Apps & notifications -> Special app access.

Bug: 36376411
Test: make RunSettingsRoboTests
Change-Id: Ic72cd165da9a91e18e1982d2696830f3f5a0987c
This commit is contained in:
Doris Ling
2017-04-11 15:35:49 -07:00
committed by Fan Zhang
parent a0e617f96d
commit 0e1b53fa6f
3 changed files with 140 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ import com.android.settings.core.PreferenceController;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -55,7 +56,13 @@ public class AppAndNotificationDashboardFragment extends DashboardFragment {
@Override
protected List<PreferenceController> getPreferenceControllers(Context context) {
return null;
return buildPreferenceControllers(context);
}
private static List<PreferenceController> buildPreferenceControllers(Context context) {
final List<PreferenceController> controllers = new ArrayList<>();
controllers.add(new SpecialAppAccessPreferenceController(context));
return controllers;
}
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
@@ -67,5 +74,10 @@ public class AppAndNotificationDashboardFragment extends DashboardFragment {
sir.xmlResId = R.xml.app_and_notification;
return Arrays.asList(sir);
}
@Override
public List<PreferenceController> getPreferenceControllers(Context context) {
return buildPreferenceControllers(context);
}
};
}