2 * Copyright (c) 2008, The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package android.net.wifi;
20 import android.content.pm.ParceledListSlice;
22 import android.net.wifi.hotspot2.PasspointConfiguration;
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;
33 import android.net.DhcpInfo;
35 import android.os.Messenger;
36 import android.os.ResultReceiver;
37 import android.os.WorkSource;
40 * Interface that allows controlling and querying Wi-Fi connectivity.
44 interface IWifiManager
46 int getSupportedFeatures();
48 WifiActivityEnergyInfo reportActivityInfo();
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.
56 oneway void requestActivityInfo(in ResultReceiver result);
58 ParceledListSlice getConfiguredNetworks();
60 ParceledListSlice getPrivilegedConfiguredNetworks();
62 WifiConfiguration getMatchingWifiConfig(in ScanResult scanResult);
64 int addOrUpdateNetwork(in WifiConfiguration config);
66 boolean addOrUpdatePasspointConfiguration(in PasspointConfiguration config);
68 boolean removePasspointConfiguration(in String fqdn);
70 List<PasspointConfiguration> getPasspointConfigurations();
72 void queryPasspointIcon(long bssid, String fileName);
74 int matchProviderWithCurrentNetwork(String fqdn);
76 void deauthenticateNetwork(long holdoff, boolean ess);
78 boolean removeNetwork(int netId);
80 boolean enableNetwork(int netId, boolean disableOthers);
82 boolean disableNetwork(int netId);
84 void startScan(in ScanSettings requested, in WorkSource ws, in String packageName);
86 List<ScanResult> getScanResults(String callingPackage);
94 WifiInfo getConnectionInfo();
96 boolean setWifiEnabled(String packageName, boolean enable);
98 int getWifiEnabledState();
100 void setCountryCode(String country, boolean persist);
102 String getCountryCode();
104 boolean isDualBandSupported();
106 boolean saveConfiguration();
108 DhcpInfo getDhcpInfo();
110 boolean isScanAlwaysAvailable();
112 boolean acquireWifiLock(IBinder lock, int lockType, String tag, in WorkSource ws);
114 void updateWifiLockWorkSource(IBinder lock, in WorkSource ws);
116 boolean releaseWifiLock(IBinder lock);
118 void initializeMulticastFiltering();
120 boolean isMulticastEnabled();
122 void acquireMulticastLock(IBinder binder, String tag);
124 void releaseMulticastLock();
126 void setWifiApEnabled(in WifiConfiguration wifiConfig, boolean enable);
128 void updateInterfaceIpState(String ifaceName, int mode);
130 boolean startSoftAp(in WifiConfiguration wifiConfig);
132 boolean stopSoftAp();
134 WifiConfiguration startLocalOnlyHotspot(in Messenger messenger, in IBinder binder);
136 void stopLocalOnlyHotspot();
138 void startWatchLocalOnlyHotspot(in Messenger messenger, in IBinder binder);
140 void stopWatchLocalOnlyHotspot();
142 int getWifiApEnabledState();
144 WifiConfiguration getWifiApConfiguration();
146 void setWifiApConfiguration(in WifiConfiguration wifiConfig);
148 Messenger getWifiServiceMessenger();
150 void enableTdls(String remoteIPAddress, boolean enable);
152 void enableTdlsWithMacAddress(String remoteMacAddress, boolean enable);
154 String getCurrentNetworkWpsNfcConfigurationToken();
156 void enableVerboseLogging(int verbose);
158 int getVerboseLoggingLevel();
160 void enableAggressiveHandover(int enabled);
161 int getAggressiveHandover();
163 void setAllowScansWithTraffic(int enabled);
164 int getAllowScansWithTraffic();
166 boolean setEnableAutoJoinWhenAssociated(boolean enabled);
167 boolean getEnableAutoJoinWhenAssociated();
169 void enableWifiConnectivityManager(boolean enabled);
171 WifiConnectionStatistics getConnectionStatistics();
173 void disableEphemeralNetwork(String SSID);
177 Network getCurrentNetwork();
179 byte[] retrieveBackupData();
181 void restoreBackupData(in byte[] data);
183 void restoreSupplicantBackupData(in byte[] supplicantData, in byte[] ipConfigData);