Home
last modified time | relevance | path

Searched refs:ConnectivityManager (Results 1 – 25 of 173) sorted by relevance

1234567

/frameworks/base/tests/net/java/android/net/
DConnectivityManagerTest.java51 import android.net.ConnectivityManager;
52 import android.net.ConnectivityManager.NetworkCallback;
85 final NetworkCapabilities nc = ConnectivityManager.networkCapabilitiesForType(legacyType); in verifyNetworkCapabilities()
120 ConnectivityManager.TYPE_MOBILE, TRANSPORT_CELLULAR); in testNetworkCapabilitiesForTypeMobile()
126 ConnectivityManager.TYPE_MOBILE_CBS, NET_CAPABILITY_CBS); in testNetworkCapabilitiesForTypeMobileCbs()
132 ConnectivityManager.TYPE_MOBILE_DUN, NET_CAPABILITY_DUN); in testNetworkCapabilitiesForTypeMobileDun()
138 ConnectivityManager.TYPE_MOBILE_FOTA, NET_CAPABILITY_FOTA); in testNetworkCapabilitiesForTypeMobileFota()
144 ConnectivityManager.TYPE_MOBILE_HIPRI, TRANSPORT_CELLULAR); in testNetworkCapabilitiesForTypeMobileHipri()
150 ConnectivityManager.TYPE_MOBILE_IMS, NET_CAPABILITY_IMS); in testNetworkCapabilitiesForTypeMobileIms()
156 ConnectivityManager.TYPE_MOBILE_MMS, in testNetworkCapabilitiesForTypeMobileMms()
[all …]
/frameworks/base/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/
DConnectivityManagerMobileTest.java19 import android.net.ConnectivityManager;
57 if (!waitForNetworkState(ConnectivityManager.TYPE_MOBILE, in setUp()
89 ConnectivityManager.TYPE_MOBILE, State.CONNECTED, LONG_TIMEOUT)); in test3GToWifiNotification()
93 assertEquals("active network is not mobile", ConnectivityManager.TYPE_MOBILE, ni.getType()); in test3GToWifiNotification()
124 ConnectivityManager.TYPE_WIFI, State.CONNECTED, WIFI_CONNECTION_TIMEOUT)); in testConnectToWifi()
148 ConnectivityManager.TYPE_WIFI, State.CONNECTED, WIFI_CONNECTION_TIMEOUT)); in testConnectToWifWithKnownAP()
160 ConnectivityManager.TYPE_MOBILE, State.CONNECTED, LONG_TIMEOUT)); in testConnectToWifWithKnownAP()
172 ConnectivityManager.TYPE_WIFI, State.CONNECTED, WIFI_CONNECTION_TIMEOUT)); in testConnectToWifWithKnownAP()
196 ConnectivityManager.TYPE_WIFI, State.CONNECTED, WIFI_CONNECTION_TIMEOUT)); in testDisconnectWifi()
206 assertTrue("mobile not enabled", waitForNetworkState(ConnectivityManager.TYPE_MOBILE, in testDisconnectWifi()
[all …]
/frameworks/ex/common/java/com/android/common/
DNetworkConnectivityListener.java23 import android.net.ConnectivityManager;
68 if (!action.equals(ConnectivityManager.CONNECTIVITY_ACTION) || in onReceive()
75 intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false); in onReceive()
84 intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO); in onReceive()
86 intent.getParcelableExtra(ConnectivityManager.EXTRA_OTHER_NETWORK_INFO); in onReceive()
88 mReason = intent.getStringExtra(ConnectivityManager.EXTRA_REASON); in onReceive()
90 intent.getBooleanExtra(ConnectivityManager.EXTRA_IS_FAILOVER, false); in onReceive()
142 filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); in startListening()
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/hotspot2/
DOsuNetworkConnectionTest.java34 import android.net.ConnectivityManager;
81 @Mock ConnectivityManager mConnectivityManager;
217 ArgumentCaptor<ConnectivityManager.NetworkCallback> networkCallbackCaptor = in verifyNetworkCallbackInvokedWhenConnected()
218 ArgumentCaptor.forClass(ConnectivityManager.NetworkCallback.class); in verifyNetworkCallbackInvokedWhenConnected()
221 ConnectivityManager.NetworkCallback callback = networkCallbackCaptor.getValue(); in verifyNetworkCallbackInvokedWhenConnected()
231 verify(mConnectivityManager).unregisterNetworkCallback(any(ConnectivityManager in verifyNetworkCallbackInvokedWhenConnected()
247 ArgumentCaptor<ConnectivityManager.NetworkCallback> networkCallbackCaptor = in verifyNetworkCallbackWithoutOnAvailable()
248 ArgumentCaptor.forClass(ConnectivityManager.NetworkCallback.class); in verifyNetworkCallbackWithoutOnAvailable()
251 ConnectivityManager.NetworkCallback callback = networkCallbackCaptor.getValue(); in verifyNetworkCallbackWithoutOnAvailable()
270 ArgumentCaptor<ConnectivityManager.NetworkCallback> networkCallbackCaptor = in verifyNetworkConnectionTimeout()
[all …]
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/deviceinfo/
DSimStatusImeiInfoPreferenceControllerTest.java23 import android.net.ConnectivityManager;
60 extract(RuntimeEnvironment.application.getSystemService(ConnectivityManager.class)); in testIsAvailable_isAdminAndHasMobile_shouldReturnTrue()
61 connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, true); in testIsAvailable_isAdminAndHasMobile_shouldReturnTrue()
72 extract(RuntimeEnvironment.application.getSystemService(ConnectivityManager.class)); in testIsAvailable_isAdminButNoMobile_shouldReturnFalse()
73 connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, false); in testIsAvailable_isAdminButNoMobile_shouldReturnFalse()
102 @Implements(ConnectivityManager.class)
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/deviceinfo/
DAbstractIpAddressPreferenceController.java20 import android.net.ConnectivityManager;
44 ConnectivityManager.CONNECTIVITY_ACTION,
50 private final ConnectivityManager mCM;
54 mCM = context.getSystemService(ConnectivityManager.class); in AbstractIpAddressPreferenceController()
95 private static String getDefaultIpAddresses(ConnectivityManager cm) { in getDefaultIpAddresses()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/
DHotspotControllerImpl.java23 import android.net.ConnectivityManager;
46 private final ConnectivityManager mConnectivityManager;
61 (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); in HotspotControllerImpl()
152 mConnectivityManager.startTethering(ConnectivityManager.TETHERING_WIFI, false, in setHotspotEnabled()
153 new ConnectivityManager.OnStartTetheringCallback() { in setHotspotEnabled()
162 mConnectivityManager.stopTethering(ConnectivityManager.TETHERING_WIFI); in setHotspotEnabled()
206 mConnectivityManager.stopTethering(ConnectivityManager.TETHERING_WIFI); in maybeResetSoftApState()
/frameworks/base/samples/training/network-usage/src/com/example/android/networkusage/
DNetworkActivity.java23 import android.net.ConnectivityManager;
88 IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION); in onCreate()
129 ConnectivityManager connMgr = in updateConnectedFlags()
130 (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); in updateConnectedFlags()
134 wifiConnected = activeInfo.getType() == ConnectivityManager.TYPE_WIFI; in updateConnectedFlags()
135 mobileConnected = activeInfo.getType() == ConnectivityManager.TYPE_MOBILE; in updateConnectedFlags()
290 ConnectivityManager connMgr = in onReceive()
291 (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); in onReceive()
299 && networkInfo.getType() == ConnectivityManager.TYPE_WIFI) { in onReceive()
/frameworks/base/services/core/java/com/android/server/connectivity/tethering/
DUpstreamNetworkMonitor.java19 import static android.net.ConnectivityManager.TYPE_MOBILE_DUN;
20 import static android.net.ConnectivityManager.TYPE_MOBILE_HIPRI;
21 import static android.net.ConnectivityManager.TYPE_NONE;
22 import static android.net.ConnectivityManager.getNetworkTypeName;
28 import android.net.ConnectivityManager;
29 import android.net.ConnectivityManager.NetworkCallback;
95 private ConnectivityManager mCM;
120 ConnectivityManager cm, StateMachine tgt, SharedLog log, int what) { in UpstreamNetworkMonitor()
197 .setCapabilities(ConnectivityManager.networkCapabilitiesForType(legacyType)) in registerMobileNetworkRequest()
391 private ConnectivityManager cm() { in cm()
[all …]
DEntitlementManager.java19 import static android.net.ConnectivityManager.EXTRA_ADD_TETHER_TYPE;
20 import static android.net.ConnectivityManager.EXTRA_PROVISION_CALLBACK;
21 import static android.net.ConnectivityManager.EXTRA_RUN_PROVISION;
22 import static android.net.ConnectivityManager.TETHERING_BLUETOOTH;
23 import static android.net.ConnectivityManager.TETHERING_INVALID;
24 import static android.net.ConnectivityManager.TETHERING_USB;
25 import static android.net.ConnectivityManager.TETHERING_WIFI;
26 import static android.net.ConnectivityManager.TETHER_ERROR_ENTITLEMENT_UNKONWN;
27 import static android.net.ConnectivityManager.TETHER_ERROR_NO_ERROR;
28 import static android.net.ConnectivityManager.TETHER_ERROR_PROVISION_FAILED;
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/net/
DDataUsageController.java19 import static android.net.ConnectivityManager.TYPE_MOBILE;
30 import android.net.ConnectivityManager;
62 private final ConnectivityManager mConnectivityManager;
74 mConnectivityManager = ConnectivityManager.from(context); in DataUsageController()
248 return ConnectivityManager.TYPE_NONE; in getNetworkType()
254 return ConnectivityManager.TYPE_MOBILE; in getNetworkType()
257 return ConnectivityManager.TYPE_WIFI; in getNetworkType()
259 return ConnectivityManager.TYPE_ETHERNET; in getNetworkType()
261 return ConnectivityManager.TYPE_MOBILE; in getNetworkType()
/frameworks/base/core/java/com/android/server/net/
DNetworkPinner.java20 import android.net.ConnectivityManager;
21 import android.net.ConnectivityManager.NetworkCallback;
68 private static ConnectivityManager sCM;
81 sCM = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); in maybeInitConnectivityManager()
/frameworks/base/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/
DConnectivityManagerTestBase.java24 import android.net.ConnectivityManager;
74 protected ConnectivityManager mCm;
101 if (!action.equals(ConnectivityManager.CONNECTIVITY_ACTION)) { in onReceive()
128 mCm = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE); in setUp()
135 new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); in setUp()
144 mIntentFilter.addAction(ConnectivityManager.ACTION_TETHER_STATE_CHANGED); in setUp()
245 return (mCm.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_MOBILE); in isConnectedToMobile()
250 return (mCm.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIFI); in isConnectedToWifi()
480 waitForNetworkState(ConnectivityManager.TYPE_WIFI, in connectToWifi()
/frameworks/base/services/core/java/com/android/server/location/
DGnssNetworkConnectivityHandler.java21 import android.net.ConnectivityManager;
89 private final ConnectivityManager mConnMgr;
111 private int mType = ConnectivityManager.TYPE_NONE;
151 private ConnectivityManager.NetworkCallback mNetworkConnectivityCallback;
158 private ConnectivityManager.NetworkCallback mSuplConnectivityCallback;
177 mConnMgr = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE); in GnssNetworkConnectivityHandler()
226 private ConnectivityManager.NetworkCallback createNetworkConnectivityCallback() { in createNetworkConnectivityCallback()
227 return new ConnectivityManager.NetworkCallback() { in createNetworkConnectivityCallback()
278 private ConnectivityManager.NetworkCallback createSuplConnectivityCallback() { in createSuplConnectivityCallback()
279 return new ConnectivityManager.NetworkCallback() { in createSuplConnectivityCallback()
[all …]
/frameworks/base/services/net/java/android/net/ip/
DIpServer.java25 import android.net.ConnectivityManager;
230 mLastError = ConnectivityManager.TETHER_ERROR_NO_ERROR; in IpServer()
329 mLastError = ConnectivityManager.TETHER_ERROR_DHCPSERVER_ERROR; in handleError()
364 mLastError = ConnectivityManager.TETHER_ERROR_DHCPSERVER_ERROR; in stopDhcp()
400 if (mInterfaceType == ConnectivityManager.TETHERING_USB) { in configureIPv4()
403 } else if (mInterfaceType == ConnectivityManager.TETHERING_WIFI) { in configureIPv4()
423 if (mInterfaceType == ConnectivityManager.TETHERING_WIFI) { in configureIPv4()
699 mLastError = ConnectivityManager.TETHER_ERROR_NO_ERROR; in processMessage()
728 mLastError = ConnectivityManager.TETHER_ERROR_IFACE_CFG_ERROR; in enter()
736 mLastError = ConnectivityManager.TETHER_ERROR_TETHER_IFACE_ERROR; in enter()
[all …]
/frameworks/base/services/core/java/com/android/server/connectivity/
DDataConnectionStats.java23 import android.net.ConnectivityManager;
64 filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); in startMonitoring()
65 filter.addAction(ConnectivityManager.INET_CONDITION_ACTION); in startMonitoring()
75 } else if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION) || in onReceive()
76 action.equals(ConnectivityManager.INET_CONDITION_ACTION)) { in onReceive()
DMultipathPolicyTracker.java19 import static android.net.ConnectivityManager.MULTIPATH_PREFERENCE_HANDOVER;
20 import static android.net.ConnectivityManager.MULTIPATH_PREFERENCE_RELIABILITY;
21 import static android.net.ConnectivityManager.TYPE_MOBILE;
41 import android.net.ConnectivityManager;
42 import android.net.ConnectivityManager.NetworkCallback;
108 private ConnectivityManager mCM;
146 mCM = mContext.getSystemService(ConnectivityManager.class); in start()
266 ConnectivityManager.TYPE_MOBILE, in getTemplateMatchingNetworkIdentity()
452 mMobileNetworkCallback = new ConnectivityManager.NetworkCallback() { in registerTrackMobileCallback()
551 DebugUtils.flagsToString(ConnectivityManager.class, "MULTIPATH_PREFERENCE_", in dump()
/frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/
DDeviceStateMonitorTest.java30 import android.net.ConnectivityManager;
83 Intent intent = new Intent(ConnectivityManager.ACTION_TETHER_STATE_CHANGED); in testTethering()
84 intent.putExtra(ConnectivityManager.EXTRA_ACTIVE_TETHER, new ArrayList<>(asList("abc"))); in testTethering()
93 intent = new Intent(ConnectivityManager.ACTION_TETHER_STATE_CHANGED); in testTethering()
94 intent.putExtra(ConnectivityManager.EXTRA_ACTIVE_TETHER, new ArrayList<>()); in testTethering()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/wifi/
DWifiStatusTracker.java19 import android.net.ConnectivityManager;
39 public class WifiStatusTracker extends ConnectivityManager.NetworkCallback {
44 private final ConnectivityManager mConnectivityManager;
58 private final ConnectivityManager.NetworkCallback mNetworkCallback = new ConnectivityManager
79 NetworkScoreManager networkScoreManager, ConnectivityManager connectivityManager, in WifiStatusTracker()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/
DTetherUtil.java21 import android.net.ConnectivityManager;
59 final ConnectivityManager cm = context.getSystemService(ConnectivityManager.class); in isTetherAvailable()
/frameworks/base/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/
DConnectionUtil.java30 import android.net.ConnectivityManager;
70 private ConnectivityManager mCM;
79 private static final int NUM_NETWORK_TYPES = ConnectivityManager.MAX_NETWORK_TYPE + 1;
95 new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); in initialize()
113 mCM = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE); in initialize()
152 if (!action.equals(ConnectivityManager.CONNECTIVITY_ACTION)) { in onReceive()
157 final ConnectivityManager connManager = (ConnectivityManager) context in onReceive()
161 if (intent.hasExtra(ConnectivityManager.EXTRA_OTHER_NETWORK_INFO)) { in onReceive()
163 intent.getParcelableExtra(ConnectivityManager.EXTRA_OTHER_NETWORK_INFO); in onReceive()
518 NetworkInfo networkInfo = mCM.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); in isConnectedToMobile()
[all …]
/frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/
DApnContext.java20 import android.net.ConnectivityManager;
538 case ConnectivityManager.TYPE_MOBILE: in getApnTypeFromNetworkType()
540 case ConnectivityManager.TYPE_MOBILE_MMS: in getApnTypeFromNetworkType()
542 case ConnectivityManager.TYPE_MOBILE_SUPL: in getApnTypeFromNetworkType()
544 case ConnectivityManager.TYPE_MOBILE_DUN: in getApnTypeFromNetworkType()
546 case ConnectivityManager.TYPE_MOBILE_FOTA: in getApnTypeFromNetworkType()
548 case ConnectivityManager.TYPE_MOBILE_IMS: in getApnTypeFromNetworkType()
550 case ConnectivityManager.TYPE_MOBILE_CBS: in getApnTypeFromNetworkType()
552 case ConnectivityManager.TYPE_MOBILE_IA: in getApnTypeFromNetworkType()
554 case ConnectivityManager.TYPE_MOBILE_EMERGENCY: in getApnTypeFromNetworkType()
/frameworks/base/core/java/android/util/
DNtpTrustedTime.java23 import android.net.ConnectivityManager;
47 private ConnectivityManager mCM;
90 mCM = sContext.getSystemService(ConnectivityManager.class); in forceRefresh()
107 mCM = sContext.getSystemService(ConnectivityManager.class); in forceRefresh()
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/
DTestUtil.java22 import android.net.ConnectivityManager;
109 Intent intent = new Intent(ConnectivityManager.ACTION_TETHER_STATE_CHANGED); in sendTetherStateChanged()
110 intent.putExtra(ConnectivityManager.EXTRA_AVAILABLE_TETHER, available); in sendTetherStateChanged()
111 intent.putExtra(ConnectivityManager.EXTRA_ACTIVE_TETHER, active); in sendTetherStateChanged()
/frameworks/opt/net/ethernet/java/com/android/server/ethernet/
DEthernetNetworkFactory.java19 import static android.net.ConnectivityManager.TYPE_ETHERNET;
25 import android.net.ConnectivityManager;
288 new TransportInfo(ConnectivityManager.TYPE_NONE, 30)); in sTransports.put()
291 new TransportInfo(ConnectivityManager.TYPE_NONE, 1)); in sTransports.put()
294 new TransportInfo(ConnectivityManager.TYPE_ETHERNET, 70)); in sTransports.put()
297 new TransportInfo(ConnectivityManager.TYPE_BLUETOOTH, 69)); in sTransports.put()
300 new TransportInfo(ConnectivityManager.TYPE_WIFI, 60)); in sTransports.put()
303 new TransportInfo(ConnectivityManager.TYPE_MOBILE, 50)); in sTransports.put()
362 int legacyType = ConnectivityManager.TYPE_NONE; in NetworkInterfaceState()
399 return ConnectivityManager.TYPE_NONE; in getLegacyType()

1234567