summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbnarasimha <bnarasimha@cyngn.com>2016-11-18 10:29:38 -0800
committerMichael Bestas <mikeioannina@gmail.com>2017-01-01 23:10:32 +0200
commit76493b8dba73ba16d60559db182a16cfc1dbd700 (patch)
treec2476847ccd6e6e1fd4b5c90f1abfe79e43773d4
parent91c17ab058b76351c8eea9f7dbaee3bb72dc73a0 (diff)
downloadandroid_frameworks_opt_net_wifi-staging/cm-14.1-cafrebase.tar.gz
android_frameworks_opt_net_wifi-staging/cm-14.1-cafrebase.tar.bz2
android_frameworks_opt_net_wifi-staging/cm-14.1-cafrebase.zip
Tethering: Turn off wifi hotspot after inactivity(2/3)staging/cm-14.1-cafrebase
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: I26ad7027a57df8109c87cc08b6887b5af108bbaf
-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 a0341d748..2f49586d5 100644
--- a/service/java/com/android/server/wifi/WifiApConfigStore.java
+++ b/service/java/com/android/server/wifi/WifiApConfigStore.java
@@ -160,6 +160,10 @@ public class WifiApConfigStore {
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();
+ }
} catch (IOException e) {
Log.e(TAG, "Error reading hotspot configuration " + e);
config = null;
@@ -194,6 +198,7 @@ public class WifiApConfigStore {
if (authType != KeyMgmt.NONE) {
out.writeUTF(config.preSharedKey);
}
+ out.writeLong(config.wifiApInactivityTimeout);
} catch (IOException e) {
Log.e(TAG, "Error writing hotspot configuration" + e);
}
@@ -219,6 +224,7 @@ public class WifiApConfigStore {
//first 12 chars from xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
config.preSharedKey = randomUUID.substring(0, 8) + randomUUID.substring(9,13);
}
+ config.wifiApInactivityTimeout = 0;
return config;
}
}