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

Commit 1da494c5 authored by jasonwshsu's avatar jasonwshsu
Browse files

[HA Status] Show the connection status drawable for hearing device in floating menu

* Handle connected and disconnected status drawable
* Get the status drawable via HearingDeviceStatusDrawable
* Partial update via onBindViewHolder(holder, position, payload)

Bug: 357882387
Test: atest AccessibilityTargetAdapterTest MenuListViewTouchHandlerTest
Flag: com.android.settingslib.flags.hearing_device_set_connection_status_report
Change-Id: Icd2aae3170cb3c58948ffb3f4414956840cb3026
parent c8d744d0
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -17,8 +17,10 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@color/accessibility_feature_background" />
    <foreground>
        <!-- TODO: b/382377298 - To update correct drawable with same inset
        @dimen/accessibility_icon_foreground_padding_ratio or remove the inset together. -->
        <inset
            android:drawable="@drawable/ic_accessibility_hearing_aid_foreground"
            android:inset="@dimen/accessibility_icon_foreground_padding_ratio" />
            android:inset="30%" />
    </foreground>
</adaptive-icon>
+27 −0
Original line number Diff line number Diff line
<!--
    Copyright (C) 2024 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="14dp"
    android:height="14dp"
    android:viewportWidth="14"
    android:viewportHeight="14">
    <path
        android:pathData="M7,7m-6,0a6,6 0,1 1,12 0a6,6 0,1 1,-12 0"
        android:strokeWidth="2"
        android:fillColor="#3998D3"
        android:strokeColor="#3E373C"/>
</vector>
+26 −0
Original line number Diff line number Diff line
<!--
    Copyright (C) 2024 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@color/accessibility_feature_background" />
    <foreground>
        <!-- TODO: b/382377298 - To update correct drawable with same inset
        @dimen/accessibility_icon_foreground_padding_ratio or remove the inset together. -->
        <inset
            android:drawable="@drawable/ic_accessibility_hearing_aid_disconnected_foreground"
            android:inset="30%" />
    </foreground>
</adaptive-icon>
+26 −0
Original line number Diff line number Diff line
<!--
    Copyright (C) 2024 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="22dp"
    android:height="23dp"
    android:viewportWidth="22"
    android:viewportHeight="23">
    <path
        android:pathData="M13,1C14.275,1 15.42,1.284 16.435,1.851L14.934,3.352C14.346,3.117 13.701,3 13,3C11.583,3 10.396,3.479 9.438,4.438C8.479,5.396 8,6.583 8,8C8,8.671 8.109,9.324 8.326,9.96L6.794,11.492C6.265,10.355 6,9.191 6,8C6,6.033 6.675,4.375 8.025,3.025C9.375,1.675 11.033,1 13,1ZM13,4.5C13.251,4.5 13.491,4.522 13.72,4.566L9.566,8.72C9.522,8.49 9.5,8.25 9.5,8C9.5,7.033 9.842,6.208 10.525,5.525C11.208,4.842 12.033,4.5 13,4.5ZM9.332,14.582L1.707,22.207L0.293,20.793L20.293,0.793L21.707,2.207L19.22,4.694C19.74,5.677 20,6.779 20,8H18C18,7.356 17.901,6.76 17.703,6.211L16.465,7.449C16.514,7.793 16.509,8.152 16.45,8.525L20.575,12.1L19.075,13.3C19.408,13.833 19.646,14.421 19.788,15.063C19.929,15.704 20,16.35 20,17C20,18.1 19.608,19.042 18.825,19.825C18.042,20.608 17.1,21 16,21C15.05,21 14.217,20.717 13.5,20.15C12.783,19.583 12.267,18.833 11.95,17.9C11.667,17.067 11.363,16.45 11.038,16.05C10.712,15.65 10.175,15.183 9.425,14.65C9.394,14.628 9.363,14.605 9.332,14.582ZM10.756,13.158C11.518,13.704 12.129,14.23 12.587,14.738C13.063,15.262 13.442,15.975 13.725,16.875C13.908,17.458 14.188,17.958 14.563,18.375C14.938,18.792 15.417,19 16,19C16.533,19 17,18.804 17.4,18.413C17.8,18.021 18,17.55 18,17C18,16.567 17.958,16.138 17.875,15.712C17.792,15.288 17.658,14.9 17.475,14.55L15.775,15.9L13.275,11.5C12.985,11.524 12.706,11.516 12.438,11.477L10.756,13.158ZM3.989,14.297L5.434,12.852C5.145,12.405 4.896,11.934 4.688,11.438C4.229,10.346 4,9.2 4,8C4,6.783 4.229,5.625 4.688,4.525C5.146,3.425 5.8,2.45 6.65,1.6L5.2,0.2C4.167,1.25 3.375,2.446 2.825,3.788C2.275,5.129 2,6.533 2,8C2,9.433 2.275,10.821 2.825,12.163C3.136,12.921 3.524,13.632 3.989,14.297ZM16.375,12.9L17.425,12.05L15.55,10.4L15.363,10.587C15.304,10.646 15.242,10.7 15.175,10.75L16.375,12.9Z"
        android:fillColor="#ffffff"
        android:fillType="evenOdd"/>
</vector>
+27 −0
Original line number Diff line number Diff line
<!--
    Copyright (C) 2024 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="14dp"
    android:height="14dp"
    android:viewportWidth="14"
    android:viewportHeight="14">
    <path
        android:pathData="M7,7m-6,0a6,6 0,1 1,12 0a6,6 0,1 1,-12 0"
        android:strokeWidth="2"
        android:fillColor="#6DD58C"
        android:strokeColor="#3E373C"/>
</vector>
Loading