1 /**
2  * Copyright (c) 2008, The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.net.wifi;
18 
19 
20 import android.content.pm.ParceledListSlice;
21 
22 import android.net.wifi.hotspot2.PasspointConfiguration;
23 
24 import android.net.wifi.WifiConfiguration;
25 import android.net.wifi.WifiInfo;
26 import android.net.wifi.ScanSettings;
27 import android.net.wifi.ScanResult;
28 import android.net.wifi.PasspointManagementObjectDefinition;
29 import android.net.wifi.WifiConnectionStatistics;
30 import android.net.wifi.WifiActivityEnergyInfo;
31 import android.net.Network;
32 
33 import android.net.DhcpInfo;
34 
35 import android.os.Messenger;
36 import android.os.ResultReceiver;
37 import android.os.WorkSource;
38 
39 /**
40  * Interface that allows controlling and querying Wi-Fi connectivity.
41  *
42  * {@hide}
43  */
44 interface IWifiManager
45 {
getSupportedFeatures()46     int getSupportedFeatures();
47 
reportActivityInfo()48     WifiActivityEnergyInfo reportActivityInfo();
49 
50     /**
51      * Requests the controller activity info asynchronously.
52      * The implementor is expected to reply with the
53      * {@link android.net.wifi.WifiActivityEnergyInfo} object placed into the Bundle with the key
54      * {@link android.os.BatteryStats#RESULT_RECEIVER_CONTROLLER_KEY}. The result code is ignored.
55      */
requestActivityInfo(in ResultReceiver result)56     oneway void requestActivityInfo(in ResultReceiver result);
57 
getConfiguredNetworks()58     ParceledListSlice getConfiguredNetworks();
59 
getPrivilegedConfiguredNetworks()60     ParceledListSlice getPrivilegedConfiguredNetworks();
61 
getMatchingWifiConfig(in ScanResult scanResult)62     WifiConfiguration getMatchingWifiConfig(in ScanResult scanResult);
63 
addOrUpdateNetwork(in WifiConfiguration config)64     int addOrUpdateNetwork(in WifiConfiguration config);
65 
addOrUpdatePasspointConfiguration(in PasspointConfiguration config)66     boolean addOrUpdatePasspointConfiguration(in PasspointConfiguration config);
67 
removePasspointConfiguration(in String fqdn)68     boolean removePasspointConfiguration(in String fqdn);
69 
getPasspointConfigurations()70     List<PasspointConfiguration> getPasspointConfigurations();
71 
queryPasspointIcon(long bssid, String fileName)72     void queryPasspointIcon(long bssid, String fileName);
73 
matchProviderWithCurrentNetwork(String fqdn)74     int matchProviderWithCurrentNetwork(String fqdn);
75 
deauthenticateNetwork(long holdoff, boolean ess)76     void deauthenticateNetwork(long holdoff, boolean ess);
77 
removeNetwork(int netId)78     boolean removeNetwork(int netId);
79 
enableNetwork(int netId, boolean disableOthers)80     boolean enableNetwork(int netId, boolean disableOthers);
81 
disableNetwork(int netId)82     boolean disableNetwork(int netId);
83 
startScan(in ScanSettings requested, in WorkSource ws, in String packageName)84     void startScan(in ScanSettings requested, in WorkSource ws, in String packageName);
85 
getScanResults(String callingPackage)86     List<ScanResult> getScanResults(String callingPackage);
87 
disconnect()88     void disconnect();
89 
reconnect()90     void reconnect();
91 
reassociate()92     void reassociate();
93 
getConnectionInfo()94     WifiInfo getConnectionInfo();
95 
setWifiEnabled(String packageName, boolean enable)96     boolean setWifiEnabled(String packageName, boolean enable);
97 
getWifiEnabledState()98     int getWifiEnabledState();
99 
setCountryCode(String country, boolean persist)100     void setCountryCode(String country, boolean persist);
101 
getCountryCode()102     String getCountryCode();
103 
isDualBandSupported()104     boolean isDualBandSupported();
105 
saveConfiguration()106     boolean saveConfiguration();
107 
getDhcpInfo()108     DhcpInfo getDhcpInfo();
109 
isScanAlwaysAvailable()110     boolean isScanAlwaysAvailable();
111 
acquireWifiLock(IBinder lock, int lockType, String tag, in WorkSource ws)112     boolean acquireWifiLock(IBinder lock, int lockType, String tag, in WorkSource ws);
113 
updateWifiLockWorkSource(IBinder lock, in WorkSource ws)114     void updateWifiLockWorkSource(IBinder lock, in WorkSource ws);
115 
releaseWifiLock(IBinder lock)116     boolean releaseWifiLock(IBinder lock);
117 
initializeMulticastFiltering()118     void initializeMulticastFiltering();
119 
isMulticastEnabled()120     boolean isMulticastEnabled();
121 
acquireMulticastLock(IBinder binder, String tag)122     void acquireMulticastLock(IBinder binder, String tag);
123 
releaseMulticastLock()124     void releaseMulticastLock();
125 
setWifiApEnabled(in WifiConfiguration wifiConfig, boolean enable)126     void setWifiApEnabled(in WifiConfiguration wifiConfig, boolean enable);
127 
updateInterfaceIpState(String ifaceName, int mode)128     void updateInterfaceIpState(String ifaceName, int mode);
129 
startSoftAp(in WifiConfiguration wifiConfig)130     boolean startSoftAp(in WifiConfiguration wifiConfig);
131 
stopSoftAp()132     boolean stopSoftAp();
133 
startLocalOnlyHotspot(in Messenger messenger, in IBinder binder, in String packageName)134     int startLocalOnlyHotspot(in Messenger messenger, in IBinder binder, in String packageName);
135 
stopLocalOnlyHotspot()136     void stopLocalOnlyHotspot();
137 
startWatchLocalOnlyHotspot(in Messenger messenger, in IBinder binder)138     void startWatchLocalOnlyHotspot(in Messenger messenger, in IBinder binder);
139 
stopWatchLocalOnlyHotspot()140     void stopWatchLocalOnlyHotspot();
141 
getWifiApEnabledState()142     int getWifiApEnabledState();
143 
getWifiApConfiguration()144     WifiConfiguration getWifiApConfiguration();
145 
setWifiApConfiguration(in WifiConfiguration wifiConfig)146     void setWifiApConfiguration(in WifiConfiguration wifiConfig);
147 
getWifiServiceMessenger()148     Messenger getWifiServiceMessenger();
149 
enableTdls(String remoteIPAddress, boolean enable)150     void enableTdls(String remoteIPAddress, boolean enable);
151 
enableTdlsWithMacAddress(String remoteMacAddress, boolean enable)152     void enableTdlsWithMacAddress(String remoteMacAddress, boolean enable);
153 
getCurrentNetworkWpsNfcConfigurationToken()154     String getCurrentNetworkWpsNfcConfigurationToken();
155 
enableVerboseLogging(int verbose)156     void enableVerboseLogging(int verbose);
157 
getVerboseLoggingLevel()158     int getVerboseLoggingLevel();
159 
enableAggressiveHandover(int enabled)160     void enableAggressiveHandover(int enabled);
getAggressiveHandover()161     int getAggressiveHandover();
162 
setAllowScansWithTraffic(int enabled)163     void setAllowScansWithTraffic(int enabled);
getAllowScansWithTraffic()164     int getAllowScansWithTraffic();
165 
setEnableAutoJoinWhenAssociated(boolean enabled)166     boolean setEnableAutoJoinWhenAssociated(boolean enabled);
getEnableAutoJoinWhenAssociated()167     boolean getEnableAutoJoinWhenAssociated();
168 
enableWifiConnectivityManager(boolean enabled)169     void enableWifiConnectivityManager(boolean enabled);
170 
getConnectionStatistics()171     WifiConnectionStatistics getConnectionStatistics();
172 
disableEphemeralNetwork(String SSID)173     void disableEphemeralNetwork(String SSID);
174 
factoryReset()175     void factoryReset();
176 
getCurrentNetwork()177     Network getCurrentNetwork();
178 
retrieveBackupData()179     byte[] retrieveBackupData();
180 
restoreBackupData(in byte[] data)181     void restoreBackupData(in byte[] data);
182 
restoreSupplicantBackupData(in byte[] supplicantData, in byte[] ipConfigData)183     void restoreSupplicantBackupData(in byte[] supplicantData, in byte[] ipConfigData);
184 }
185 
186