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.content.pm.ParceledListSlice; 20 21 import android.net.wifi.hotspot2.OsuProvider; 22 import android.net.wifi.hotspot2.PasspointConfiguration; 23 import android.net.wifi.hotspot2.IProvisioningCallback; 24 25 import android.net.DhcpInfo; 26 import android.net.Network; 27 import android.net.wifi.IDppCallback; 28 import android.net.wifi.INetworkRequestMatchCallback; 29 import android.net.wifi.ISoftApCallback; 30 import android.net.wifi.ITrafficStateCallback; 31 import android.net.wifi.IOnWifiUsabilityStatsListener; 32 import android.net.wifi.PasspointManagementObjectDefinition; 33 import android.net.wifi.ScanResult; 34 import android.net.wifi.WifiActivityEnergyInfo; 35 import android.net.wifi.WifiConfiguration; 36 import android.net.wifi.WifiInfo; 37 import android.net.wifi.WifiNetworkSuggestion; 38 39 import android.os.Messenger; 40 import android.os.ResultReceiver; 41 import android.os.WorkSource; 42 43 /** 44 * Interface that allows controlling and querying Wi-Fi connectivity. 45 * 46 * {@hide} 47 */ 48 interface IWifiManager 49 { getSupportedFeatures()50 long getSupportedFeatures(); 51 reportActivityInfo()52 WifiActivityEnergyInfo reportActivityInfo(); 53 54 /** 55 * Requests the controller activity info asynchronously. 56 * The implementor is expected to reply with the 57 * {@link android.net.wifi.WifiActivityEnergyInfo} object placed into the Bundle with the key 58 * {@link android.os.BatteryStats#RESULT_RECEIVER_CONTROLLER_KEY}. The result code is ignored. 59 */ requestActivityInfo(in ResultReceiver result)60 oneway void requestActivityInfo(in ResultReceiver result); 61 getConfiguredNetworks(String packageName)62 ParceledListSlice getConfiguredNetworks(String packageName); 63 getPrivilegedConfiguredNetworks(String packageName)64 ParceledListSlice getPrivilegedConfiguredNetworks(String packageName); 65 getAllMatchingFqdnsForScanResults(in List<ScanResult> scanResult)66 Map getAllMatchingFqdnsForScanResults(in List<ScanResult> scanResult); 67 getMatchingOsuProviders(in List<ScanResult> scanResult)68 Map getMatchingOsuProviders(in List<ScanResult> scanResult); 69 getMatchingPasspointConfigsForOsuProviders(in List<OsuProvider> osuProviders)70 Map getMatchingPasspointConfigsForOsuProviders(in List<OsuProvider> osuProviders); 71 addOrUpdateNetwork(in WifiConfiguration config, String packageName)72 int addOrUpdateNetwork(in WifiConfiguration config, String packageName); 73 addOrUpdatePasspointConfiguration(in PasspointConfiguration config, String packageName)74 boolean addOrUpdatePasspointConfiguration(in PasspointConfiguration config, String packageName); 75 removePasspointConfiguration(in String fqdn, String packageName)76 boolean removePasspointConfiguration(in String fqdn, String packageName); 77 getPasspointConfigurations(in String packageName)78 List<PasspointConfiguration> getPasspointConfigurations(in String packageName); 79 getWifiConfigsForPasspointProfiles(in List<String> fqdnList)80 List<WifiConfiguration> getWifiConfigsForPasspointProfiles(in List<String> fqdnList); 81 queryPasspointIcon(long bssid, String fileName)82 void queryPasspointIcon(long bssid, String fileName); 83 matchProviderWithCurrentNetwork(String fqdn)84 int matchProviderWithCurrentNetwork(String fqdn); 85 deauthenticateNetwork(long holdoff, boolean ess)86 void deauthenticateNetwork(long holdoff, boolean ess); 87 removeNetwork(int netId, String packageName)88 boolean removeNetwork(int netId, String packageName); 89 enableNetwork(int netId, boolean disableOthers, String packageName)90 boolean enableNetwork(int netId, boolean disableOthers, String packageName); 91 disableNetwork(int netId, String packageName)92 boolean disableNetwork(int netId, String packageName); 93 startScan(String packageName)94 boolean startScan(String packageName); 95 getScanResults(String callingPackage)96 List<ScanResult> getScanResults(String callingPackage); 97 disconnect(String packageName)98 boolean disconnect(String packageName); 99 reconnect(String packageName)100 boolean reconnect(String packageName); 101 reassociate(String packageName)102 boolean reassociate(String packageName); 103 getConnectionInfo(String callingPackage)104 WifiInfo getConnectionInfo(String callingPackage); 105 setWifiEnabled(String packageName, boolean enable)106 boolean setWifiEnabled(String packageName, boolean enable); 107 getWifiEnabledState()108 int getWifiEnabledState(); 109 setCountryCode(String country)110 void setCountryCode(String country); 111 getCountryCode()112 String getCountryCode(); 113 isDualBandSupported()114 boolean isDualBandSupported(); 115 needs5GHzToAnyApBandConversion()116 boolean needs5GHzToAnyApBandConversion(); 117 getDhcpInfo()118 DhcpInfo getDhcpInfo(); 119 isScanAlwaysAvailable()120 boolean isScanAlwaysAvailable(); 121 acquireWifiLock(IBinder lock, int lockType, String tag, in WorkSource ws)122 boolean acquireWifiLock(IBinder lock, int lockType, String tag, in WorkSource ws); 123 updateWifiLockWorkSource(IBinder lock, in WorkSource ws)124 void updateWifiLockWorkSource(IBinder lock, in WorkSource ws); 125 releaseWifiLock(IBinder lock)126 boolean releaseWifiLock(IBinder lock); 127 initializeMulticastFiltering()128 void initializeMulticastFiltering(); 129 isMulticastEnabled()130 boolean isMulticastEnabled(); 131 acquireMulticastLock(IBinder binder, String tag)132 void acquireMulticastLock(IBinder binder, String tag); 133 releaseMulticastLock(String tag)134 void releaseMulticastLock(String tag); 135 updateInterfaceIpState(String ifaceName, int mode)136 void updateInterfaceIpState(String ifaceName, int mode); 137 startSoftAp(in WifiConfiguration wifiConfig)138 boolean startSoftAp(in WifiConfiguration wifiConfig); 139 stopSoftAp()140 boolean stopSoftAp(); 141 startLocalOnlyHotspot(in Messenger messenger, in IBinder binder, String packageName)142 int startLocalOnlyHotspot(in Messenger messenger, in IBinder binder, String packageName); 143 stopLocalOnlyHotspot()144 void stopLocalOnlyHotspot(); 145 startWatchLocalOnlyHotspot(in Messenger messenger, in IBinder binder)146 void startWatchLocalOnlyHotspot(in Messenger messenger, in IBinder binder); 147 stopWatchLocalOnlyHotspot()148 void stopWatchLocalOnlyHotspot(); 149 150 @UnsupportedAppUsage getWifiApEnabledState()151 int getWifiApEnabledState(); 152 153 @UnsupportedAppUsage getWifiApConfiguration()154 WifiConfiguration getWifiApConfiguration(); 155 setWifiApConfiguration(in WifiConfiguration wifiConfig, String packageName)156 boolean setWifiApConfiguration(in WifiConfiguration wifiConfig, String packageName); 157 notifyUserOfApBandConversion(String packageName)158 void notifyUserOfApBandConversion(String packageName); 159 getWifiServiceMessenger(String packageName)160 Messenger getWifiServiceMessenger(String packageName); 161 enableTdls(String remoteIPAddress, boolean enable)162 void enableTdls(String remoteIPAddress, boolean enable); 163 enableTdlsWithMacAddress(String remoteMacAddress, boolean enable)164 void enableTdlsWithMacAddress(String remoteMacAddress, boolean enable); 165 getCurrentNetworkWpsNfcConfigurationToken()166 String getCurrentNetworkWpsNfcConfigurationToken(); 167 enableVerboseLogging(int verbose)168 void enableVerboseLogging(int verbose); 169 getVerboseLoggingLevel()170 int getVerboseLoggingLevel(); 171 enableWifiConnectivityManager(boolean enabled)172 void enableWifiConnectivityManager(boolean enabled); 173 disableEphemeralNetwork(String SSID, String packageName)174 void disableEphemeralNetwork(String SSID, String packageName); 175 factoryReset(String packageName)176 void factoryReset(String packageName); 177 178 @UnsupportedAppUsage getCurrentNetwork()179 Network getCurrentNetwork(); 180 retrieveBackupData()181 byte[] retrieveBackupData(); 182 restoreBackupData(in byte[] data)183 void restoreBackupData(in byte[] data); 184 restoreSupplicantBackupData(in byte[] supplicantData, in byte[] ipConfigData)185 void restoreSupplicantBackupData(in byte[] supplicantData, in byte[] ipConfigData); 186 startSubscriptionProvisioning(in OsuProvider provider, in IProvisioningCallback callback)187 void startSubscriptionProvisioning(in OsuProvider provider, in IProvisioningCallback callback); 188 registerSoftApCallback(in IBinder binder, in ISoftApCallback callback, int callbackIdentifier)189 void registerSoftApCallback(in IBinder binder, in ISoftApCallback callback, int callbackIdentifier); 190 unregisterSoftApCallback(int callbackIdentifier)191 void unregisterSoftApCallback(int callbackIdentifier); 192 addOnWifiUsabilityStatsListener(in IBinder binder, in IOnWifiUsabilityStatsListener listener, int listenerIdentifier)193 void addOnWifiUsabilityStatsListener(in IBinder binder, in IOnWifiUsabilityStatsListener listener, int listenerIdentifier); 194 removeOnWifiUsabilityStatsListener(int listenerIdentifier)195 void removeOnWifiUsabilityStatsListener(int listenerIdentifier); 196 registerTrafficStateCallback(in IBinder binder, in ITrafficStateCallback callback, int callbackIdentifier)197 void registerTrafficStateCallback(in IBinder binder, in ITrafficStateCallback callback, int callbackIdentifier); 198 unregisterTrafficStateCallback(int callbackIdentifier)199 void unregisterTrafficStateCallback(int callbackIdentifier); 200 registerNetworkRequestMatchCallback(in IBinder binder, in INetworkRequestMatchCallback callback, int callbackIdentifier)201 void registerNetworkRequestMatchCallback(in IBinder binder, in INetworkRequestMatchCallback callback, int callbackIdentifier); 202 unregisterNetworkRequestMatchCallback(int callbackIdentifier)203 void unregisterNetworkRequestMatchCallback(int callbackIdentifier); 204 addNetworkSuggestions(in List<WifiNetworkSuggestion> networkSuggestions, in String packageName)205 int addNetworkSuggestions(in List<WifiNetworkSuggestion> networkSuggestions, in String packageName); 206 removeNetworkSuggestions(in List<WifiNetworkSuggestion> networkSuggestions, in String packageName)207 int removeNetworkSuggestions(in List<WifiNetworkSuggestion> networkSuggestions, in String packageName); 208 getFactoryMacAddresses()209 String[] getFactoryMacAddresses(); 210 setDeviceMobilityState(int state)211 void setDeviceMobilityState(int state); 212 startDppAsConfiguratorInitiator(in IBinder binder, in String enrolleeUri, int selectedNetworkId, int netRole, in IDppCallback callback)213 void startDppAsConfiguratorInitiator(in IBinder binder, in String enrolleeUri, 214 int selectedNetworkId, int netRole, in IDppCallback callback); 215 startDppAsEnrolleeInitiator(in IBinder binder, in String configuratorUri, in IDppCallback callback)216 void startDppAsEnrolleeInitiator(in IBinder binder, in String configuratorUri, 217 in IDppCallback callback); 218 stopDppSession()219 void stopDppSession(); 220 updateWifiUsabilityScore(int seqNum, int score, int predictionHorizonSec)221 void updateWifiUsabilityScore(int seqNum, int score, int predictionHorizonSec); 222 } 223