blob: 92aeff27478016663178d578a63dd08ac76d054c [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/**
2 * Copyright (c) 2008, The Android Open Source Project
3 *
Danica Chang6fdd0c62010-08-11 14:54:43 -07004 * 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
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007 *
Danica Chang6fdd0c62010-08-11 14:54:43 -07008 * http://www.apache.org/licenses/LICENSE-2.0
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009 *
Danica Chang6fdd0c62010-08-11 14:54:43 -070010 * 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
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080014 * limitations under the License.
15 */
16
17package android.net;
18
Robert Greenwaltd192dad2010-09-14 09:18:02 -070019import android.net.LinkProperties;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.net.NetworkInfo;
Jeff Sharkeyf0ceede2011-08-02 17:22:34 -070021import android.net.NetworkQuotaInfo;
Jeff Sharkeyd2a45872011-05-28 20:56:34 -070022import android.net.NetworkState;
Robert Greenwalt434203a2010-10-11 16:00:27 -070023import android.net.ProxyProperties;
Robert Greenwalt42acef32009-08-12 16:08:25 -070024import android.os.IBinder;
Chia-chi Yehff3bdca2011-05-23 17:26:46 -070025import android.os.ParcelFileDescriptor;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080026
Chia-chi Yeh2e467642011-07-04 03:23:12 -070027import com.android.internal.net.LegacyVpnInfo;
Chia-chi Yeh04ba25c2011-06-15 17:07:27 -070028import com.android.internal.net.VpnConfig;
29
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030/**
31 * Interface that answers queries about, and allows changing, the
32 * state of network connectivity.
33 */
34/** {@hide} */
35interface IConnectivityManager
36{
37 void setNetworkPreference(int pref);
38
39 int getNetworkPreference();
40
41 NetworkInfo getActiveNetworkInfo();
Jeff Sharkeyc006f1a2011-05-19 17:12:49 -070042 NetworkInfo getActiveNetworkInfoForUid(int uid);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043 NetworkInfo getNetworkInfo(int networkType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044 NetworkInfo[] getAllNetworkInfo();
45
Robert Greenwalt9b2886e2011-08-31 11:46:42 -070046 boolean isNetworkSupported(int networkType);
47
Robert Greenwaltd192dad2010-09-14 09:18:02 -070048 LinkProperties getActiveLinkProperties();
Robert Greenwaltd192dad2010-09-14 09:18:02 -070049 LinkProperties getLinkProperties(int networkType);
50
Jeff Sharkeyd2a45872011-05-28 20:56:34 -070051 NetworkState[] getAllNetworkState();
52
Jeff Sharkeyf0ceede2011-08-02 17:22:34 -070053 NetworkQuotaInfo getActiveNetworkQuotaInfo();
Jeff Sharkey9f7cbf02012-04-12 18:34:54 -070054 boolean isActiveNetworkMetered();
Jeff Sharkeyf0ceede2011-08-02 17:22:34 -070055
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056 boolean setRadios(boolean onOff);
57
58 boolean setRadio(int networkType, boolean turnOn);
59
Robert Greenwalt42acef32009-08-12 16:08:25 -070060 int startUsingNetworkFeature(int networkType, in String feature,
61 in IBinder binder);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080062
63 int stopUsingNetworkFeature(int networkType, in String feature);
64
65 boolean requestRouteToHost(int networkType, int hostAddress);
66
Robert Greenwalt585ac0f2010-08-27 09:24:29 -070067 boolean requestRouteToHostAddress(int networkType, in byte[] hostAddress);
68
Robert Greenwaltc03fa502010-02-23 18:58:05 -080069 boolean getMobileDataEnabled();
Robert Greenwaltc03fa502010-02-23 18:58:05 -080070 void setMobileDataEnabled(boolean enabled);
71
Jeff Sharkey8e28b7d2011-08-19 02:24:24 -070072 /** Policy control over specific {@link NetworkStateTracker}. */
73 void setPolicyDataEnable(int networkType, boolean enabled);
74
Robert Greenwalt5a735062010-03-02 17:25:02 -080075 int tether(String iface);
Robert Greenwaltd0e18ff2010-01-26 11:40:34 -080076
Robert Greenwalt5a735062010-03-02 17:25:02 -080077 int untether(String iface);
78
79 int getLastTetherError(String iface);
Robert Greenwaltd0e18ff2010-01-26 11:40:34 -080080
Robert Greenwalt2a091d72010-02-11 18:18:40 -080081 boolean isTetheringSupported();
82
Robert Greenwaltd0e18ff2010-01-26 11:40:34 -080083 String[] getTetherableIfaces();
84
85 String[] getTetheredIfaces();
Robert Greenwalt2a091d72010-02-11 18:18:40 -080086
Jeff Sharkeycdd02c5d2011-09-16 01:52:49 -070087 /**
88 * Return list of interface pairs that are actively tethered. Even indexes are
89 * remote interface, and odd indexes are corresponding local interfaces.
90 */
91 String[] getTetheredIfacePairs();
92
Robert Greenwalt5a735062010-03-02 17:25:02 -080093 String[] getTetheringErroredIfaces();
94
Robert Greenwalt2a091d72010-02-11 18:18:40 -080095 String[] getTetherableUsbRegexs();
96
97 String[] getTetherableWifiRegexs();
Robert Greenwalt14f2ef42010-06-15 12:19:37 -070098
Danica Chang6fdd0c62010-08-11 14:54:43 -070099 String[] getTetherableBluetoothRegexs();
100
Mike Lockwood6c2260b2011-07-19 13:04:47 -0700101 int setUsbTethering(boolean enable);
102
Robert Greenwalt14f2ef42010-06-15 12:19:37 -0700103 void requestNetworkTransitionWakelock(in String forWhom);
Robert Greenwaltca4306c2010-09-09 13:15:32 -0700104
Robert Greenwaltd7085fc2010-09-08 15:24:47 -0700105 void reportInetCondition(int networkType, int percentage);
Robert Greenwalt434203a2010-10-11 16:00:27 -0700106
107 ProxyProperties getGlobalProxy();
108
109 void setGlobalProxy(in ProxyProperties p);
110
111 ProxyProperties getProxy();
Robert Greenwaltd55a6b42011-03-25 13:09:25 -0700112
113 void setDataDependency(int networkType, boolean met);
Chia-chi Yehff3bdca2011-05-23 17:26:46 -0700114
Chia-chi Yeh5779c9c2011-07-14 16:19:19 -0700115 boolean protectVpn(in ParcelFileDescriptor socket);
Chia-chi Yehff3bdca2011-05-23 17:26:46 -0700116
Chia-chi Yeh100155a2011-07-03 16:52:38 -0700117 boolean prepareVpn(String oldPackage, String newPackage);
Chia-chi Yehff3bdca2011-05-23 17:26:46 -0700118
Chia-chi Yeh04ba25c2011-06-15 17:07:27 -0700119 ParcelFileDescriptor establishVpn(in VpnConfig config);
Chia-chi Yeh77fd4852011-07-02 17:15:00 -0700120
Chia-chi Yeh2e467642011-07-04 03:23:12 -0700121 void startLegacyVpn(in VpnConfig config, in String[] racoon, in String[] mtpd);
122
123 LegacyVpnInfo getLegacyVpnInfo();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800124}