Merge "Replace CM#isNetworkSupported() with checking FEATURE_TELEPHONY" am: ac06b167f9

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649305

Change-Id: I4a4bb433b565539d33dfeb515a277b0b61a2aa91
This commit is contained in:
Lucas Lin
2021-03-24 04:44:17 +00:00
committed by Automerger Merge Worker

View File

@@ -20,7 +20,7 @@ import android.annotation.Nullable;
import android.app.AlarmManager;
import android.content.ContentResolver;
import android.content.Context;
import android.net.ConnectivityManager;
import android.content.pm.PackageManager;
import android.os.SystemProperties;
import android.provider.Settings;
@@ -52,9 +52,7 @@ public final class TimeZoneDetectorCallbackImpl implements TimeZoneDetectorStrat
}
private boolean deviceHasTelephonyNetwork() {
// TODO b/150583524 Avoid the use of a deprecated API.
return mContext.getSystemService(ConnectivityManager.class)
.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
}
@Override