Remove refresh button from WifiSettings.
Bug: 34891524 Test: b/34673204 for instrumentation tests. Verified button is removed. Change-Id: I0b30d36bd6b3f0b1361ef4f7dc775ed3545a7bdc
This commit is contained in:
@@ -48,7 +48,6 @@ import android.util.Log;
|
|||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
import android.view.ContextMenu.ContextMenuInfo;
|
import android.view.ContextMenu.ContextMenuInfo;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
@@ -93,7 +92,6 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
|
|
||||||
/* package */ static final int MENU_ID_WPS_PBC = Menu.FIRST;
|
/* package */ static final int MENU_ID_WPS_PBC = Menu.FIRST;
|
||||||
private static final int MENU_ID_WPS_PIN = Menu.FIRST + 1;
|
private static final int MENU_ID_WPS_PIN = Menu.FIRST + 1;
|
||||||
private static final int MENU_ID_SCAN = Menu.FIRST + 5;
|
|
||||||
private static final int MENU_ID_CONNECT = Menu.FIRST + 6;
|
private static final int MENU_ID_CONNECT = Menu.FIRST + 6;
|
||||||
private static final int MENU_ID_FORGET = Menu.FIRST + 7;
|
private static final int MENU_ID_FORGET = Menu.FIRST + 7;
|
||||||
private static final int MENU_ID_MODIFY = Menu.FIRST + 8;
|
private static final int MENU_ID_MODIFY = Menu.FIRST + 8;
|
||||||
@@ -166,8 +164,6 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
private Preference mSavedNetworksPreference;
|
private Preference mSavedNetworksPreference;
|
||||||
private LinkablePreference mStatusMessagePreference;
|
private LinkablePreference mStatusMessagePreference;
|
||||||
|
|
||||||
private MenuItem mScanMenuItem;
|
|
||||||
|
|
||||||
// For Search
|
// For Search
|
||||||
private static final String DATA_KEY_REFERENCE = "main_toggle_wifi";
|
private static final String DATA_KEY_REFERENCE = "main_toggle_wifi";
|
||||||
|
|
||||||
@@ -371,26 +367,6 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
mWifiTracker.stopTracking();
|
mWifiTracker.stopTracking();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
||||||
// If the user is not allowed to configure wifi, do not show the menu.
|
|
||||||
if (isUiRestricted()) return;
|
|
||||||
|
|
||||||
addOptionsMenuItems(menu);
|
|
||||||
super.onCreateOptionsMenu(menu, inflater);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param menu
|
|
||||||
*/
|
|
||||||
void addOptionsMenuItems(Menu menu) {
|
|
||||||
final boolean wifiIsEnabled = mWifiTracker.isWifiEnabled();
|
|
||||||
mScanMenuItem = menu.add(Menu.NONE, MENU_ID_SCAN, 0, R.string.menu_stats_refresh)
|
|
||||||
.setIcon(com.android.internal.R.drawable.ic_menu_refresh);
|
|
||||||
mScanMenuItem.setEnabled(wifiIsEnabled)
|
|
||||||
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetricsCategory() {
|
public int getMetricsCategory() {
|
||||||
return MetricsEvent.WIFI;
|
return MetricsEvent.WIFI;
|
||||||
@@ -443,10 +419,6 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
case MENU_ID_WPS_PIN:
|
case MENU_ID_WPS_PIN:
|
||||||
showDialog(WPS_PIN_DIALOG_ID);
|
showDialog(WPS_PIN_DIALOG_ID);
|
||||||
return true;
|
return true;
|
||||||
case MENU_ID_SCAN:
|
|
||||||
mMetricsFeatureProvider.action(getActivity(), MetricsEvent.ACTION_WIFI_FORCE_SCAN);
|
|
||||||
mWifiTracker.forceScan();
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
@@ -719,9 +691,6 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
mAccessPointsPreferenceCategory.addPreference(mSeeAllNetworksPreference);
|
mAccessPointsPreferenceCategory.addPreference(mSeeAllNetworksPreference);
|
||||||
}
|
}
|
||||||
setConfigureWifiSettingsVisibility();
|
setConfigureWifiSettingsVisibility();
|
||||||
if (mScanMenuItem != null) {
|
|
||||||
mScanMenuItem.setEnabled(true);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WifiManager.WIFI_STATE_ENABLING:
|
case WifiManager.WIFI_STATE_ENABLING:
|
||||||
@@ -739,9 +708,6 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
setOffMessage();
|
setOffMessage();
|
||||||
setConfigureWifiSettingsVisibility();
|
setConfigureWifiSettingsVisibility();
|
||||||
setProgressBarVisible(false);
|
setProgressBarVisible(false);
|
||||||
if (mScanMenuItem != null) {
|
|
||||||
mScanMenuItem.setEnabled(false);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user