Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b326816 authored by Jack Yu's avatar Jack Yu Committed by Gerrit Code Review
Browse files

Merge changes from topic "auto_data_switch_api"

* changes:
  Add MOBILE_DATA_POLICY_AUTO_DATA_SWITCH
  Add string for auto data siwtch notification
parents cb0b073d 09b3c89b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -13624,6 +13624,7 @@ package android.telephony {
    field public static final int INVALID_EMERGENCY_NUMBER_DB_VERSION = -1; // 0xffffffff
    field public static final int KEY_TYPE_EPDG = 1; // 0x1
    field public static final int KEY_TYPE_WLAN = 2; // 0x2
    field public static final int MOBILE_DATA_POLICY_AUTO_DATA_SWITCH = 3; // 0x3
    field public static final int MOBILE_DATA_POLICY_DATA_ON_NON_DEFAULT_DURING_VOICE_CALL = 1; // 0x1
    field public static final int MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED = 2; // 0x2
    field public static final int NR_DUAL_CONNECTIVITY_DISABLE = 2; // 0x2
+5 −0
Original line number Diff line number Diff line
@@ -202,6 +202,11 @@
    <!-- Displayed to tell the user that they cannot change the caller ID setting. -->
    <string name="CLIRPermanent">You can\'t change the caller ID setting.</string>

    <!-- Notification title to tell the user that auto data switch has occurred. [CHAR LIMIT=NOTIF_TITLE] -->
    <string name="auto_data_switch_title">Switched data to <xliff:g id="carrierDisplay" example="Verizon">%s</xliff:g></string>
    <!-- Notification content to tell the user that auto data switch can be disabled at settings. [CHAR LIMIT=NOTIF_BODY] -->
    <string name="auto_data_switch_content">You can change this anytime in Settings</string>

    <!-- Notification title to tell the user that data service is blocked by access control. [CHAR LIMIT=NOTIF_TITLE] -->
    <string name="RestrictedOnDataTitle">No mobile data service</string>
    <!-- Notification title to tell the user that emergency calling is blocked by access control. [CHAR LIMIT=NOTIF_TITLE] -->
+2 −0
Original line number Diff line number Diff line
@@ -598,6 +598,8 @@
  <java-symbol type="string" name="RestrictedOnEmergencyTitle" />
  <java-symbol type="string" name="RestrictedOnNormalTitle" />
  <java-symbol type="string" name="RestrictedStateContent" />
  <java-symbol type="string" name="auto_data_switch_title" />
  <java-symbol type="string" name="auto_data_switch_content" />
  <java-symbol type="string" name="RestrictedStateContentMsimTemplate" />
  <java-symbol type="string" name="notification_channel_network_alert" />
  <java-symbol type="string" name="notification_channel_call_forward" />
+2 −0
Original line number Diff line number Diff line
@@ -206,6 +206,8 @@ public final class TelephonyUtils {
                return "DATA_ON_NON_DEFAULT_DURING_VOICE_CALL";
            case TelephonyManager.MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED:
                return "MMS_ALWAYS_ALLOWED";
            case TelephonyManager.MOBILE_DATA_POLICY_AUTO_DATA_SWITCH:
                return "AUTO_DATA_SWITCH";
            default:
                return "UNKNOWN(" + mobileDataPolicy + ")";
        }
+18 −0
Original line number Diff line number Diff line
@@ -15400,12 +15400,30 @@ public class TelephonyManager {
    @SystemApi
    public static final int MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED = 2;
    /**
     * Allow switching mobile data to the non-default SIM if the non-default SIM has better
     * availability.
     *
     * This is used for temporarily allowing data on the non-default data SIM when on-default SIM
     * has better availability on DSDS devices, where better availability means strong
     * signal/connectivity.
     * If this policy is enabled, data will be temporarily enabled on the non-default data SIM,
     * including during any voice calls(equivalent to enabling
     * {@link #MOBILE_DATA_POLICY_DATA_ON_NON_DEFAULT_DURING_VOICE_CALL}).
     *
     * This policy can be enabled and disabled via {@link #setMobileDataPolicyEnabled}.
     * @hide
     */
    @SystemApi
    public static final int MOBILE_DATA_POLICY_AUTO_DATA_SWITCH = 3;
    /**
     * @hide
     */
    @IntDef(prefix = { "MOBILE_DATA_POLICY_" }, value = {
            MOBILE_DATA_POLICY_DATA_ON_NON_DEFAULT_DURING_VOICE_CALL,
            MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED,
            MOBILE_DATA_POLICY_AUTO_DATA_SWITCH,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface MobileDataPolicy { }