Merge "Cleaned up the flag backup_and_restore_for_enable_2g" into main
diff --git a/flags/Android.bp b/flags/Android.bp
index edcfc3f..862b519 100644
--- a/flags/Android.bp
+++ b/flags/Android.bp
@@ -22,6 +22,7 @@
name: "telephony_flags",
package: "com.android.internal.telephony.flags",
container: "system",
+ exportable: true,
srcs: [
"calling.aconfig",
"data.aconfig",
diff --git a/flags/calling.aconfig b/flags/calling.aconfig
index 27d3518..c14ae29 100644
--- a/flags/calling.aconfig
+++ b/flags/calling.aconfig
@@ -78,7 +78,8 @@
namespace: "telephony"
description: "To prevent passing the TelephonyRegistry's original instance to listeners in the same process"
bug:"379126049"
+ is_exported: true
metadata {
purpose: PURPOSE_BUGFIX
}
-}
\ No newline at end of file
+}
diff --git a/flags/data.aconfig b/flags/data.aconfig
index be2501f..1541999 100644
--- a/flags/data.aconfig
+++ b/flags/data.aconfig
@@ -41,46 +41,6 @@
bug:"286171724"
}
-# OWNER=qingqi TARGET=24Q3
-flag {
- name: "vonr_enabled_metric"
- namespace: "telephony"
- description: "Collect vonr status in voice call metric"
- bug:"288449751"
-}
-
-# OWNER=apsankar TARGET=24Q3
-flag {
- name: "data_call_session_stats_captures_cross_sim_calling"
- namespace: "telephony"
- description: "The DataCallSessionStats metrics will capture whether the IWLAN PDN is set up on cross-SIM calling."
- bug: "313956117"
-}
-
-# OWNER=sewook TARGET=24Q3
-flag {
- name: "reconnect_qualified_network"
- namespace: "telephony"
- description: "This flag is for internal implementation to handle reconnect request from QNS in telephony FWK."
- bug: "319520561"
-}
-
-# OWNER=jackyu TARGET=24Q3
-flag {
- name: "dsrs_diagnostics_enabled"
- namespace: "telephony"
- description: "Enable DSRS diagnostics."
- bug: "319601607"
-}
-
-# OWNER=jackyu TARGET=24Q3
-flag {
- name: "data_rat_metric_enabled"
- namespace: "telephony"
- description: "Write DataRatStateChanged atom"
- bug:"318519337"
-}
-
# OWNER=jackyu TARGET=24Q4
flag {
name: "dds_callback"
diff --git a/flags/misc.aconfig b/flags/misc.aconfig
index 5d02cb4..38c9e14 100644
--- a/flags/misc.aconfig
+++ b/flags/misc.aconfig
@@ -43,22 +43,6 @@
bug: "309655251"
}
-# OWNER=sangyun TARGET=24Q2
-flag {
- name: "reorganize_roaming_notification"
- namespace: "telephony"
- description: "Reorganize conditions to show and dismiss roaming notifications."
- bug: "310594087"
-}
-
-# OWNER=sangyun TARGET=24Q2
-flag {
- name: "dismiss_network_selection_notification_on_sim_disable"
- namespace: "telephony"
- description: "Fix to dismiss network selection notification when disable sim."
- bug: "310594186"
-}
-
# OWNER=nagendranb TARGET=24Q3
flag {
name: "enable_telephony_analytics"
@@ -265,3 +249,14 @@
purpose: PURPOSE_BUGFIX
}
}
+
+# OWNER=jackyu TARGET=25Q2
+flag {
+ name: "carrier_config_changed_callback_fix"
+ namespace: "telephony"
+ description: "Carrier config callback race condition fix"
+ bug:"375526692"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/src/java/com/android/internal/telephony/DisplayInfoController.java b/src/java/com/android/internal/telephony/DisplayInfoController.java
index c25561c..8521849 100644
--- a/src/java/com/android/internal/telephony/DisplayInfoController.java
+++ b/src/java/com/android/internal/telephony/DisplayInfoController.java
@@ -118,10 +118,8 @@
// To Support Satellite bandwidth constrained data capability status at telephony
// display info
- if (mFeatureFlags.carrierEnabledSatelliteFlag()) {
- log("register for satellite network callback");
- mNetworkTypeController.registerForSatelliteNetwork();
- }
+ log("register for satellite network callback");
+ mNetworkTypeController.registerForSatelliteNetwork();
}
/**
diff --git a/src/java/com/android/internal/telephony/data/AccessNetworksManager.java b/src/java/com/android/internal/telephony/data/AccessNetworksManager.java
index 2691eab..d364120 100644
--- a/src/java/com/android/internal/telephony/data/AccessNetworksManager.java
+++ b/src/java/com/android/internal/telephony/data/AccessNetworksManager.java
@@ -347,13 +347,11 @@
@Override
public void onReconnectQualifiedNetworkType(int apnTypes, int qualifiedNetworkType) {
- if (mFeatureFlags.reconnectQualifiedNetwork()) {
- log("onReconnectQualifiedNetworkType: apnTypes = ["
- + ApnSetting.getApnTypesStringFromBitmask(apnTypes)
- + "], networks = [" + AccessNetworkType.toString(qualifiedNetworkType)
- + "]");
- handleQualifiedNetworksChanged(apnTypes, new int[]{qualifiedNetworkType}, true);
- }
+ log("onReconnectQualifiedNetworkType: apnTypes = ["
+ + ApnSetting.getApnTypesStringFromBitmask(apnTypes)
+ + "], networks = [" + AccessNetworkType.toString(qualifiedNetworkType)
+ + "]");
+ handleQualifiedNetworksChanged(apnTypes, new int[]{qualifiedNetworkType}, true);
}
}
diff --git a/src/java/com/android/internal/telephony/data/AutoDataSwitchController.java b/src/java/com/android/internal/telephony/data/AutoDataSwitchController.java
index 90ed2c2..0beb176 100644
--- a/src/java/com/android/internal/telephony/data/AutoDataSwitchController.java
+++ b/src/java/com/android/internal/telephony/data/AutoDataSwitchController.java
@@ -275,8 +275,8 @@
*/
private UsableState getUsableState() {
ServiceState serviceState = mPhone.getServiceState();
- boolean isUsingNonTerrestrialNetwork = sFeatureFlags.carrierEnabledSatelliteFlag()
- && (serviceState != null) && serviceState.isUsingNonTerrestrialNetwork();
+ boolean isUsingNonTerrestrialNetwork =
+ (serviceState != null) && serviceState.isUsingNonTerrestrialNetwork();
return switch (mDataRegState) {
case NetworkRegistrationInfo.REGISTRATION_STATE_HOME -> {
@@ -459,7 +459,7 @@
private void readDeviceResourceConfig() {
Phone phone = PhoneFactory.getDefaultPhone();
DataConfigManager dataConfig = phone.getDataNetworkController().getDataConfigManager();
- mScoreTolerance = dataConfig.getAutoDataSwitchScoreTolerance();
+ mScoreTolerance = dataConfig.getAutoDataSwitchScoreTolerance();
mRequirePingTestBeforeSwitch = dataConfig.isPingTestBeforeAutoDataSwitchRequired();
mAllowNddsRoaming = dataConfig.doesAutoDataSwitchAllowRoaming();
mAutoDataSwitchAvailabilityStabilityTimeThreshold =
diff --git a/src/java/com/android/internal/telephony/data/DataProfileManager.java b/src/java/com/android/internal/telephony/data/DataProfileManager.java
index 28fe935..f9f78ea 100644
--- a/src/java/com/android/internal/telephony/data/DataProfileManager.java
+++ b/src/java/com/android/internal/telephony/data/DataProfileManager.java
@@ -743,7 +743,6 @@
// if esim bootstrap provisioning in progress, do not apply preferred data profile
if (!isEsimBootStrapProvisioning) {
- if (mFeatureFlags.carrierEnabledSatelliteFlag()) {
// If the preferred data profile can be used, always use it if it can satisfy the
// network request with current network type (even though it's been marked as
// permanent failed.)
@@ -763,24 +762,6 @@
+ "retry can happen.");
return null;
}
- } else {
- // If the preferred data profile can be used, always use it if it can satisfy the
- // network request with current network type (even though it's been marked as
- // permanent failed.)
- if (mPreferredDataProfile != null
- && networkRequest.canBeSatisfiedBy(mPreferredDataProfile)
- && mPreferredDataProfile.getApnSetting() != null
- && mPreferredDataProfile.getApnSetting()
- .canSupportNetworkType(networkType)) {
- if (ignorePermanentFailure || !mPreferredDataProfile.getApnSetting()
- .getPermanentFailed()) {
- return mPreferredDataProfile.getApnSetting();
- }
- log("The preferred data profile is permanently failed. Only condition based "
- + "retry can happen.");
- return null;
- }
- }
}
// Filter out the data profile that can't satisfy the request.
@@ -807,26 +788,18 @@
if (!dp.getApnSetting().canSupportNetworkType(networkType)) return false;
if (isEsimBootStrapProvisioning
!= dp.getApnSetting().isEsimBootstrapProvisioning()) return false;
- if (mFeatureFlags.carrierEnabledSatelliteFlag()) {
- if (isNtn && !dp.getApnSetting().isForInfrastructure(
- ApnSetting.INFRASTRUCTURE_SATELLITE)) {
- return false;
- }
- return isNtn || dp.getApnSetting().isForInfrastructure(
- ApnSetting.INFRASTRUCTURE_CELLULAR);
+ if (isNtn && !dp.getApnSetting().isForInfrastructure(
+ ApnSetting.INFRASTRUCTURE_SATELLITE)) {
+ return false;
}
-
- return true;
+ return isNtn || dp.getApnSetting().isForInfrastructure(
+ ApnSetting.INFRASTRUCTURE_CELLULAR);
})
.collect(Collectors.toList());
if (dataProfiles.isEmpty()) {
- String ntnReason = "";
- if (mFeatureFlags.carrierEnabledSatelliteFlag()) {
- ntnReason = " and infrastructure for "
- + NetworkRegistrationInfo.isNonTerrestrialNetworkToString(isNtn);
- }
log("Can't find any data profile for network type "
- + TelephonyManager.getNetworkTypeName(networkType) + ntnReason);
+ + TelephonyManager.getNetworkTypeName(networkType) + " and infrastructure for "
+ + NetworkRegistrationInfo.isNonTerrestrialNetworkToString(isNtn));
return null;
}
diff --git a/src/java/com/android/internal/telephony/data/DataStallRecoveryManager.java b/src/java/com/android/internal/telephony/data/DataStallRecoveryManager.java
index 42e1a78..6147d66 100644
--- a/src/java/com/android/internal/telephony/data/DataStallRecoveryManager.java
+++ b/src/java/com/android/internal/telephony/data/DataStallRecoveryManager.java
@@ -571,16 +571,12 @@
private void onInternetValidationStatusChanged(@ValidationStatus int status) {
logl("onInternetValidationStatusChanged: " + DataUtils.validationStatusToString(status));
final boolean isValid = status == NetworkAgent.VALIDATION_STATUS_VALID;
- if (mFeatureFlags.dsrsDiagnosticsEnabled()) {
- mValidationCount += 1;
- mActionValidationCount += 1;
- }
+ mValidationCount += 1;
+ mActionValidationCount += 1;
setNetworkValidationState(isValid);
if (isValid) {
- if (mFeatureFlags.dsrsDiagnosticsEnabled()) {
- // Broadcast intent that data stall recovered.
- broadcastDataStallDetected(mLastAction);
- }
+ // Broadcast intent that data stall recovered.
+ broadcastDataStallDetected(mLastAction);
reset();
} else if (isRecoveryNeeded(true)) {
// Set the network as invalid, because recovery is needed
@@ -620,7 +616,7 @@
@VisibleForTesting
public void setRecoveryAction(@RecoveryAction int action) {
// Reset the validation count for action change
- if (mFeatureFlags.dsrsDiagnosticsEnabled() && mRecoveryAction != action) {
+ if (mRecoveryAction != action) {
mActionValidationCount = 0;
}
mRecoveryAction = action;
@@ -702,10 +698,8 @@
final int duration = (int) (SystemClock.elapsedRealtime() - mDataStallStartMs);
@RecoveredReason final int reason = getRecoveredReason(mIsValidNetwork);
final int durationOfAction = (int) getDurationOfCurrentRecoveryMs();
- if (mFeatureFlags.dsrsDiagnosticsEnabled()) {
- log("mValidationCount=" + mValidationCount
- + ", mActionValidationCount=" + mActionValidationCount);
- }
+ log("mValidationCount=" + mValidationCount
+ + ", mActionValidationCount=" + mActionValidationCount);
// Get the bundled DSRS stats.
Bundle bundle = mStats.getDataStallRecoveryMetricsData(
diff --git a/src/java/com/android/internal/telephony/metrics/DataConnectionStateTracker.java b/src/java/com/android/internal/telephony/metrics/DataConnectionStateTracker.java
index 696c9ce..4f46c39 100644
--- a/src/java/com/android/internal/telephony/metrics/DataConnectionStateTracker.java
+++ b/src/java/com/android/internal/telephony/metrics/DataConnectionStateTracker.java
@@ -16,8 +16,6 @@
package com.android.internal.telephony.metrics;
-import static com.android.internal.telephony.flags.Flags.dataRatMetricEnabled;
-
import android.os.Handler;
import android.os.HandlerExecutor;
import android.os.HandlerThread;
@@ -235,9 +233,7 @@
@Override
public void onActiveDataSubscriptionIdChanged(int subId) {
- if (dataRatMetricEnabled()) {
- logRATChanges(subId);
- }
+ logRATChanges(subId);
mActiveDataSubId = subId;
}
diff --git a/src/java/com/android/internal/telephony/metrics/DataStallRecoveryStats.java b/src/java/com/android/internal/telephony/metrics/DataStallRecoveryStats.java
index e7352a4..ba851d3 100644
--- a/src/java/com/android/internal/telephony/metrics/DataStallRecoveryStats.java
+++ b/src/java/com/android/internal/telephony/metrics/DataStallRecoveryStats.java
@@ -89,9 +89,6 @@
private final @NonNull TelephonyManager mTelephonyManager;
private final @NonNull FeatureFlags mFeatureFlags;
- // Flag to control the DSRS diagnostics
- private final boolean mIsDsrsDiagnosticsEnabled;
-
// The interface name of the internet network.
private @Nullable String mIfaceName = null;
@@ -172,43 +169,40 @@
}
});
- mIsDsrsDiagnosticsEnabled = mFeatureFlags.dsrsDiagnosticsEnabled();
- if (mIsDsrsDiagnosticsEnabled) {
- try {
- // Register ConnectivityDiagnosticsCallback to get diagnostics states
- mConnectivityDiagnosticsManager =
- mPhone.getContext().getSystemService(ConnectivityDiagnosticsManager.class);
- mConnectivityDiagnosticsCallback = new ConnectivityDiagnosticsCallback() {
- @Override
- public void onConnectivityReportAvailable(@NonNull ConnectivityReport report) {
- PersistableBundle bundle = report.getAdditionalInfo();
- mNetworkProbesResult = bundle.getInt(KEY_NETWORK_PROBES_SUCCEEDED_BITMASK);
- mNetworkProbesType = bundle.getInt(KEY_NETWORK_PROBES_ATTEMPTED_BITMASK);
- mNetworkValidationResult = bundle.getInt(KEY_NETWORK_VALIDATION_RESULT);
- }
+ try {
+ // Register ConnectivityDiagnosticsCallback to get diagnostics states
+ mConnectivityDiagnosticsManager =
+ mPhone.getContext().getSystemService(ConnectivityDiagnosticsManager.class);
+ mConnectivityDiagnosticsCallback = new ConnectivityDiagnosticsCallback() {
+ @Override
+ public void onConnectivityReportAvailable(@NonNull ConnectivityReport report) {
+ PersistableBundle bundle = report.getAdditionalInfo();
+ mNetworkProbesResult = bundle.getInt(KEY_NETWORK_PROBES_SUCCEEDED_BITMASK);
+ mNetworkProbesType = bundle.getInt(KEY_NETWORK_PROBES_ATTEMPTED_BITMASK);
+ mNetworkValidationResult = bundle.getInt(KEY_NETWORK_VALIDATION_RESULT);
+ }
- @Override
- public void onDataStallSuspected(@NonNull DataStallReport report) {
- PersistableBundle bundle = report.getStallDetails();
- mTcpMetricsCollectionPeriodMillis =
- bundle.getInt(KEY_TCP_METRICS_COLLECTION_PERIOD_MILLIS);
- mTcpPacketFailRate = bundle.getInt(KEY_TCP_PACKET_FAIL_RATE);
- mDnsConsecutiveTimeouts = bundle.getInt(KEY_DNS_CONSECUTIVE_TIMEOUTS);
- }
- };
- mConnectivityDiagnosticsManager.registerConnectivityDiagnosticsCallback(
- new NetworkRequest.Builder()
- .clearCapabilities()
- .addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
- .addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR)
- .build(),
- INLINE_EXECUTOR,
- mConnectivityDiagnosticsCallback
- );
- } catch (Exception e) {
- mConnectivityDiagnosticsManager = null;
- mConnectivityDiagnosticsCallback = null;
- }
+ @Override
+ public void onDataStallSuspected(@NonNull DataStallReport report) {
+ PersistableBundle bundle = report.getStallDetails();
+ mTcpMetricsCollectionPeriodMillis =
+ bundle.getInt(KEY_TCP_METRICS_COLLECTION_PERIOD_MILLIS);
+ mTcpPacketFailRate = bundle.getInt(KEY_TCP_PACKET_FAIL_RATE);
+ mDnsConsecutiveTimeouts = bundle.getInt(KEY_DNS_CONSECUTIVE_TIMEOUTS);
+ }
+ };
+ mConnectivityDiagnosticsManager.registerConnectivityDiagnosticsCallback(
+ new NetworkRequest.Builder()
+ .clearCapabilities()
+ .addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
+ .addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR)
+ .build(),
+ INLINE_EXECUTOR,
+ mConnectivityDiagnosticsCallback
+ );
+ } catch (Exception e) {
+ mConnectivityDiagnosticsManager = null;
+ mConnectivityDiagnosticsCallback = null;
}
}
@@ -293,19 +287,17 @@
mPhoneId = mPhone.getPhoneId() + 1;
mCarrierId = mPhone.getCarrierId();
mSignalStrength = mPhone.getSignalStrength().getLevel();
- if (mIsDsrsDiagnosticsEnabled) {
- // Get the MCCMNC and convert it to an int
- String networkOperator = mTelephonyManager.getNetworkOperator();
- if (!TextUtils.isEmpty(networkOperator)) {
- try {
- mConvertedMccMnc = Integer.parseInt(networkOperator);
- } catch (NumberFormatException e) {
- loge("Invalid MCCMNC format: " + networkOperator);
- mConvertedMccMnc = -1;
- }
- } else {
+ // Get the MCCMNC and convert it to an int
+ String networkOperator = mTelephonyManager.getNetworkOperator();
+ if (!TextUtils.isEmpty(networkOperator)) {
+ try {
+ mConvertedMccMnc = Integer.parseInt(networkOperator);
+ } catch (NumberFormatException e) {
+ loge("Invalid MCCMNC format: " + networkOperator);
mConvertedMccMnc = -1;
}
+ } else {
+ mConvertedMccMnc = -1;
}
// Update the bandwidth.
@@ -430,71 +422,46 @@
int actionValidationCount,
int durationOfAction) {
- if (mIsDsrsDiagnosticsEnabled) {
- // Refresh data if the data has not been updated within 3 minutes
- final long refreshDuration = SystemClock.elapsedRealtime() - mMetricsReflashTime;
- if (refreshDuration > REFRESH_DURATION_IN_MILLIS) {
- // Refreshes the metrics data.
- try {
- refreshMetricsData();
- } catch (Exception e) {
- loge("The metrics data cannot be refreshed.", e);
- }
+ // Refresh data if the data has not been updated within 3 minutes
+ final long refreshDuration = SystemClock.elapsedRealtime() - mMetricsReflashTime;
+ if (refreshDuration > REFRESH_DURATION_IN_MILLIS) {
+ // Refreshes the metrics data.
+ try {
+ refreshMetricsData();
+ } catch (Exception e) {
+ loge("The metrics data cannot be refreshed.", e);
}
}
Bundle bundle = new Bundle();
- if (mIsDsrsDiagnosticsEnabled) {
- bundle.putInt("Action", action);
- bundle.putInt("IsRecovered", isRecovered ? 1 : 0);
- bundle.putInt("Duration", duration);
- bundle.putInt("Reason", reason);
- bundle.putInt("DurationOfAction", durationOfAction);
- bundle.putInt("ValidationCount", validationCount);
- bundle.putInt("ActionValidationCount", actionValidationCount);
- bundle.putInt("PhoneId", mPhoneId);
- bundle.putInt("CarrierId", mCarrierId);
- bundle.putInt("MccMnc", mConvertedMccMnc);
- bundle.putInt("SignalStrength", mSignalStrength);
- bundle.putInt("Band", mBand);
- bundle.putInt("Rat", mRat);
- bundle.putInt("IsOpportunistic", mIsOpportunistic ? 1 : 0);
- bundle.putInt("IsMultiSim", mIsMultiSim ? 1 : 0);
- bundle.putInt("NetworkRegState", mNetworkRegState);
- bundle.putInt("OtherSignalStrength", mOtherSignalStrength);
- bundle.putInt("OtherNetworkRegState", mOtherNetworkRegState);
- bundle.putInt("InternetLinkStatus", mInternetLinkStatus);
- bundle.putInt("LinkDownBandwidthKbps", mLinkDownBandwidthKbps);
- bundle.putInt("LinkUpBandwidthKbps", mLinkUpBandwidthKbps);
- bundle.putInt("NetworkProbesResult", mNetworkProbesResult);
- bundle.putInt("NetworkProbesType", mNetworkProbesType);
- bundle.putInt("NetworkValidationResult", mNetworkValidationResult);
- bundle.putInt("TcpMetricsCollectionPeriodMillis", mTcpMetricsCollectionPeriodMillis);
- bundle.putInt("TcpPacketFailRate", mTcpPacketFailRate);
- bundle.putInt("DnsConsecutiveTimeouts", mDnsConsecutiveTimeouts);
- } else {
- bundle.putInt("Action", action);
- bundle.putBoolean("IsRecovered", isRecovered);
- bundle.putInt("Duration", duration);
- bundle.putInt("Reason", reason);
- bundle.putBoolean("IsFirstValidation", validationCount == 1);
- bundle.putInt("DurationOfAction", durationOfAction);
- bundle.putInt("PhoneId", mPhoneId);
- bundle.putInt("CarrierId", mCarrierId);
- bundle.putInt("SignalStrength", mSignalStrength);
- bundle.putInt("Band", mBand);
- bundle.putInt("Rat", mRat);
- bundle.putBoolean("IsOpportunistic", mIsOpportunistic);
- bundle.putBoolean("IsMultiSim", mIsMultiSim);
- bundle.putInt("NetworkRegState", mNetworkRegState);
- bundle.putInt("OtherSignalStrength", mOtherSignalStrength);
- bundle.putInt("OtherNetworkRegState", mOtherNetworkRegState);
- bundle.putInt("InternetLinkStatus", mInternetLinkStatus);
- bundle.putInt("LinkDownBandwidthKbps", mLinkDownBandwidthKbps);
- bundle.putInt("LinkUpBandwidthKbps", mLinkUpBandwidthKbps);
- }
-
+ bundle.putInt("Action", action);
+ bundle.putInt("IsRecovered", isRecovered ? 1 : 0);
+ bundle.putInt("Duration", duration);
+ bundle.putInt("Reason", reason);
+ bundle.putInt("DurationOfAction", durationOfAction);
+ bundle.putInt("ValidationCount", validationCount);
+ bundle.putInt("ActionValidationCount", actionValidationCount);
+ bundle.putInt("PhoneId", mPhoneId);
+ bundle.putInt("CarrierId", mCarrierId);
+ bundle.putInt("MccMnc", mConvertedMccMnc);
+ bundle.putInt("SignalStrength", mSignalStrength);
+ bundle.putInt("Band", mBand);
+ bundle.putInt("Rat", mRat);
+ bundle.putInt("IsOpportunistic", mIsOpportunistic ? 1 : 0);
+ bundle.putInt("IsMultiSim", mIsMultiSim ? 1 : 0);
+ bundle.putInt("NetworkRegState", mNetworkRegState);
+ bundle.putInt("OtherSignalStrength", mOtherSignalStrength);
+ bundle.putInt("OtherNetworkRegState", mOtherNetworkRegState);
+ bundle.putInt("InternetLinkStatus", mInternetLinkStatus);
+ bundle.putInt("LinkDownBandwidthKbps", mLinkDownBandwidthKbps);
+ bundle.putInt("LinkUpBandwidthKbps", mLinkUpBandwidthKbps);
+ bundle.putInt("NetworkProbesResult", mNetworkProbesResult);
+ bundle.putInt("NetworkProbesType", mNetworkProbesType);
+ bundle.putInt("NetworkValidationResult", mNetworkValidationResult);
+ bundle.putInt("TcpMetricsCollectionPeriodMillis", mTcpMetricsCollectionPeriodMillis);
+ bundle.putInt("TcpPacketFailRate", mTcpPacketFailRate);
+ bundle.putInt("DnsConsecutiveTimeouts", mDnsConsecutiveTimeouts);
return bundle;
}
diff --git a/src/java/com/android/internal/telephony/metrics/DefaultNetworkMonitor.java b/src/java/com/android/internal/telephony/metrics/DefaultNetworkMonitor.java
index 1dab10b..cb7ada7 100644
--- a/src/java/com/android/internal/telephony/metrics/DefaultNetworkMonitor.java
+++ b/src/java/com/android/internal/telephony/metrics/DefaultNetworkMonitor.java
@@ -64,9 +64,7 @@
DefaultNetworkMonitor(@NonNull Context context, @NonNull FeatureFlags featureFlags) {
super(Looper.myLooper());
- if (featureFlags.dataCallSessionStatsCapturesCrossSimCalling()) {
- registerSystemDefaultNetworkCallback(context);
- }
+ registerSystemDefaultNetworkCallback(context);
}
private void registerSystemDefaultNetworkCallback(@NonNull Context context) {
diff --git a/src/java/com/android/internal/telephony/metrics/ServiceStateStats.java b/src/java/com/android/internal/telephony/metrics/ServiceStateStats.java
index 3f24968..1a909a0 100644
--- a/src/java/com/android/internal/telephony/metrics/ServiceStateStats.java
+++ b/src/java/com/android/internal/telephony/metrics/ServiceStateStats.java
@@ -21,7 +21,6 @@
import static com.android.internal.telephony.TelephonyStatsLog.VOICE_CALL_SESSION__BEARER_AT_END__CALL_BEARER_CS;
import static com.android.internal.telephony.TelephonyStatsLog.VOICE_CALL_SESSION__BEARER_AT_END__CALL_BEARER_IMS;
import static com.android.internal.telephony.TelephonyStatsLog.VOICE_CALL_SESSION__BEARER_AT_END__CALL_BEARER_UNKNOWN;
-import static com.android.internal.telephony.flags.Flags.dataRatMetricEnabled;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -150,9 +149,7 @@
prevState, now, getDataServiceSwitch(prevState.mServiceState, newState));
}
- if (dataRatMetricEnabled()) {
- writeDataRatAtom(serviceState);
- }
+ writeDataRatAtom(serviceState);
}
/** Updates the fold state of the device for the current service state. */
diff --git a/src/java/com/android/internal/telephony/metrics/SmsStats.java b/src/java/com/android/internal/telephony/metrics/SmsStats.java
index 4ede747..d8b519c 100644
--- a/src/java/com/android/internal/telephony/metrics/SmsStats.java
+++ b/src/java/com/android/internal/telephony/metrics/SmsStats.java
@@ -57,7 +57,6 @@
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.ServiceStateTracker;
-import com.android.internal.telephony.flags.Flags;
import com.android.internal.telephony.nano.PersistAtomsProto.IncomingSms;
import com.android.internal.telephony.nano.PersistAtomsProto.OutgoingShortCodeSms;
import com.android.internal.telephony.nano.PersistAtomsProto.OutgoingSms;
@@ -411,10 +410,6 @@
}
private boolean isNonTerrestrialNetwork() {
- if (!Flags.carrierEnabledSatelliteFlag()) {
- return false;
- }
-
ServiceState ss = getServiceState();
if (ss != null) {
return ss.isUsingNonTerrestrialNetwork();
diff --git a/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java b/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
index b6a26c6..dcacb4e 100644
--- a/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
+++ b/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
@@ -478,9 +478,7 @@
@VideoState int videoState = conn.getVideoState();
VoiceCallSession proto = new VoiceCallSession();
- if (mFlags.vonrEnabledMetric()) {
- mVonrHelper.updateVonrEnabledState();
- }
+ mVonrHelper.updateVonrEnabledState();
proto.bearerAtStart = bearer;
proto.bearerAtEnd = bearer;
@@ -582,9 +580,7 @@
// Set device fold state
proto.foldState = mDeviceStateHelper.getFoldState();
- if (mFlags.vonrEnabledMetric()) {
- proto.vonrEnabled = mVonrHelper.getVonrEnabled(mPhone.getSubId());
- }
+ proto.vonrEnabled = mVonrHelper.getVonrEnabled(mPhone.getSubId());
proto.supportsBusinessCallComposer = isBusinessCallSupported();
// 0 is defined as UNKNOWN in Enum
diff --git a/src/java/com/android/internal/telephony/metrics/VonrHelper.java b/src/java/com/android/internal/telephony/metrics/VonrHelper.java
index 24c0945..0c1c111 100644
--- a/src/java/com/android/internal/telephony/metrics/VonrHelper.java
+++ b/src/java/com/android/internal/telephony/metrics/VonrHelper.java
@@ -45,22 +45,18 @@
public VonrHelper(@NonNull FeatureFlags featureFlags) {
this.mFlags = featureFlags;
- if (mFlags.vonrEnabledMetric()) {
- if (mFlags.threadShred()) {
- mHandler = new Handler(BackgroundThread.get().getLooper());
- } else {
- HandlerThread mHandlerThread = new HandlerThread("VonrHelperThread");
- mHandlerThread.start();
- mHandler = new Handler(mHandlerThread.getLooper());
- }
+ if (mFlags.threadShred()) {
+ mHandler = new Handler(BackgroundThread.get().getLooper());
+ } else {
+ HandlerThread mHandlerThread = new HandlerThread("VonrHelperThread");
+ mHandlerThread.start();
+ mHandler = new Handler(mHandlerThread.getLooper());
}
}
/** Update vonr_enabled state */
public void updateVonrEnabledState() {
- if (mFlags.vonrEnabledMetric()) {
- mHandler.post(mVonrRunnable);
- }
+ mHandler.post(mVonrRunnable);
}
@VisibleForTesting
@@ -77,10 +73,6 @@
/** Get vonr_enabled per subId */
public boolean getVonrEnabled(int subId) {
- if (mFlags.vonrEnabledMetric()) {
- return mPhoneVonrState.getOrDefault(subId, false);
- } else {
- return false;
- }
+ return mPhoneVonrState.getOrDefault(subId, false);
}
}
diff --git a/src/java/com/android/internal/telephony/satellite/SatelliteController.java b/src/java/com/android/internal/telephony/satellite/SatelliteController.java
index 48c551d..bd0f766 100644
--- a/src/java/com/android/internal/telephony/satellite/SatelliteController.java
+++ b/src/java/com/android/internal/telephony/satellite/SatelliteController.java
@@ -3125,14 +3125,8 @@
public void addAttachRestrictionForCarrier(int subId,
@SatelliteManager.SatelliteCommunicationRestrictionReason int reason,
@NonNull IIntegerConsumer callback) {
- if (DBG) logd("addAttachRestrictionForCarrier(" + subId + ", " + reason + ")");
+ logd("addAttachRestrictionForCarrier(" + subId + ", " + reason + ")");
Consumer<Integer> result = FunctionalUtils.ignoreRemoteException(callback::accept);
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- result.accept(SatelliteManager.SATELLITE_RESULT_REQUEST_NOT_SUPPORTED);
- logd("addAttachRestrictionForCarrier: carrierEnabledSatelliteFlag is "
- + "disabled");
- return;
- }
synchronized (mIsSatelliteEnabledLock) {
if (mSatelliteAttachRestrictionForCarrierArray.getOrDefault(
@@ -3164,14 +3158,8 @@
public void removeAttachRestrictionForCarrier(int subId,
@SatelliteManager.SatelliteCommunicationRestrictionReason int reason,
@NonNull IIntegerConsumer callback) {
- if (DBG) logd("removeAttachRestrictionForCarrier(" + subId + ", " + reason + ")");
+ logd("removeAttachRestrictionForCarrier(" + subId + ", " + reason + ")");
Consumer<Integer> result = FunctionalUtils.ignoreRemoteException(callback::accept);
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- result.accept(SatelliteManager.SATELLITE_RESULT_REQUEST_NOT_SUPPORTED);
- logd("removeAttachRestrictionForCarrier: carrierEnabledSatelliteFlag is "
- + "disabled");
- return;
- }
synchronized (mIsSatelliteEnabledLock) {
if (mSatelliteAttachRestrictionForCarrierArray.getOrDefault(
@@ -3198,11 +3186,6 @@
* @return Set of reasons for disallowing satellite attach for carrier.
*/
@NonNull public Set<Integer> getAttachRestrictionReasonsForCarrier(int subId) {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("getAttachRestrictionReasonsForCarrier: carrierEnabledSatelliteFlag is "
- + "disabled");
- return new HashSet<>();
- }
synchronized (mIsSatelliteEnabledLock) {
Set<Integer> resultSet =
mSatelliteAttachRestrictionForCarrierArray.get(subId);
@@ -3775,11 +3758,6 @@
*/
@NonNull
public List<String> getSatellitePlmnsForCarrier(int subId) {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("getSatellitePlmnsForCarrier: carrierEnabledSatelliteFlag is disabled");
- return new ArrayList<>();
- }
-
if (!isSatelliteSupportedViaCarrier(subId)) {
logd("Satellite for carrier is not supported.");
return new ArrayList<>();
@@ -3884,10 +3862,6 @@
*/
@NonNull
public List<Integer> getSupportedSatelliteServicesForPlmn(int subId, String plmn) {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("getSupportedSatelliteServices: carrierEnabledSatelliteFlag is disabled");
- return new ArrayList<>();
- }
synchronized (mSupportedSatelliteServicesLock) {
Map<String, List<Integer>> allowedServicesList
= mEntitlementServiceTypeMapPerCarrier.get(subId);
@@ -3935,10 +3909,6 @@
* {@code false} otherwise.
*/
public boolean isSatelliteSupportedViaCarrier() {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("isSatelliteSupportedViaCarrier: carrierEnabledSatelliteFlag is disabled");
- return false;
- }
for (Phone phone : PhoneFactory.getPhones()) {
if (isSatelliteSupportedViaCarrier(phone.getSubId())) {
return true;
@@ -3952,11 +3922,6 @@
* subscription on the device, {@code false} otherwise.
*/
public boolean isSatelliteEmergencyMessagingSupportedViaCarrier() {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("isSatelliteEmergencyMessagingSupportedViaCarrier: carrierEnabledSatelliteFlag is"
- + " disabled");
- return false;
- }
for (Phone phone : PhoneFactory.getPhones()) {
if (isSatelliteEmergencyMessagingSupportedViaCarrier(phone.getSubId())) {
return true;
@@ -3978,10 +3943,6 @@
* satellite, {@code Pair<false, null>} otherwise.
*/
Pair<Boolean, Integer> isUsingNonTerrestrialNetworkViaCarrier() {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("isUsingNonTerrestrialNetwork: carrierEnabledSatelliteFlag is disabled");
- return new Pair<>(false, null);
- }
for (Phone phone : PhoneFactory.getPhones()) {
ServiceState serviceState = phone.getServiceState();
if (serviceState != null && serviceState.isUsingNonTerrestrialNetwork()) {
@@ -3998,11 +3959,6 @@
* duration, {@code false} and null otherwise.
*/
public Pair<Boolean, Integer> isSatelliteConnectedViaCarrierWithinHysteresisTime() {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("isSatelliteConnectedViaCarrierWithinHysteresisTime: carrierEnabledSatelliteFlag"
- + " is disabled");
- return new Pair<>(false, null);
- }
Pair<Boolean, Integer> ntnConnectedState = isUsingNonTerrestrialNetworkViaCarrier();
if (ntnConnectedState.first) {
return ntnConnectedState;
@@ -4027,11 +3983,6 @@
* duration, {@code false} otherwise.
*/
public boolean isInSatelliteModeForCarrierRoaming(@Nullable Phone phone) {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("isInSatelliteModeForCarrierRoaming: carrierEnabledSatelliteFlag is disabled");
- return false;
- }
-
if (phone == null) {
return false;
}
@@ -4161,12 +4112,6 @@
*/
@NonNull
public List<Integer> getCapabilitiesForCarrierRoamingSatelliteMode(Phone phone) {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("getCapabilitiesForCarrierRoamingSatelliteMode: carrierEnabledSatelliteFlag"
- + " is disabled");
- return new ArrayList<>();
- }
-
synchronized (mSatelliteConnectedLock) {
int subId = phone.getSubId();
if (mSatModeCapabilitiesForCarrierRoaming.containsKey(subId)) {
@@ -4270,11 +4215,6 @@
@Nullable Map<String,Integer> plmnDataServicePolicyMap,
@Nullable Map<String,Integer> plmnVoiceServicePolicyMap,
@Nullable IIntegerConsumer callback) {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("onSatelliteEntitlementStatusUpdated: carrierEnabledSatelliteFlag is not enabled");
- return;
- }
-
if (callback == null) {
callback = new IIntegerConsumer.Stub() {
@Override
@@ -5275,11 +5215,6 @@
private void configureSatellitePlmnForCarrier(int subId) {
logd("configureSatellitePlmnForCarrier");
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("configureSatellitePlmnForCarrier: carrierEnabledSatelliteFlag is disabled");
- return;
- }
-
Phone phone = SatelliteServiceUtils.getPhone(subId);
if (phone == null) {
ploge("configureSatellitePlmnForCarrier: phone is null for subId=" + subId);
@@ -5304,12 +5239,6 @@
}
private void updateSupportedSatelliteServicesForActiveSubscriptions() {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("updateSupportedSatelliteServicesForActiveSubscriptions: "
- + "carrierEnabledSatelliteFlag is disabled");
- return;
- }
-
synchronized (mSupportedSatelliteServicesLock) {
mSatelliteServicesSupportedByCarriersFromConfig.clear();
mMergedPlmnListPerCarrier.clear();
@@ -5414,11 +5343,6 @@
@NonNull
private List<String> readSatellitePlmnsFromOverlayConfig() {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("readSatellitePlmnsFromOverlayConfig: carrierEnabledSatelliteFlag is disabled");
- return new ArrayList<>();
- }
-
String[] devicePlmns = readStringArrayFromOverlayConfig(
R.array.config_satellite_providers);
return Arrays.stream(devicePlmns).toList();
@@ -6009,9 +5933,6 @@
}
private void registerForServiceStateChanged() {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- return;
- }
for (Phone phone : PhoneFactory.getPhones()) {
phone.registerForServiceStateChanged(this, EVENT_SERVICE_STATE_CHANGED, null);
}
@@ -6096,7 +6017,6 @@
}
private void updateLastNotifiedNtnModeAndNotify(@Nullable Phone phone) {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) return;
if (phone == null) {
return;
}
@@ -6586,11 +6506,6 @@
}
private void determineAutoConnectSystemNotification() {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) {
- logd("determineSystemNotification: carrierEnabledSatelliteFlag is disabled");
- return;
- }
-
Pair<Boolean, Integer> isNtn = isUsingNonTerrestrialNetworkViaCarrier();
boolean suppressSatelliteNotification = mSharedPreferences.getBoolean(
SATELLITE_SYSTEM_NOTIFICATION_DONE_KEY, false);
@@ -6857,16 +6772,12 @@
}
private void resetCarrierRoamingSatelliteModeParams() {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) return;
-
for (Phone phone : PhoneFactory.getPhones()) {
resetCarrierRoamingSatelliteModeParams(phone.getSubId());
}
}
private void resetCarrierRoamingSatelliteModeParams(int subId) {
- if (!mFeatureFlags.carrierEnabledSatelliteFlag()) return;
-
synchronized (mSatelliteConnectedLock) {
mLastSatelliteDisconnectedTimesMillis.put(subId, null);
mSatModeCapabilitiesForCarrierRoaming.remove(subId);
diff --git a/tests/telephonytests/src/com/android/internal/telephony/SignalStrengthTest.java b/tests/telephonytests/src/com/android/internal/telephony/SignalStrengthTest.java
index 786bb94..355704f 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/SignalStrengthTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/SignalStrengthTest.java
@@ -37,8 +37,6 @@
import androidx.test.filters.SmallTest;
-import com.android.internal.telephony.flags.Flags;
-
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -111,7 +109,6 @@
@Before
public void setUp() {
- mSetFlagsRule.enableFlags(Flags.FLAG_CARRIER_ENABLED_SATELLITE_FLAG);
}
@Test
diff --git a/tests/telephonytests/src/com/android/internal/telephony/data/AccessNetworksManagerTest.java b/tests/telephonytests/src/com/android/internal/telephony/data/AccessNetworksManagerTest.java
index e45023c..ddd72e3 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/data/AccessNetworksManagerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/data/AccessNetworksManagerTest.java
@@ -350,10 +350,7 @@
}
@Test
- public void testCallbackForReconnectQualifiedNetworkTypeWithFlagEnabled() throws Exception {
- when(mFeatureFlags.reconnectQualifiedNetwork()).thenReturn(true);
-
-
+ public void testCallbackForReconnectQualifiedNetworkType() throws Exception {
mAccessNetworksManager.registerCallback(mMockedCallback);
mQnsCallback.onReconnectQualifiedNetworkType(ApnSetting.TYPE_IMS | ApnSetting.TYPE_MMS,
@@ -377,29 +374,4 @@
NetworkCapabilities.NET_CAPABILITY_XCAP)).isEqualTo(
AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
}
-
- @Test
- public void testCallbackForReconnectQualifiedNetworkTypeWithFlagDisabled() throws Exception {
- when(mFeatureFlags.reconnectQualifiedNetwork()).thenReturn(false);
- mQnsCallback.onReconnectQualifiedNetworkType(ApnSetting.TYPE_IMS | ApnSetting.TYPE_MMS,
- AccessNetworkType.IWLAN);
- processAllMessages();
-
- verify(mMockedCallback, never()).onPreferredTransportChanged(
- eq(NetworkCapabilities.NET_CAPABILITY_MMS), eq(true));
- verify(mMockedCallback, never()).onPreferredTransportChanged(
- eq(NetworkCapabilities.NET_CAPABILITY_IMS), eq(true));
- verify(mMockedCallback, never()).onPreferredTransportChanged(
- eq(NetworkCapabilities.NET_CAPABILITY_XCAP), eq(true));
- Mockito.clearInvocations(mMockedCallback);
- assertThat(mAccessNetworksManager.getPreferredTransportByNetworkCapability(
- NetworkCapabilities.NET_CAPABILITY_MMS)).isEqualTo(
- AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
- assertThat(mAccessNetworksManager.getPreferredTransportByNetworkCapability(
- NetworkCapabilities.NET_CAPABILITY_IMS)).isEqualTo(
- AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
- assertThat(mAccessNetworksManager.getPreferredTransportByNetworkCapability(
- NetworkCapabilities.NET_CAPABILITY_XCAP)).isEqualTo(
- AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
- }
}
diff --git a/tests/telephonytests/src/com/android/internal/telephony/data/AutoDataSwitchControllerTest.java b/tests/telephonytests/src/com/android/internal/telephony/data/AutoDataSwitchControllerTest.java
index ae8c18e..78a1838 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/data/AutoDataSwitchControllerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/data/AutoDataSwitchControllerTest.java
@@ -193,7 +193,6 @@
mScheduledEventsToExtras = getPrivateField(mAutoDataSwitchControllerUT,
"mScheduledEventsToExtras", Map.class);
- doReturn(true).when(mFeatureFlags).carrierEnabledSatelliteFlag();
doReturn(true).when(mFeatureFlags).autoDataSwitchEnhanced();
}
diff --git a/tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkControllerTest.java b/tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkControllerTest.java
index 9a514a0..7fb743c 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkControllerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkControllerTest.java
@@ -891,7 +891,6 @@
doReturn(PhoneConstants.State.IDLE).when(mCT).getState();
doReturn(new SubscriptionInfoInternal.Builder().setId(1).build())
.when(mSubscriptionManagerService).getSubscriptionInfoInternal(anyInt());
- doReturn(true).when(mFeatureFlags).carrierEnabledSatelliteFlag();
doReturn(true).when(mFeatureFlags).incallHandoverPolicy();
when(mContext.getPackageManager()).thenReturn(mMockPackageManager);
diff --git a/tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkTest.java b/tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkTest.java
index ecff3d9..10f8718 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/data/DataNetworkTest.java
@@ -434,7 +434,6 @@
doReturn(CarrierConfigManager.SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED)
.when(mSatelliteController)
.getSatelliteDataServicePolicyForPlmn(anyInt(), anyString());
- doReturn(true).when(mFeatureFlags).carrierEnabledSatelliteFlag();
serviceStateChanged(TelephonyManager.NETWORK_TYPE_LTE,
NetworkRegistrationInfo.REGISTRATION_STATE_HOME, false/*isNtn*/);
diff --git a/tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java b/tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java
index 96d0c8c..854c871 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/data/DataProfileManagerTest.java
@@ -24,7 +24,6 @@
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
import android.annotation.NonNull;
import android.content.ContentValues;
@@ -1031,8 +1030,6 @@
@Test
public void testGetDataProfileForSatellite() {
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
-
NetworkRequest request = new NetworkRequest.Builder()
.addCapability(NetworkCapabilities.NET_CAPABILITY_RCS)
.build();
@@ -1982,7 +1979,6 @@
public void testDifferentNetworkRequestProfilesOnEsimBootStrapProvisioning() {
Mockito.clearInvocations(mDataProfileManagerCallback);
Mockito.clearInvocations(mMockedWwanDataServiceManager);
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
// SIM inserted
mDataProfileManagerUT.obtainMessage(3 /* EVENT_SIM_REFRESH */).sendToTarget();
@@ -2051,7 +2047,6 @@
public void testInfrastructureProfileOnEsimBootStrapProvisioning() {
Mockito.clearInvocations(mDataProfileManagerCallback);
Mockito.clearInvocations(mMockedWwanDataServiceManager);
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
// SIM inserted
mDataProfileManagerUT.obtainMessage(3 /* EVENT_SIM_REFRESH */).sendToTarget();
diff --git a/tests/telephonytests/src/com/android/internal/telephony/data/DataStallRecoveryManagerTest.java b/tests/telephonytests/src/com/android/internal/telephony/data/DataStallRecoveryManagerTest.java
index 9f8b8ad..55b4f1c 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/data/DataStallRecoveryManagerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/data/DataStallRecoveryManagerTest.java
@@ -91,7 +91,6 @@
Field field = DataStallRecoveryManager.class.getDeclaredField("mPredictWaitingMillis");
field.setAccessible(true);
- doReturn(true).when(mFeatureFlags).dsrsDiagnosticsEnabled();
mFakeContentResolver = new FakeContentResolver();
doReturn(mFakeContentResolver).when(mContext).getContentResolver();
// Set the global settings for action enabled state and duration to
@@ -433,7 +432,6 @@
@Test
public void testSendDSRMData() throws Exception {
ArgumentCaptor<Intent> captorIntent = ArgumentCaptor.forClass(Intent.class);
- boolean isDsrsDiagnosticsEnabled = mFeatureFlags.dsrsDiagnosticsEnabled();
logd("Set phone status to normal status.");
sendOnInternetDataNetworkCallback(true);
@@ -465,13 +463,8 @@
logd(bundle.toString());
int size = bundle.size();
logd("bundle size is " + size);
- if (isDsrsDiagnosticsEnabled) {
- // Check if bundle size is 27
- assertThat(size).isEqualTo(27);
- } else {
- // Check if bundle size is 19
- assertThat(size).isEqualTo(19);
- }
+ // Check if bundle size is 27
+ assertThat(size).isEqualTo(27);
}
}
diff --git a/tests/telephonytests/src/com/android/internal/telephony/metrics/VoiceCallSessionStatsTest.java b/tests/telephonytests/src/com/android/internal/telephony/metrics/VoiceCallSessionStatsTest.java
index 4347869..e56a8d6 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/metrics/VoiceCallSessionStatsTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/metrics/VoiceCallSessionStatsTest.java
@@ -235,8 +235,6 @@
mVoiceCallSessionStats1 = new TestableVoiceCallSessionStats(
1, mSecondPhone, mFeatureFlags);
mVoiceCallSessionStats1.onServiceStateChanged(mSecondServiceState);
-
- doReturn(true).when(mFeatureFlags).vonrEnabledMetric();
}
@After
diff --git a/tests/telephonytests/src/com/android/internal/telephony/metrics/VonrHelperTest.java b/tests/telephonytests/src/com/android/internal/telephony/metrics/VonrHelperTest.java
index ddc29de..89ec8d9 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/metrics/VonrHelperTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/metrics/VonrHelperTest.java
@@ -53,7 +53,6 @@
doReturn(SUBID).when(mPhone).getSubId();
doReturn(false).when(mTelephonyManager).isVoNrEnabled();
mVonrHelper = new TestableVonrHelper(mFeatureFlags);
- doReturn(true).when(mFeatureFlags).vonrEnabledMetric();
}
@After
diff --git a/tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java b/tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java
index 98bd7de..831c15d 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java
@@ -119,7 +119,6 @@
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import android.annotation.NonNull;
@@ -966,7 +965,6 @@
@Test
public void testRadioPowerOff() {
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
NetworkRegistrationInfo satelliteNri = new NetworkRegistrationInfo.Builder()
.setIsNonTerrestrialNetwork(true)
.setAvailableServices(List.of(NetworkRegistrationInfo.SERVICE_TYPE_DATA))
@@ -2077,14 +2075,6 @@
@Test
public void testSupportedSatelliteServices() throws Exception {
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(false);
- List<String> satellitePlmnList = mSatelliteControllerUT.getSatellitePlmnsForCarrier(
- SUB_ID);
- assertEquals(EMPTY_STRING_ARRAY.length, satellitePlmnList.size());
- List<Integer> supportedSatelliteServices =
- mSatelliteControllerUT.getSupportedSatelliteServicesForPlmn(SUB_ID, "00101");
- assertTrue(supportedSatelliteServices.isEmpty());
-
String[] satelliteProviderStrArray = {"00101", "00102"};
mContextFixture.putStringArrayResource(
R.array.config_satellite_providers, satelliteProviderStrArray);
@@ -2106,39 +2096,6 @@
TestSatelliteController testSatelliteController =
new TestSatelliteController(mContext, Looper.myLooper(), mFeatureFlags);
- satellitePlmnList = testSatelliteController.getSatellitePlmnsForCarrier(SUB_ID);
- assertTrue(satellitePlmnList.isEmpty());
- supportedSatelliteServices =
- testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID, "00101");
- assertTrue(supportedSatelliteServices.isEmpty());
-
- // Add entitlement provided PLMNs.
- setEntitlementPlmnList(testSatelliteController, SUB_ID,
- Arrays.asList("00102", "00104", "00105"));
- // Carrier config changed with carrierEnabledSatelliteFlag disabled
- for (Pair<Executor, CarrierConfigManager.CarrierConfigChangeListener> pair
- : mCarrierConfigChangedListenerList) {
- pair.first.execute(() -> pair.second.onCarrierConfigChanged(
- /*slotIndex*/ 0, /*subId*/ SUB_ID, /*carrierId*/ 0, /*specificCarrierId*/ 0)
- );
- }
- processAllMessages();
-
- supportedSatelliteServices =
- testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID, "00102");
- assertTrue(supportedSatelliteServices.isEmpty());
- supportedSatelliteServices =
- testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID, "00103");
- assertTrue(supportedSatelliteServices.isEmpty());
- supportedSatelliteServices =
- testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID, "00104");
- assertTrue(supportedSatelliteServices.isEmpty());
- supportedSatelliteServices =
- testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID, "00105");
- assertTrue(supportedSatelliteServices.isEmpty());
-
- // Trigger carrier config changed with carrierEnabledSatelliteFlag enabled
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
mCarrierConfigBundle.putBoolean(CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL,
true);
for (Pair<Executor, CarrierConfigManager.CarrierConfigChangeListener> pair
@@ -2149,35 +2106,31 @@
}
processAllMessages();
- satellitePlmnList = testSatelliteController.getSatellitePlmnsForCarrier(SUB_ID);
- assertTrue(Arrays.equals(
- expectedSupportedSatellitePlmns, satellitePlmnList.stream().toArray()));
- supportedSatelliteServices =
+ List<String> satellitePlmnList = testSatelliteController.getSatellitePlmnsForCarrier(
+ SUB_ID);
+ assertArrayEquals(expectedSupportedSatellitePlmns, satellitePlmnList.stream().toArray());
+ List<Integer> supportedSatelliteServices =
mSatelliteControllerUT.getSupportedSatelliteServicesForPlmn(SUB_ID, "00102");
// "00101" should return carrier config assigned value, though it is in allowed list.
- assertTrue(Arrays.equals(expectedSupportedServices2,
- supportedSatelliteServices.stream()
- .mapToInt(Integer::intValue)
- .toArray()));
+ assertArrayEquals(expectedSupportedServices2, supportedSatelliteServices.stream()
+ .mapToInt(Integer::intValue)
+ .toArray());
supportedSatelliteServices =
mSatelliteControllerUT.getSupportedSatelliteServicesForPlmn(SUB_ID, "00103");
- assertTrue(Arrays.equals(expectedSupportedServices3,
- supportedSatelliteServices.stream()
- .mapToInt(Integer::intValue)
- .toArray()));
+ assertArrayEquals(expectedSupportedServices3, supportedSatelliteServices.stream()
+ .mapToInt(Integer::intValue)
+ .toArray());
// "00104", and "00105" should return default supported service.
supportedSatelliteServices =
testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID, "00104");
- assertTrue(Arrays.equals(defaultSupportedServices,
- supportedSatelliteServices.stream()
- .mapToInt(Integer::intValue)
- .toArray()));
+ assertArrayEquals(defaultSupportedServices, supportedSatelliteServices.stream()
+ .mapToInt(Integer::intValue)
+ .toArray());
supportedSatelliteServices =
testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID, "00105");
- assertTrue(Arrays.equals(defaultSupportedServices,
- supportedSatelliteServices.stream()
- .mapToInt(Integer::intValue)
- .toArray()));
+ assertArrayEquals(defaultSupportedServices, supportedSatelliteServices.stream()
+ .mapToInt(Integer::intValue)
+ .toArray());
// Subscriptions changed
int[] newActiveSubIds = {SUB_ID1};
@@ -2195,64 +2148,55 @@
// "00102" and "00103" should return default supported service for SUB_ID.
supportedSatelliteServices =
testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID, "00102");
- assertTrue(Arrays.equals(defaultSupportedServices,
- supportedSatelliteServices.stream()
- .mapToInt(Integer::intValue)
- .toArray()));
+ assertArrayEquals(defaultSupportedServices, supportedSatelliteServices.stream()
+ .mapToInt(Integer::intValue)
+ .toArray());
supportedSatelliteServices =
testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID, "00103");
- assertTrue(Arrays.equals(defaultSupportedServices,
- supportedSatelliteServices.stream()
- .mapToInt(Integer::intValue)
- .toArray()));
+ assertArrayEquals(defaultSupportedServices, supportedSatelliteServices.stream()
+ .mapToInt(Integer::intValue)
+ .toArray());
// "00104", and "00105" should return default supported service for SUB_ID.
supportedSatelliteServices =
testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID, "00104");
- assertTrue(Arrays.equals(defaultSupportedServices,
- supportedSatelliteServices.stream()
- .mapToInt(Integer::intValue)
- .toArray()));
+ assertArrayEquals(defaultSupportedServices, supportedSatelliteServices.stream()
+ .mapToInt(Integer::intValue)
+ .toArray());
supportedSatelliteServices =
testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID, "00105");
- assertTrue(Arrays.equals(defaultSupportedServices,
- supportedSatelliteServices.stream()
- .mapToInt(Integer::intValue)
- .toArray()));
+ assertArrayEquals(defaultSupportedServices, supportedSatelliteServices.stream()
+ .mapToInt(Integer::intValue)
+ .toArray());
supportedSatelliteServices =
testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID1, "00102");
assertNotNull(supportedSatelliteServices);
- assertTrue(Arrays.equals(expectedSupportedServices2,
- supportedSatelliteServices.stream()
- .mapToInt(Integer::intValue)
- .toArray()));
+ assertArrayEquals(expectedSupportedServices2, supportedSatelliteServices.stream()
+ .mapToInt(Integer::intValue)
+ .toArray());
supportedSatelliteServices =
testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID1, "00103");
- assertTrue(Arrays.equals(expectedSupportedServices3,
- supportedSatelliteServices.stream()
- .mapToInt(Integer::intValue)
- .toArray()));
+ assertArrayEquals(expectedSupportedServices3, supportedSatelliteServices.stream()
+ .mapToInt(Integer::intValue)
+ .toArray());
/* "00104", and "00105" should return default supported service. */
supportedSatelliteServices =
testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID1, "00104");
- assertTrue(Arrays.equals(defaultSupportedServices,
- supportedSatelliteServices.stream()
- .mapToInt(Integer::intValue)
- .toArray()));
+ assertArrayEquals(defaultSupportedServices, supportedSatelliteServices.stream()
+ .mapToInt(Integer::intValue)
+ .toArray());
supportedSatelliteServices =
testSatelliteController.getSupportedSatelliteServicesForPlmn(SUB_ID1, "00105");
- assertTrue(Arrays.equals(defaultSupportedServices,
- supportedSatelliteServices.stream()
- .mapToInt(Integer::intValue)
- .toArray()));
+ assertArrayEquals(defaultSupportedServices, supportedSatelliteServices.stream()
+ .mapToInt(Integer::intValue)
+ .toArray());
}
@Test
public void testConfigureSatellitePlmnOnCarrierConfigChanged() {
logd("testConfigureSatellitePlmnOnCarrierConfigChanged");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(false);
String[] satelliteProviderStrArray =
{"00101", "00102", "00103", "00104", "00105"};
List<String> satellitePlmnListFromOverlayConfig =
@@ -2285,34 +2229,14 @@
carrierSupportedSatelliteServicesPerProvider.putIntArray(
"00103", supportedServices3);
List<String> expectedCarrierPlmnList = Arrays.asList("00102", "00103");
- mCarrierConfigBundle.putPersistableBundle(CarrierConfigManager
- .KEY_CARRIER_SUPPORTED_SATELLITE_SERVICES_PER_PROVIDER_BUNDLE,
- carrierSupportedSatelliteServicesPerProvider);
- for (Pair<Executor, CarrierConfigManager.CarrierConfigChangeListener> pair
- : mCarrierConfigChangedListenerList) {
- pair.first.execute(() -> pair.second.onCarrierConfigChanged(
- /*slotIndex*/ 0, /*subId*/ SUB_ID, /*carrierId*/ 0, /*specificCarrierId*/ 0)
- );
- }
- processAllMessages();
- carrierPlmnList = testSatelliteController.getSatellitePlmnsForCarrier(SUB_ID);
- verify(mPhone, never()).setSatellitePlmn(
- anyInt(), anyList(), anyList(), any(Message.class));
- assertTrue(carrierPlmnList.isEmpty());
- reset(mMockSatelliteModemInterface);
- reset(mPhone);
- // Reset TestSatelliteController so that device satellite PLMNs is loaded when
- // carrierEnabledSatelliteFlag is enabled.
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
mCarrierConfigChangedListenerList.clear();
when(mPhone.getSignalStrengthController()).thenReturn(mSignalStrengthController);
when(mPhone.getDeviceStateMonitor()).thenReturn(mDeviceStateMonitor);
testSatelliteController =
new TestSatelliteController(mContext, Looper.myLooper(), mFeatureFlags);
- // Trigger carrier config changed with carrierEnabledSatelliteFlag enabled and empty
- // carrier supported satellite services.
+ // Trigger carrier config changed with empty carrier supported satellite services.
mCarrierConfigBundle.putPersistableBundle(CarrierConfigManager
.KEY_CARRIER_SUPPORTED_SATELLITE_SERVICES_PER_PROVIDER_BUNDLE,
new PersistableBundle());
@@ -2333,8 +2257,7 @@
reset(mMockSatelliteModemInterface);
reset(mPhone);
- // Trigger carrier config changed with carrierEnabledSatelliteFlag enabled and non-empty
- // carrier supported satellite services.
+ // Trigger carrier config changed with non-empty carrier supported satellite services.
mCarrierConfigBundle.putPersistableBundle(CarrierConfigManager
.KEY_CARRIER_SUPPORTED_SATELLITE_SERVICES_PER_PROVIDER_BUNDLE,
carrierSupportedSatelliteServicesPerProvider);
@@ -2398,7 +2321,6 @@
@Test
public void testSatelliteCommunicationRestriction() {
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
mCarrierConfigBundle.putBoolean(
CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL, true);
for (Pair<Executor, CarrierConfigManager.CarrierConfigChangeListener> pair
@@ -2529,30 +2451,6 @@
verify(mPhone, times(1))
.setSatelliteEnabledForCarrier(anyInt(), eq(true), any(Message.class));
reset(mMockSatelliteModemInterface);
-
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(false);
-
- mIIntegerConsumerResults.clear();
- mSatelliteControllerUT.removeAttachRestrictionForCarrier(SUB_ID,
- SATELLITE_COMMUNICATION_RESTRICTION_REASON_USER, mIIntegerConsumer);
- processAllMessages();
- assertTrue(waitForIIntegerConsumerResult(1));
- assertEquals(
- SATELLITE_RESULT_REQUEST_NOT_SUPPORTED, (long) mIIntegerConsumerResults.get(0));
- verifyZeroInteractions(mMockSatelliteModemInterface);
-
- mIIntegerConsumerResults.clear();
- mSatelliteControllerUT.addAttachRestrictionForCarrier(SUB_ID,
- SATELLITE_COMMUNICATION_RESTRICTION_REASON_USER, mIIntegerConsumer);
- processAllMessages();
- assertTrue(waitForIIntegerConsumerResult(1));
- assertEquals(
- SATELLITE_RESULT_REQUEST_NOT_SUPPORTED, (long) mIIntegerConsumerResults.get(0));
- verifyZeroInteractions(mMockSatelliteModemInterface);
-
- Set<Integer> satelliteRestrictionReasons =
- mSatelliteControllerUT.getAttachRestrictionReasonsForCarrier(SUB_ID);
- assertTrue(satelliteRestrictionReasons.isEmpty());
}
@Test
@@ -2847,10 +2745,6 @@
@Test
public void testIsSatelliteSupportedViaCarrier() {
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(false);
- assertFalse(mSatelliteControllerUT.isSatelliteSupportedViaCarrier());
-
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
assertFalse(mSatelliteControllerUT.isSatelliteSupportedViaCarrier());
mCarrierConfigBundle.putBoolean(KEY_SATELLITE_ATTACH_SUPPORTED_BOOL, true);
@@ -2866,13 +2760,8 @@
@Test
public void testCarrierEnabledSatelliteConnectionHysteresisTime() throws Exception {
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(false);
- assertFalse(mSatelliteControllerUT
- .isSatelliteConnectedViaCarrierWithinHysteresisTime().first);
-
when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
when(mServiceState2.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
mCarrierConfigBundle.putInt(KEY_SATELLITE_CONNECTION_HYSTERESIS_SEC_INT, 1 * 60);
mCarrierConfigBundle.putBoolean(KEY_SATELLITE_ATTACH_SUPPORTED_BOOL, true);
for (Pair<Executor, CarrierConfigManager.CarrierConfigChangeListener> pair
@@ -3005,7 +2894,6 @@
@Test
public void testSatelliteCommunicationRestrictionForEntitlement() throws Exception {
logd("testSatelliteCommunicationRestrictionForEntitlement");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
mCarrierConfigBundle.putBoolean(CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL,
true);
@@ -3062,7 +2950,6 @@
public void testPassSatellitePlmnToModemAfterUpdateSatelliteEntitlementStatus()
throws Exception {
logd("testPassSatellitePlmnToModemAfterUpdateSatelliteEntitlementStatus");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
replaceInstance(SatelliteController.class, "mMergedPlmnListPerCarrier",
mSatelliteControllerUT, new SparseArray<>());
@@ -3215,7 +3102,6 @@
@Test
public void testUpdateSupportedSatelliteServices() throws Exception {
logd("testUpdateSupportedSatelliteServices");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
replaceInstance(SatelliteController.class, "mMergedPlmnListPerCarrier",
mSatelliteControllerUT, new SparseArray<>());
replaceInstance(SatelliteController.class,
@@ -3337,7 +3223,6 @@
@Test
public void testUpdatePlmnListPerCarrier() throws Exception {
logd("testUpdatePlmnListPerCarrier");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
replaceInstance(SatelliteController.class, "mMergedPlmnListPerCarrier",
mSatelliteControllerUT, new SparseArray<>());
@@ -3396,7 +3281,6 @@
@Test
public void testEntitlementStatus() throws Exception {
logd("testEntitlementStatus");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
SparseBooleanArray satelliteEnabledPerCarrier = new SparseBooleanArray();
replaceInstance(SatelliteController.class, "mSatelliteEntitlementStatusPerCarrier",
mSatelliteControllerUT, satelliteEnabledPerCarrier);
@@ -3429,7 +3313,6 @@
@Test
public void testUpdateRestrictReasonForEntitlementPerCarrier() throws Exception {
logd("testUpdateRestrictReasonForEntitlementPerCarrier");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
// Verify that the entitlement restriction reason is added before the entitlement query,
// When the Satellite entitlement status value read from DB is disabled.
@@ -3459,7 +3342,6 @@
@Test
public void testUpdateEntitlementPlmnListPerCarrier() throws Exception {
logd("testUpdateEntitlementPlmnListPerCarrier");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
// If the Satellite entitlement plmn list read from the DB is empty list and carrier
// config plmn list also is empty , check whether an empty list is returned when calling
@@ -3555,7 +3437,6 @@
public void testHandleEventServiceStateChanged() {
mContextFixture.putBooleanResource(
R.bool.config_satellite_should_notify_availability, true);
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true);
mCarrierConfigBundle.putInt(KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT,
CARRIER_ROAMING_NTN_CONNECT_AUTOMATIC);
@@ -3954,12 +3835,7 @@
@Test
public void testIsSatelliteEmergencyMessagingSupportedViaCarrier() {
- // Carrier-enabled flag is off
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(false);
- assertFalse(mSatelliteControllerUT.isSatelliteEmergencyMessagingSupportedViaCarrier());
-
- // Carrier-enabled flag is on and satellite attach is not supported
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
+ // Satellite attach is not supported
assertFalse(mSatelliteControllerUT.isSatelliteEmergencyMessagingSupportedViaCarrier());
// Trigger carrier config changed to enable satellite attach
@@ -3991,13 +3867,6 @@
@Test
public void testGetCarrierEmergencyCallWaitForConnectionTimeoutMillis() {
- // Carrier-enabled flag is off
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(false);
- assertEquals(DEFAULT_CARRIER_EMERGENCY_CALL_WAIT_FOR_CONNECTION_TIMEOUT_MILLIS,
- mSatelliteControllerUT.getCarrierEmergencyCallWaitForConnectionTimeoutMillis());
-
- // Carrier-enabled flag is on
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
assertEquals(DEFAULT_CARRIER_EMERGENCY_CALL_WAIT_FOR_CONNECTION_TIMEOUT_MILLIS,
mSatelliteControllerUT.getCarrierEmergencyCallWaitForConnectionTimeoutMillis());
@@ -4057,7 +3926,6 @@
assertFalse(mSatelliteControllerUT.isCarrierRoamingNtnEligible(null));
when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true);
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
when(mServiceState2.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
mSatelliteControllerUT.mIsApplicationSupportsP2P = true;
@@ -4121,7 +3989,6 @@
mContextFixture.putBooleanResource(
R.bool.config_satellite_should_notify_availability, true);
when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true);
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
when(mServiceState2.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
mSatelliteControllerUT.mIsApplicationSupportsP2P = true;
@@ -4184,7 +4051,6 @@
@Test
public void testNotifyCarrierRoamingNtnSignalStrengthChanged() {
when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true);
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
sendSignalStrengthChangedEvent(mPhone.getPhoneId());
processAllMessages();
@@ -4922,7 +4788,6 @@
@Test
public void testIsCarrierRoamingNtnAvailableServicesForManualConnect() {
when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true);
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
mCarrierConfigBundle.putBoolean(KEY_SATELLITE_ATTACH_SUPPORTED_BOOL, true);
// CARRIER_ROAMING_NTN_CONNECT_MANUAL: 1
mCarrierConfigBundle.putInt(KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT, 1);
@@ -4943,7 +4808,6 @@
@Test
public void testIsCarrierRoamingNtnAvailableServicesForAutomaticConnect() {
when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true);
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
mCarrierConfigBundle.putBoolean(KEY_SATELLITE_ATTACH_SUPPORTED_BOOL, true);
// CARRIER_ROAMING_NTN_CONNECT_AUTOMATIC: 0
mCarrierConfigBundle.putInt(KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT, 0);
@@ -6294,7 +6158,6 @@
@Test
public void testGetSatelliteDataPlanForPlmn_WithEntitlement() throws Exception {
logd("testGetSatelliteDataPlanForPlmn_WithEntitlement");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
replaceInstance(SatelliteController.class, "mMergedPlmnListPerCarrier",
mSatelliteControllerUT, new SparseArray<>());
@@ -6328,7 +6191,6 @@
@Test
public void testGetSatelliteDataPlanForPlmn_WithoutEntitlement() throws Exception {
logd("testGetSatelliteDataPlanForPlmn_WithoutEntitlement");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
replaceInstance(SatelliteController.class, "mMergedPlmnListPerCarrier",
mSatelliteControllerUT, new SparseArray<>());
@@ -6357,7 +6219,6 @@
public void testSupportedSatelliteServices_WithoutDataEntitlement_WithNoDataServiceWithConfig()
throws Exception {
logd("TestGetSupportedSatelliteServicesForPlmn_WithEntitlement");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
replaceInstance(SatelliteController.class, "mMergedPlmnListPerCarrier",
mSatelliteControllerUT, new SparseArray<>());
@@ -6416,7 +6277,6 @@
public void testSupportedSatelliteServices_WithoutDataEntitlement_WithDataServiceConfig()
throws Exception {
logd("TestGetSupportedSatelliteServicesForPlmn_WithEntitlement");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
replaceInstance(SatelliteController.class, "mMergedPlmnListPerCarrier",
mSatelliteControllerUT, new SparseArray<>());
@@ -6478,7 +6338,6 @@
public void testSupportedSatelliteServices_WithoutDataEntitlement_NoMmsServiceWithConfig()
throws Exception {
logd("TestGetSupportedSatelliteServicesForPlmn_WithEntitlement");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
replaceInstance(SatelliteController.class, "mMergedPlmnListPerCarrier",
mSatelliteControllerUT, new SparseArray<>());
@@ -6537,7 +6396,6 @@
public void testSupportedSatelliteServices_WithoutDataEntitlement_NonRestrictedMode()
throws Exception {
logd("TestGetSupportedSatelliteServicesForPlmn_WithEntitlement");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
replaceInstance(SatelliteController.class, "mMergedPlmnListPerCarrier",
mSatelliteControllerUT, new SparseArray<>());
@@ -6596,7 +6454,6 @@
@Test
public void testGetSupportedSatelliteServicesForPlmn_WithoutEntitlement() throws Exception {
logd("TestGetSupportedSatelliteServicesForPlmn_WithoutAllowedServices");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
replaceInstance(SatelliteController.class, "mMergedPlmnListPerCarrier",
mSatelliteControllerUT, new SparseArray<>());
@@ -6644,7 +6501,6 @@
@Test
public void testGetSupportedSatelliteDataModeForPlmn_WithEntitlement() throws Exception {
logd("testGetSupportedSatelliteDataModeForPlmn_WithEntitlement");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
replaceInstance(SatelliteController.class, "mMergedPlmnListPerCarrier",
mSatelliteControllerUT, new SparseArray<>());
@@ -6682,7 +6538,6 @@
@Test
public void testGetSupportedSatelliteDataModeForPlmn_WithoutEntitlement() throws Exception {
logd("testGetSupportedSatelliteDataModeForPlmn_WithoutEntitlement");
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
replaceInstance(SatelliteController.class, "mMergedPlmnListPerCarrier",
mSatelliteControllerUT, new SparseArray<>());
@@ -6731,7 +6586,6 @@
@Test
public void testNotifyCarrierRoamingNtnAvailableServicesChanged_noServices() throws Exception {
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true);
mSatelliteControllerUT.setCallOnlySuperMethod();
List<String> overlayConfigPlmnList = new ArrayList<>();
@@ -6741,19 +6595,22 @@
CarrierConfigManager.KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, true);
mCarrierConfigBundle.putBoolean(CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL,
true);
+ mCarrierConfigBundle.putIntArray(
+ CarrierConfigManager.KEY_CARRIER_ROAMING_SATELLITE_DEFAULT_SERVICES_INT_ARRAY,
+ new int[]{});
+ invokeCarrierConfigChanged();
List<String> entitlementPlmnList = Arrays.stream(
new String[]{"00101", "00102", "00103", "00104"}).toList();
mSatelliteControllerUT.onSatelliteEntitlementStatusUpdated(SUB_ID, false,
entitlementPlmnList, new ArrayList<>(), new HashMap<>(),
new HashMap<>() /*serviceTypeListMap*/, new HashMap<>(), new HashMap<>(),
mIIntegerConsumer);
- verify(mPhone, times(1)).notifyCarrierRoamingNtnAvailableServicesChanged(
+ verify(mPhone, times(2)).notifyCarrierRoamingNtnAvailableServicesChanged(
(int[]) ArgumentMatchers.any());
}
@Test
public void testNotifyCarrierRoamingNtnAvailableServicesChanged() throws Exception {
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true);
mSatelliteControllerUT.setCallOnlySuperMethod();
List<String> overlayConfigPlmnList = new ArrayList<>();
@@ -6763,6 +6620,7 @@
CarrierConfigManager.KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, true);
mCarrierConfigBundle.putBoolean(CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL,
true);
+ invokeCarrierConfigChanged();
List<String> entitlementPlmnList = Arrays.stream(
new String[]{"00101", "00102", "00103", "00104"}).toList();
@@ -6778,14 +6636,13 @@
int[] supportedServices = mSatelliteControllerUT.getSupportedServicesOnCarrierRoamingNtn(
SUB_ID);
assertArrayEquals(expectedServices, supportedServices);
- verify(mPhone, times(1)).notifyCarrierRoamingNtnAvailableServicesChanged(
+ verify(mPhone, times(2)).notifyCarrierRoamingNtnAvailableServicesChanged(
(int[]) ArgumentMatchers.any());
}
@Test
public void testNotifyCarrierRoamingNtnAvailableServicesChange_duplicateUpdates()
throws Exception {
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true);
mSatelliteControllerUT.setCallOnlySuperMethod();
List<String> overlayConfigPlmnList = new ArrayList<>();
@@ -6795,6 +6652,7 @@
CarrierConfigManager.KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, true);
mCarrierConfigBundle.putBoolean(CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL,
true);
+ invokeCarrierConfigChanged();
List<String> entitlementPlmnList = Arrays.stream(
new String[]{"00101", "00102", "00103", "00104"}).toList();
@@ -6810,7 +6668,7 @@
int[] supportedServices = mSatelliteControllerUT.getSupportedServicesOnCarrierRoamingNtn(
SUB_ID);
assertArrayEquals(expectedServices, supportedServices);
- verify(mPhone, times(1)).notifyCarrierRoamingNtnAvailableServicesChanged(
+ verify(mPhone, times(2)).notifyCarrierRoamingNtnAvailableServicesChanged(
(int[]) ArgumentMatchers.any());
mSatelliteControllerUT.onSatelliteEntitlementStatusUpdated(SUB_ID, false,
@@ -6819,14 +6677,13 @@
// There is no change in services between 2 calls, so notify should not invoke again.
supportedServices = mSatelliteControllerUT.getSupportedServicesOnCarrierRoamingNtn(SUB_ID);
assertArrayEquals(expectedServices, supportedServices);
- verify(mPhone, times(1)).notifyCarrierRoamingNtnAvailableServicesChanged(
+ verify(mPhone, times(2)).notifyCarrierRoamingNtnAvailableServicesChanged(
(int[]) ArgumentMatchers.any());
}
@Test
public void testNotifyCarrierRoamingNtnAvailableServicesChange_multipleUpdates()
throws Exception {
- when(mFeatureFlags.carrierEnabledSatelliteFlag()).thenReturn(true);
when(mFeatureFlags.carrierRoamingNbIotNtn()).thenReturn(true);
mSatelliteControllerUT.setCallOnlySuperMethod();
List<String> overlayConfigPlmnList = new ArrayList<>();
@@ -6836,6 +6693,7 @@
CarrierConfigManager.KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, true);
mCarrierConfigBundle.putBoolean(CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL,
true);
+ invokeCarrierConfigChanged();
List<String> entitlementPlmnList = Arrays.stream(
new String[]{"00101", "00102", "00103", "00104"}).toList();
@@ -6851,7 +6709,7 @@
int[] supportedServices = mSatelliteControllerUT.getSupportedServicesOnCarrierRoamingNtn(
SUB_ID);
assertArrayEquals(expectedServices, supportedServices);
- verify(mPhone, times(1)).notifyCarrierRoamingNtnAvailableServicesChanged(
+ verify(mPhone, times(2)).notifyCarrierRoamingNtnAvailableServicesChanged(
(int[]) ArgumentMatchers.any());
serviceTypeListMap = Map.of("00101", List.of(SERVICE_TYPE_VOICE, SERVICE_TYPE_SMS), "00102",
@@ -6863,7 +6721,7 @@
supportedServices = mSatelliteControllerUT.getSupportedServicesOnCarrierRoamingNtn(SUB_ID);
assertArrayEquals(expectedServices, supportedServices);
// 2 times notify called due to previous and current changes
- verify(mPhone, times(2)).notifyCarrierRoamingNtnAvailableServicesChanged(
+ verify(mPhone, times(3)).notifyCarrierRoamingNtnAvailableServicesChanged(
(int[]) ArgumentMatchers.any());
}
diff --git a/tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteSOSMessageRecommenderTest.java b/tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteSOSMessageRecommenderTest.java
index 8c972ff..0a60b85 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteSOSMessageRecommenderTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteSOSMessageRecommenderTest.java
@@ -46,6 +46,7 @@
import android.hardware.devicestate.DeviceState;
import android.net.Uri;
import android.os.Bundle;
+import android.os.Handler;
import android.os.Looper;
import android.os.OutcomeReceiver;
import android.os.RemoteException;
@@ -814,8 +815,9 @@
int registerForProvisionCount, int registerForCellularCount) {
assertEquals(registerForProvisionCount,
mTestSatelliteController.getRegisterForSatelliteProvisionStateChangedCalls());
+ Handler handler = mTestSOSMessageRecommender.getTestHandler();
verify(phone, times(registerForCellularCount))
- .registerForServiceStateChanged(any(), anyInt(), any());
+ .registerForServiceStateChanged(eq(handler), anyInt(), any());
}
private void assertUnregisterForStateChangedEventsTriggered(
@@ -1152,6 +1154,10 @@
mIsSatelliteConnectedViaCarrierWithinHysteresisTime.set(connectedViaCarrier);
mSubIdOfSatelliteConnectedViaCarrierWithinHysteresisTime.set(subId);
}
+
+ public Handler getTestHandler() {
+ return this;
+ }
}
private static class TestConnection extends Connection {