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

Commit df473dce authored by Yiyi Shen's avatar Yiyi Shen
Browse files

[Cleanup] Clean up legacy broadcast features for app switch

Test: atest
Bug: 333324985
Flag: EXEMPT remove com.android.settingslib.flags.legacy_le_audio_sharing
Change-Id: Iecd5b8074bd3724cb100f885ee0f9a6c864340c8
parent 9eef798c
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import com.android.systemui.activityIntentHelper
import com.android.systemui.animation.ActivityTransitionAnimator
import com.android.systemui.animation.DialogTransitionAnimator
import com.android.systemui.animation.Expandable
import com.android.systemui.bluetooth.mockBroadcastDialogController
import com.android.systemui.concurrency.fakeExecutor
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.kosmos.testScope
@@ -211,22 +210,6 @@ class MediaControlInteractorTest : SysuiTestCase() {
            )
    }

    @Test
    fun startBroadcastDialog() {
        val expandable = mock<Expandable>()
        val dialogTransitionController = mock<DialogTransitionAnimator.Controller>()
        whenever(expandable.dialogTransitionController()).thenReturn(dialogTransitionController)

        underTest.startBroadcastDialog(expandable, APP_NAME, PACKAGE_NAME)

        verify(kosmos.mockBroadcastDialogController)
            .createBroadcastDialogWithController(
                eq(APP_NAME),
                eq(PACKAGE_NAME),
                eq(dialogTransitionController),
            )
    }

    @Test
    fun removeMediaControl() {
        whenever(notificationLockscreenUserManager.isCurrentProfile(USER_ID)).thenReturn(true)
+0 −23
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2022 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.
-->

<shape xmlns:android="http://schemas.android.com/apk/res/android"
       xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
       android:shape="rectangle">
    <solid android:color="?androidprv:attr/colorAccentPrimary" />
    <corners android:radius="@dimen/broadcast_dialog_btn_radius" />
</shape>
+0 −23
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2022 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="24dp"
        android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"
        android:tint="?android:attr/textColorSecondary">
    <path android:fillColor="#FF000000"
          android:pathData="M9,22.4 L7.6,21 11,17.6V14.3Q10.325,14 9.913,13.375Q9.5,12.75 9.5,12Q9.5,10.95 10.225,10.225Q10.95,9.5 12,9.5Q13.05,9.5 13.775,10.225Q14.5,10.95 14.5,12Q14.5,12.75 14.088,13.375Q13.675,14 13,14.3V17.6L16.4,21L15,22.4L12,19.4ZM5,12Q5,9.05 7.05,7.025Q9.1,5 12,5Q14.9,5 16.95,7.025Q19,9.05 19,12H17Q17,9.925 15.538,8.462Q14.075,7 12,7Q9.925,7 8.463,8.462Q7,9.925 7,12ZM1,12Q1,9.7 1.863,7.7Q2.725,5.7 4.225,4.212Q5.725,2.725 7.725,1.862Q9.725,1 12,1Q14.275,1 16.275,1.862Q18.275,2.725 19.775,4.212Q21.275,5.7 22.138,7.7Q23,9.7 23,12H21Q21,10.125 20.288,8.487Q19.575,6.85 18.35,5.625Q17.125,4.4 15.488,3.7Q13.85,3 12,3Q10.15,3 8.512,3.7Q6.875,4.4 5.65,5.625Q4.425,6.85 3.712,8.487Q3,10.125 3,12Z"/>
</vector>
 No newline at end of file
+0 −79
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 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.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/dialog_bg"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/broadcast_dialog_margin"
        android:orientation="vertical">

        <ImageView
            android:id="@+id/dialog_icon"
            android:layout_width="@dimen/broadcast_dialog_icon_size"
            android:layout_height="@dimen/broadcast_dialog_icon_size"
            android:layout_marginTop="@dimen/broadcast_dialog_icon_margin_top"
            android:layout_marginBottom="@dimen/broadcast_dialog_title_img_margin_top"
            android:layout_gravity="center"
            android:src="@drawable/settings_input_antenna"/>

        <TextView
            style="@style/BroadcastDialogTitleStyle"
            android:id="@+id/dialog_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:layout_gravity="center"/>

        <TextView
            style="@style/BroadcastDialogBodyStyle"
            android:id="@+id/dialog_subtitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:layout_gravity="center"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="@dimen/broadcast_dialog_margin"
        android:layout_marginBottom="@dimen/broadcast_dialog_margin"
        android:orientation="vertical">

        <Button
            android:layout_marginBottom="@dimen/broadcast_dialog_btn_margin_bottom"
            android:id="@+id/switch_broadcast"
            style="@style/BroadcastDialogButtonStyle"/>

        <Button
            android:layout_marginBottom="@dimen/broadcast_dialog_btn_margin_bottom"
            android:id="@+id/change_output"
            android:text="@string/bt_le_audio_broadcast_dialog_different_output"
            style="@style/BroadcastDialogButtonStyle"/>

        <Button
            android:id="@+id/cancel"
            android:text="@android:string/cancel"
            style="@style/BroadcastDialogButtonStyle"/>
    </LinearLayout>

</LinearLayout>
+0 −140
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2022 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.
  -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/broadcast_info_area"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="start|center_vertical"
    android:orientation="vertical">

    <View
        style="@style/BroadcastDialog.Divider.Horizontal"
        android:layout_marginBottom="6dp"/>

    <LinearLayout
        android:id="@+id/broadcast_qrcode_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >
        <ImageView
            android:id="@+id/qrcode_view"
            android:layout_width="@dimen/media_output_qrcode_size"
            android:layout_height="@dimen/media_output_qrcode_size"
            android:src="@android:color/transparent"
            android:gravity="start|center_vertical"
            android:layout_marginStart="82dp"/>
        <ImageView
            android:id="@+id/broadcast_info"
            android:layout_width="@dimen/media_output_broadcast_info"
            android:layout_height="@dimen/media_output_broadcast_info"
            android:src="@drawable/ic_info_outline"
            android:tint="?android:attr/textColorTertiary"
            android:clickable="true"
            android:layout_marginTop="168dp"
            android:layout_marginStart="31dp"/>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/broadcast_name_layout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingStart="@dimen/media_output_broadcast_info_item_padding_start"
        android:paddingEnd="@dimen/media_output_broadcast_info_item_padding_end"
        android:orientation="horizontal">
        <LinearLayout
            android:layout_width="0dp"
            android:layout_weight="1"
            android:orientation="vertical"
            style="@style/BroadcastDialog.InfoItem" >
            <TextView
                android:id="@+id/broadcast_name_title"
                android:text="@string/media_output_broadcast_name"
                style="@style/BroadcastDialog.InfoItem.Title" />
            <TextView
                android:id="@+id/broadcast_name_summary"
                style="@style/BroadcastDialog.InfoItem.Summary" />
        </LinearLayout>

        <View
            style="@style/BroadcastDialog.Divider.Vertical" />

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end|center_vertical">
            <ImageView
                android:id="@+id/broadcast_name_edit"
                style="@style/BroadcastDialog.InfoItem.Edit" />
        </FrameLayout>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/broadcast_code_layout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingStart="@dimen/media_output_broadcast_info_item_padding_start"
        android:paddingEnd="@dimen/media_output_broadcast_info_item_padding_end"
        android:orientation="horizontal" >
        <LinearLayout
            android:layout_width="0dp"
            android:layout_weight="1"
            android:orientation="vertical"
            style="@style/BroadcastDialog.InfoItem" >
            <TextView
                android:id="@+id/broadcast_code_title"
                android:text="@string/media_output_broadcast_code"
                style="@style/BroadcastDialog.InfoItem.Title" />
            <TextView
                android:id="@+id/broadcast_code_summary"
                style="@style/BroadcastDialog.InfoItem.Summary" />
        </LinearLayout>

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end|center_vertical"
            android:layout_marginEnd="26dp">
            <ImageView
                android:id="@+id/broadcast_code_eye"
                android:layout_width="20dp"
                android:layout_height="16dp"
                android:background="?android:attr/selectableItemBackground"
                android:clickable="true"
                android:focusable="true"
                android:src="@drawable/ic_broadcast_code_eye"
                android:tint="?android:attr/textColorPrimary"/>
        </FrameLayout>

        <View
            style="@style/BroadcastDialog.Divider.Vertical" />

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end|center_vertical">
            <ImageView
                android:id="@+id/broadcast_code_edit"
                style="@style/BroadcastDialog.InfoItem.Edit" />
        </FrameLayout>
    </LinearLayout>

    <View
        style="@style/BroadcastDialog.Divider.Horizontal"
        android:layout_marginTop="14dp"
        android:layout_marginBottom="20dp"/>
</LinearLayout>
 No newline at end of file
Loading