summaryrefslogtreecommitdiffstats
path: root/service/java/com/android/server/wifi
diff options
context:
space:
mode:
authorbnarasimha <bnarasimha@cyngn.com>2016-11-18 10:29:38 -0800
committerbnarasimha <bnarasimha@cyngn.com>2016-11-28 11:17:53 -0800
commitad493b0bff4a913f728464da462d5f6083f85299 (patch)
tree83e3d8da99c8d408b4bc3840ca6504ace325ef1a /service/java/com/android/server/wifi
parenta5190f38c8aa731bd2782561ab273652a8062ec1 (diff)
downloadandroid_frameworks_opt_net_wifi-ad493b0bff4a913f728464da462d5f6083f85299.tar.gz
android_frameworks_opt_net_wifi-ad493b0bff4a913f728464da462d5f6083f85299.tar.bz2
android_frameworks_opt_net_wifi-ad493b0bff4a913f728464da462d5f6083f85299.zip
Tethering: Turn off wifi 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: I26ad7027a57df8109c87cc08b6887b5af108bbaf
Diffstat (limited to 'service/java/com/android/server/wifi')
-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;
}
}