Loading src/com/android/settings/datausage/DataUsageSummary.java +0 −52 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ import java.util.List; /** * Settings preference fragment that displays data usage summary. */ @SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC) public class DataUsageSummary extends DataUsageBaseFragment implements DataUsageEditController { private static final String TAG = "DataUsageSummary"; Loading Loading @@ -334,55 +333,4 @@ public class DataUsageSummary extends DataUsageBaseFragment implements DataUsage public static final SummaryLoader.SummaryProviderFactory SUMMARY_PROVIDER_FACTORY = SummaryProvider::new; /** * For search */ public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = new BaseSearchIndexProvider() { @Override public List<SearchIndexableResource> getXmlResourcesToIndex(Context context, boolean enabled) { List<SearchIndexableResource> resources = new ArrayList<>(); SearchIndexableResource resource = new SearchIndexableResource(context); resource.xmlResId = R.xml.data_usage; resources.add(resource); resource = new SearchIndexableResource(context); resource.xmlResId = R.xml.data_usage_cellular; resources.add(resource); resource = new SearchIndexableResource(context); resource.xmlResId = R.xml.data_usage_wifi; resources.add(resource); return resources; } @Override public List<String> getNonIndexableKeys(Context context) { List<String> keys = super.getNonIndexableKeys(context); if (!DataUsageUtils.hasMobileData(context)) { keys.add(KEY_MOBILE_USAGE_TITLE); keys.add(KEY_MOBILE_DATA_USAGE_TOGGLE); keys.add(KEY_MOBILE_DATA_USAGE); } if (!DataUsageUtils.hasWifiRadio(context)) { keys.add(KEY_WIFI_DATA_USAGE); } // This title is named Wifi, and will confuse users. keys.add(KEY_WIFI_USAGE_TITLE); // Duplicate entry for "Data saver" keys.add(KEY_RESTRICT_BACKGROUND); // Duplicate entry for "Data warning & limit" keys.add(KEY_MOBILE_BILLING_CYCLE); return keys; } }; } tests/robotests/assets/grandfather_not_implementing_index_provider +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ com.android.settings.bluetooth.BluetoothPairingDetail com.android.settings.bluetooth.DevicePickerFragment com.android.settings.datausage.AppDataUsage com.android.settings.datausage.DataUsageList com.android.settings.datausage.DataUsageSummary com.android.settings.datetime.timezone.TimeZoneSettings com.android.settings.deviceinfo.PrivateVolumeSettings com.android.settings.deviceinfo.PublicVolumeSettings Loading Loading
src/com/android/settings/datausage/DataUsageSummary.java +0 −52 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ import java.util.List; /** * Settings preference fragment that displays data usage summary. */ @SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC) public class DataUsageSummary extends DataUsageBaseFragment implements DataUsageEditController { private static final String TAG = "DataUsageSummary"; Loading Loading @@ -334,55 +333,4 @@ public class DataUsageSummary extends DataUsageBaseFragment implements DataUsage public static final SummaryLoader.SummaryProviderFactory SUMMARY_PROVIDER_FACTORY = SummaryProvider::new; /** * For search */ public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = new BaseSearchIndexProvider() { @Override public List<SearchIndexableResource> getXmlResourcesToIndex(Context context, boolean enabled) { List<SearchIndexableResource> resources = new ArrayList<>(); SearchIndexableResource resource = new SearchIndexableResource(context); resource.xmlResId = R.xml.data_usage; resources.add(resource); resource = new SearchIndexableResource(context); resource.xmlResId = R.xml.data_usage_cellular; resources.add(resource); resource = new SearchIndexableResource(context); resource.xmlResId = R.xml.data_usage_wifi; resources.add(resource); return resources; } @Override public List<String> getNonIndexableKeys(Context context) { List<String> keys = super.getNonIndexableKeys(context); if (!DataUsageUtils.hasMobileData(context)) { keys.add(KEY_MOBILE_USAGE_TITLE); keys.add(KEY_MOBILE_DATA_USAGE_TOGGLE); keys.add(KEY_MOBILE_DATA_USAGE); } if (!DataUsageUtils.hasWifiRadio(context)) { keys.add(KEY_WIFI_DATA_USAGE); } // This title is named Wifi, and will confuse users. keys.add(KEY_WIFI_USAGE_TITLE); // Duplicate entry for "Data saver" keys.add(KEY_RESTRICT_BACKGROUND); // Duplicate entry for "Data warning & limit" keys.add(KEY_MOBILE_BILLING_CYCLE); return keys; } }; }
tests/robotests/assets/grandfather_not_implementing_index_provider +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ com.android.settings.bluetooth.BluetoothPairingDetail com.android.settings.bluetooth.DevicePickerFragment com.android.settings.datausage.AppDataUsage com.android.settings.datausage.DataUsageList com.android.settings.datausage.DataUsageSummary com.android.settings.datetime.timezone.TimeZoneSettings com.android.settings.deviceinfo.PrivateVolumeSettings com.android.settings.deviceinfo.PublicVolumeSettings Loading