[Audiosharing] Add audio sharing settings with the main switch.

Flagged with enable_le_audio_sharing

Bug: 305620450
Test: Manual
Change-Id: I9ca520014d3f6f7147bb9b8e7648797e79b46f53
This commit is contained in:
Yiyi Shen
2023-10-24 16:09:49 +08:00
parent a7d0d00f4a
commit 4410df7f42
7 changed files with 315 additions and 9 deletions

View File

@@ -0,0 +1,38 @@
/*
* 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.core.BasePreferenceController;
import com.android.settings.flags.Flags;
public class AudioSharingPreferenceController extends BasePreferenceController {
private static final String TAG = "AudioSharingPreferenceController";
private Context mContext;
public AudioSharingPreferenceController(Context context, String preferenceKey) {
super(context, preferenceKey);
mContext = context;
}
@Override
public int getAvailabilityStatus() {
return Flags.enableLeAudioSharing() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
}
}