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

Commit 55fde59c authored by Chelsea Hao's avatar Chelsea Hao Committed by Android (Google) Code Review
Browse files

Merge changes Ia5b56c28,I258add40 into main

* changes:
  [Audiosharing] Add audio sharing streams page and entry point.
  Add flag for LE audio private sharing via QR code.
parents 13150d92 9dd627e9
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -13,3 +13,10 @@ flag {
  description: "Gates whether to enable LE audio sharing"
  bug: "305620450"
}

flag {
  name: "enable_le_audio_qr_code_private_broadcast_sharing"
  namespace: "pixel_cross_device_control"
  description: "Gates whether to enable LE audio private broadcast sharing via QR code"
  bug: "308368124"
}
+9 −0
Original line number Diff line number Diff line
@@ -295,6 +295,15 @@
    <!-- Title for calls and alarms device on audio sharing page [CHAR LIMIT=none]-->
    <string name="calls_and_alarms_device_title">Calls and alarms</string>
    <!-- Title for audio streams preference category [CHAR LIMIT=none]-->
    <string name="audio_sharing_streams_category_title">Connect to a LE audio stream</string>
    <!-- Title for audio streams preference [CHAR LIMIT=none]-->
    <string name="audio_sharing_streams_pref_title">Nearby audio streams</string>
    <!-- Title for audio streams page [CHAR LIMIT=none]-->
    <string name="audio_sharing_streams_title">Audio streams</string>
    <!-- Summary for QR code scanning in audio streams page [CHAR LIMIT=none]-->
    <string name="audio_sharing_streams_qr_code_summary">Connect to an audio stream using QR code</string>
    <!-- Date & time settings screen title -->
    <string name="date_and_time">Date &amp; time</string>
+14 −0
Original line number Diff line number Diff line
@@ -25,4 +25,18 @@
        android:icon="@drawable/ic_audio_calls_and_alarms"
        settings:controller="com.android.settings.connecteddevice.audiosharing.CallsAndAlarmsPreferenceController"
        android:summary=""/>

    <PreferenceCategory
        android:key="audio_streams_settings_category"
        android:title="@string/audio_sharing_streams_category_title"
        settings:controller="com.android.settings.connecteddevice.audiosharing.AudioStreamsCategoryController" >

        <Preference
            android:key="audio_streams_settings"
            android:fragment="com.android.settings.connecteddevice.audiosharing.AudioStreamsDashboardFragment"
            android:title="@string/audio_sharing_streams_pref_title"
            android:icon="@drawable/ic_chevron_right_24dp" />

    </PreferenceCategory>

</PreferenceScreen>
 No newline at end of file
+28 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2023 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.
  -->

<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:title="@string/audio_sharing_streams_title">

    <Preference
        android:key="audio_streams_scan_qr_code"
        android:title="@string/bluetooth_find_broadcast_button_scan"
        android:icon="@drawable/ic_add_24dp"
        android:summary="@string/audio_sharing_streams_qr_code_summary"/>

</PreferenceScreen>
 No newline at end of file
+34 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 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.
 */

package com.android.settings.connecteddevice.audiosharing;

import android.content.Context;

import com.android.settings.flags.Flags;
import com.android.settings.widget.PreferenceCategoryController;

public class AudioStreamsCategoryController extends PreferenceCategoryController {

    public AudioStreamsCategoryController(Context context, String key) {
        super(context, key);
    }

    @Override
    public int getAvailabilityStatus() {
        return Flags.enableLeAudioQrCodePrivateBroadcastSharing() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
    }
}
Loading