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.OsuProvider;
23 import android.net.wifi.hotspot2.PasspointConfiguration;
24 import android.net.wifi.hotspot2.IProvisioningCallback;
25 
26 import android.net.DhcpInfo;
27 import android.net.Network;
28 import android.net.wifi.ISoftApCallback;
29 import android.net.wifi.PasspointManagementObjectDefinition;
30 import android.net.wifi.ScanResult;
31 import android.net.wifi.WifiActivityEnergyInfo;
32 import android.net.wifi.WifiConfiguration;
33 import android.net.wifi.WifiInfo;
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 
getAllMatchingWifiConfigs(in ScanResult scanResult)64     List<WifiConfiguration> getAllMatchingWifiConfigs(in ScanResult scanResult);
65 
getMatchingOsuProviders(in ScanResult scanResult)66     List<OsuProvider> getMatchingOsuProviders(in ScanResult scanResult);
67 
addOrUpdateNetwork(in WifiConfiguration config, String packageName)68     int addOrUpdateNetwork(in WifiConfiguration config, String packageName);
69 
addOrUpdatePasspointConfiguration(in PasspointConfiguration config, String packageName)70     boolean addOrUpdatePasspointConfiguration(in PasspointConfiguration config, String packageName);
71 
removePasspointConfiguration(in String fqdn, String packageName)72     boolean removePasspointConfiguration(in String fqdn, String packageName);
73 
getPasspointConfigurations()74     List<PasspointConfiguration> getPasspointConfigurations();
75 
queryPasspointIcon(long bssid, String fileName)76     void queryPasspointIcon(long bssid, String fileName);
77 
matchProviderWithCurrentNetwork(String fqdn)78     int matchProviderWithCurrentNetwork(String fqdn);
79 
deauthenticateNetwork(long holdoff, boolean ess)80     void deauthenticateNetwork(long holdoff, boolean ess);
81 
removeNetwork(int netId, String packageName)82     boolean removeNetwork(int netId, String packageName);
83 
enableNetwork(int netId, boolean disableOthers, String packageName)84     boolean enableNetwork(int netId, boolean disableOthers, String packageName);
85 
disableNetwork(int netId, String packageName)86     boolean disableNetwork(int netId, String packageName);
87 
startScan(String packageName)88     boolean startScan(String packageName);
89 
getScanResults(String callingPackage)90     List<ScanResult> getScanResults(String callingPackage);
91 
disconnect(String packageName)92     void disconnect(String packageName);
93 
reconnect(String packageName)94     void reconnect(String packageName);
95 
reassociate(String packageName)96     void reassociate(String packageName);
97 
getConnectionInfo(String callingPackage)98     WifiInfo getConnectionInfo(String callingPackage);
99 
setWifiEnabled(String packageName, boolean enable)100     boolean setWifiEnabled(String packageName, boolean enable);
101 
getWifiEnabledState()102     int getWifiEnabledState();
103 
setCountryCode(String country)104     void setCountryCode(String country);
105 
getCountryCode()106     String getCountryCode();
107 
isDualBandSupported()108     boolean isDualBandSupported();
109 
needs5GHzToAnyApBandConversion()110     boolean needs5GHzToAnyApBandConversion();
111 
getDhcpInfo()112     DhcpInfo getDhcpInfo();
113 
isScanAlwaysAvailable()114     boolean isScanAlwaysAvailable();
115 
acquireWifiLock(IBinder lock, int lockType, String tag, in WorkSource ws)116     boolean acquireWifiLock(IBinder lock, int lockType, String tag, in WorkSource ws);
117 
updateWifiLockWorkSource(IBinder lock, in WorkSource ws)118     void updateWifiLockWorkSource(IBinder lock, in WorkSource ws);
119 
releaseWifiLock(IBinder lock)120     boolean releaseWifiLock(IBinder lock);
121 
initializeMulticastFiltering()122     void initializeMulticastFiltering();
123 
isMulticastEnabled()124     boolean isMulticastEnabled();
125 
acquireMulticastLock(IBinder binder, String tag)126     void acquireMulticastLock(IBinder binder, String tag);
127 
releaseMulticastLock()128     void releaseMulticastLock();
129 
updateInterfaceIpState(String ifaceName, int mode)130     void updateInterfaceIpState(String ifaceName, int mode);
131 
startSoftAp(in WifiConfiguration wifiConfig)132     boolean startSoftAp(in WifiConfiguration wifiConfig);
133 
stopSoftAp()134     boolean stopSoftAp();
135 
startLocalOnlyHotspot(in Messenger messenger, in IBinder binder, String packageName)136     int startLocalOnlyHotspot(in Messenger messenger, in IBinder binder, String packageName);
137 
stopLocalOnlyHotspot()138     void stopLocalOnlyHotspot();
139 
startWatchLocalOnlyHotspot(in Messenger messenger, in IBinder binder)140     void startWatchLocalOnlyHotspot(in Messenger messenger, in IBinder binder);
141 
stopWatchLocalOnlyHotspot()142     void stopWatchLocalOnlyHotspot();
143 
getWifiApEnabledState()144     int getWifiApEnabledState();
145 
getWifiApConfiguration()146     WifiConfiguration getWifiApConfiguration();
147 
setWifiApConfiguration(in WifiConfiguration wifiConfig, String packageName)148     boolean setWifiApConfiguration(in WifiConfiguration wifiConfig, String packageName);
149 
getWifiServiceMessenger(String packageName)150     Messenger getWifiServiceMessenger(String packageName);
151 
enableTdls(String remoteIPAddress, boolean enable)152     void enableTdls(String remoteIPAddress, boolean enable);
153 
enableTdlsWithMacAddress(String remoteMacAddress, boolean enable)154     void enableTdlsWithMacAddress(String remoteMacAddress, boolean enable);
155 
getCurrentNetworkWpsNfcConfigurationToken()156     String getCurrentNetworkWpsNfcConfigurationToken();
157 
enableVerboseLogging(int verbose)158     void enableVerboseLogging(int verbose);
159 
getVerboseLoggingLevel()160     int getVerboseLoggingLevel();
161 
enableWifiConnectivityManager(boolean enabled)162     void enableWifiConnectivityManager(boolean enabled);
163 
disableEphemeralNetwork(String SSID, String packageName)164     void disableEphemeralNetwork(String SSID, String packageName);
165 
factoryReset(String packageName)166     void factoryReset(String packageName);
167 
getCurrentNetwork()168     Network getCurrentNetwork();
169 
retrieveBackupData()170     byte[] retrieveBackupData();
171 
restoreBackupData(in byte[] data)172     void restoreBackupData(in byte[] data);
173 
restoreSupplicantBackupData(in byte[] supplicantData, in byte[] ipConfigData)174     void restoreSupplicantBackupData(in byte[] supplicantData, in byte[] ipConfigData);
175 
startSubscriptionProvisioning(in OsuProvider provider, in IProvisioningCallback callback)176     void startSubscriptionProvisioning(in OsuProvider provider, in IProvisioningCallback callback);
177 
registerSoftApCallback(in IBinder binder, in ISoftApCallback callback, int callbackIdentifier)178     void registerSoftApCallback(in IBinder binder, in ISoftApCallback callback, int callbackIdentifier);
179 
unregisterSoftApCallback(int callbackIdentifier)180     void unregisterSoftApCallback(int callbackIdentifier);
181 }
182 
183