This preference is not needed for Data plan settings page. This change
fixes the NPE which happens because we try to remove a preference which
is not added to the settings preference fragment.
Test: make RunSettingsRoboTests -j40
Bug:
64068792
Change-Id: Ibbcf1637b8aed1a94542ea3786170f2f318df4a9
public class DataPlanUsageSummary extends DataUsageBase implements Indexable {
- public static final String KEY_RESTRICT_BACKGROUND = "restrict_background";
public static final String KEY_DATA_PLAN_USAGE = "data_plan_usage";
public static final String KEY_STATUS_HEADER = "status_header";
}
mDefaultTemplate = DataUsageUtils.getDefaultTemplate(context, defaultSubId);
- if (!hasMobileData || !isAdmin()) {
- removePreference(KEY_RESTRICT_BACKGROUND);
- }
-
if (hasMobileData) {
addDataPlanSection(defaultSubId);
}