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

Commit 96723e40 authored by Shaowei Shen's avatar Shaowei Shen Committed by Android (Google) Code Review
Browse files

Merge changes from topic "sync_codebase_tm-dev"

* changes:
  [Output Switcher] Align latest code with tm-dev to resolve merge confict
  [Output Switcher] [Settingslib] Align latest code with tm-dev to resolve merge confict
parents df855952 28cca5b5
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -46,8 +46,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@@ -56,7 +54,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
 */
@RequiresApi(Build.VERSION_CODES.R)
public class LocalMediaManager implements BluetoothCallback {
    private static final Comparator<MediaDevice> COMPARATOR = Comparator.naturalOrder();
    private static final String TAG = "LocalMediaManager";
    private static final int MAX_DISCONNECTED_DEVICE_NUM = 5;

@@ -65,13 +62,15 @@ public class LocalMediaManager implements BluetoothCallback {
            MediaDeviceState.STATE_CONNECTING,
            MediaDeviceState.STATE_DISCONNECTED,
            MediaDeviceState.STATE_CONNECTING_FAILED,
            MediaDeviceState.STATE_SELECTED})
            MediaDeviceState.STATE_SELECTED,
            MediaDeviceState.STATE_GROUPING})
    public @interface MediaDeviceState {
        int STATE_CONNECTED = 0;
        int STATE_CONNECTING = 1;
        int STATE_DISCONNECTED = 2;
        int STATE_CONNECTING_FAILED = 3;
        int STATE_SELECTED = 4;
        int STATE_GROUPING = 5;
    }

    private final Collection<DeviceCallback> mCallbacks = new CopyOnWriteArrayList<>();
@@ -322,6 +321,7 @@ public class LocalMediaManager implements BluetoothCallback {
     * @return If add device successful return {@code true}, otherwise return {@code false}
     */
    public boolean addDeviceToPlayMedia(MediaDevice device) {
        device.setState(MediaDeviceState.STATE_GROUPING);
        return mInfoMediaManager.addDeviceToPlayMedia(device);
    }

@@ -332,6 +332,7 @@ public class LocalMediaManager implements BluetoothCallback {
     * @return If device stop successful return {@code true}, otherwise return {@code false}
     */
    public boolean removeDeviceFromPlayMedia(MediaDevice device) {
        device.setState(MediaDeviceState.STATE_GROUPING);
        return mInfoMediaManager.removeDeviceFromPlayMedia(device);
    }

@@ -524,7 +525,6 @@ public class LocalMediaManager implements BluetoothCallback {
        @Override
        public void onDeviceListAdded(List<MediaDevice> devices) {
            synchronized (mMediaDevicesLock) {
                Collections.sort(devices, COMPARATOR);
                mMediaDevices.clear();
                mMediaDevices.addAll(devices);
                // Add disconnected bluetooth devices only when phone output device is available.
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
        <clip>
            <shape>
                <corners
                    android:radius="28dp"/>
                    android:radius="16dp"/>
                <size
                    android:height="64dp"/>
                <solid android:color="@color/material_dynamic_primary80" />
+10 −0
Original line number Diff line number Diff line
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24"
    android:tint="?attr/colorControlNormal">
  <path
      android:fillColor="@color/media_dialog_item_main_content"
      android:pathData="M14,20.725V18.675Q16.25,18.025 17.625,16.175Q19,14.325 19,11.975Q19,9.625 17.625,7.775Q16.25,5.925 14,5.275V3.225Q17.1,3.925 19.05,6.362Q21,8.8 21,11.975Q21,15.15 19.05,17.587Q17.1,20.025 14,20.725ZM3,15V9H7L12,4V20L7,15ZM14,16V7.95Q15.125,8.475 15.812,9.575Q16.5,10.675 16.5,12Q16.5,13.325 15.812,14.4Q15.125,15.475 14,16ZM10,8.85 L7.85,11H5V13H7.85L10,15.15ZM7.5,12Z"/>
</vector>
+2 −2
Original line number Diff line number Diff line
@@ -21,6 +21,6 @@
        android:viewportHeight="24"
        android:tint="?attr/colorControlNormal">
    <path
        android:fillColor="@color/media_dialog_item_status"
        android:pathData="M9,16.2L4.8,12l-1.4,1.4L9,19 21,7l-1.4,-1.4L9,16.2z"/>
        android:fillColor="@android:color/white"
        android:pathData="M12,22Q9.925,22 8.1,21.212Q6.275,20.425 4.925,19.075Q3.575,17.725 2.788,15.9Q2,14.075 2,12Q2,9.925 2.788,8.1Q3.575,6.275 4.925,4.925Q6.275,3.575 8.1,2.787Q9.925,2 12,2Q14.075,2 15.9,2.787Q17.725,3.575 19.075,4.925Q20.425,6.275 21.212,8.1Q22,9.925 22,12Q22,14.075 21.212,15.9Q20.425,17.725 19.075,19.075Q17.725,20.425 15.9,21.212Q14.075,22 12,22ZM10.6,16.6 L17.65,9.55 16.25,8.15 10.6,13.8 7.75,10.95 6.35,12.35Z"/>
</vector>
+1 −1
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@
            style="@style/Widget.Dialog.Button.BorderButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/keyboard_key_media_stop"
            android:text="@string/media_output_dialog_button_stop_casting"
            android:visibility="gone"/>

        <Space
Loading