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

Commit 94c22b71 authored by Sarah Chin's avatar Sarah Chin Committed by Gerrit Code Review
Browse files

Merge changes from topics "displayinfocontroller", "remove_displayinfo"

* changes:
  Remove constants for DisplayInfo logic from DcTracker
  Add carrier configs for 5G timer requirements
parents 15418261 22b7b5e3
Loading
Loading
Loading
Loading
+85 −10
Original line number Diff line number Diff line
@@ -3025,19 +3025,93 @@ public class CarrierConfigManager {
    public static final String KEY_5G_ICON_CONFIGURATION_STRING = "5g_icon_configuration_string";

    /**
     * Timeout in seconds for displaying 5G icon, default value is 0 which means the timer is
     * disabled.
     * This configuration allows the system UI to determine how long to continue to display 5G icons
     * when the device switches between different 5G scenarios.
     *
     * There are six 5G scenarios:
     * 1. connected_mmwave: device currently connected to 5G cell as the secondary cell and using
     *    millimeter wave.
     * 2. connected: device currently connected to 5G cell as the secondary cell but not using
     *    millimeter wave.
     * 3. not_restricted_rrc_idle: device camped on a network that has 5G capability(not necessary
     *    to connect a 5G cell as a secondary cell) and the use of 5G is not restricted and RRC
     *    currently in IDLE state.
     * 4. not_restricted_rrc_con: device camped on a network that has 5G capability(not necessary
     *    to connect a 5G cell as a secondary cell) and the use of 5G is not restricted and RRC
     *    currently in CONNECTED state.
     * 5. restricted: device camped on a network that has 5G capability(not necessary to connect a
     *    5G cell as a secondary cell) but the use of 5G is restricted.
     * 6. any: any of the above scenarios, as well as none (not connected to 5G)
     *
     * The configured string contains various timer rules separated by a semicolon.
     * Each rule will have three items: prior 5G scenario, current 5G scenario, and grace period
     * in seconds before changing the icon. When the 5G state changes from the prior to the current
     * 5G scenario, the system UI will continue to show the icon for the prior 5G scenario (defined
     * in {@link #KEY_5G_ICON_CONFIGURATION_STRING}) for the amount of time specified by the grace
     * period. If the prior 5G scenario is reestablished, the timer will reset and start again if
     * the UE changes 5G scenarios again. Defined states (5G scenarios #1-5) take precedence over
     * 'any' (5G scenario #6), and unspecified transitions have a default grace period of 0.
     * The order of rules in the configuration determines the priority (the first applicable timer
     * rule will be used).
     *
     * Here is an example: "connected_mmwave,connected,30;connected_mmwave,any,10;connected,any,10"
     * This configuration defines 3 timers:
     * 1. When UE goes from 'connected_mmwave' to 'connected', system UI will continue to display
     *    the 5G icon for 'connected_mmwave' for 30 seconds.
     * 2. When UE goes from 'connected_mmwave' to any other state (except for connected, since
     *    rule 1 would be used instead), system UI will continue to display the 5G icon for
     *    'connected_mmwave' for 10 seconds.
     * 3. When UE goes from 'connected' to any other state, system UI will continue to display the
     *    5G icon for 'connected' for 10 seconds.
     *
     * @hide
     */
    public static final String KEY_5G_ICON_DISPLAY_GRACE_PERIOD_STRING =
            "5g_icon_display_grace_period_string";

    /**
     * This configuration extends {@link #KEY_5G_ICON_DISPLAY_GRACE_PERIOD_STRING} to allow the
     * system UI to continue displaying 5G icons after the initial timer expires.
     *
     * There are six 5G scenarios:
     * 1. connected_mmwave: device currently connected to 5G cell as the secondary cell and using
     *    millimeter wave.
     * 2. connected: device currently connected to 5G cell as the secondary cell but not using
     *    millimeter wave.
     * 3. not_restricted_rrc_idle: device camped on a network that has 5G capability(not necessary
     *    to connect a 5G cell as a secondary cell) and the use of 5G is not restricted and RRC
     *    currently in IDLE state.
     * 4. not_restricted_rrc_con: device camped on a network that has 5G capability(not necessary
     *    to connect a 5G cell as a secondary cell) and the use of 5G is not restricted and RRC
     *    currently in CONNECTED state.
     * 5. restricted: device camped on a network that has 5G capability(not necessary to connect a
     *    5G cell as a secondary cell) but the use of 5G is restricted.
     * 6. any: any of the above scenarios, as well as none (not connected to 5G)
     *
     * The configured string contains various timer rules separated by a semicolon.
     * Each rule will have three items: primary 5G scenario, secondary 5G scenario, and
     * grace period in seconds before changing the icon. When the timer for the primary 5G timer
     * expires, the system UI will continue to show the icon for the primary 5G scenario (defined
     * in {@link #KEY_5G_ICON_CONFIGURATION_STRING}) for the amount of time specified by the grace
     * period. If the primary 5G scenario is reestablished, the timers will reset and the system UI
     * will continue to display the icon for the primary 5G scenario without interruption. If the
     * secondary 5G scenario is lost, the timer will reset and the icon will reflect the true state.
     * Defined states (5G scenarios #1-5) take precedence over 'any' (5G scenario #6), and
     * unspecified transitions have a default grace period of 0. The order of rules in the
     * configuration determines the priority (the first applicable timer rule will be used).
     *
     * System UI will show the 5G icon and start a timer with the timeout from this config when the
     * device connects to a 5G cell. System UI stops displaying 5G icon when both the device
     * disconnects from 5G cell and the timer is expired.
     * Here is an example: "connected,not_restricted_rrc_idle,30"
     * This configuration defines a secondary timer that extends the primary 'connected' timer.
     * When the primary 'connected' timer expires while the UE is in the 'not_restricted_rrc_idle'
     * 5G state, system UI will continue to display the 5G icon for 'connected' for 30 seconds.
     * If the 5G state returns to 'connected', the timer will be reset without change to the icon,
     * and if the 5G state changes to neither 'connected' not 'not_restricted_rrc_idle', the icon
     * will change to reflect the true state.
     *
     * If 5G is reacquired during this timer, the timer is canceled and restarted when 5G is next
     * lost. Allows us to momentarily lose 5G without blinking the icon.
     * @hide
     */
    public static final String KEY_5G_ICON_DISPLAY_GRACE_PERIOD_SEC_INT =
            "5g_icon_display_grace_period_sec_int";
    public static final String KEY_5G_ICON_DISPLAY_SECONDARY_GRACE_PERIOD_STRING =
            "5g_icon_display_secondary_grace_period_string";

    /**
     * Controls time in milliseconds until DcTracker reevaluates 5G connection state.
@@ -4089,7 +4163,8 @@ public class CarrierConfigManager {
        sDefaults.putString(KEY_5G_ICON_CONFIGURATION_STRING,
                "connected_mmwave:5G,connected:5G,not_restricted_rrc_idle:5G,"
                        + "not_restricted_rrc_con:5G");
        sDefaults.putInt(KEY_5G_ICON_DISPLAY_GRACE_PERIOD_SEC_INT, 0);
        sDefaults.putString(KEY_5G_ICON_DISPLAY_GRACE_PERIOD_STRING, "");
        sDefaults.putString(KEY_5G_ICON_DISPLAY_SECONDARY_GRACE_PERIOD_STRING, "");
        /* Default value is 1 hour. */
        sDefaults.putLong(KEY_5G_WATCHDOG_TIME_MS_LONG, 3600000);
        sDefaults.putBoolean(KEY_UNMETERED_NR_NSA_BOOL, false);
+4 −5
Original line number Diff line number Diff line
@@ -109,11 +109,10 @@ public class DctConstants {
    public static final int EVENT_DATA_SERVICE_BINDING_CHANGED = BASE + 49;
    public static final int EVENT_DEVICE_PROVISIONED_CHANGE = BASE + 50;
    public static final int EVENT_DATA_ENABLED_OVERRIDE_RULES_CHANGED = BASE + 51;
    public static final int EVENT_SERVICE_STATE_CHANGED = BASE + 52;
    public static final int EVENT_5G_TIMER_HYSTERESIS = BASE + 53;
    public static final int EVENT_5G_TIMER_WATCHDOG = BASE + 54;
    public static final int EVENT_CARRIER_CONFIG_CHANGED = BASE + 55;
    public static final int EVENT_SIM_STATE_UPDATED = BASE + 56;
    public static final int EVENT_TELEPHONY_DISPLAY_INFO_CHANGED = BASE + 52;
    public static final int EVENT_NR_TIMER_WATCHDOG = BASE + 53;
    public static final int EVENT_CARRIER_CONFIG_CHANGED = BASE + 54;
    public static final int EVENT_SIM_STATE_UPDATED = BASE + 55;

    /***** Constants *****/