Register most app info related controllers in xml

Bug: 77216595
Test: robotests
Change-Id: I79afa38820b7518d8b3112148802797ebcf6d184
This commit is contained in:
Fan Zhang
2018-03-29 15:45:49 -07:00
parent 65983f71d5
commit b5c651c939
40 changed files with 299 additions and 249 deletions

View File

@@ -29,14 +29,18 @@ import com.android.settingslib.applications.ApplicationsState;
public class AppNotificationPreferenceController extends AppInfoPreferenceControllerBase {
private static final String KEY_NOTIFICATION = "notification_settings";
private String mChannelId = null;
// Used for updating notification preference.
private final NotificationBackend mBackend = new NotificationBackend();
public AppNotificationPreferenceController(Context context, AppInfoDashboardFragment parent) {
super(context, parent, KEY_NOTIFICATION);
public AppNotificationPreferenceController(Context context, String key) {
super(context, key);
}
@Override
public void setParentFragment(AppInfoDashboardFragment parent) {
super.setParentFragment(parent);
if (parent != null && parent.getActivity() != null
&& parent.getActivity().getIntent() != null) {
mChannelId = parent.getActivity().getIntent().getStringExtra(EXTRA_FRAGMENT_ARG_KEY);
@@ -63,6 +67,7 @@ public class AppNotificationPreferenceController extends AppInfoPreferenceContro
return bundle;
}
private CharSequence getNotificationSummary(ApplicationsState.AppEntry appEntry,
Context context, NotificationBackend backend) {
NotificationBackend.AppRow appRow =