Removed mocked BluetoothAdapter
Bluetooth adapter can not be mocked anymore, using config resource instead. Tag: #feature Bug: 216422716 Test: robotest Change-Id: I92e503cbceb8412031c7f3b08a3e1016d38da18c
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