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

Commit 3b78d753 authored by Jayachandran C's avatar Jayachandran C
Browse files

Remove usage of Telephonymanager getDefault() hidden API

This CL changes to use getSystemService(TelephonyManager.class)

Bug: 140768340
Test: Build
Change-Id: I428ab53fd18e70a3532870039d14129d025412b3
parent af357413
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -321,7 +321,11 @@ class GnssNetworkConnectivityHandler {

    private void handleUpdateNetworkState(Network network, boolean isConnected,
            NetworkCapabilities capabilities) {
        boolean networkAvailable = isConnected && TelephonyManager.getDefault().getDataEnabled();
        boolean networkAvailable = false;
        TelephonyManager telephonyManager = mContext.getSystemService(TelephonyManager.class);
        if (telephonyManager != null) {
            networkAvailable = isConnected && telephonyManager.getDataEnabled();
        }
        NetworkAttributes networkAttributes = updateTrackedNetworksState(isConnected, network,
                capabilities);
        String apn = networkAttributes.mApn;