summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nathan Harold <nharold@google.com> 2020-02-13 15:35:28 -0800
committer Nathan Harold <nharold@google.com> 2020-02-13 18:06:43 -0800
commit2fb0bc50f93a728c52dd729ba28005ba1061b2b3 (patch)
tree6469de26a5f639d93975ba411de37cb9e682f300
parentb0f1fe887a0e12671c94fc0315f1a8a23934f92e (diff)
Allow Nullable Registered PLMN
API Council has noted an inconsistency between setRegisteredPlmn() and getRegisteredPlmn(). Because other methods such as CellIdentity#getMncStr() are already nullable, it's reasonable to allow the registered PLMN to be null in the event that the device isn't registered. Bug: 149476549 Test: make update-api && make && atest NetworkRegistrationInfoTest Change-Id: Ib38e72a6bdbaf4e1fd439e92f835daa6f87ceb73
-rw-r--r--api/current.txt2
-rw-r--r--telephony/java/android/telephony/NetworkRegistrationInfo.java10
2 files changed, 6 insertions, 6 deletions
diff --git a/api/current.txt b/api/current.txt
index 611fec3514b9..5540a3e89ae5 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -47229,7 +47229,7 @@ package android.telephony {
method @Nullable public android.telephony.CellIdentity getCellIdentity();
method public int getDomain();
method public int getNrState();
- method @NonNull public String getRegisteredPlmn();
+ method @Nullable public String getRegisteredPlmn();
method public int getTransportType();
method public boolean isRegistered();
method public boolean isRoaming();
diff --git a/telephony/java/android/telephony/NetworkRegistrationInfo.java b/telephony/java/android/telephony/NetworkRegistrationInfo.java
index f9de47d7677d..c74e17f6bca1 100644
--- a/telephony/java/android/telephony/NetworkRegistrationInfo.java
+++ b/telephony/java/android/telephony/NetworkRegistrationInfo.java
@@ -258,7 +258,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
mCellIdentity = cellIdentity;
mEmergencyOnly = emergencyOnly;
mNrState = NR_STATE_NONE;
- mRplmn = (rplmn == null) ? "" : rplmn;
+ mRplmn = rplmn;
}
/**
@@ -408,13 +408,13 @@ public final class NetworkRegistrationInfo implements Parcelable {
* <p>If the device is registered, this will return the registered PLMN-ID. If registration
* has failed, then this will return the PLMN ID of the last attempted registration. If the
* device is not registered, or if is registered to a non-3GPP radio technology, then this
- * will return an empty string.
+ * will return null.
*
* <p>See 3GPP TS 23.122 for further information about the Registered PLMN.
*
- * @return the registered PLMN-ID or an empty string.
+ * @return the registered PLMN-ID or null.
*/
- @NonNull public String getRegisteredPlmn() {
+ @Nullable public String getRegisteredPlmn() {
return mRplmn;
}
@@ -892,7 +892,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
* @return The same instance of the builder.
*/
public @NonNull Builder setRegisteredPlmn(@Nullable String rplmn) {
- mRplmn = (rplmn == null) ? "" : rplmn;
+ mRplmn = rplmn;
return this;
}