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

Commit 7f9b03ac authored by Alina Zaidi's avatar Alina Zaidi Committed by Android (Google) Code Review
Browse files

Merge "Cache last focussed display id in LocalBluetoothManager" into main

parents 6019ad9b 1f265a6f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ public class LocalBluetoothManager {

    /** The broadcast receiver event manager. */
    private final BluetoothEventManager mEventManager;
    private int mCachedFocussedDisplayId = -1;

    @Nullable
    public static synchronized LocalBluetoothManager getInstance(Context context,
@@ -149,6 +150,7 @@ public class LocalBluetoothManager {
        if (context != null) {
            Log.d(TAG, "setting foreground activity to non-null context");
            mForegroundActivity = new WeakReference<>(context);
            mCachedFocussedDisplayId = context.getDisplayId();
        } else {
            if (mForegroundActivity != null) {
                Log.d(TAG, "setting foreground activity to null");
@@ -169,6 +171,11 @@ public class LocalBluetoothManager {
        return mProfileManager;
    }

    /** The displayId cached from the latest focussed display. */
    public int getCachedFocussedDisplayId() {
        return mCachedFocussedDisplayId;
    }

    public interface BluetoothManagerCallback {
        void onBluetoothManagerInitialized(Context appContext,
                LocalBluetoothManager bluetoothManager);