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

Commit b2c60799 authored by SongFerng Wang's avatar SongFerng Wang Committed by Android (Google) Code Review
Browse files

Merge "Fix testcase failed" into udc-qpr-dev

parents 99d99c1e 7cbfe4a1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
        mManager = manager;
        mProfileManager = mManager.getProfileManager();
        mCachedDevice = device;
        mAllOfCachedDevices = Utils.getAllOfCachedBluetoothDevices(mContext, mCachedDevice);
        mAllOfCachedDevices = Utils.getAllOfCachedBluetoothDevices(mManager, mCachedDevice);
        lifecycle.addObserver(this);
    }

@@ -460,7 +460,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
        for (CachedBluetoothDevice item : mAllOfCachedDevices) {
            item.unregisterCallback(this);
        }
        mAllOfCachedDevices = Utils.getAllOfCachedBluetoothDevices(mContext, mCachedDevice);
        mAllOfCachedDevices = Utils.getAllOfCachedBluetoothDevices(mManager, mCachedDevice);
        for (CachedBluetoothDevice item : mAllOfCachedDevices) {
            item.registerCallback(this);
        }
+4 −2
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ public class LeAudioBluetoothDetailsHeaderController extends BasePreferenceContr

    @VisibleForTesting
    LayoutPreference mLayoutPreference;
    LocalBluetoothManager mManager;
    private CachedBluetoothDevice mCachedDevice;
    private List<CachedBluetoothDevice> mAllOfCachedDevices;
    @VisibleForTesting
@@ -152,8 +153,9 @@ public class LeAudioBluetoothDetailsHeaderController extends BasePreferenceContr
    public void init(CachedBluetoothDevice cachedBluetoothDevice,
            LocalBluetoothManager bluetoothManager) {
        mCachedDevice = cachedBluetoothDevice;
        mManager = bluetoothManager;
        mProfileManager = bluetoothManager.getProfileManager();
        mAllOfCachedDevices = Utils.getAllOfCachedBluetoothDevices(mContext, mCachedDevice);
        mAllOfCachedDevices = Utils.getAllOfCachedBluetoothDevices(mManager, mCachedDevice);
    }

    @VisibleForTesting
@@ -300,7 +302,7 @@ public class LeAudioBluetoothDetailsHeaderController extends BasePreferenceContr
        for (CachedBluetoothDevice item : mAllOfCachedDevices) {
            item.unregisterCallback(this);
        }
        mAllOfCachedDevices = Utils.getAllOfCachedBluetoothDevices(mContext, mCachedDevice);
        mAllOfCachedDevices = Utils.getAllOfCachedBluetoothDevices(mManager, mCachedDevice);
        for (CachedBluetoothDevice item : mAllOfCachedDevices) {
            item.registerCallback(this);
        }
+2 −2
Original line number Diff line number Diff line
@@ -235,7 +235,8 @@ public final class Utils {
     * @param cachedBluetoothDevice The main cachedBluetoothDevice.
     * @return all cachedBluetoothDevices with the same groupId.
     */
    public static List<CachedBluetoothDevice> getAllOfCachedBluetoothDevices(Context context,
    public static List<CachedBluetoothDevice> getAllOfCachedBluetoothDevices(
            LocalBluetoothManager localBtMgr,
            CachedBluetoothDevice cachedBluetoothDevice) {
        List<CachedBluetoothDevice> cachedBluetoothDevices = new ArrayList<>();
        if (cachedBluetoothDevice == null) {
@@ -248,7 +249,6 @@ public final class Utils {
            return cachedBluetoothDevices;
        }

        final LocalBluetoothManager localBtMgr = Utils.getLocalBtManager(context);
        if (localBtMgr == null) {
            Log.e(TAG, "getAllOfCachedBluetoothDevices: no LocalBluetoothManager");
            return cachedBluetoothDevices;