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