From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Oliver Scott Date: Thu, 25 Feb 2021 11:31:14 -0500 Subject: [PATCH] add Wi-Fi timeout feature --- res/values/arrays.xml | 44 +++++++ res/values/strings.xml | 19 +++ res/xml/wifi_configure_settings.xml | 8 ++ .../wifi/WifiTimeoutPreferenceController.java | 115 ++++++++++++++++++ 4 files changed, 186 insertions(+) create mode 100644 src/com/android/settings/wifi/WifiTimeoutPreferenceController.java diff --git a/res/values/arrays.xml b/res/values/arrays.xml index d40e65e536..6259f4d1a5 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -83,6 +83,50 @@ 28800000 + + + @string/wifi_timeout_summary_never + @string/wifi_timeout_summary_15secs + @string/wifi_timeout_summary_30secs + @string/wifi_timeout_summary_1min + @string/wifi_timeout_summary_2mins + @string/wifi_timeout_summary_5mins + @string/wifi_timeout_summary_10mins + @string/wifi_timeout_summary_30mins + @string/wifi_timeout_summary_1hour + @string/wifi_timeout_summary_2hours + @string/wifi_timeout_summary_4hours + @string/wifi_timeout_summary_8hours + + + + + + 0 + + 15000 + + 30000 + + 60000 + + 120000 + + 300000 + + 600000 + + 1800000 + + 3600000 + + 7200000 + + 14400000 + + 28800000 + + 15 seconds diff --git a/res/values/strings.xml b/res/values/strings.xml index e925a30b3e..de6d38bcbd 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -46,6 +46,25 @@ 4 hours 8 hours + + Turn off Wi-Fi automatically + + + Wi-Fi will turn off after %1$s if no network connected + Disabled + Never + 15 seconds + 30 seconds + 1 minute + 2 minutes + 5 minutes + 10 minutes + 30 minutes + 1 hour + 2 hours + 4 hours + 8 hours + Unknown diff --git a/res/xml/wifi_configure_settings.xml b/res/xml/wifi_configure_settings.xml index cc281fa876..98d28f053b 100644 --- a/res/xml/wifi_configure_settings.xml +++ b/res/xml/wifi_configure_settings.xml @@ -26,6 +26,14 @@ android:summary="@string/wifi_wakeup_summary" settings:controller="com.android.settings.wifi.WifiWakeupPreferenceController"/> + +