diff options
-rw-r--r-- | res/values/strings.xml | 7 | ||||
-rw-r--r-- | res/xml/tether_prefs.xml | 36 | ||||
-rw-r--r-- | src/com/android/settings/TetherSettings.java | 47 |
3 files changed, 20 insertions, 70 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index edf0ddc..4499cc1 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -726,8 +726,6 @@ <string name="bluetooth_dock_settings_remember">Remember settings</string> <!-- Wi-Fi Settings --> <skip /> - <!-- Used in the 2nd-level settings screen to turn on Wi-Fi --> - <string name="wifi">Wi-Fi</string> <!-- Used in the 1st-level settings screen to turn on Wi-Fi --> <string name="wifi_quick_toggle_title">Wi-Fi</string> <!-- Used in the 1st-level settings screen as the turn-on summary --> @@ -1398,11 +1396,6 @@ <!-- Thethering help button - calls up a web view with general tethering info --> <string name="tethering_help_button_text">Tethering help</string> - <!-- Tethered notification text - shown in the notification bar when tethering is active --> - <string name="tethered_notifcation_title">Tethering active</string> - <!-- Tethered notification message - shown under the notification title --> - <string name="tethered_notification_message">Touch to configure</string> - <!-- Wireless controls, item title to go into the network settings --> <string name="network_settings_title">Mobile networks</string> <!-- Wireless controls, the item summary for the user to go into the network settings --> diff --git a/res/xml/tether_prefs.xml b/res/xml/tether_prefs.xml index bdf693f..d9ba2c5 100644 --- a/res/xml/tether_prefs.xml +++ b/res/xml/tether_prefs.xml @@ -22,26 +22,20 @@ android:title="@string/usb_tethering_button_text" android:persistent="false" /> - <PreferenceCategory - android:key="wifi_category" - android:title="@string/wifi"> - - <CheckBoxPreference - android:key="enable_wifi_ap" - android:title="@string/wifi_tether_checkbox_text" - android:persistent="false" /> - - <PreferenceScreen - android:key="wifi_ap_settings" - android:dependency="enable_wifi_ap" - android:title="@string/wifi_tether_settings_text" - android:summary="@string/wifi_tether_settings_subtext" > - <intent - android:action="android.intent.action.MAIN" - android:targetPackage="com.android.settings" - android:targetClass="com.android.settings.wifi.WifiApSettings" /> - </PreferenceScreen> - - </PreferenceCategory> + <CheckBoxPreference + android:key="enable_wifi_ap" + android:title="@string/wifi_tether_checkbox_text" + android:persistent="false" /> + + <PreferenceScreen + android:key="wifi_ap_settings" + android:dependency="enable_wifi_ap" + android:title="@string/wifi_tether_settings_text" + android:summary="@string/wifi_tether_settings_subtext" > + <intent + android:action="android.intent.action.MAIN" + android:targetPackage="com.android.settings" + android:targetClass="com.android.settings.wifi.WifiApSettings" /> + </PreferenceScreen> </PreferenceScreen> diff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.java index a30f522..9b83379 100644 --- a/src/com/android/settings/TetherSettings.java +++ b/src/com/android/settings/TetherSettings.java @@ -143,7 +143,6 @@ public class TetherSettings extends PreferenceActivity { boolean massStorageActive = Environment.MEDIA_SHARED.equals(Environment.getExternalStorageState()); boolean wifiErrored = false; - for (Object o : available) { String s = (String)o; for (String regex : mUsbRegexs) { @@ -182,15 +181,14 @@ public class TetherSettings extends PreferenceActivity { } } - if (usbTethered || wifiTethered) { -// showTetheredNotification(); - } if (usbTethered) { mUsbTether.setSummary(R.string.usb_tethering_active_subtext); mUsbTether.setEnabled(true); + mUsbTether.setChecked(true); } else if (massStorageActive) { mUsbTether.setSummary(R.string.usb_tethering_storage_active_subtext); mUsbTether.setEnabled(false); + mUsbTether.setChecked(false); } else if (usbAvailable) { if (usbError == ConnectivityManager.TETHER_ERROR_NO_ERROR) { mUsbTether.setSummary(R.string.usb_tethering_available_subtext); @@ -198,12 +196,15 @@ public class TetherSettings extends PreferenceActivity { mUsbTether.setSummary(R.string.usb_tethering_errored_subtext); } mUsbTether.setEnabled(true); + mUsbTether.setChecked(false); } else if (usbErrored) { mUsbTether.setSummary(R.string.usb_tethering_errored_subtext); mUsbTether.setEnabled(false); + mUsbTether.setChecked(false); } else { mUsbTether.setSummary(R.string.usb_tethering_unavailable_subtext); mUsbTether.setEnabled(false); + mUsbTether.setChecked(false); } } @@ -257,42 +258,4 @@ public class TetherSettings extends PreferenceActivity { } return null; } - -// private showTetheredNotification() { -// NotificationManager notificationManager = (NotificationManager)mContext. -// getSystemService(Context.NOTIFICATION_SERVICE); -// if (notificationManager == null) { -// return; -// } -// -// Intent intent = new Intent(); -// -// PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0); -// -// Resources r = Resources.getSystem(); -// CharSequence title = r.getText(com.android.internal.R.string. -// tether_stop_notification_title); -// CharSequence message = r.getText(com.android.internal.R.string. -// tether_stop_notification_message); -// -// if(mTetheringNotification == null) { -// mTetheringNotification = new Notification(); -// mTetheringNotification.when = 0; -// } -// mTetheringNotification.icon = com.android.internal.R.drawable.stat_sys_tether_usb; -// -// boolean playSounds = false; -// //playSounds = SystemProperties.get("persist.service.mount.playsnd", "1").equals("1"); -// if (playSounds) { -// mTetheringNotification.defaults |= Notification.DEFAULT_SOUND; -// } else { -// mTetheringNotification.defaults &= ~Notification.DEFAULT_SOUND; -// } -// mTetheringNotification.flags = Notification.FLAG_ONGOING_EVENT; -// mTetheringNotification.tickerText = title; -// mTetheringNotification.setLatestEventInfo(mContext, title, message, pi); -// -// notificationManager.notify(mTetheringNotification.icon, mTetheringNotification); -// } - } |