IConnectivityManager.aidl revision 403aa2684e0e93b4792aabc0bbe1f32ac5e417af
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    NetworkCapabilities[] getDefaultNetworkCapabilitiesForUser(int userId);
53
54    NetworkInfo getProvisioningOrActiveNetworkInfo();
55
56    boolean isNetworkSupported(int networkType);
57
58    LinkProperties getActiveLinkProperties();
59    LinkProperties getLinkPropertiesForType(int networkType);
60    LinkProperties getLinkProperties(in Network network);
61
62    NetworkCapabilities getNetworkCapabilities(in Network network);
63
64    NetworkState[] getAllNetworkState();
65
66    NetworkQuotaInfo getActiveNetworkQuotaInfo();
67    boolean isActiveNetworkMetered();
68
69    boolean requestRouteToHostAddress(int networkType, in byte[] hostAddress);
70
71    /** Policy control over specific {@link NetworkStateTracker}. */
72    void setPolicyDataEnable(int networkType, boolean enabled);
73
74    int tether(String iface);
75
76    int untether(String iface);
77
78    int getLastTetherError(String iface);
79
80    boolean isTetheringSupported();
81
82    String[] getTetherableIfaces();
83
84    String[] getTetheredIfaces();
85
86    String[] getTetheringErroredIfaces();
87
88    String[] getTetheredDhcpRanges();
89
90    String[] getTetherableUsbRegexs();
91
92    String[] getTetherableWifiRegexs();
93
94    String[] getTetherableBluetoothRegexs();
95
96    int setUsbTethering(boolean enable);
97
98    void reportInetCondition(int networkType, int percentage);
99
100    void reportBadNetwork(in Network network);
101
102    ProxyInfo getGlobalProxy();
103
104    void setGlobalProxy(in ProxyInfo p);
105
106    ProxyInfo getProxy();
107
108    void setDataDependency(int networkType, boolean met);
109
110    boolean prepareVpn(String oldPackage, String newPackage);
111
112    void setVpnPackageAuthorization(boolean authorized);
113
114    ParcelFileDescriptor establishVpn(in VpnConfig config);
115
116    VpnConfig getVpnConfig();
117
118    void startLegacyVpn(in VpnProfile profile);
119
120    LegacyVpnInfo getLegacyVpnInfo();
121
122    boolean updateLockdownVpn();
123
124    void captivePortalCheckCompleted(in NetworkInfo info, boolean isCaptivePortal);
125
126    void supplyMessenger(int networkType, in Messenger messenger);
127
128    int findConnectionTypeForIface(in String iface);
129
130    int checkMobileProvisioning(int suggestedTimeOutMs);
131
132    String getMobileProvisioningUrl();
133
134    String getMobileRedirectedProvisioningUrl();
135
136    void setProvisioningNotificationVisible(boolean visible, int networkType, in String action);
137
138    void setAirplaneMode(boolean enable);
139
140    void registerNetworkFactory(in Messenger messenger, in String name);
141
142    void unregisterNetworkFactory(in Messenger messenger);
143
144    void registerNetworkAgent(in Messenger messenger, in NetworkInfo ni, in LinkProperties lp,
145            in NetworkCapabilities nc, int score, in NetworkMisc misc);
146
147    NetworkRequest requestNetwork(in NetworkCapabilities networkCapabilities,
148            in Messenger messenger, int timeoutSec, in IBinder binder, int legacy);
149
150    NetworkRequest pendingRequestForNetwork(in NetworkCapabilities networkCapabilities,
151            in PendingIntent operation);
152
153    void releasePendingNetworkRequest(in PendingIntent operation);
154
155    NetworkRequest listenForNetwork(in NetworkCapabilities networkCapabilities,
156            in Messenger messenger, in IBinder binder);
157
158    void pendingListenForNetwork(in NetworkCapabilities networkCapabilities,
159            in PendingIntent operation);
160
161    void releaseNetworkRequest(in NetworkRequest networkRequest);
162
163    int getRestoreDefaultNetworkDelay(int networkType);
164
165    boolean addVpnAddress(String address, int prefixLength);
166    boolean removeVpnAddress(String address, int prefixLength);
167    boolean setUnderlyingNetworksForVpn(in Network[] networks);
168}
169