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; 18 19 import android.app.PendingIntent; 20 import android.net.LinkProperties; 21 import android.net.Network; 22 import android.net.NetworkCapabilities; 23 import android.net.NetworkInfo; 24 import android.net.NetworkMisc; 25 import android.net.NetworkQuotaInfo; 26 import android.net.NetworkRequest; 27 import android.net.NetworkState; 28 import android.net.ProxyInfo; 29 import android.os.IBinder; 30 import android.os.Messenger; 31 import android.os.ParcelFileDescriptor; 32 import android.os.ResultReceiver; 33 34 import com.android.internal.net.LegacyVpnInfo; 35 import com.android.internal.net.VpnConfig; 36 import com.android.internal.net.VpnProfile; 37 38 /** 39 * Interface that answers queries about, and allows changing, the 40 * state of network connectivity. 41 */ 42 /** {@hide} */ 43 interface IConnectivityManager 44 { getActiveNetworkInfo()45 NetworkInfo getActiveNetworkInfo(); getActiveNetworkInfoForUid(int uid)46 NetworkInfo getActiveNetworkInfoForUid(int uid); getNetworkInfo(int networkType)47 NetworkInfo getNetworkInfo(int networkType); getNetworkInfoForNetwork(in Network network)48 NetworkInfo getNetworkInfoForNetwork(in Network network); getAllNetworkInfo()49 NetworkInfo[] getAllNetworkInfo(); getNetworkForType(int networkType)50 Network getNetworkForType(int networkType); getAllNetworks()51 Network[] getAllNetworks(); getDefaultNetworkCapabilitiesForUser(int userId)52 NetworkCapabilities[] getDefaultNetworkCapabilitiesForUser(int userId); 53 getProvisioningOrActiveNetworkInfo()54 NetworkInfo getProvisioningOrActiveNetworkInfo(); 55 isNetworkSupported(int networkType)56 boolean isNetworkSupported(int networkType); 57 getActiveLinkProperties()58 LinkProperties getActiveLinkProperties(); getLinkPropertiesForType(int networkType)59 LinkProperties getLinkPropertiesForType(int networkType); getLinkProperties(in Network network)60 LinkProperties getLinkProperties(in Network network); 61 getNetworkCapabilities(in Network network)62 NetworkCapabilities getNetworkCapabilities(in Network network); 63 getAllNetworkState()64 NetworkState[] getAllNetworkState(); 65 getActiveNetworkQuotaInfo()66 NetworkQuotaInfo getActiveNetworkQuotaInfo(); isActiveNetworkMetered()67 boolean isActiveNetworkMetered(); 68 requestRouteToHostAddress(int networkType, in byte[] hostAddress)69 boolean requestRouteToHostAddress(int networkType, in byte[] hostAddress); 70 tether(String iface)71 int tether(String iface); 72 untether(String iface)73 int untether(String iface); 74 getLastTetherError(String iface)75 int getLastTetherError(String iface); 76 isTetheringSupported()77 boolean isTetheringSupported(); 78 getTetherableIfaces()79 String[] getTetherableIfaces(); 80 getTetheredIfaces()81 String[] getTetheredIfaces(); 82 getTetheringErroredIfaces()83 String[] getTetheringErroredIfaces(); 84 getTetheredDhcpRanges()85 String[] getTetheredDhcpRanges(); 86 getTetherableUsbRegexs()87 String[] getTetherableUsbRegexs(); 88 getTetherableWifiRegexs()89 String[] getTetherableWifiRegexs(); 90 getTetherableBluetoothRegexs()91 String[] getTetherableBluetoothRegexs(); 92 setUsbTethering(boolean enable)93 int setUsbTethering(boolean enable); 94 reportInetCondition(int networkType, int percentage)95 void reportInetCondition(int networkType, int percentage); 96 reportBadNetwork(in Network network)97 void reportBadNetwork(in Network network); 98 getGlobalProxy()99 ProxyInfo getGlobalProxy(); 100 setGlobalProxy(in ProxyInfo p)101 void setGlobalProxy(in ProxyInfo p); 102 getDefaultProxy()103 ProxyInfo getDefaultProxy(); 104 setDataDependency(int networkType, boolean met)105 void setDataDependency(int networkType, boolean met); 106 prepareVpn(String oldPackage, String newPackage)107 boolean prepareVpn(String oldPackage, String newPackage); 108 setVpnPackageAuthorization(boolean authorized)109 void setVpnPackageAuthorization(boolean authorized); 110 establishVpn(in VpnConfig config)111 ParcelFileDescriptor establishVpn(in VpnConfig config); 112 getVpnConfig()113 VpnConfig getVpnConfig(); 114 startLegacyVpn(in VpnProfile profile)115 void startLegacyVpn(in VpnProfile profile); 116 getLegacyVpnInfo()117 LegacyVpnInfo getLegacyVpnInfo(); 118 updateLockdownVpn()119 boolean updateLockdownVpn(); 120 captivePortalCheckCompleted(in NetworkInfo info, boolean isCaptivePortal)121 void captivePortalCheckCompleted(in NetworkInfo info, boolean isCaptivePortal); 122 supplyMessenger(int networkType, in Messenger messenger)123 void supplyMessenger(int networkType, in Messenger messenger); 124 findConnectionTypeForIface(in String iface)125 int findConnectionTypeForIface(in String iface); 126 checkMobileProvisioning(int suggestedTimeOutMs)127 int checkMobileProvisioning(int suggestedTimeOutMs); 128 getMobileProvisioningUrl()129 String getMobileProvisioningUrl(); 130 getMobileRedirectedProvisioningUrl()131 String getMobileRedirectedProvisioningUrl(); 132 setProvisioningNotificationVisible(boolean visible, int networkType, in String action)133 void setProvisioningNotificationVisible(boolean visible, int networkType, in String action); 134 setAirplaneMode(boolean enable)135 void setAirplaneMode(boolean enable); 136 registerNetworkFactory(in Messenger messenger, in String name)137 void registerNetworkFactory(in Messenger messenger, in String name); 138 unregisterNetworkFactory(in Messenger messenger)139 void unregisterNetworkFactory(in Messenger messenger); 140 registerNetworkAgent(in Messenger messenger, in NetworkInfo ni, in LinkProperties lp, in NetworkCapabilities nc, int score, in NetworkMisc misc)141 void registerNetworkAgent(in Messenger messenger, in NetworkInfo ni, in LinkProperties lp, 142 in NetworkCapabilities nc, int score, in NetworkMisc misc); 143 requestNetwork(in NetworkCapabilities networkCapabilities, in Messenger messenger, int timeoutSec, in IBinder binder, int legacy)144 NetworkRequest requestNetwork(in NetworkCapabilities networkCapabilities, 145 in Messenger messenger, int timeoutSec, in IBinder binder, int legacy); 146 pendingRequestForNetwork(in NetworkCapabilities networkCapabilities, in PendingIntent operation)147 NetworkRequest pendingRequestForNetwork(in NetworkCapabilities networkCapabilities, 148 in PendingIntent operation); 149 releasePendingNetworkRequest(in PendingIntent operation)150 void releasePendingNetworkRequest(in PendingIntent operation); 151 listenForNetwork(in NetworkCapabilities networkCapabilities, in Messenger messenger, in IBinder binder)152 NetworkRequest listenForNetwork(in NetworkCapabilities networkCapabilities, 153 in Messenger messenger, in IBinder binder); 154 pendingListenForNetwork(in NetworkCapabilities networkCapabilities, in PendingIntent operation)155 void pendingListenForNetwork(in NetworkCapabilities networkCapabilities, 156 in PendingIntent operation); 157 releaseNetworkRequest(in NetworkRequest networkRequest)158 void releaseNetworkRequest(in NetworkRequest networkRequest); 159 getRestoreDefaultNetworkDelay(int networkType)160 int getRestoreDefaultNetworkDelay(int networkType); 161 addVpnAddress(String address, int prefixLength)162 boolean addVpnAddress(String address, int prefixLength); removeVpnAddress(String address, int prefixLength)163 boolean removeVpnAddress(String address, int prefixLength); setUnderlyingNetworksForVpn(in Network[] networks)164 boolean setUnderlyingNetworksForVpn(in Network[] networks); 165 } 166