Keep the settings title as "Settings" even if launching a shortcut.
Handle clicks on Settings icon in top-left.
Also fix a bug where Tethering settings was changing the title.
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index a47fa56..09584ad 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -49,8 +49,12 @@
getMetaData();
super.onCreate(savedInstanceState);
- // TODO: Do this only if 2-pane mode
- highlightHeader();
+ if (!onIsHidingHeaders() && onIsMultiPane()) {
+ highlightHeader();
+ // Force the title so that it doesn't get overridden by a direct launch of
+ // a specific settings screen.
+ setTitle(R.string.settings_label);
+ }
}
@Override
diff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.java
index f632a02..bc27dc0 100644
--- a/src/com/android/settings/TetherSettings.java
+++ b/src/com/android/settings/TetherSettings.java
@@ -131,6 +131,7 @@
mBluetoothSettings.setEnabled(false);
}
}
+ /* Don't change the title for two-pane settings
if (wifiAvailable && usbAvailable && bluetoothAvailable){
activity.setTitle(R.string.tether_settings_title_all);
} else if (wifiAvailable && usbAvailable){
@@ -146,6 +147,7 @@
} else {
activity.setTitle(R.string.tether_settings_title_bluetooth);
}
+ */
mWifiApEnabler = new WifiApEnabler(activity, mEnableWifiAp);
mView = new WebView(activity);
}
diff --git a/src/com/android/settings/accounts/ManageAccountsSettings.java b/src/com/android/settings/accounts/ManageAccountsSettings.java
index 8f61516..4efe62b 100644
--- a/src/com/android/settings/accounts/ManageAccountsSettings.java
+++ b/src/com/android/settings/accounts/ManageAccountsSettings.java
@@ -216,8 +216,12 @@
@Override
public boolean onOptionsItemSelected(MenuItem item) {
- onAddAccountClicked();
- return true;
+ if (item.getItemId() == MENU_ADD_ACCOUNT) {
+ onAddAccountClicked();
+ return true;
+ } else {
+ return super.onOptionsItemSelected(item);
+ }
}
private void setBackgroundDataInt(boolean enabled) {