Cleaned up the flag reorganize_roaming_notification
Cleaned up the 24Q2 flag reorganize_roaming_notification
Test: atest TeleServiceTests
Test: Basic telephony functionality tests
Bug: 310594087
Flag: EXEMPT flag cleanup
Change-Id: I2d50feac588d1049c794b3b0e93fdd394165e3a4
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index 17d3392..26fe0f2 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -17,7 +17,6 @@
package com.android.phone;
import android.annotation.IntDef;
-import android.annotation.Nullable;
import android.app.Activity;
import android.app.KeyguardManager;
import android.app.ProgressDialog;
@@ -443,19 +442,11 @@
//TODO: handle message here;
break;
case EVENT_DATA_ROAMING_SETTINGS_CHANGED:
- if (mFeatureFlags.reorganizeRoamingNotification()) {
- updateDataRoamingStatus(
- ROAMING_NOTIFICATION_REASON_DATA_ROAMING_SETTING_CHANGED);
- } else {
- updateDataRoamingStatusForFeatureDisabled(null);
- }
+ updateDataRoamingStatus(
+ ROAMING_NOTIFICATION_REASON_DATA_ROAMING_SETTING_CHANGED);
break;
case EVENT_MOBILE_DATA_SETTINGS_CHANGED:
- if (mFeatureFlags.reorganizeRoamingNotification()) {
- updateDataRoamingStatus(ROAMING_NOTIFICATION_REASON_DATA_SETTING_CHANGED);
- } else {
- updateDataRoamingStatusForFeatureDisabled(null);
- }
+ updateDataRoamingStatus(ROAMING_NOTIFICATION_REASON_DATA_SETTING_CHANGED);
break;
case EVENT_CARRIER_CONFIG_CHANGED:
int subId = (Integer) msg.obj;
@@ -896,11 +887,7 @@
/** Clear fields on power off radio **/
private void clearCacheOnRadioOff() {
// Re-show is-roaming notifications after APM mode
- if (mFeatureFlags.reorganizeRoamingNotification()) {
- mShownNotificationReasons.clear();
- } else {
- mPrevRoamingOperatorNumerics.clear();
- }
+ mShownNotificationReasons.clear();
}
private void setRadioPowerOn() {
@@ -997,11 +984,7 @@
} else if (action.equals(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED)) {
// Roaming status could be overridden by carrier config, so we need to update it.
if (VDBG) Log.v(LOG_TAG, "carrier config changed.");
- if (mFeatureFlags.reorganizeRoamingNotification()) {
- updateDataRoamingStatus(ROAMING_NOTIFICATION_REASON_CARRIER_CONFIG_CHANGED);
- } else {
- updateDataRoamingStatusForFeatureDisabled(null);
- }
+ updateDataRoamingStatus(ROAMING_NOTIFICATION_REASON_CARRIER_CONFIG_CHANGED);
updateLimitedSimFunctionForDualSim();
int subId = intent.getIntExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX,
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
@@ -1016,12 +999,8 @@
registerSettingsObserver();
Phone phone = getPhone(mDefaultDataSubId);
if (phone != null) {
- if (mFeatureFlags.reorganizeRoamingNotification()) {
- updateDataRoamingStatus(
- ROAMING_NOTIFICATION_REASON_DEFAULT_DATA_SUBS_CHANGED);
- } else {
- updateDataRoamingStatusForFeatureDisabled(null);
- }
+ updateDataRoamingStatus(
+ ROAMING_NOTIFICATION_REASON_DEFAULT_DATA_SUBS_CHANGED);
}
}
}
@@ -1037,11 +1016,7 @@
+ mDefaultDataSubId + ", ss roaming=" + serviceState.getDataRoaming());
}
if (subId == mDefaultDataSubId) {
- if (mFeatureFlags.reorganizeRoamingNotification()) {
- updateDataRoamingStatus(ROAMING_NOTIFICATION_REASON_SERVICE_STATE_CHANGED);
- } else {
- updateDataRoamingStatusForFeatureDisabled(serviceState.getOperatorNumeric());
- }
+ updateDataRoamingStatus(ROAMING_NOTIFICATION_REASON_SERVICE_STATE_CHANGED);
}
}
@@ -1229,88 +1204,6 @@
return mCurrentRoamingNotification;
}
- // For reorganize_roaming_notification feature disabled.
- /**
- * When roaming, if mobile data cannot be established due to data roaming not enabled, we need
- * to notify the user so they can enable it through settings. Vise versa if the condition
- * changes, we need to dismiss the notification.
- * @param roamingOperatorNumeric The operator numeric for the current roaming. {@code null} if
- * the current roaming operator numeric didn't change.
- */
- private void updateDataRoamingStatusForFeatureDisabled(
- @Nullable String roamingOperatorNumeric) {
- if (VDBG) Log.v(LOG_TAG, "updateDataRoamingStatusForFeatureDisabled");
- Phone phone = getPhone(mDefaultDataSubId);
- if (phone == null) {
- Log.w(LOG_TAG, "Can't get phone with sub id = " + mDefaultDataSubId);
- return;
- }
-
- boolean dataAllowed;
- boolean notAllowedDueToRoamingOff;
- List<DataDisallowedReason> reasons = phone.getDataNetworkController()
- .getInternetDataDisallowedReasons();
- dataAllowed = reasons.isEmpty();
- notAllowedDueToRoamingOff = (reasons.size() == 1
- && reasons.contains(DataDisallowedReason.ROAMING_DISABLED));
- mDataRoamingNotifLog.log("dataAllowed=" + dataAllowed + ", reasons=" + reasons
- + ", roamingOperatorNumeric=" + roamingOperatorNumeric);
- if (VDBG) {
- Log.v(LOG_TAG, "dataAllowed=" + dataAllowed + ", reasons=" + reasons
- + ", roamingOperatorNumeric=" + roamingOperatorNumeric);
- }
-
- if (!dataAllowed && notAllowedDueToRoamingOff) {
- // Don't show roaming notification if we've already shown for this MccMnc
- if (roamingOperatorNumeric != null
- && !mPrevRoamingOperatorNumerics.add(roamingOperatorNumeric)) {
- Log.d(LOG_TAG, "Skip roaming disconnected notification since already shown in "
- + "MccMnc " + roamingOperatorNumeric);
- return;
- }
- // No need to show it again if we never cancelled it explicitly.
- if (mPrevRoamingNotification == ROAMING_NOTIFICATION_DISCONNECTED) return;
- // If the only reason of no data is data roaming disabled, then we notify the user
- // so the user can turn on data roaming.
- mPrevRoamingNotification = ROAMING_NOTIFICATION_DISCONNECTED;
- Log.d(LOG_TAG, "Show roaming disconnected notification");
- mDataRoamingNotifLog.log("Show roaming off.");
- Message msg = mHandler.obtainMessage(EVENT_DATA_ROAMING_DISCONNECTED);
- msg.arg1 = mDefaultDataSubId;
- msg.sendToTarget();
- } else if (dataAllowed && dataIsNowRoaming(mDefaultDataSubId)) {
- if (!shouldShowRoamingNotification(roamingOperatorNumeric != null
- ? roamingOperatorNumeric : phone.getServiceState().getOperatorNumeric())) {
- Log.d(LOG_TAG, "Skip showing roaming connected notification.");
- return;
- }
- // Don't show roaming notification if we've already shown for this MccMnc
- if (roamingOperatorNumeric != null
- && !mPrevRoamingOperatorNumerics.add(roamingOperatorNumeric)) {
- Log.d(LOG_TAG, "Skip roaming connected notification since already shown in "
- + "MccMnc " + roamingOperatorNumeric);
- return;
- }
- // No need to show it again if we never cancelled it explicitly, or carrier config
- // indicates this is not needed.
- if (mPrevRoamingNotification == ROAMING_NOTIFICATION_CONNECTED) return;
- mPrevRoamingNotification = ROAMING_NOTIFICATION_CONNECTED;
- Log.d(LOG_TAG, "Show roaming connected notification");
- mDataRoamingNotifLog.log("Show roaming on.");
- Message msg = mHandler.obtainMessage(EVENT_DATA_ROAMING_CONNECTED);
- msg.arg1 = mDefaultDataSubId;
- msg.sendToTarget();
- } else if (mPrevRoamingNotification != ROAMING_NOTIFICATION_NO_NOTIFICATION) {
- // Otherwise we either 1) we are not roaming or 2) roaming is off but ROAMING_DISABLED
- // is not the only data disable reason. In this case we dismiss the notification we
- // showed earlier.
- mPrevRoamingNotification = ROAMING_NOTIFICATION_NO_NOTIFICATION;
- Log.d(LOG_TAG, "Dismiss roaming notification");
- mDataRoamingNotifLog.log("Hide. data allowed=" + dataAllowed);
- mHandler.sendEmptyMessage(EVENT_DATA_ROAMING_OK);
- }
- }
-
/**
*
* @param subId to check roaming on
@@ -1448,16 +1341,10 @@
pw.increaseIndent();
pw.println("FeatureFlags:");
pw.increaseIndent();
- pw.println("reorganizeRoamingNotification="
- + mFeatureFlags.reorganizeRoamingNotification());
pw.println("dismissNetworkSelectionNotificationOnSimDisable="
+ mFeatureFlags.dismissNetworkSelectionNotificationOnSimDisable());
pw.decreaseIndent();
- if (mFeatureFlags.reorganizeRoamingNotification()) {
- pw.println("mCurrentRoamingNotification=" + mCurrentRoamingNotification);
- } else {
- pw.println("mPrevRoamingNotification=" + mPrevRoamingNotification);
- }
+ pw.println("mCurrentRoamingNotification=" + mCurrentRoamingNotification);
pw.println("mDefaultDataSubId=" + mDefaultDataSubId);
pw.println("isSmsCapable=" + TelephonyManager.from(this).isSmsCapable());
pw.println("mDataRoamingNotifLog:");
@@ -1495,11 +1382,7 @@
}
pw.decreaseIndent();
pw.decreaseIndent();
- if (mFeatureFlags.reorganizeRoamingNotification()) {
- pw.println("mShownNotificationReasons=" + mShownNotificationReasons);
- } else {
- pw.println("mPrevRoamingOperatorNumerics:" + mPrevRoamingOperatorNumerics);
- }
+ pw.println("mShownNotificationReasons=" + mShownNotificationReasons);
pw.println("------- End PhoneGlobals -------");
}