Merge "Replace CM#isNetworkSupported() with checking FEATURE_TELEPHONY" into sc-dev

This commit is contained in:
Lucas Lin
2021-03-22 12:06:48 +00:00
committed by Android (Google) Code Review

View File

@@ -18,8 +18,8 @@ package com.android.server.timezonedetector;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.net.ConnectivityManager;
import android.os.SystemProperties;
import android.util.ArraySet;
@@ -124,9 +124,7 @@ public final class ServiceConfigAccessor {
* device.
*/
public boolean isTelephonyTimeZoneDetectionFeatureSupported() {
// 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);
}
/**