From d9165c06a4fc06f0f7b460578a3ac6b33520ae62 Mon Sep 17 00:00:00 2001 From: Maurice Lam Date: Thu, 18 Dec 2014 11:36:16 -0800 Subject: [PATCH] [WifiSetup] Don't show menu during setup Hides the menu during Wi-Fi setup -- we removed the menu button from the UI but the menu can still be started with a hardware menu button. This change removes that ability as well (during setup). If you want to test on a device without a hardware menu button, you can use the command adb shell input keyevent 82 Change-Id: Ibe3cc679353a83c995e24680c3e7dc1575d32fe0 --- .../wifi/WifiSettingsForSetupWizard.java | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java b/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java index 554666dd5f6..d3219454f79 100644 --- a/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java +++ b/src/com/android/settings/wifi/WifiSettingsForSetupWizard.java @@ -17,17 +17,14 @@ package com.android.settings.wifi; import android.content.Intent; -import android.content.res.TypedArray; import android.net.wifi.WifiConfiguration; import android.os.Bundle; -import android.view.Gravity; import android.view.LayoutInflater; import android.view.Menu; -import android.view.MenuItem; +import android.view.MenuInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; -import android.widget.AbsListView.LayoutParams; import android.widget.ListView; import android.widget.TextView; @@ -35,9 +32,9 @@ import com.android.settings.R; /** * This customized version of WifiSettings is shown to the user only during Setup Wizard. Menu - * selections are limited, clicking on an access point will auto-advance to the next screen (once - * connected), and, if the user opts to skip ahead without a wifi connection, a warning message - * alerts of possible carrier data charges or missing software updates. + * is not shown, clicking on an access point will auto-advance to the next screen (once connected), + * and, if the user opts to skip ahead without a wifi connection, a warning message alerts of + * possible carrier data charges or missing software updates. */ public class WifiSettingsForSetupWizard extends WifiSettings { @@ -115,18 +112,8 @@ public class WifiSettingsForSetupWizard extends WifiSettings { } @Override - /* package */ void addOptionsMenuItems(Menu menu) { - final boolean wifiIsEnabled = mWifiManager.isWifiEnabled(); - final TypedArray ta = getActivity().getTheme() - .obtainStyledAttributes(new int[] {R.attr.ic_wps}); - menu.add(Menu.NONE, MENU_ID_WPS_PBC, 0, R.string.wifi_menu_wps_pbc) - .setIcon(ta.getDrawable(0)) - .setEnabled(wifiIsEnabled) - .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); - menu.add(Menu.NONE, MENU_ID_ADD_NETWORK, 0, R.string.wifi_add_network) - .setEnabled(wifiIsEnabled) - .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); - ta.recycle(); + public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + // Do not show menu during setup wizard } @Override