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.net.LinkProperties; 20 import android.net.NetworkInfo; 21 import android.net.NetworkQuotaInfo; 22 import android.net.NetworkState; 23 import android.net.ProxyProperties; 24 import android.os.IBinder; 25 import android.os.ParcelFileDescriptor; 26 27 import com.android.internal.net.LegacyVpnInfo; 28 import com.android.internal.net.VpnConfig; 29 import com.android.internal.net.VpnProfile; 30 31 /** 32 * Interface that answers queries about, and allows changing, the 33 * state of network connectivity. 34 */ 35 /** {@hide} */ 36 interface IConnectivityManager 37 { setNetworkPreference(int pref)38 void setNetworkPreference(int pref); 39 getNetworkPreference()40 int getNetworkPreference(); 41 getActiveNetworkInfo()42 NetworkInfo getActiveNetworkInfo(); getActiveNetworkInfoForUid(int uid)43 NetworkInfo getActiveNetworkInfoForUid(int uid); getNetworkInfo(int networkType)44 NetworkInfo getNetworkInfo(int networkType); getAllNetworkInfo()45 NetworkInfo[] getAllNetworkInfo(); 46 isNetworkSupported(int networkType)47 boolean isNetworkSupported(int networkType); 48 getActiveLinkProperties()49 LinkProperties getActiveLinkProperties(); getLinkProperties(int networkType)50 LinkProperties getLinkProperties(int networkType); 51 getAllNetworkState()52 NetworkState[] getAllNetworkState(); 53 getActiveNetworkQuotaInfo()54 NetworkQuotaInfo getActiveNetworkQuotaInfo(); isActiveNetworkMetered()55 boolean isActiveNetworkMetered(); 56 setRadios(boolean onOff)57 boolean setRadios(boolean onOff); 58 setRadio(int networkType, boolean turnOn)59 boolean setRadio(int networkType, boolean turnOn); 60 startUsingNetworkFeature(int networkType, in String feature, in IBinder binder)61 int startUsingNetworkFeature(int networkType, in String feature, 62 in IBinder binder); 63 stopUsingNetworkFeature(int networkType, in String feature)64 int stopUsingNetworkFeature(int networkType, in String feature); 65 requestRouteToHost(int networkType, int hostAddress)66 boolean requestRouteToHost(int networkType, int hostAddress); 67 requestRouteToHostAddress(int networkType, in byte[] hostAddress)68 boolean requestRouteToHostAddress(int networkType, in byte[] hostAddress); 69 getMobileDataEnabled()70 boolean getMobileDataEnabled(); setMobileDataEnabled(boolean enabled)71 void setMobileDataEnabled(boolean enabled); 72 73 /** Policy control over specific {@link NetworkStateTracker}. */ setPolicyDataEnable(int networkType, boolean enabled)74 void setPolicyDataEnable(int networkType, boolean enabled); 75 tether(String iface)76 int tether(String iface); 77 untether(String iface)78 int untether(String iface); 79 getLastTetherError(String iface)80 int getLastTetherError(String iface); 81 isTetheringSupported()82 boolean isTetheringSupported(); 83 getTetherableIfaces()84 String[] getTetherableIfaces(); 85 getTetheredIfaces()86 String[] getTetheredIfaces(); 87 88 /** 89 * Return list of interface pairs that are actively tethered. Even indexes are 90 * remote interface, and odd indexes are corresponding local interfaces. 91 */ getTetheredIfacePairs()92 String[] getTetheredIfacePairs(); 93 getTetheringErroredIfaces()94 String[] getTetheringErroredIfaces(); 95 getTetherableUsbRegexs()96 String[] getTetherableUsbRegexs(); 97 getTetherableWifiRegexs()98 String[] getTetherableWifiRegexs(); 99 getTetherableBluetoothRegexs()100 String[] getTetherableBluetoothRegexs(); 101 setUsbTethering(boolean enable)102 int setUsbTethering(boolean enable); 103 requestNetworkTransitionWakelock(in String forWhom)104 void requestNetworkTransitionWakelock(in String forWhom); 105 reportInetCondition(int networkType, int percentage)106 void reportInetCondition(int networkType, int percentage); 107 getGlobalProxy()108 ProxyProperties getGlobalProxy(); 109 setGlobalProxy(in ProxyProperties p)110 void setGlobalProxy(in ProxyProperties p); 111 getProxy()112 ProxyProperties getProxy(); 113 setDataDependency(int networkType, boolean met)114 void setDataDependency(int networkType, boolean met); 115 protectVpn(in ParcelFileDescriptor socket)116 boolean protectVpn(in ParcelFileDescriptor socket); 117 prepareVpn(String oldPackage, String newPackage)118 boolean prepareVpn(String oldPackage, String newPackage); 119 establishVpn(in VpnConfig config)120 ParcelFileDescriptor establishVpn(in VpnConfig config); 121 startLegacyVpn(in VpnProfile profile)122 void startLegacyVpn(in VpnProfile profile); 123 getLegacyVpnInfo()124 LegacyVpnInfo getLegacyVpnInfo(); 125 updateLockdownVpn()126 boolean updateLockdownVpn(); 127 captivePortalCheckComplete(in NetworkInfo info)128 void captivePortalCheckComplete(in NetworkInfo info); 129 } 130