Merge "Remove Network Restrictions duplicate from setting search" into oc-dev

am: 09dbc8043f

Change-Id: Ia172fc4c93b2259ed9a51248159784a89fbdf638
This commit is contained in:
Matthew Fritze
2017-05-17 17:37:51 +00:00
committed by android-build-merger
3 changed files with 28 additions and 9 deletions

View File

@@ -71,10 +71,11 @@ public class DataUsageSummary extends DataUsageBase implements Indexable, DataUs
public static final boolean TEST_RADIOS = false;
public static final String TEST_RADIOS_PROP = "test.radios";
public static final String KEY_RESTRICT_BACKGROUND = "restrict_background";
public static final String KEY_NETWORK_RESTRICTIONS = "network_restrictions";
private static final String KEY_STATUS_HEADER = "status_header";
private static final String KEY_LIMIT_SUMMARY = "limit_summary";
private static final String KEY_RESTRICT_BACKGROUND = "restrict_background";
private static final String KEY_NETWORK_RESTRICTIONS = "network_restrictions";
private static final String KEY_WIFI_USAGE_TITLE = "wifi_category";
private DataUsageController mDataUsageController;
@@ -465,7 +466,7 @@ public class DataUsageSummary extends DataUsageBase implements Indexable, DataUs
@Override
public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
boolean enabled) {
ArrayList<SearchIndexableResource> resources = new ArrayList<>();
List<SearchIndexableResource> resources = new ArrayList<>();
SearchIndexableResource resource = new SearchIndexableResource(context);
resource.xmlResId = R.xml.data_usage;
resources.add(resource);
@@ -485,13 +486,14 @@ public class DataUsageSummary extends DataUsageBase implements Indexable, DataUs
@Override
public List<String> getNonIndexableKeys(Context context) {
ArrayList<String> keys = new ArrayList<>();
boolean hasMobileData = ConnectivityManager.from(context).isNetworkSupported(
ConnectivityManager.TYPE_MOBILE);
List<String> keys = super.getNonIndexableKeys(context);
if (hasMobileData) {
if (hasMobileData(context)) {
keys.add(KEY_RESTRICT_BACKGROUND);
}
if (hasWifiRadio(context)) {
keys.add(KEY_NETWORK_RESTRICTIONS);
}
keys.add(KEY_WIFI_USAGE_TITLE);
return keys;