summaryrefslogtreecommitdiffstats
path: root/service/java/com/android
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2016-01-29 11:49:05 -0800
committerClark Scheff <clark@cyngn.com>2016-01-29 12:32:56 -0800
commitbb978df9cb645062b4707e0bde82abe5b13fafce (patch)
treea4dd9641e54c35a518e07e00297d29b764d43731 /service/java/com/android
parent53cbe974863cee30372a098d7b873652e40a778b (diff)
downloadandroid_frameworks_opt_net_wifi-bb978df9cb645062b4707e0bde82abe5b13fafce.tar.gz
android_frameworks_opt_net_wifi-bb978df9cb645062b4707e0bde82abe5b13fafce.tar.bz2
android_frameworks_opt_net_wifi-bb978df9cb645062b4707e0bde82abe5b13fafce.zip
Tethering: Turn off Wi-Fi Hotspot after inactivity (2/3)
Turn off the Wi-Fi hotspot after a specified time of inactivity. The hotspot is considered to be inactive when no clients are connected to it. Change-Id: Ifebce027b596828b33587fafa13ca0427cdd9e31
Diffstat (limited to 'service/java/com/android')
-rw-r--r--service/java/com/android/server/wifi/WifiApConfigStore.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiApConfigStore.java b/service/java/com/android/server/wifi/WifiApConfigStore.java
index 4db0367d1..69d77f5cc 100644
--- a/service/java/com/android/server/wifi/WifiApConfigStore.java
+++ b/service/java/com/android/server/wifi/WifiApConfigStore.java
@@ -181,6 +181,10 @@ class WifiApConfigStore extends StateMachine {
if (authType != KeyMgmt.NONE) {
config.preSharedKey = in.readUTF();
}
+ // read in wifiApInactivityTimeout if bytes are available from in
+ if (in.available() != 0) {
+ config.wifiApInactivityTimeout = in.readLong();
+ }
mWifiApConfig = config;
} catch (IOException ignore) {
@@ -213,6 +217,7 @@ class WifiApConfigStore extends StateMachine {
if(authType != KeyMgmt.NONE) {
out.writeUTF(config.preSharedKey);
}
+ out.writeLong(config.wifiApInactivityTimeout);
} catch (IOException e) {
Log.e(TAG, "Error writing hotspot configuration" + e);
} finally {
@@ -249,6 +254,7 @@ class WifiApConfigStore extends StateMachine {
config.preSharedKey = randomUUID.substring(0, 8)
+ randomUUID.substring(9, 13);
}
+ config.wifiApInactivityTimeout = 0;
sendMessage(WifiStateMachine.CMD_SET_AP_CONFIG, config);
}