From d60f85daadc27df47d0fb04e73f18c50ac70f3c7 Mon Sep 17 00:00:00 2001 From: PauloftheWest Date: Sun, 3 Aug 2014 11:34:45 -0700 Subject: [PATCH] Added WiFi Assistant settings. + Added ability to setup Wifi Assistant. - Removed 'Avoid poor connections' from WiFi Advance Settings. - Removed 'Optimize Wi-Fi' from WiFi Advance Settings. + Replaced checkboxes with switches in WifFI Advance Settings. + Added horizontal rule to seperate MAC/IP address text. Bug: 15698824 Change-Id: Ia319ff5fb2566854666a07d0e77c8816a49fd3d6 --- res/layout/mac_preference.xml | 79 ++++++++++++++ res/values/colors.xml | 2 + res/values/dimens.xml | 2 + res/values/strings.xml | 2 +- res/xml/wifi_advanced_settings.xml | 40 +++---- .../settings/wifi/AdvancedWifiSettings.java | 102 ++++++++++-------- .../android/settings/wifi/WifiSettings.java | 17 +++ 7 files changed, 176 insertions(+), 68 deletions(-) create mode 100644 res/layout/mac_preference.xml diff --git a/res/layout/mac_preference.xml b/res/layout/mac_preference.xml new file mode 100644 index 00000000000..f096b07e9cd --- /dev/null +++ b/res/layout/mac_preference.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/values/colors.xml b/res/values/colors.xml index 9c199bff338..01387728e49 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -85,4 +85,6 @@ @*android:color/material_grey_500 + #ffe0e0e0 + diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 2b53f96b877..865b0291050 100755 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -217,4 +217,6 @@ 8dip 32 + 1px + diff --git a/res/values/strings.xml b/res/values/strings.xml index 7905d30acf4..e5909a6aa90 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1486,7 +1486,7 @@ Automatically manage Wi\u2011Fi - Let a Wi\u2011Fi assistant manage your Wi\u2011Fi connection + Let %1$s manage your Wi\u2011Fi connection Wi\u2011Fi assistant diff --git a/res/xml/wifi_advanced_settings.xml b/res/xml/wifi_advanced_settings.xml index 118f6913515..f83a10663ca 100644 --- a/res/xml/wifi_advanced_settings.xml +++ b/res/xml/wifi_advanced_settings.xml @@ -18,31 +18,30 @@ android:title="@string/wifi_advanced_titlebar"> - + + + + - - - - + android:entryValues="@array/wifi_sleep_policy_values" /> + android:entryValues="@array/wifi_frequency_band_values" /> - - + android:layout="@layout/mac_preference" /> scorers = + NetworkScorerAppManager.getAllValidScorers(context); + + if (scorers.isEmpty()) { + return null; + } + + // TODO: b/13780935 - Implement proper scorer selection. Rather than pick the first + // scorer on the system, we should allow the user to select one. + return scorers.iterator().next(); + } + private void prepareWifiAssistantCard() { if (getActivity() instanceof WifiPickerActivity) { return;