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