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

Commit 39117387 authored by sangyun's avatar sangyun
Browse files

API: Separates getting roaming according to overridden or non-overridden

1. New API
 - TelephonyDisplayInfo#IsRoaming returns true if device is roaming
   overridden by carrier config.
 - NetworkRegistrationInfo #isNetworkRoaming, #isNetworkRegistered,
   #isNetworkSearching and #getNetworkResitrationState return
   roaming value of network without overridden by carrier config or
   overlay resource.
2. Deprecated API
 - NetworkRegistrationInfo #isRoaming, #isRegistered, #isSearching
   and #getResitrationState.

Bug: 260017781
Test: atest CtsTelephonyTestCases:NetworkRegistrationInfoTest
Change-Id: I025b64145caa772b27c410ae5836224f2e922fa1
parent 331e4ee4
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -43514,9 +43514,12 @@ package android.telephony {
    method public int getDomain();
    method @Nullable public String getRegisteredPlmn();
    method public int getTransportType();
    method public boolean isRegistered();
    method public boolean isRoaming();
    method public boolean isSearching();
    method public boolean isNetworkRegistered();
    method public boolean isNetworkRoaming();
    method public boolean isNetworkSearching();
    method @Deprecated public boolean isRegistered();
    method @Deprecated public boolean isRoaming();
    method @Deprecated public boolean isSearching();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.NetworkRegistrationInfo> CREATOR;
    field public static final int DOMAIN_CS = 1; // 0x1
@@ -44282,6 +44285,7 @@ package android.telephony {
    method public int describeContents();
    method public int getNetworkType();
    method public int getOverrideNetworkType();
    method public boolean isRoaming();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.TelephonyDisplayInfo> CREATOR;
    field public static final int OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO = 2; // 0x2
+2 −1
Original line number Diff line number Diff line
@@ -13270,7 +13270,8 @@ package android.telephony {
  public final class NetworkRegistrationInfo implements android.os.Parcelable {
    method @Nullable public android.telephony.DataSpecificRegistrationInfo getDataSpecificInfo();
    method public int getRegistrationState();
    method public int getNetworkRegistrationState();
    method @Deprecated public int getRegistrationState();
    method public int getRejectCause();
    method public int getRoamingType();
    method public boolean isEmergencyEnabled();
+1 −1
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ public class MobileStatusTracker {
        public SignalStrength signalStrength;
        public TelephonyDisplayInfo telephonyDisplayInfo =
                new TelephonyDisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
                        TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE);
                        TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, false);

        /**
         * Empty constructor
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ public class InternetDialogController implements AccessPointController.AccessPoi
    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
    private static final TelephonyDisplayInfo DEFAULT_TELEPHONY_DISPLAY_INFO =
            new TelephonyDisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
                    TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE);
                    TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, false);

    static final int MAX_WIFI_ENTRY_COUNT = 3;

+2 −2
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ internal class MobileState(
) : ConnectivityState() {

    @JvmField var telephonyDisplayInfo = TelephonyDisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
            TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE)
            TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE, false)
    @JvmField var serviceState: ServiceState? = null
    @JvmField var signalStrength: SignalStrength? = null

@@ -131,7 +131,7 @@ internal class MobileState(
    }

    fun isRoaming(): Boolean {
        return serviceState != null && serviceState!!.roaming
        return telephonyDisplayInfo != null && telephonyDisplayInfo.isRoaming
    }

    /**
Loading