Home
last modified time | relevance | path

Searched refs:connectivityManager (Results 1 – 25 of 32) sorted by relevance

12

/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/network/
DNetworkUtilsTest.java39 ConnectivityManager connectivityManager = mock(ConnectivityManager.class); in hasMobileNetwork_hasCellularCapabilities_returnsTrue() local
43 when(connectivityManager.getAllNetworks()).thenReturn(new Network[]{network}); in hasMobileNetwork_hasCellularCapabilities_returnsTrue()
44 when(connectivityManager.getNetworkCapabilities(network)).thenReturn(capabilities); in hasMobileNetwork_hasCellularCapabilities_returnsTrue()
47 assertThat(NetworkUtils.hasMobileNetwork(connectivityManager)).isTrue(); in hasMobileNetwork_hasCellularCapabilities_returnsTrue()
52 ConnectivityManager connectivityManager = mock(ConnectivityManager.class); in hasMobileNetwork_hasNoCellularCapabilities_returnsFalse() local
56 when(connectivityManager.getAllNetworks()).thenReturn(new Network[]{network}); in hasMobileNetwork_hasNoCellularCapabilities_returnsFalse()
57 when(connectivityManager.getNetworkCapabilities(network)).thenReturn(capabilities); in hasMobileNetwork_hasNoCellularCapabilities_returnsFalse()
60 assertThat(NetworkUtils.hasMobileNetwork(connectivityManager)).isFalse(); in hasMobileNetwork_hasNoCellularCapabilities_returnsFalse()
/packages/apps/StorageManager/src/com/android/storagemanager/automatic/
DJobPreconditions.java18 ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService( in isNetworkMetered() local
20 if (connectivityManager != null) { in isNetworkMetered()
21 return connectivityManager.isActiveNetworkMetered(); in isNetworkMetered()
27 ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService( in isWifiConnected() local
29 if (connectivityManager != null) { in isWifiConnected()
30 for (Network network : connectivityManager.getAllNetworks()) { in isWifiConnected()
31 NetworkInfo networkInfo = connectivityManager.getNetworkInfo(network); in isWifiConnected()
/packages/services/Mms/src/com/android/mms/service/
DMmsNetworkManager.java212 final ConnectivityManager connectivityManager = getConnectivityManager(); in startNewNetworkRequestLocked() local
214 connectivityManager.requestNetwork( in startNewNetworkRequestLocked()
225 final ConnectivityManager connectivityManager = getConnectivityManager(); in releaseRequestLocked() local
227 connectivityManager.unregisterNetworkCallback(callback); in releaseRequestLocked()
291 final ConnectivityManager connectivityManager = getConnectivityManager(); in getApnName() local
292 final NetworkInfo mmsNetworkInfo = connectivityManager.getNetworkInfo(network); in getApnName()
/packages/apps/Dialer/java/com/android/dialer/common/
DNetworkUtil.java44 ConnectivityManager connectivityManager = in getCurrentNetworkType() local
46 return getNetworkType(connectivityManager.getActiveNetworkInfo()); in getCurrentNetworkType()
56 ConnectivityManager connectivityManager = in getCurrentNetworkInfo() local
58 return connectivityManager.getActiveNetworkInfo(); in getCurrentNetworkInfo()
70 ConnectivityManager connectivityManager = in getCurrentNetworkTypeName() local
72 NetworkInfo netInfo = connectivityManager.getActiveNetworkInfo(); in getCurrentNetworkTypeName()
/packages/apps/Settings/src/com/android/settings/datausage/
DDataUsageUtils.java97 ConnectivityManager connectivityManager = ConnectivityManager.from(context); in hasMobileData() local
98 return connectivityManager != null && connectivityManager in hasMobileData()
146 final ConnectivityManager connectivityManager = ConnectivityManager.from(context); in hasWifiRadio() local
147 return connectivityManager != null && connectivityManager.isNetworkSupported(TYPE_WIFI); in hasWifiRadio()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/datausage/
DDataUsageUtils.java96 ConnectivityManager connectivityManager = ConnectivityManager.from(context); in hasMobileData() local
97 return connectivityManager != null && connectivityManager in hasMobileData()
145 final ConnectivityManager connectivityManager = ConnectivityManager.from(context); in hasWifiRadio() local
146 return connectivityManager != null && connectivityManager.isNetworkSupported(TYPE_WIFI); in hasWifiRadio()
/packages/apps/Settings/tests/robotests/src/com/android/settings/datetime/
DAutoTimeZonePreferenceControllerTest.java51 private ShadowConnectivityManager connectivityManager; field in AutoTimeZonePreferenceControllerTest
58 connectivityManager = extract(mContext.getSystemService(ConnectivityManager.class)); in setUp()
59 connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, true); in setUp()
80 connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, false); in isWifiOnly_notAvailable()
98 connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, false); in isWifiOnly_notEnable()
/packages/apps/Settings/tests/robotests/src/com/android/settings/deviceinfo/firmwareversion/
DBasebandVersionPreferenceControllerTest.java57 final ShadowConnectivityManager connectivityManager = in getAvailability_wifiOnly_unavailable() local
59 connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, false); in getAvailability_wifiOnly_unavailable()
68 ShadowConnectivityManager connectivityManager = in getAvailability_hasMobile_available() local
70 connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, true); in getAvailability_hasMobile_available()
/packages/apps/Dialer/java/com/android/voicemail/impl/sync/
DVvmNetworkRequestCallback.java54 private ConnectivityManager connectivityManager; field in VvmNetworkRequestCallback
170 if (connectivityManager == null) { in getConnectivityManager()
171 connectivityManager = in getConnectivityManager()
174 return connectivityManager; in getConnectivityManager()
/packages/apps/TV/src/com/android/tv/util/
DNetworkUtils.java33 public static boolean isNetworkAvailable(@Nullable ConnectivityManager connectivityManager) { in isNetworkAvailable() argument
34 if (connectivityManager == null) { in isNetworkAvailable()
37 NetworkInfo info = connectivityManager.getActiveNetworkInfo(); in isNetworkAvailable()
/packages/apps/Dialer/java/com/android/incallui/calllocation/impl/
DLocationHelper.java168 private final ConnectivityManager connectivityManager; field in LocationHelper.LocationHelperInternal
176 connectivityManager = in LocationHelperInternal()
244 if (connectivityManager == null) { in isConnected()
247 NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); in isConnected()
/packages/services/BuiltInPrintService/src/com/android/bips/util/
DWifiMonitor.java46 ConnectivityManager connectivityManager = in WifiMonitor() local
48 if (connectivityManager == null) { in WifiMonitor()
57 NetworkInfo info = connectivityManager.getActiveNetworkInfo(); in WifiMonitor()
/packages/apps/Car/Settings/src/com/android/car/settings/network/
DNetworkUtils.java36 public static boolean hasMobileNetwork(ConnectivityManager connectivityManager) { in hasMobileNetwork() argument
37 Network[] networks = connectivityManager.getAllNetworks(); in hasMobileNetwork()
39 NetworkCapabilities capabilities = connectivityManager.getNetworkCapabilities(network); in hasMobileNetwork()
/packages/apps/Settings/src/com/android/settings/
DSettingsDumpService.java104 ConnectivityManager connectivityManager = getSystemService(ConnectivityManager.class); in dumpDataUsage() local
107 if (connectivityManager.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)) { in dumpDataUsage()
118 if (connectivityManager.isNetworkSupported(ConnectivityManager.TYPE_WIFI)) { in dumpDataUsage()
121 if (connectivityManager.isNetworkSupported(ConnectivityManager.TYPE_ETHERNET)) { in dumpDataUsage()
DResetNetworkConfirm.java92 ConnectivityManager connectivityManager = (ConnectivityManager) in doInBackground() local
94 if (connectivityManager != null) { in doInBackground()
95 connectivityManager.factoryReset(); in doInBackground()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/
DSettingsDumpService.java104 ConnectivityManager connectivityManager = getSystemService(ConnectivityManager.class); in dumpDataUsage() local
107 if (connectivityManager.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)) { in dumpDataUsage()
118 if (connectivityManager.isNetworkSupported(ConnectivityManager.TYPE_WIFI)) { in dumpDataUsage()
121 if (connectivityManager.isNetworkSupported(ConnectivityManager.TYPE_ETHERNET)) { in dumpDataUsage()
DResetNetworkConfirm.java121 ConnectivityManager connectivityManager = (ConnectivityManager)
123 if (connectivityManager != null) {
124 connectivityManager.factoryReset();
/packages/apps/Settings/tests/robotests/src/com/android/settings/network/
DMobileNetworkPreferenceControllerTest.java96 ShadowConnectivityManager connectivityManager = in secondaryUser_prefIsNotAvailable() local
98 connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, true); in secondaryUser_prefIsNotAvailable()
108 ShadowConnectivityManager connectivityManager = in wifiOnly_prefIsNotAvailable() local
110 connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, false); in wifiOnly_prefIsNotAvailable()
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/appinfo/
DAppDataUsagePreferenceControllerTest.java101 final ConnectivityManager connectivityManager = mock(ConnectivityManager.class); in onResume_isAvailable_shouldRestartDataLoader() local
103 .thenReturn(connectivityManager); in onResume_isAvailable_shouldRestartDataLoader()
104 when(connectivityManager.isNetworkSupported(anyInt())).thenReturn(true); in onResume_isAvailable_shouldRestartDataLoader()
/packages/apps/Settings/tests/robotests/src/com/android/settings/
DUtilsTest.java86 private ConnectivityManager connectivityManager; field in UtilsTest
106 .thenReturn(connectivityManager); in setUp()
116 when(connectivityManager.getLinkProperties(network)).thenReturn(lp); in getWifiIpAddresses_succeeds()
125 when(connectivityManager.getLinkProperties(network)).thenReturn(null); in getWifiIpAddresses_nullLinkProperties()
/packages/apps/Car/Settings/src/com/android/car/settings/system/
DResetNetworkConfirmFragment.java87 ConnectivityManager connectivityManager = (ConnectivityManager) in resetNetwork() local
89 if (connectivityManager != null) { in resetNetwork()
90 connectivityManager.factoryReset(); in resetNetwork()
/packages/apps/Email/provider_src/com/android/email/provider/
DRefreshStatusMonitor.java86 final ConnectivityManager connectivityManager = in isConnected() local
88 final NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); in isConnected()
/packages/apps/Settings/src/com/android/settings/wifi/
DWifiEnabler.java91 ConnectivityManager connectivityManager) { in WifiEnabler() argument
97 mConnectivityManager = connectivityManager; in WifiEnabler()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/wifi/
DWifiEnabler.java91 ConnectivityManager connectivityManager) { in WifiEnabler() argument
97 mConnectivityManager = connectivityManager; in WifiEnabler()
/packages/apps/UnifiedEmail/src/com/android/mail/utils/
DAttachmentUtils.java283 ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService( in canDownloadAttachment() local
285 NetworkInfo info = connectivityManager.getActiveNetworkInfo(); in canDownloadAttachment()

12