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

Commit 72490ec1 authored by Zhenwei Chen's avatar Zhenwei Chen Committed by Android (Google) Code Review
Browse files

Merge "Fix incorrect dock defender banner icon." into tm-qpr-dev

parents 47fa8933 36c1e7dc
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -17,14 +17,14 @@
<vector
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:name="vector"
    android:width="16dp"
    android:height="16dp"
    android:viewportWidth="16"
    android:viewportHeight="16">
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:name="path_1"
        android:pathData="M 11.739 14.409 C 11.572 14.576 11.346 14.67 11.11 14.67 L 4.89 14.67 C 4.654 14.67 4.428 14.576 4.261 14.409 C 4.094 14.242 4 14.016 4 13.78 L 4 3.55 C 4 3.316 4.092 3.091 4.257 2.924 C 4.422 2.758 4.646 2.663 4.88 2.66 L 6.33 2.66 L 6.33 1.33 L 9.66 1.33 L 9.66 2.66 L 11.11 2.66 C 11.227 2.66 11.343 2.683 11.451 2.728 C 11.559 2.773 11.657 2.838 11.739 2.921 C 11.822 3.003 11.887 3.102 11.932 3.209 C 11.977 3.317 12 3.433 12 3.55 L 12 13.78 C 12 14.016 11.906 14.242 11.739 14.409 Z M 6 9 L 8.67 4 L 8.67 7.67 L 10 7.67 L 7.33 12.67 L 7.33 9 L 6 9 Z"
        android:fillColor="#ffffff"
        android:name="path"
        android:pathData="M 18 20.673 C 18 21.027 17.859 21.367 17.609 21.617 C 17.359 21.867 17.019 22.008 16.665 22.008 L 7.335 22.008 C 6.981 22.008 6.641 21.867 6.391 21.617 C 6.141 21.367 6 21.027 6 20.673 L 6 5.328 C 6 4.977 6.139 4.639 6.386 4.389 C 6.633 4.139 6.969 3.997 7.32 3.993 L 9.495 3.993 L 9.495 1.998 L 14.49 1.998 L 14.49 3.993 L 16.665 3.993 C 16.84 3.993 17.014 4.028 17.176 4.095 C 17.338 4.162 17.485 4.26 17.609 4.384 C 17.733 4.508 17.831 4.655 17.898 4.817 C 17.965 4.979 18 5.153 18 5.328 L 18 20.673 Z M 9 13.503 L 13.005 6.003 L 13.005 11.508 L 15 11.508 L 10.995 19.008 L 10.995 13.503 L 9 13.503 Z"
        android:strokeWidth="1"
        android:fillColor="?android:attr/colorAccent"
        android:fillType="evenOdd"/>
</vector>
+13 −9
Original line number Diff line number Diff line
@@ -17,14 +17,18 @@
<vector
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:name="vector"
    android:width="16dp"
    android:height="16dp"
    android:viewportWidth="16"
    android:viewportHeight="16">
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:name="path"
        android:pathData="M 11.739 14.409 C 11.572 14.576 11.346 14.67 11.11 14.67 L 4.89 14.67 C 4.654 14.67 4.428 14.576 4.261 14.409 C 4.094 14.242 4 14.016 4 13.78 L 4 3.55 C 4 3.316 4.092 3.091 4.257 2.924 C 4.422 2.758 4.646 2.663 4.88 2.66 L 6.33 2.66 L 6.33 1.33 L 9.66 1.33 L 9.66 2.66 L 11.11 2.66 C 11.227 2.66 11.343 2.683 11.451 2.728 C 11.559 2.773 11.657 2.838 11.739 2.921 C 11.822 3.003 11.887 3.102 11.932 3.209 C 11.977 3.317 12 3.433 12 3.55 L 12 13.78 C 12 14.016 11.906 14.242 11.739 14.409 Z M 6 9 L 8.67 4 L 8.67 7.67 L 10 7.67 L 7.33 12.67 L 7.33 9 L 6 9 Z"
        android:fillColor="#000000"
        android:strokeWidth="1"
        android:fillType="evenOdd"/>
        android:pathData="M 12 11.493 L 18 9.243 L 18 5.328 C 18 4.593 17.4 3.993 16.665 3.993 L 14.49 3.993 L 14.49 1.998 L 9.495 1.998 L 9.495 3.993 L 7.32 3.993 C 6.585 3.993 5.985 4.593 5.985 5.328 L 5.985 20.673 C 5.985 21.408 6.585 22.008 7.32 22.008 L 13.365 22.008 C 12.495 20.583 12 18.918 12 17.193 L 12 11.493 Z M 7.995 6.003 L 15.99 6.003 L 15.99 9.003 L 7.995 9.003 L 7.995 6.003 Z"
        android:fillColor="?android:attr/colorAccent"
        android:strokeWidth="1"/>
    <path
        android:name="path_2"
        android:pathData="M 19.005 10.998 L 14.01 12.873 L 14.01 17.178 C 14.01 20.328 16.14 23.283 19.005 24.003 C 21.87 23.283 24 20.343 24 17.178 L 24 12.873 L 19.005 10.998 Z"
        android:fillColor="?android:attr/colorAccent"
        android:strokeWidth="1"/>
</vector>
+2 −1
Original line number Diff line number Diff line
@@ -90,7 +90,8 @@ public class DockDefenderTip extends BatteryTip {

    @Override
    public int getIconId() {
        return R.drawable.ic_battery_status_protected_24dp;
        return mMode == DockDefenderMode.ACTIVE ? R.drawable.ic_battery_status_protected_24dp :
                R.drawable.ic_battery_dock_defender_untriggered_24dp;
    }

    @Override
+12 −2
Original line number Diff line number Diff line
@@ -109,11 +109,21 @@ public class DockDefenderTipTest {
    }

    @Test
    public void testGetIconId() {
        assertThat(mDockDefenderTipFutureBypass.getIconId()).isEqualTo(
    public void testGetIconId_dockDefenderActive_getProtectedIcon() {
        assertThat(mDockDefenderTipActive.getIconId()).isEqualTo(
                R.drawable.ic_battery_status_protected_24dp);
    }

    @Test
    public void testGetIconId_dockDefenderNotActive_getUntriggeredIcon() {
        assertThat(mDockDefenderTipFutureBypass.getIconId()).isEqualTo(
                R.drawable.ic_battery_dock_defender_untriggered_24dp);
        assertThat(mDockDefenderTipTemporarilyBypassed.getIconId()).isEqualTo(
                R.drawable.ic_battery_dock_defender_untriggered_24dp);
        assertThat(mDockDefenderTipDisabled.getIconId()).isEqualTo(
                R.drawable.ic_battery_dock_defender_untriggered_24dp);
    }

    @Test
    public void testUpdateState() {
        mDockDefenderTipTemporarilyBypassed.updateState(mDockDefenderTipDisabled);