diff options
| author | 2021-03-19 18:13:00 +0800 | |
|---|---|---|
| committer | 2021-03-19 18:39:11 +0000 | |
| commit | 3fb8626b94c7f387be484073f27ea11e44e06a9d (patch) | |
| tree | 8f5c8bc42ab0ae5ce1112115843b44dbc0dc3445 | |
| parent | 6dae2c8f594aeae578923c3e94df775522eb4b10 (diff) | |
Replace CM#isNetworkSupported() with checking FEATURE_TELEPHONY
ConnectivityManager will be a part of mainline module, so its
hidden API cannot be called by external caller.
Replace ConnectivityManager#isNetworkSupported() with
checking FEATURE_TELEPHONY.
Bug: 182963397
Test: m
Change-Id: I457459554e5e6fe0874b8db81c6547035a6603b8
| -rw-r--r-- | services/core/java/com/android/server/timezonedetector/ServiceConfigAccessor.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/timezonedetector/ServiceConfigAccessor.java b/services/core/java/com/android/server/timezonedetector/ServiceConfigAccessor.java index 2452c8d3ddc9..222e852728f5 100644 --- a/services/core/java/com/android/server/timezonedetector/ServiceConfigAccessor.java +++ b/services/core/java/com/android/server/timezonedetector/ServiceConfigAccessor.java @@ -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); } /** |