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 import android.net.wifi.BatchedScanResult; 20 import android.net.wifi.BatchedScanSettings; 21 import android.net.wifi.WifiConfiguration; 22 import android.net.wifi.WifiInfo; 23 import android.net.wifi.ScanSettings; 24 import android.net.wifi.WifiChannel; 25 import android.net.wifi.ScanResult; 26 import android.net.wifi.WifiConnectionStatistics; 27 import android.net.wifi.WifiActivityEnergyInfo; 28 import android.net.Network; 29 30 import android.net.DhcpInfo; 31 32 33 import android.os.Messenger; 34 import android.os.WorkSource; 35 36 /** 37 * Interface that allows controlling and querying Wi-Fi connectivity. 38 * 39 * {@hide} 40 */ 41 interface IWifiManager 42 { getSupportedFeatures()43 int getSupportedFeatures(); 44 reportActivityInfo()45 WifiActivityEnergyInfo reportActivityInfo(); 46 getConfiguredNetworks()47 List<WifiConfiguration> getConfiguredNetworks(); 48 getPrivilegedConfiguredNetworks()49 List<WifiConfiguration> getPrivilegedConfiguredNetworks(); 50 getMatchingWifiConfig(in ScanResult scanResult)51 WifiConfiguration getMatchingWifiConfig(in ScanResult scanResult); 52 addOrUpdateNetwork(in WifiConfiguration config)53 int addOrUpdateNetwork(in WifiConfiguration config); 54 removeNetwork(int netId)55 boolean removeNetwork(int netId); 56 enableNetwork(int netId, boolean disableOthers)57 boolean enableNetwork(int netId, boolean disableOthers); 58 disableNetwork(int netId)59 boolean disableNetwork(int netId); 60 pingSupplicant()61 boolean pingSupplicant(); 62 getChannelList()63 List<WifiChannel> getChannelList(); 64 startScan(in ScanSettings requested, in WorkSource ws)65 void startScan(in ScanSettings requested, in WorkSource ws); 66 startLocationRestrictedScan(in WorkSource ws)67 void startLocationRestrictedScan(in WorkSource ws); 68 getScanResults(String callingPackage)69 List<ScanResult> getScanResults(String callingPackage); 70 disconnect()71 void disconnect(); 72 reconnect()73 void reconnect(); 74 reassociate()75 void reassociate(); 76 getConnectionInfo()77 WifiInfo getConnectionInfo(); 78 setWifiEnabled(boolean enable)79 boolean setWifiEnabled(boolean enable); 80 getWifiEnabledState()81 int getWifiEnabledState(); 82 setCountryCode(String country, boolean persist)83 void setCountryCode(String country, boolean persist); 84 getCountryCode()85 String getCountryCode(); 86 setFrequencyBand(int band, boolean persist)87 void setFrequencyBand(int band, boolean persist); 88 getFrequencyBand()89 int getFrequencyBand(); 90 isDualBandSupported()91 boolean isDualBandSupported(); 92 saveConfiguration()93 boolean saveConfiguration(); 94 getDhcpInfo()95 DhcpInfo getDhcpInfo(); 96 isScanAlwaysAvailable()97 boolean isScanAlwaysAvailable(); 98 acquireWifiLock(IBinder lock, int lockType, String tag, in WorkSource ws)99 boolean acquireWifiLock(IBinder lock, int lockType, String tag, in WorkSource ws); 100 updateWifiLockWorkSource(IBinder lock, in WorkSource ws)101 void updateWifiLockWorkSource(IBinder lock, in WorkSource ws); 102 releaseWifiLock(IBinder lock)103 boolean releaseWifiLock(IBinder lock); 104 initializeMulticastFiltering()105 void initializeMulticastFiltering(); 106 isMulticastEnabled()107 boolean isMulticastEnabled(); 108 acquireMulticastLock(IBinder binder, String tag)109 void acquireMulticastLock(IBinder binder, String tag); 110 releaseMulticastLock()111 void releaseMulticastLock(); 112 setWifiApEnabled(in WifiConfiguration wifiConfig, boolean enable)113 void setWifiApEnabled(in WifiConfiguration wifiConfig, boolean enable); 114 getWifiApEnabledState()115 int getWifiApEnabledState(); 116 getWifiApConfiguration()117 WifiConfiguration getWifiApConfiguration(); 118 buildWifiConfig(String uriString, String mimeType, in byte[] data)119 WifiConfiguration buildWifiConfig(String uriString, String mimeType, in byte[] data); 120 setWifiApConfiguration(in WifiConfiguration wifiConfig)121 void setWifiApConfiguration(in WifiConfiguration wifiConfig); 122 startWifi()123 void startWifi(); 124 stopWifi()125 void stopWifi(); 126 addToBlacklist(String bssid)127 void addToBlacklist(String bssid); 128 clearBlacklist()129 void clearBlacklist(); 130 getWifiServiceMessenger()131 Messenger getWifiServiceMessenger(); 132 getConfigFile()133 String getConfigFile(); 134 enableTdls(String remoteIPAddress, boolean enable)135 void enableTdls(String remoteIPAddress, boolean enable); 136 enableTdlsWithMacAddress(String remoteMacAddress, boolean enable)137 void enableTdlsWithMacAddress(String remoteMacAddress, boolean enable); 138 requestBatchedScan(in BatchedScanSettings requested, IBinder binder, in WorkSource ws)139 boolean requestBatchedScan(in BatchedScanSettings requested, IBinder binder, in WorkSource ws); 140 stopBatchedScan(in BatchedScanSettings requested)141 void stopBatchedScan(in BatchedScanSettings requested); 142 getBatchedScanResults(String callingPackage)143 List<BatchedScanResult> getBatchedScanResults(String callingPackage); 144 isBatchedScanSupported()145 boolean isBatchedScanSupported(); 146 pollBatchedScan()147 void pollBatchedScan(); 148 getWpsNfcConfigurationToken(int netId)149 String getWpsNfcConfigurationToken(int netId); 150 enableVerboseLogging(int verbose)151 void enableVerboseLogging(int verbose); 152 getVerboseLoggingLevel()153 int getVerboseLoggingLevel(); 154 enableAggressiveHandover(int enabled)155 void enableAggressiveHandover(int enabled); getAggressiveHandover()156 int getAggressiveHandover(); 157 setAllowScansWithTraffic(int enabled)158 void setAllowScansWithTraffic(int enabled); getAllowScansWithTraffic()159 int getAllowScansWithTraffic(); 160 setHalBasedAutojoinOffload(int enabled)161 void setHalBasedAutojoinOffload(int enabled); getHalBasedAutojoinOffload()162 int getHalBasedAutojoinOffload(); 163 enableAutoJoinWhenAssociated(boolean enabled)164 boolean enableAutoJoinWhenAssociated(boolean enabled); getEnableAutoJoinWhenAssociated()165 boolean getEnableAutoJoinWhenAssociated(); 166 getConnectionStatistics()167 WifiConnectionStatistics getConnectionStatistics(); 168 disableEphemeralNetwork(String SSID)169 void disableEphemeralNetwork(String SSID); 170 factoryReset()171 void factoryReset(); 172 getCurrentNetwork()173 Network getCurrentNetwork(); 174 } 175 176