From 298ffee39e7e9d87d58016119023dbe4e30ac84b Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Mon, 25 Sep 2017 11:34:10 -0700 Subject: [PATCH] Get rid of unnecessary KEY_RESTRICT_BACKGROUND preference. 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 --- src/com/android/settings/datausage/DataPlanUsageSummary.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/com/android/settings/datausage/DataPlanUsageSummary.java b/src/com/android/settings/datausage/DataPlanUsageSummary.java index 074374916c7..1905deb96ff 100644 --- a/src/com/android/settings/datausage/DataPlanUsageSummary.java +++ b/src/com/android/settings/datausage/DataPlanUsageSummary.java @@ -53,7 +53,6 @@ import java.util.List; 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"; @@ -100,10 +99,6 @@ public class DataPlanUsageSummary extends DataUsageBase implements Indexable { } mDefaultTemplate = DataUsageUtils.getDefaultTemplate(context, defaultSubId); - if (!hasMobileData || !isAdmin()) { - removePreference(KEY_RESTRICT_BACKGROUND); - } - if (hasMobileData) { addDataPlanSection(defaultSubId); }