IConnectivityManager.aidl revision 75f018e6a7c2280c62e686440000a1dcdf5179cf
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
17package android.net;
18
19import android.app.PendingIntent;
20import android.net.LinkProperties;
21import android.net.Network;
22import android.net.NetworkCapabilities;
23import android.net.NetworkInfo;
24import android.net.NetworkMisc;
25import android.net.NetworkQuotaInfo;
26import android.net.NetworkRequest;
27import android.net.NetworkState;
28import android.net.ProxyInfo;
29import android.os.IBinder;
30import android.os.Messenger;
31import android.os.ParcelFileDescriptor;
32import android.os.ResultReceiver;
33
34import com.android.internal.net.LegacyVpnInfo;
35import com.android.internal.net.VpnConfig;
36import com.android.internal.net.VpnProfile;
37
38/**
39 * Interface that answers queries about, and allows changing, the
40 * state of network connectivity.
41 */
42/** {@hide} */
43interface IConnectivityManager
44{
45    NetworkInfo getActiveNetworkInfo();
46    NetworkInfo getActiveNetworkInfoForUid(int uid);
47    NetworkInfo getNetworkInfo(int networkType);
48    NetworkInfo getNetworkInfoForNetwork(in Network network);
49    NetworkInfo[] getAllNetworkInfo();
50    Network getNetworkForType(int networkType);
51    Network[] getAllNetworks();
52
53    NetworkInfo getProvisioningOrActiveNetworkInfo();
54
55    boolean isNetworkSupported(int networkType);
56
57    LinkProperties getActiveLinkProperties();
58    LinkProperties getLinkPropertiesForType(int networkType);
59    LinkProperties getLinkProperties(in Network network);
60
61    NetworkCapabilities getNetworkCapabilities(in Network network);
62
63    NetworkState[] getAllNetworkState();
64
65    NetworkQuotaInfo getActiveNetworkQuotaInfo();
66    boolean isActiveNetworkMetered();
67
68    boolean requestRouteToHostAddress(int networkType, in byte[] hostAddress);
69
70    /** Policy control over specific {@link NetworkStateTracker}. */
71    void setPolicyDataEnable(int networkType, boolean enabled);
72
73    int tether(String iface);
74
75    int untether(String iface);
76
77    int getLastTetherError(String iface);
78
79    boolean isTetheringSupported();
80
81    String[] getTetherableIfaces();
82
83    String[] getTetheredIfaces();
84
85    String[] getTetheringErroredIfaces();
86
87    String[] getTetheredDhcpRanges();
88
89    String[] getTetherableUsbRegexs();
90
91    String[] getTetherableWifiRegexs();
92
93    String[] getTetherableBluetoothRegexs();
94
95    int setUsbTethering(boolean enable);
96
97    void reportInetCondition(int networkType, int percentage);
98
99    void reportBadNetwork(in Network network);
100
101    ProxyInfo getGlobalProxy();
102
103    void setGlobalProxy(in ProxyInfo p);
104
105    ProxyInfo getProxy();
106
107    void setDataDependency(int networkType, boolean met);
108
109    boolean prepareVpn(String oldPackage, String newPackage);
110
111    void setVpnPackageAuthorization(boolean authorized);
112
113    ParcelFileDescriptor establishVpn(in VpnConfig config);
114
115    VpnConfig getVpnConfig();
116
117    void startLegacyVpn(in VpnProfile profile);
118
119    LegacyVpnInfo getLegacyVpnInfo();
120
121    boolean updateLockdownVpn();
122
123    void captivePortalCheckCompleted(in NetworkInfo info, boolean isCaptivePortal);
124
125    void supplyMessenger(int networkType, in Messenger messenger);
126
127    int findConnectionTypeForIface(in String iface);
128
129    int checkMobileProvisioning(int suggestedTimeOutMs);
130
131    String getMobileProvisioningUrl();
132
133    String getMobileRedirectedProvisioningUrl();
134
135    void setProvisioningNotificationVisible(boolean visible, int networkType, in String action);
136
137    void setAirplaneMode(boolean enable);
138
139    void registerNetworkFactory(in Messenger messenger, in String name);
140
141    void unregisterNetworkFactory(in Messenger messenger);
142
143    void registerNetworkAgent(in Messenger messenger, in NetworkInfo ni, in LinkProperties lp,
144            in NetworkCapabilities nc, int score, in NetworkMisc misc);
145
146    NetworkRequest requestNetwork(in NetworkCapabilities networkCapabilities,
147            in Messenger messenger, int timeoutSec, in IBinder binder, int legacy);
148
149    NetworkRequest pendingRequestForNetwork(in NetworkCapabilities networkCapabilities,
150            in PendingIntent operation);
151
152    void releasePendingNetworkRequest(in PendingIntent operation);
153
154    NetworkRequest listenForNetwork(in NetworkCapabilities networkCapabilities,
155            in Messenger messenger, in IBinder binder);
156
157    void pendingListenForNetwork(in NetworkCapabilities networkCapabilities,
158            in PendingIntent operation);
159
160    void releaseNetworkRequest(in NetworkRequest networkRequest);
161
162    int getRestoreDefaultNetworkDelay(int networkType);
163
164    boolean addVpnAddress(String address, int prefixLength);
165    boolean removeVpnAddress(String address, int prefixLength);
166}
167