Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fb8626b authored by lucaslin's avatar lucaslin Committed by Lucas Lin
Browse files

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
parent 6dae2c8f
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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);
    }

    /**