Remove hidden API usage of isNetworkSupported
isNetworkSupported(TYPE_MOBILE) is equivalent to
TelephonyManager.isDataCapable, as the former is set based on the
latter.
Bug: 182859030
Test: atest CarrierConfigManagerTest
Change-Id: Iaf5e8c193ff7e20475e2a25c89a58a6cbaff538d
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/CarrierConfigManagerTest.java b/tests/tests/telephony/current/src/android/telephony/cts/CarrierConfigManagerTest.java
index 97c8a51..f9175be 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/CarrierConfigManagerTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/CarrierConfigManagerTest.java
@@ -43,7 +43,6 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
-import android.net.ConnectivityManager;
import android.os.Looper;
import android.os.PersistableBundle;
import android.platform.test.annotations.SecurityTest;
@@ -107,9 +106,7 @@
* the device supports cellular data.
*/
private boolean hasTelephony() {
- ConnectivityManager mgr =
- (ConnectivityManager) getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
- return mgr.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
+ return mTelephonyManager.isDataCapable();
}
private boolean isSimCardPresent() {