blob: b69797e0b709b462418e6acbc1ddfdea0a067de1 [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
Vinit Deshapnde6a2d3252013-09-04 14:11:24 -070019import android.net.LinkQualityInfo;
Robert Greenwaltd192dad2010-09-14 09:18:02 -070020import android.net.LinkProperties;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080021import android.net.NetworkInfo;
Jeff Sharkeyf0ceede2011-08-02 17:22:34 -070022import android.net.NetworkQuotaInfo;
Jeff Sharkeyd2a45872011-05-28 20:56:34 -070023import android.net.NetworkState;
Jason Monk207900c2014-04-25 15:00:09 -040024import android.net.ProxyInfo;
Robert Greenwalt42acef32009-08-12 16:08:25 -070025import android.os.IBinder;
Robert Greenwalt665e1ae2012-08-21 19:27:00 -070026import android.os.Messenger;
Chia-chi Yehff3bdca2011-05-23 17:26:46 -070027import android.os.ParcelFileDescriptor;
Wink Savilleab9321d2013-06-29 21:10:57 -070028import android.os.ResultReceiver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029
Chia-chi Yeh2e467642011-07-04 03:23:12 -070030import com.android.internal.net.LegacyVpnInfo;
Chia-chi Yeh04ba25c2011-06-15 17:07:27 -070031import com.android.internal.net.VpnConfig;
Jeff Sharkey82f85212012-08-24 11:17:25 -070032import com.android.internal.net.VpnProfile;
Chia-chi Yeh04ba25c2011-06-15 17:07:27 -070033
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080034/**
35 * Interface that answers queries about, and allows changing, the
36 * state of network connectivity.
37 */
38/** {@hide} */
39interface IConnectivityManager
40{
Chad Brubakerd1c87542013-07-16 11:22:32 -070041 // Keep this in sync with framework/native/services/connectivitymanager/ConnectivityManager.h
42 void markSocketAsUser(in ParcelFileDescriptor socket, int uid);
43
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044 void setNetworkPreference(int pref);
45
46 int getNetworkPreference();
47
48 NetworkInfo getActiveNetworkInfo();
Jeff Sharkeyc006f1a2011-05-19 17:12:49 -070049 NetworkInfo getActiveNetworkInfoForUid(int uid);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050 NetworkInfo getNetworkInfo(int networkType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051 NetworkInfo[] getAllNetworkInfo();
52
Wink Saville948282b2013-08-29 08:55:16 -070053 NetworkInfo getProvisioningOrActiveNetworkInfo();
54
Robert Greenwalt9b2886e2011-08-31 11:46:42 -070055 boolean isNetworkSupported(int networkType);
56
Robert Greenwaltd192dad2010-09-14 09:18:02 -070057 LinkProperties getActiveLinkProperties();
Robert Greenwaltd192dad2010-09-14 09:18:02 -070058 LinkProperties getLinkProperties(int networkType);
59
Jeff Sharkeyd2a45872011-05-28 20:56:34 -070060 NetworkState[] getAllNetworkState();
61
Jeff Sharkeyf0ceede2011-08-02 17:22:34 -070062 NetworkQuotaInfo getActiveNetworkQuotaInfo();
Jeff Sharkey9f7cbf02012-04-12 18:34:54 -070063 boolean isActiveNetworkMetered();
Jeff Sharkeyf0ceede2011-08-02 17:22:34 -070064
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080065 boolean setRadios(boolean onOff);
66
67 boolean setRadio(int networkType, boolean turnOn);
68
Robert Greenwalt42acef32009-08-12 16:08:25 -070069 int startUsingNetworkFeature(int networkType, in String feature,
70 in IBinder binder);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080071
72 int stopUsingNetworkFeature(int networkType, in String feature);
73
Chad Brubakerf81daa92014-02-14 13:22:34 -080074 boolean requestRouteToHost(int networkType, int hostAddress, String packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080075
Chad Brubakerf81daa92014-02-14 13:22:34 -080076 boolean requestRouteToHostAddress(int networkType, in byte[] hostAddress, String packageName);
Robert Greenwalt585ac0f2010-08-27 09:24:29 -070077
Robert Greenwaltc03fa502010-02-23 18:58:05 -080078 boolean getMobileDataEnabled();
Robert Greenwaltc03fa502010-02-23 18:58:05 -080079 void setMobileDataEnabled(boolean enabled);
80
Jeff Sharkey8e28b7d2011-08-19 02:24:24 -070081 /** Policy control over specific {@link NetworkStateTracker}. */
82 void setPolicyDataEnable(int networkType, boolean enabled);
83
Robert Greenwalt5a735062010-03-02 17:25:02 -080084 int tether(String iface);
Robert Greenwaltd0e18ff2010-01-26 11:40:34 -080085
Robert Greenwalt5a735062010-03-02 17:25:02 -080086 int untether(String iface);
87
88 int getLastTetherError(String iface);
Robert Greenwaltd0e18ff2010-01-26 11:40:34 -080089
Robert Greenwalt2a091d72010-02-11 18:18:40 -080090 boolean isTetheringSupported();
91
Robert Greenwaltd0e18ff2010-01-26 11:40:34 -080092 String[] getTetherableIfaces();
93
94 String[] getTetheredIfaces();
Robert Greenwalt2a091d72010-02-11 18:18:40 -080095
Robert Greenwalt5a735062010-03-02 17:25:02 -080096 String[] getTetheringErroredIfaces();
97
Robert Greenwalt2a091d72010-02-11 18:18:40 -080098 String[] getTetherableUsbRegexs();
99
100 String[] getTetherableWifiRegexs();
Robert Greenwalt14f2ef42010-06-15 12:19:37 -0700101
Danica Chang6fdd0c62010-08-11 14:54:43 -0700102 String[] getTetherableBluetoothRegexs();
103
Mike Lockwood6c2260b2011-07-19 13:04:47 -0700104 int setUsbTethering(boolean enable);
105
Robert Greenwalt14f2ef42010-06-15 12:19:37 -0700106 void requestNetworkTransitionWakelock(in String forWhom);
Robert Greenwaltca4306c2010-09-09 13:15:32 -0700107
Robert Greenwaltd7085fc2010-09-08 15:24:47 -0700108 void reportInetCondition(int networkType, int percentage);
Robert Greenwalt434203a2010-10-11 16:00:27 -0700109
Jason Monk207900c2014-04-25 15:00:09 -0400110 ProxyInfo getGlobalProxy();
Robert Greenwalt434203a2010-10-11 16:00:27 -0700111
Jason Monk207900c2014-04-25 15:00:09 -0400112 void setGlobalProxy(in ProxyInfo p);
Robert Greenwalt434203a2010-10-11 16:00:27 -0700113
Jason Monk207900c2014-04-25 15:00:09 -0400114 ProxyInfo getProxy();
Robert Greenwaltd55a6b42011-03-25 13:09:25 -0700115
116 void setDataDependency(int networkType, boolean met);
Chia-chi Yehff3bdca2011-05-23 17:26:46 -0700117
Chia-chi Yeh5779c9c2011-07-14 16:19:19 -0700118 boolean protectVpn(in ParcelFileDescriptor socket);
Chia-chi Yehff3bdca2011-05-23 17:26:46 -0700119
Chia-chi Yeh100155a2011-07-03 16:52:38 -0700120 boolean prepareVpn(String oldPackage, String newPackage);
Chia-chi Yehff3bdca2011-05-23 17:26:46 -0700121
Chia-chi Yeh04ba25c2011-06-15 17:07:27 -0700122 ParcelFileDescriptor establishVpn(in VpnConfig config);
Chia-chi Yeh77fd4852011-07-02 17:15:00 -0700123
Chad Brubakerbf6ff2c2013-07-16 18:59:12 -0700124 VpnConfig getVpnConfig();
125
Jeff Sharkey82f85212012-08-24 11:17:25 -0700126 void startLegacyVpn(in VpnProfile profile);
Chia-chi Yeh2e467642011-07-04 03:23:12 -0700127
128 LegacyVpnInfo getLegacyVpnInfo();
Jeff Sharkey69ddab42012-08-25 00:05:46 -0700129
130 boolean updateLockdownVpn();
Irfan Sheriffda6da092012-08-16 12:49:23 -0700131
Wink Savilled747cbc2013-08-07 16:22:47 -0700132 void captivePortalCheckCompleted(in NetworkInfo info, boolean isCaptivePortal);
133
Robert Greenwalt665e1ae2012-08-21 19:27:00 -0700134 void supplyMessenger(int networkType, in Messenger messenger);
Robert Greenwalt1b0ca9d2013-04-22 11:13:02 -0700135
136 int findConnectionTypeForIface(in String iface);
Wink Savilleab9321d2013-06-29 21:10:57 -0700137
Wink Saville948282b2013-08-29 08:55:16 -0700138 int checkMobileProvisioning(int suggestedTimeOutMs);
Robert Greenwalte182bfe2013-07-16 12:06:09 -0700139
140 String getMobileProvisioningUrl();
Wink Saville42d4f082013-07-20 20:31:59 -0700141
142 String getMobileRedirectedProvisioningUrl();
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -0700143
Vinit Deshapnde6a2d3252013-09-04 14:11:24 -0700144 LinkQualityInfo getLinkQualityInfo(int networkType);
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -0700145
Vinit Deshapnde6a2d3252013-09-04 14:11:24 -0700146 LinkQualityInfo getActiveLinkQualityInfo();
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -0700147
Vinit Deshapnde6a2d3252013-09-04 14:11:24 -0700148 LinkQualityInfo[] getAllLinkQualityInfo();
Vinit Deshapnde1f12cb52013-08-21 13:09:01 -0700149
Wink Saville948282b2013-08-29 08:55:16 -0700150 void setProvisioningNotificationVisible(boolean visible, int networkType, in String extraInfo, in String url);
Yuhao Zheng5cd1a0e2013-09-09 17:00:04 -0700151
152 void setAirplaneMode(boolean enable);
Robert Greenwalte049c232014-04-11 15:53:27 -0700153
154 void registerNetworkFactory(in Messenger messenger);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800155}