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

Commit 3fce9f7b authored by Evan Laird's avatar Evan Laird Committed by Android (Google) Code Review
Browse files

Merge changes Ib274a6af,I1f8e5a92,Ifb28f882 into main

* changes:
  [mobile] stacked mobile icon roaming indicator
  [battery] add battery saver accessibility string
  [sb] 6sp spacing between the new RAT and the level
parents 11538b19 b94073d3
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -213,6 +213,32 @@ class StackedMobileIconViewModelTest : SysuiTestCase() {
            assertThat(underTest.mobileContext).isEqualTo(contextSub2)
        }

    @Test
    @EnableFlags(NewStatusBarIcons.FLAG_NAME, StatusBarRootModernization.FLAG_NAME)
    fun roaming_primaryConnectionIsRoaming_true() =
        kosmos.runTest {
            fakeMobileIconsInteractor.filteredSubscriptions.value = listOf(SUB_1, SUB_2)
            fakeMobileIconsInteractor.activeMobileDataSubscriptionId.value = SUB_1.subscriptionId
            val intr1 = fakeMobileIconsInteractor.getInteractorForSubId(SUB_1.subscriptionId)!!

            intr1.isRoaming.value = true

            assertThat(underTest.roaming).isTrue()
        }

    @Test
    @EnableFlags(NewStatusBarIcons.FLAG_NAME, StatusBarRootModernization.FLAG_NAME)
    fun roaming_secondaryConnectionIsRoaming_false() =
        kosmos.runTest {
            fakeMobileIconsInteractor.filteredSubscriptions.value = listOf(SUB_1, SUB_2)
            fakeMobileIconsInteractor.activeMobileDataSubscriptionId.value = SUB_1.subscriptionId
            val intr2 = fakeMobileIconsInteractor.getInteractorForSubId(SUB_2.subscriptionId)!!

            intr2.isRoaming.value = true

            assertThat(underTest.roaming).isFalse()
        }

    private fun setIconLevel(subId: Int, level: Int) {
        with(kosmos.fakeMobileIconsInteractor.getInteractorForSubId(subId)!!) {
            signalLevelIcon.value =
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@
            android:id="@+id/mobile_roaming_updated"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/status_bar_mobile_roam_size_updated"
            android:layout_marginStart="@dimen/status_bar_mobile_type_container_margin_end"
            android:layout_marginStart="@dimen/status_bar_end_side_roam_icon_margin_start"
            android:layout_marginTop="1sp"
            android:visibility="gone"
            android:src="@drawable/stat_sys_roaming_updated"
+2 −1
Original line number Diff line number Diff line
@@ -232,7 +232,8 @@
    <!-- Size of the view that contains the network type. Should be equal to
   status_bar_mobile_type_size + 2, to account for 1sp top and bottom padding -->
    <dimen name="status_bar_mobile_container_height_updated">12sp</dimen>
    <dimen name="status_bar_mobile_type_container_margin_end">2sp</dimen>
    <dimen name="status_bar_mobile_type_container_margin_end">6sp</dimen>
    <dimen name="status_bar_end_side_roam_icon_margin_start">2sp</dimen>
    <!-- Corner radius for the background of the network type indicator. Should be equal to
        status_bar_mobile_container_height / 2 -->
    <dimen name="status_bar_mobile_container_corner_radius_updated">7sp</dimen>
+3 −0
Original line number Diff line number Diff line
@@ -643,6 +643,9 @@
    <!-- Content description of the battery level icon for accessibility, including the estimated time remaining before the phone runs out of battery *and* information that the device charging is paused in order to protect the lifetime of the battery (not shown on screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_battery_level_charging_paused_with_estimate">Battery <xliff:g id="percentage" example="90%">%1$d</xliff:g> percent, <xliff:g id="time" example="Until 3:15pm">%2$s</xliff:g>, charging paused for battery protection.</string>

    <!-- Content description of the battery level icon for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_battery_level_battery_saver_with_percent">Battery <xliff:g id="number">%d</xliff:g> percent. Battery saver is on.</string>

    <!-- Content description of overflow icon container of the notifications for accessibility (not shown on the screen)[CHAR LIMIT=NONE] -->
    <string name="accessibility_overflow_action">See all notifications</string>

+9 −0
Original line number Diff line number Diff line
@@ -198,6 +198,15 @@ sealed class BatteryViewModel(
                            ContentDescription.Loaded(descr)
                        }

                        attr == PowerSave -> {
                            val descr =
                                context.getString(
                                    R.string.accessibility_battery_level_battery_saver_with_percent,
                                    level,
                                )
                            ContentDescription.Loaded(descr)
                        }

                        else -> {
                            val descr =
                                context.getString(R.string.accessibility_battery_level, level)
Loading