diff options
author | Rebecca Silberstein <silberst@google.com> | 2017-04-21 11:17:04 -0700 |
---|---|---|
committer | Rebecca Silberstein <silberst@google.com> | 2017-04-26 06:32:36 +0000 |
commit | 455cc203f08e4713eafa6acd26a74a7db9c95a40 (patch) | |
tree | 6d682491c81cc572f7887ae7d57e38805176a798 /service | |
parent | 960b599df670bf9c0fc301ac0a6a4cb30a929e5a (diff) |
WifiServiceImpl: add updateInterfaceIpState
Add a call to WifiService protected by the NETWORK_STACK permission that
allows ConnectivityService to provide interface mode change updates.
A corresponding CL will be added to WifiManager.
Bug: 31466854
Test: make
Change-Id: Iab5aa71c10f86bf1485239a453aae363f7ae3b9c
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiServiceImpl.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index c5f367561..b81878df0 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -703,6 +703,29 @@ public class WifiServiceImpl extends IWifiManager.Stub { } /** + * see {@link android.net.wifi.WifiManager#updateInterfaceIpState(String, int)} + * + * The possible modes include: {@link WifiManager#IFACE_IP_MODE_TETHERED}, + * {@link WifiManager#IFACE_IP_MODE_LOCAL_ONLY}, + * {@link WifiManager#IFACE_IP_MODE_CONFIGURATION_ERROR} + * + * @param ifaceName String name of the updated interface + * @param mode new operating mode of the interface + * + * @throws SecurityException if the caller does not have permission to call update + */ + @Override + public void updateInterfaceIpState(String ifaceName, int mode) { + // NETWORK_STACK is a signature only permission. + enforceNetworkStackPermission(); + + Slog.d(TAG, "updateInterfaceIpState: ifaceName=" + ifaceName + " mode=" + mode); + // TODO: keep track of modes in a datastructure - protect it with a lock of some sort. + // TODO: check the mode when startLOHS comes in in case it is already active + // TODO: if mode == LOCAL_ONLY, trigger onStarted callbacks + } + + /** * see {@link android.net.wifi.WifiManager#startSoftAp(WifiConfiguration)} * @param wifiConfig SSID, security and channel details as * part of WifiConfiguration |