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.WifiConfiguration; 20 import android.net.wifi.WifiInfo; 21 import android.net.wifi.ScanSettings; 22 import android.net.wifi.ScanResult; 23 import android.net.wifi.PasspointManagementObjectDefinition; 24 import android.net.wifi.WifiConnectionStatistics; 25 import android.net.wifi.WifiActivityEnergyInfo; 26 import android.net.Network; 27 28 import android.net.DhcpInfo; 29 30 import android.os.Messenger; 31 import android.os.ResultReceiver; 32 import android.os.WorkSource; 33 34 /** 35 * Interface that allows controlling and querying Wi-Fi connectivity. 36 * 37 * {@hide} 38 */ 39 interface IWifiManager 40 { getSupportedFeatures()41 int getSupportedFeatures(); 42 reportActivityInfo()43 WifiActivityEnergyInfo reportActivityInfo(); 44 45 /** 46 * Requests the controller activity info asynchronously. 47 * The implementor is expected to reply with the 48 * {@link android.net.wifi.WifiActivityEnergyInfo} object placed into the Bundle with the key 49 * {@link android.os.BatteryStats#RESULT_RECEIVER_CONTROLLER_KEY}. The result code is ignored. 50 */ requestActivityInfo(in ResultReceiver result)51 oneway void requestActivityInfo(in ResultReceiver result); 52 getConfiguredNetworks()53 List<WifiConfiguration> getConfiguredNetworks(); 54 getPrivilegedConfiguredNetworks()55 List<WifiConfiguration> getPrivilegedConfiguredNetworks(); 56 getMatchingWifiConfig(in ScanResult scanResult)57 WifiConfiguration getMatchingWifiConfig(in ScanResult scanResult); 58 addOrUpdateNetwork(in WifiConfiguration config)59 int addOrUpdateNetwork(in WifiConfiguration config); 60 addPasspointManagementObject(String mo)61 int addPasspointManagementObject(String mo); 62 modifyPasspointManagementObject(String fqdn, in List<PasspointManagementObjectDefinition> mos)63 int modifyPasspointManagementObject(String fqdn, 64 in List<PasspointManagementObjectDefinition> mos); 65 queryPasspointIcon(long bssid, String fileName)66 void queryPasspointIcon(long bssid, String fileName); 67 matchProviderWithCurrentNetwork(String fqdn)68 int matchProviderWithCurrentNetwork(String fqdn); 69 deauthenticateNetwork(long holdoff, boolean ess)70 void deauthenticateNetwork(long holdoff, boolean ess); 71 removeNetwork(int netId)72 boolean removeNetwork(int netId); 73 enableNetwork(int netId, boolean disableOthers)74 boolean enableNetwork(int netId, boolean disableOthers); 75 disableNetwork(int netId)76 boolean disableNetwork(int netId); 77 pingSupplicant()78 boolean pingSupplicant(); 79 startScan(in ScanSettings requested, in WorkSource ws)80 void startScan(in ScanSettings requested, in WorkSource ws); 81 getScanResults(String callingPackage)82 List<ScanResult> getScanResults(String callingPackage); 83 disconnect()84 void disconnect(); 85 reconnect()86 void reconnect(); 87 reassociate()88 void reassociate(); 89 getConnectionInfo()90 WifiInfo getConnectionInfo(); 91 setWifiEnabled(boolean enable)92 boolean setWifiEnabled(boolean enable); 93 getWifiEnabledState()94 int getWifiEnabledState(); 95 setCountryCode(String country, boolean persist)96 void setCountryCode(String country, boolean persist); 97 getCountryCode()98 String getCountryCode(); 99 setFrequencyBand(int band, boolean persist)100 void setFrequencyBand(int band, boolean persist); 101 getFrequencyBand()102 int getFrequencyBand(); 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 getWifiApEnabledState()128 int getWifiApEnabledState(); 129 getWifiApConfiguration()130 WifiConfiguration getWifiApConfiguration(); 131 buildWifiConfig(String uriString, String mimeType, in byte[] data)132 WifiConfiguration buildWifiConfig(String uriString, String mimeType, in byte[] data); 133 setWifiApConfiguration(in WifiConfiguration wifiConfig)134 void setWifiApConfiguration(in WifiConfiguration wifiConfig); 135 addToBlacklist(String bssid)136 void addToBlacklist(String bssid); 137 clearBlacklist()138 void clearBlacklist(); 139 getWifiServiceMessenger()140 Messenger getWifiServiceMessenger(); 141 getConfigFile()142 String getConfigFile(); 143 enableTdls(String remoteIPAddress, boolean enable)144 void enableTdls(String remoteIPAddress, boolean enable); 145 enableTdlsWithMacAddress(String remoteMacAddress, boolean enable)146 void enableTdlsWithMacAddress(String remoteMacAddress, boolean enable); 147 getWpsNfcConfigurationToken(int netId)148 String getWpsNfcConfigurationToken(int netId); 149 enableVerboseLogging(int verbose)150 void enableVerboseLogging(int verbose); 151 getVerboseLoggingLevel()152 int getVerboseLoggingLevel(); 153 enableAggressiveHandover(int enabled)154 void enableAggressiveHandover(int enabled); getAggressiveHandover()155 int getAggressiveHandover(); 156 setAllowScansWithTraffic(int enabled)157 void setAllowScansWithTraffic(int enabled); getAllowScansWithTraffic()158 int getAllowScansWithTraffic(); 159 setEnableAutoJoinWhenAssociated(boolean enabled)160 boolean setEnableAutoJoinWhenAssociated(boolean enabled); getEnableAutoJoinWhenAssociated()161 boolean getEnableAutoJoinWhenAssociated(); 162 enableWifiConnectivityManager(boolean enabled)163 void enableWifiConnectivityManager(boolean enabled); 164 getConnectionStatistics()165 WifiConnectionStatistics getConnectionStatistics(); 166 disableEphemeralNetwork(String SSID)167 void disableEphemeralNetwork(String SSID); 168 factoryReset()169 void factoryReset(); 170 getCurrentNetwork()171 Network getCurrentNetwork(); 172 } 173 174