Changed API name from 'isNtn()' to 'isOnlyNonTerrestrialNetwork()' and updated related methods and variables according to API Council recommendations.
isNtn() -> isOnlyNonTerrestrialNetwork()
setNtn() -> setOnlyNonTerrestrialNetwork()
getNtn() -> getOnlyNonTerrestrialNetwork()
mIsNtn -> mIsOnlyNonTerrestrialNetwork
No changes in logic.
Bug: 301620244
Test: SubscriptionManagerTest, SubscriptionInfoTest, SubscriptionInfointernalTest, SubscriptionDatabaseManagerTest, SubscriptionManagerServiceTest
Change-Id: I3d1f9280ca72ccdee9d0d5c47967fb86e73d17ee
diff --git a/src/java/com/android/internal/telephony/subscription/SubscriptionDatabaseManager.java b/src/java/com/android/internal/telephony/subscription/SubscriptionDatabaseManager.java
index 2e2b147..7b927f2 100644
--- a/src/java/com/android/internal/telephony/subscription/SubscriptionDatabaseManager.java
+++ b/src/java/com/android/internal/telephony/subscription/SubscriptionDatabaseManager.java
@@ -281,7 +281,7 @@
SubscriptionInfoInternal::getSatelliteAttachEnabledForCarrier),
new AbstractMap.SimpleImmutableEntry<>(
SimInfo.COLUMN_IS_NTN,
- SubscriptionInfoInternal::getNtn)
+ SubscriptionInfoInternal::getOnlyNonTerrestrialNetwork)
);
/**
@@ -2040,7 +2040,7 @@
return;
}
writeDatabaseAndCacheHelper(subId, SimInfo.COLUMN_IS_NTN, isNtn,
- SubscriptionInfoInternal.Builder::setNtn);
+ SubscriptionInfoInternal.Builder::setOnlyNonTerrestrialNetwork);
}
/**
@@ -2304,7 +2304,7 @@
cursor.getColumnIndexOrThrow(
SimInfo.COLUMN_SATELLITE_ATTACH_ENABLED_FOR_CARRIER)));
if (mFeatureFlags.oemEnabledSatelliteFlag()) {
- builder.setNtn(cursor.getInt(cursor.getColumnIndexOrThrow(
+ builder.setOnlyNonTerrestrialNetwork(cursor.getInt(cursor.getColumnIndexOrThrow(
SimInfo.COLUMN_IS_NTN)));
}
return builder.build();
diff --git a/src/java/com/android/internal/telephony/subscription/SubscriptionInfoInternal.java b/src/java/com/android/internal/telephony/subscription/SubscriptionInfoInternal.java
index 942e9ce..f08a659 100644
--- a/src/java/com/android/internal/telephony/subscription/SubscriptionInfoInternal.java
+++ b/src/java/com/android/internal/telephony/subscription/SubscriptionInfoInternal.java
@@ -452,7 +452,7 @@
* Whether this subscription is used for communicating with non-terrestrial networks.
* By default, its disabled. It is intended to use integer to fit the database format.
*/
- private final int mIsNtn;
+ private final int mIsOnlyNonTerrestrialNetwork;
// Below are the fields that do not exist in the SimInfo table.
/**
@@ -538,7 +538,7 @@
this.mIsSatelliteEnabled = builder.mIsSatelliteEnabled;
this.mIsSatelliteAttachEnabledForCarrier =
builder.mIsSatelliteAttachEnabledForCarrier;
- this.mIsNtn = builder.mIsNtn;
+ this.mIsOnlyNonTerrestrialNetwork = builder.mIsOnlyNonTerrestrialNetwork;
// Below are the fields that do not exist in the SimInfo table.
this.mCardId = builder.mCardId;
@@ -1155,8 +1155,8 @@
*
* @return {@code 1} if the subscription is for non-terrestrial networks. {@code 0} otherwise.
*/
- public int getNtn() {
- return mIsNtn;
+ public int getOnlyNonTerrestrialNetwork() {
+ return mIsOnlyNonTerrestrialNetwork;
}
// Below are the fields that do not exist in SimInfo table.
@@ -1228,7 +1228,7 @@
.setUiccApplicationsEnabled(mAreUiccApplicationsEnabled != 0)
.setPortIndex(mPortIndex)
.setUsageSetting(mUsageSetting)
- .setNtn(mIsNtn == 1)
+ .setOnlyNonTerrestrialNetwork(mIsOnlyNonTerrestrialNetwork == 1)
.build();
}
@@ -1286,7 +1286,7 @@
+ " userId=" + mUserId
+ " isSatelliteEnabled=" + mIsSatelliteEnabled
+ " satellite_attach_enabled_for_carrier=" + mIsSatelliteAttachEnabledForCarrier
- + " getNtn=" + mIsNtn
+ + " getOnlyNonTerrestrialNetwork=" + mIsOnlyNonTerrestrialNetwork
+ " isGroupDisabled=" + mIsGroupDisabled
+ "]";
}
@@ -1344,7 +1344,7 @@
that.mDeviceToDeviceStatusSharingContacts) && mNumberFromCarrier.equals(
that.mNumberFromCarrier) && mNumberFromIms.equals(that.mNumberFromIms)
&& mIsSatelliteAttachEnabledForCarrier == that.mIsSatelliteAttachEnabledForCarrier
- && mIsNtn == that.mIsNtn;
+ && mIsOnlyNonTerrestrialNetwork == that.mIsOnlyNonTerrestrialNetwork;
}
@Override
@@ -1366,7 +1366,7 @@
mNumberFromCarrier,
mNumberFromIms, mPortIndex, mUsageSetting, mLastUsedTPMessageReference, mUserId,
mIsSatelliteEnabled, mCardId, mIsGroupDisabled,
- mIsSatelliteAttachEnabledForCarrier, mIsNtn);
+ mIsSatelliteAttachEnabledForCarrier, mIsOnlyNonTerrestrialNetwork);
result = 31 * result + Arrays.hashCode(mNativeAccessRules);
result = 31 * result + Arrays.hashCode(mCarrierConfigAccessRules);
result = 31 * result + Arrays.hashCode(mRcsConfig);
@@ -1737,7 +1737,7 @@
/**
* Whether this subscription is used for communicating with non-terrestrial network or not.
*/
- private int mIsNtn = 0;
+ private int mIsOnlyNonTerrestrialNetwork = 0;
// The following fields do not exist in the SimInfo table.
/**
@@ -1827,7 +1827,7 @@
mUserId = info.mUserId;
mIsSatelliteEnabled = info.mIsSatelliteEnabled;
mIsSatelliteAttachEnabledForCarrier = info.mIsSatelliteAttachEnabledForCarrier;
- mIsNtn = info.mIsNtn;
+ mIsOnlyNonTerrestrialNetwork = info.mIsOnlyNonTerrestrialNetwork;
// Below are the fields that do not exist in the SimInfo table.
mCardId = info.mCardId;
mIsGroupDisabled = info.mIsGroupDisabled;
@@ -2714,12 +2714,13 @@
/**
* Set whether the subscription is for NTN or not.
*
- * @param isNtn {@code 1} if the subscription is for NTN, {@code 0} otherwise.
+ * @param isOnlyNonTerrestrialNetwork {@code 1} if the subscription is for NTN, {@code 0}
+ * otherwise.
* @return The builder.
*/
@NonNull
- public Builder setNtn(int isNtn) {
- mIsNtn = isNtn;
+ public Builder setOnlyNonTerrestrialNetwork(int isOnlyNonTerrestrialNetwork) {
+ mIsOnlyNonTerrestrialNetwork = isOnlyNonTerrestrialNetwork;
return this;
}
diff --git a/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java b/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java
index aeb1702..80ec039 100644
--- a/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java
+++ b/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java
@@ -843,7 +843,7 @@
try {
mSubscriptionDatabaseManager.setNtn(subId, (isNtn ? 1 : 0));
} catch (IllegalArgumentException e) {
- loge("setNtn: invalid subId=" + subId);
+ loge("setOnlyNonTerrestrialNetwork: invalid subId=" + subId);
}
}
@@ -1143,7 +1143,8 @@
builder.setMcc(mcc);
builder.setMnc(mnc);
if (mFeatureFlags.oemEnabledSatelliteFlag()) {
- builder.setNtn(isSatellitePlmn(mcc + mnc) ? 1 : 0);
+ builder.setOnlyNonTerrestrialNetwork(
+ isSatellitePlmn(mcc + mnc) ? 1 : 0);
}
}
// If cardId = unsupported or un-initialized, we have no reason to update DB.
diff --git a/tests/telephonytests/src/com/android/internal/telephony/SubscriptionInfoTest.java b/tests/telephonytests/src/com/android/internal/telephony/SubscriptionInfoTest.java
index 20ad1a2..9fa88e2 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/SubscriptionInfoTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/SubscriptionInfoTest.java
@@ -54,7 +54,7 @@
.setEhplmns(EHPLMNS)
.setHplmns(HPLMNS)
.setCountryIso("us")
- .setNtn(true)
+ .setOnlyNonTerrestrialNetwork(true)
.build();
}
@@ -75,7 +75,7 @@
assertThat(mSubscriptionInfoUT.getSimSlotIndex()).isEqualTo(0);
assertThat(mSubscriptionInfoUT.getIccId()).isEqualTo("890126042XXXXXXXXXXX");
if (Flags.oemEnabledSatelliteFlag()) {
- assertThat(mSubscriptionInfoUT.isNtn()).isTrue();
+ assertThat(mSubscriptionInfoUT.isOnlyNonTerrestrialNetwork()).isTrue();
}
}
diff --git a/tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionDatabaseManagerTest.java b/tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionDatabaseManagerTest.java
index ce77f14..b42e6d6 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionDatabaseManagerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionDatabaseManagerTest.java
@@ -197,7 +197,7 @@
.setSatelliteEnabled(0)
.setSatelliteAttachEnabledForCarrier(
FAKE_SATELLITE_ATTACH_FOR_CARRIER_DISABLED)
- .setNtn(FAKE_SATELLITE_IS_NTN_DISABLED)
+ .setOnlyNonTerrestrialNetwork(FAKE_SATELLITE_IS_NTN_DISABLED)
.setGroupDisabled(false)
.build();
@@ -268,7 +268,7 @@
.setSatelliteEnabled(1)
.setSatelliteAttachEnabledForCarrier(
FAKE_SATELLITE_ATTACH_FOR_CARRIER_ENABLED)
- .setNtn(FAKE_SATELLITE_IS_NTN_ENABLED)
+ .setOnlyNonTerrestrialNetwork(FAKE_SATELLITE_IS_NTN_ENABLED)
.setGroupDisabled(false)
.build();
@@ -1994,7 +1994,7 @@
processAllMessages();
subInfo = new SubscriptionInfoInternal.Builder(subInfo)
- .setNtn(FAKE_SATELLITE_IS_NTN_ENABLED)
+ .setOnlyNonTerrestrialNetwork(FAKE_SATELLITE_IS_NTN_ENABLED)
.build();
verifySubscription(subInfo);
verify(mSubscriptionDatabaseManagerCallback, times(2)).onSubscriptionChanged(eq(1));
@@ -2006,7 +2006,7 @@
mDatabaseManagerUT.setSubscriptionProperty(FAKE_SUBSCRIPTION_INFO1.getSubscriptionId(),
SimInfo.COLUMN_IS_NTN, FAKE_SATELLITE_IS_NTN_DISABLED);
assertThat(mDatabaseManagerUT.getSubscriptionInfoInternal(
- FAKE_SUBSCRIPTION_INFO1.getSubscriptionId()).getNtn())
+ FAKE_SUBSCRIPTION_INFO1.getSubscriptionId()).getOnlyNonTerrestrialNetwork())
.isEqualTo(FAKE_SATELLITE_IS_NTN_DISABLED);
}
@@ -2026,7 +2026,7 @@
when(mFeatureFlags.oemEnabledSatelliteFlag()).thenReturn(false);
reset(mSubscriptionDatabaseManagerCallback);
subInfo = new SubscriptionInfoInternal.Builder(subInfo)
- .setNtn(FAKE_SATELLITE_IS_NTN_ENABLED)
+ .setOnlyNonTerrestrialNetwork(FAKE_SATELLITE_IS_NTN_ENABLED)
.build();
int subId = subInfo.getSubscriptionId();
@@ -2051,7 +2051,7 @@
mDatabaseManagerUT.setSubscriptionProperty(FAKE_SUBSCRIPTION_INFO1.getSubscriptionId(),
SimInfo.COLUMN_IS_NTN, FAKE_SATELLITE_IS_NTN_ENABLED);
assertThat(mDatabaseManagerUT.getSubscriptionInfoInternal(
- FAKE_SUBSCRIPTION_INFO1.getSubscriptionId()).getNtn())
+ FAKE_SUBSCRIPTION_INFO1.getSubscriptionId()).getOnlyNonTerrestrialNetwork())
.isNotEqualTo(FAKE_SATELLITE_IS_NTN_ENABLED);
}
diff --git a/tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionInfoInternalTest.java b/tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionInfoInternalTest.java
index 94bcca7..2505f32 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionInfoInternalTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/subscription/SubscriptionInfoInternalTest.java
@@ -104,9 +104,10 @@
.setSatelliteAttachEnabledForCarrier(
SubscriptionDatabaseManagerTest
.FAKE_SATELLITE_ATTACH_FOR_CARRIER_ENABLED)
- .setNtn(SubscriptionDatabaseManagerTest.FAKE_SATELLITE_IS_NTN_ENABLED)
+ .setOnlyNonTerrestrialNetwork(
+ SubscriptionDatabaseManagerTest.FAKE_SATELLITE_IS_NTN_ENABLED)
.setGroupDisabled(false)
- .setNtn(1)
+ .setOnlyNonTerrestrialNetwork(1)
.build();
private final SubscriptionInfoInternal mSubInfoNull =
@@ -219,10 +220,10 @@
assertThat(mSubInfo.getSatelliteAttachEnabledForCarrier())
.isEqualTo(SubscriptionDatabaseManagerTest
.FAKE_SATELLITE_ATTACH_FOR_CARRIER_ENABLED);
- assertThat(mSubInfo.getNtn()).isEqualTo(
+ assertThat(mSubInfo.getOnlyNonTerrestrialNetwork()).isEqualTo(
SubscriptionDatabaseManagerTest.FAKE_SATELLITE_IS_NTN_ENABLED);
assertThat(mSubInfo.isGroupDisabled()).isFalse();
- assertThat(mSubInfo.getNtn()).isEqualTo(1);
+ assertThat(mSubInfo.getOnlyNonTerrestrialNetwork()).isEqualTo(1);
}
@Test
@@ -285,7 +286,7 @@
assertThat(subInfo.getPortIndex()).isEqualTo(
SubscriptionManager.USAGE_SETTING_DEFAULT);
assertThat(subInfo.isGroupDisabled()).isFalse();
- assertThat(subInfo.isNtn()).isTrue();
+ assertThat(subInfo.isOnlyNonTerrestrialNetwork()).isTrue();
}
@Test