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 { 41 int getSupportedFeatures(); 42 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 */ 51 oneway void requestActivityInfo(in ResultReceiver result); 52 53 List<WifiConfiguration> getConfiguredNetworks(); 54 55 List<WifiConfiguration> getPrivilegedConfiguredNetworks(); 56 57 WifiConfiguration getMatchingWifiConfig(in ScanResult scanResult); 58 59 int addOrUpdateNetwork(in WifiConfiguration config); 60 61 int addPasspointManagementObject(String mo); 62 63 int modifyPasspointManagementObject(String fqdn, 64 in List<PasspointManagementObjectDefinition> mos); 65 66 void queryPasspointIcon(long bssid, String fileName); 67 68 int matchProviderWithCurrentNetwork(String fqdn); 69 70 void deauthenticateNetwork(long holdoff, boolean ess); 71 72 boolean removeNetwork(int netId); 73 74 boolean enableNetwork(int netId, boolean disableOthers); 75 76 boolean disableNetwork(int netId); 77 78 boolean pingSupplicant(); 79 80 void startScan(in ScanSettings requested, in WorkSource ws); 81 82 List<ScanResult> getScanResults(String callingPackage); 83 84 void disconnect(); 85 86 void reconnect(); 87 88 void reassociate(); 89 90 WifiInfo getConnectionInfo(); 91 92 boolean setWifiEnabled(boolean enable); 93 94 int getWifiEnabledState(); 95 96 void setCountryCode(String country, boolean persist); 97 98 String getCountryCode(); 99 100 void setFrequencyBand(int band, boolean persist); 101 102 int getFrequencyBand(); 103 104 boolean isDualBandSupported(); 105 106 boolean saveConfiguration(); 107 108 DhcpInfo getDhcpInfo(); 109 110 boolean isScanAlwaysAvailable(); 111 112 boolean acquireWifiLock(IBinder lock, int lockType, String tag, in WorkSource ws); 113 114 void updateWifiLockWorkSource(IBinder lock, in WorkSource ws); 115 116 boolean releaseWifiLock(IBinder lock); 117 118 void initializeMulticastFiltering(); 119 120 boolean isMulticastEnabled(); 121 122 void acquireMulticastLock(IBinder binder, String tag); 123 124 void releaseMulticastLock(); 125 126 void setWifiApEnabled(in WifiConfiguration wifiConfig, boolean enable); 127 128 int getWifiApEnabledState(); 129 130 WifiConfiguration getWifiApConfiguration(); 131 132 WifiConfiguration buildWifiConfig(String uriString, String mimeType, in byte[] data); 133 134 void setWifiApConfiguration(in WifiConfiguration wifiConfig); 135 136 void addToBlacklist(String bssid); 137 138 void clearBlacklist(); 139 140 Messenger getWifiServiceMessenger(); 141 142 String getConfigFile(); 143 144 void enableTdls(String remoteIPAddress, boolean enable); 145 146 void enableTdlsWithMacAddress(String remoteMacAddress, boolean enable); 147 148 String getWpsNfcConfigurationToken(int netId); 149 150 void enableVerboseLogging(int verbose); 151 152 int getVerboseLoggingLevel(); 153 154 void enableAggressiveHandover(int enabled); 155 int getAggressiveHandover(); 156 157 void setAllowScansWithTraffic(int enabled); 158 int getAllowScansWithTraffic(); 159 160 boolean setEnableAutoJoinWhenAssociated(boolean enabled); 161 boolean getEnableAutoJoinWhenAssociated(); 162 163 void enableWifiConnectivityManager(boolean enabled); 164 165 WifiConnectionStatistics getConnectionStatistics(); 166 167 void disableEphemeralNetwork(String SSID); 168 169 void factoryReset(); 170 171 Network getCurrentNetwork(); 172 } 173 174