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 17 package android.net; 18 19 import android.net.NetworkInfo; 20 import android.os.IBinder; 21 22 /** 23 * Interface that answers queries about, and allows changing, the 24 * state of network connectivity. 25 */ 26 /** {@hide} */ 27 interface IConnectivityManager 28 { setNetworkPreference(int pref)29 void setNetworkPreference(int pref); 30 getNetworkPreference()31 int getNetworkPreference(); 32 getActiveNetworkInfo()33 NetworkInfo getActiveNetworkInfo(); 34 getNetworkInfo(int networkType)35 NetworkInfo getNetworkInfo(int networkType); 36 getAllNetworkInfo()37 NetworkInfo[] getAllNetworkInfo(); 38 setRadios(boolean onOff)39 boolean setRadios(boolean onOff); 40 setRadio(int networkType, boolean turnOn)41 boolean setRadio(int networkType, boolean turnOn); 42 startUsingNetworkFeature(int networkType, in String feature, in IBinder binder)43 int startUsingNetworkFeature(int networkType, in String feature, 44 in IBinder binder); 45 stopUsingNetworkFeature(int networkType, in String feature)46 int stopUsingNetworkFeature(int networkType, in String feature); 47 requestRouteToHost(int networkType, int hostAddress)48 boolean requestRouteToHost(int networkType, int hostAddress); 49 getBackgroundDataSetting()50 boolean getBackgroundDataSetting(); 51 setBackgroundDataSetting(boolean allowBackgroundData)52 void setBackgroundDataSetting(boolean allowBackgroundData); 53 getMobileDataEnabled()54 boolean getMobileDataEnabled(); 55 setMobileDataEnabled(boolean enabled)56 void setMobileDataEnabled(boolean enabled); 57 tether(String iface)58 int tether(String iface); 59 untether(String iface)60 int untether(String iface); 61 getLastTetherError(String iface)62 int getLastTetherError(String iface); 63 isTetheringSupported()64 boolean isTetheringSupported(); 65 getTetherableIfaces()66 String[] getTetherableIfaces(); 67 getTetheredIfaces()68 String[] getTetheredIfaces(); 69 getTetheringErroredIfaces()70 String[] getTetheringErroredIfaces(); 71 getTetherableUsbRegexs()72 String[] getTetherableUsbRegexs(); 73 getTetherableWifiRegexs()74 String[] getTetherableWifiRegexs(); 75 reportInetCondition(int networkType, int percentage)76 void reportInetCondition(int networkType, int percentage); 77 } 78