IConnectivityManager.aidl revision 1f12cb52a494a3eaefc62d03a8d2fdf47a5535e9
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.net.LinkInfo;
20import android.net.LinkProperties;
21import android.net.NetworkInfo;
22import android.net.NetworkQuotaInfo;
23import android.net.NetworkState;
24import android.net.ProxyProperties;
25import android.os.IBinder;
26import android.os.Messenger;
27import android.os.ParcelFileDescriptor;
28import android.os.ResultReceiver;
29
30import com.android.internal.net.LegacyVpnInfo;
31import com.android.internal.net.VpnConfig;
32import com.android.internal.net.VpnProfile;
33
34/**
35 * Interface that answers queries about, and allows changing, the
36 * state of network connectivity.
37 */
38/** {@hide} */
39interface IConnectivityManager
40{
41    // Keep this in sync with framework/native/services/connectivitymanager/ConnectivityManager.h
42    void markSocketAsUser(in ParcelFileDescriptor socket, int uid);
43
44    void setNetworkPreference(int pref);
45
46    int getNetworkPreference();
47
48    NetworkInfo getActiveNetworkInfo();
49    NetworkInfo getActiveNetworkInfoForUid(int uid);
50    NetworkInfo getNetworkInfo(int networkType);
51    NetworkInfo[] getAllNetworkInfo();
52
53    boolean isNetworkSupported(int networkType);
54
55    LinkProperties getActiveLinkProperties();
56    LinkProperties getLinkProperties(int networkType);
57
58    NetworkState[] getAllNetworkState();
59
60    NetworkQuotaInfo getActiveNetworkQuotaInfo();
61    boolean isActiveNetworkMetered();
62
63    boolean setRadios(boolean onOff);
64
65    boolean setRadio(int networkType, boolean turnOn);
66
67    int startUsingNetworkFeature(int networkType, in String feature,
68            in IBinder binder);
69
70    int stopUsingNetworkFeature(int networkType, in String feature);
71
72    boolean requestRouteToHost(int networkType, int hostAddress);
73
74    boolean requestRouteToHostAddress(int networkType, in byte[] hostAddress);
75
76    boolean getMobileDataEnabled();
77    void setMobileDataEnabled(boolean enabled);
78
79    /** Policy control over specific {@link NetworkStateTracker}. */
80    void setPolicyDataEnable(int networkType, boolean enabled);
81
82    int tether(String iface);
83
84    int untether(String iface);
85
86    int getLastTetherError(String iface);
87
88    boolean isTetheringSupported();
89
90    String[] getTetherableIfaces();
91
92    String[] getTetheredIfaces();
93
94    /**
95     * Return list of interface pairs that are actively tethered.  Even indexes are
96     * remote interface, and odd indexes are corresponding local interfaces.
97     */
98    String[] getTetheredIfacePairs();
99
100    String[] getTetheringErroredIfaces();
101
102    String[] getTetherableUsbRegexs();
103
104    String[] getTetherableWifiRegexs();
105
106    String[] getTetherableBluetoothRegexs();
107
108    int setUsbTethering(boolean enable);
109
110    void requestNetworkTransitionWakelock(in String forWhom);
111
112    void reportInetCondition(int networkType, int percentage);
113
114    ProxyProperties getGlobalProxy();
115
116    void setGlobalProxy(in ProxyProperties p);
117
118    ProxyProperties getProxy();
119
120    void setDataDependency(int networkType, boolean met);
121
122    boolean protectVpn(in ParcelFileDescriptor socket);
123
124    boolean prepareVpn(String oldPackage, String newPackage);
125
126    ParcelFileDescriptor establishVpn(in VpnConfig config);
127
128    VpnConfig getVpnConfig();
129
130    void startLegacyVpn(in VpnProfile profile);
131
132    LegacyVpnInfo getLegacyVpnInfo();
133
134    boolean updateLockdownVpn();
135
136    void captivePortalCheckComplete(in NetworkInfo info);
137
138    void captivePortalCheckCompleted(in NetworkInfo info, boolean isCaptivePortal);
139
140    void supplyMessenger(int networkType, in Messenger messenger);
141
142    int findConnectionTypeForIface(in String iface);
143
144    int checkMobileProvisioning(boolean sendNotification, int suggestedTimeOutMs, in ResultReceiver resultReceiver);
145
146    String getMobileProvisioningUrl();
147
148    String getMobileRedirectedProvisioningUrl();
149
150    LinkInfo getLinkInfo(int networkType);
151
152    LinkInfo getActiveLinkInfo();
153
154    LinkInfo[] getAllLinkInfo();
155
156}
157