blob: 57f5967e61a7c5234e2d4ebe3462b63e33c863c7 [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 Sharkeyd2a45872011-05-28 20:56:34 -070021import android.net.NetworkState;
Robert Greenwalt434203a2010-10-11 16:00:27 -070022import android.net.ProxyProperties;
Robert Greenwalt42acef32009-08-12 16:08:25 -070023import android.os.IBinder;
Chia-chi Yehff3bdca2011-05-23 17:26:46 -070024import android.os.ParcelFileDescriptor;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025
Chia-chi Yeh04ba25c2011-06-15 17:07:27 -070026import com.android.internal.net.VpnConfig;
27
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080028/**
29 * Interface that answers queries about, and allows changing, the
30 * state of network connectivity.
31 */
32/** {@hide} */
33interface IConnectivityManager
34{
35 void setNetworkPreference(int pref);
36
37 int getNetworkPreference();
38
39 NetworkInfo getActiveNetworkInfo();
Jeff Sharkeyc006f1a2011-05-19 17:12:49 -070040 NetworkInfo getActiveNetworkInfoForUid(int uid);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080041 NetworkInfo getNetworkInfo(int networkType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042 NetworkInfo[] getAllNetworkInfo();
43
Robert Greenwaltd192dad2010-09-14 09:18:02 -070044 LinkProperties getActiveLinkProperties();
Robert Greenwaltd192dad2010-09-14 09:18:02 -070045 LinkProperties getLinkProperties(int networkType);
46
Jeff Sharkeyd2a45872011-05-28 20:56:34 -070047 NetworkState[] getAllNetworkState();
48
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049 boolean setRadios(boolean onOff);
50
51 boolean setRadio(int networkType, boolean turnOn);
52
Robert Greenwalt42acef32009-08-12 16:08:25 -070053 int startUsingNetworkFeature(int networkType, in String feature,
54 in IBinder binder);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080055
56 int stopUsingNetworkFeature(int networkType, in String feature);
57
58 boolean requestRouteToHost(int networkType, int hostAddress);
59
Robert Greenwalt585ac0f2010-08-27 09:24:29 -070060 boolean requestRouteToHostAddress(int networkType, in byte[] hostAddress);
61
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080062 boolean getBackgroundDataSetting();
63
64 void setBackgroundDataSetting(boolean allowBackgroundData);
Robert Greenwaltd0e18ff2010-01-26 11:40:34 -080065
Robert Greenwaltc03fa502010-02-23 18:58:05 -080066 boolean getMobileDataEnabled();
67
68 void setMobileDataEnabled(boolean enabled);
69
Robert Greenwalt5a735062010-03-02 17:25:02 -080070 int tether(String iface);
Robert Greenwaltd0e18ff2010-01-26 11:40:34 -080071
Robert Greenwalt5a735062010-03-02 17:25:02 -080072 int untether(String iface);
73
74 int getLastTetherError(String iface);
Robert Greenwaltd0e18ff2010-01-26 11:40:34 -080075
Robert Greenwalt2a091d72010-02-11 18:18:40 -080076 boolean isTetheringSupported();
77
Robert Greenwaltd0e18ff2010-01-26 11:40:34 -080078 String[] getTetherableIfaces();
79
80 String[] getTetheredIfaces();
Robert Greenwalt2a091d72010-02-11 18:18:40 -080081
Robert Greenwalt5a735062010-03-02 17:25:02 -080082 String[] getTetheringErroredIfaces();
83
Robert Greenwalt2a091d72010-02-11 18:18:40 -080084 String[] getTetherableUsbRegexs();
85
86 String[] getTetherableWifiRegexs();
Robert Greenwalt14f2ef42010-06-15 12:19:37 -070087
Danica Chang6fdd0c62010-08-11 14:54:43 -070088 String[] getTetherableBluetoothRegexs();
89
Robert Greenwalt14f2ef42010-06-15 12:19:37 -070090 void requestNetworkTransitionWakelock(in String forWhom);
Robert Greenwaltca4306c2010-09-09 13:15:32 -070091
Robert Greenwaltd7085fc2010-09-08 15:24:47 -070092 void reportInetCondition(int networkType, int percentage);
Robert Greenwalt434203a2010-10-11 16:00:27 -070093
94 ProxyProperties getGlobalProxy();
95
96 void setGlobalProxy(in ProxyProperties p);
97
98 ProxyProperties getProxy();
Robert Greenwaltd55a6b42011-03-25 13:09:25 -070099
100 void setDataDependency(int networkType, boolean met);
Chia-chi Yehff3bdca2011-05-23 17:26:46 -0700101
102 void protectVpn(in ParcelFileDescriptor socket);
103
Chia-chi Yeh100155a2011-07-03 16:52:38 -0700104 boolean prepareVpn(String oldPackage, String newPackage);
Chia-chi Yehff3bdca2011-05-23 17:26:46 -0700105
Chia-chi Yeh04ba25c2011-06-15 17:07:27 -0700106 ParcelFileDescriptor establishVpn(in VpnConfig config);
Chia-chi Yeh77fd4852011-07-02 17:15:00 -0700107
108 void doLegacyVpn(in VpnConfig config, in String[] racoon, in String[] mtpd);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800109}