Merge "Removed mocked BluetoothAdapter" am: a6d4788fa0
am: d020a96da1
am: 28b1a9e4b0
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1960844 Change-Id: Idc59b3f953adab7686e532d36c66b12d21df995c
This commit is contained in:
@@ -16,8 +16,9 @@
|
||||
|
||||
package com.android.settings.development;
|
||||
|
||||
import android.bluetooth.BluetoothManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.os.SystemProperties;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
@@ -39,13 +40,20 @@ public class BluetoothMaxConnectedAudioDevicesPreferenceController extends
|
||||
static final String MAX_CONNECTED_AUDIO_DEVICES_PROPERTY =
|
||||
"persist.bluetooth.maxconnectedaudiodevices";
|
||||
|
||||
private final int mDefaultMaxConnectedAudioDevices;
|
||||
private int mDefaultMaxConnectedAudioDevices = 0;
|
||||
|
||||
public BluetoothMaxConnectedAudioDevicesPreferenceController(Context context) {
|
||||
super(context);
|
||||
BluetoothManager mBluetoothManager = context.getSystemService(BluetoothManager.class);
|
||||
mDefaultMaxConnectedAudioDevices = mBluetoothManager.getAdapter()
|
||||
.getMaxConnectedAudioDevices();
|
||||
|
||||
try {
|
||||
Resources res = context.getPackageManager().getResourcesForApplication(
|
||||
"com.android.bluetooth");
|
||||
mDefaultMaxConnectedAudioDevices = res.getInteger(res.getIdentifier(
|
||||
"config_bluetooth_max_connected_audio_devices",
|
||||
"integer", "com.android.bluetooth"));
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user