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

Commit dcbc7c3d authored by Jack Yu's avatar Jack Yu
Browse files

Fixed misleading debug messages

The data network type of a NetworkInfo was incorrectly
set. Connectivity service debug messages were showing
incorrect network type which is misleading.

Fixed by using transport type to get the correct data
network type.

Test: Manual
Bug: 138660856
Merged-In: I717d1d736273cbbd2df39486b72e6954904f693c
Change-Id: I717d1d736273cbbd2df39486b72e6954904f693c
(cherry picked from commit 924c4bb2)
parent c292b197
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -585,7 +585,14 @@ public class DataConnection extends StateMachine {
        ServiceState ss = mPhone.getServiceState();
        mRilRat = ss.getRilDataRadioTechnology();
        mDataRegState = mPhone.getServiceState().getDataRegState();
        int networkType = ss.getDataNetworkType();
        int networkType = TelephonyManager.NETWORK_TYPE_UNKNOWN;

        NetworkRegistrationInfo nri = ss.getNetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_PS, mTransportType);
        if (nri != null) {
            networkType = nri.getAccessNetworkTechnology();
        }

        mNetworkInfo = new NetworkInfo(ConnectivityManager.TYPE_MOBILE,
                networkType, NETWORK_TYPE, TelephonyManager.getNetworkTypeName(networkType));
        mNetworkInfo.setRoaming(ss.getDataRoaming());
@@ -1614,7 +1621,14 @@ public class DataConnection extends StateMachine {

    private void updateNetworkInfo() {
        final ServiceState state = mPhone.getServiceState();
        final int subtype = state.getDataNetworkType();

        NetworkRegistrationInfo nri = state.getNetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_PS, mTransportType);
        int subtype = TelephonyManager.NETWORK_TYPE_UNKNOWN;
        if (nri != null) {
            subtype = nri.getAccessNetworkTechnology();
        }

        mNetworkInfo.setSubtype(subtype, TelephonyManager.getNetworkTypeName(subtype));
        mNetworkInfo.setRoaming(state.getDataRoaming());
    }