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 40d01907a4..0a9a9a31e8 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 c5287c4489..0f254706ff 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -44,6 +44,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 c6214662d3..27e913949e 100644 --- a/res/xml/wifi_configure_settings.xml +++ b/res/xml/wifi_configure_settings.xml @@ -26,6 +26,14 @@ android:icon="@drawable/ic_auto_wifi" android:summary="@string/wifi_wakeup_summary" /> + +