Index the System status page
- Page is found in System > About Phone > Status The page was simply never indexed. - Remove the unavailable summary text. - Suppress IP address because it appears in wifi settings as well. Test: make RunSettingsRoboTests Change-Id: I0c5eb5222fc356dd3686fb84ca47da8e2d3274f5 Fixes: 65443327
This commit is contained in:
@@ -19,6 +19,8 @@ import static android.content.Context.WIFI_SERVICE;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.NetworkScoreManager;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.provider.SearchIndexableResource;
|
||||
@@ -42,6 +44,8 @@ public class ConfigureWifiSettings extends DashboardFragment {
|
||||
|
||||
private static final String TAG = "ConfigureWifiSettings";
|
||||
|
||||
public static final String KEY_IP_ADDRESS = "current_ip_address";
|
||||
|
||||
private WifiWakeupPreferenceController mWifiWakeupPreferenceController;
|
||||
private UseOpenWifiPreferenceController mUseOpenWifiPreferenceController;
|
||||
|
||||
@@ -114,5 +118,22 @@ public class ConfigureWifiSettings extends DashboardFragment {
|
||||
sir.xmlResId = R.xml.wifi_configure_settings;
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
List<String> keys = super.getNonIndexableKeys(context);
|
||||
|
||||
// If connected to WiFi, this IP address will be the same as the Status IP.
|
||||
// Or, if there is no connection they will say unavailable.
|
||||
ConnectivityManager cm = (ConnectivityManager)
|
||||
context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo info = cm.getActiveNetworkInfo();
|
||||
if (info == null
|
||||
|| info.getType() == ConnectivityManager.TYPE_WIFI) {
|
||||
keys.add(KEY_IP_ADDRESS);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user