new SystemAPI for roamingType in NetworkRegistrationState
Bug: 79262189
Test: telephony unit test
Change-Id: I443f3c109872ad595fc55fa77fe5e10e1c19b32f
diff --git a/api/system-current.txt b/api/system-current.txt
index 0f172a3..c6b1e64 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -5113,6 +5113,7 @@
method public int getDomain();
method public int getRegState();
method public int getRejectCause();
+ method public int getRoamingType();
method public int getTransportType();
method public boolean isEmergencyEnabled();
method public boolean isRoaming();
@@ -5170,6 +5171,10 @@
method public deprecated android.telephony.NetworkRegistrationState getNetworkRegistrationStates(int, int);
method public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForDomain(int);
method public java.util.List<android.telephony.NetworkRegistrationState> getNetworkRegistrationStatesForTransportType(int);
+ field public static final int ROAMING_TYPE_DOMESTIC = 2; // 0x2
+ field public static final int ROAMING_TYPE_INTERNATIONAL = 3; // 0x3
+ field public static final int ROAMING_TYPE_NOT_ROAMING = 0; // 0x0
+ field public static final int ROAMING_TYPE_UNKNOWN = 1; // 0x1
}
public final class SmsManager {
diff --git a/telephony/java/android/telephony/NetworkRegistrationState.java b/telephony/java/android/telephony/NetworkRegistrationState.java
index c3d8898..68e512e 100644
--- a/telephony/java/android/telephony/NetworkRegistrationState.java
+++ b/telephony/java/android/telephony/NetworkRegistrationState.java
@@ -237,10 +237,9 @@
}
/**
- * @return {@link ServiceState.RoamingType roaming type}. This could return
- * overridden roaming type based on resource overlay or carrier config.
- * @hide
+ * @return the current network roaming type.
*/
+
public @ServiceState.RoamingType int getRoamingType() {
return mRoamingType;
}
diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java
index c407681..0937b10 100644
--- a/telephony/java/android/telephony/ServiceState.java
+++ b/telephony/java/android/telephony/ServiceState.java
@@ -211,29 +211,30 @@
ROAMING_TYPE_INTERNATIONAL
})
public @interface RoamingType {}
+
/**
- * Roaming type
- * HOME : in home network
+ * Not roaming, registered in home network.
* @hide
*/
+ @SystemApi
public static final int ROAMING_TYPE_NOT_ROAMING = 0;
/**
- * Roaming type
- * UNKNOWN : in a roaming network, but we can not tell if it's domestic or international
+ * registered in a roaming network, but can not tell if it's domestic or international.
* @hide
*/
+ @SystemApi
public static final int ROAMING_TYPE_UNKNOWN = 1;
/**
- * Roaming type
- * DOMESTIC : in domestic roaming network
+ * registered in a domestic roaming network
* @hide
*/
+ @SystemApi
public static final int ROAMING_TYPE_DOMESTIC = 2;
/**
- * Roaming type
- * INTERNATIONAL : in international roaming network
+ * registered in an international roaming network
* @hide
*/
+ @SystemApi
public static final int ROAMING_TYPE_INTERNATIONAL = 3;
/**