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

Commit 4319f009 authored by William Escande's avatar William Escande
Browse files

Replace hidden Iothread with new Thread

Bluetooth is going mainline and cannot call hidden api.
Iothread is hidden

Bug: 200200870
Test: build + start bt + pair
Tag: #refactor
Change-Id: Ibb4b92fbb23130575cdc565baac3a009c0aaf1fe
parent 22c1d198
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ import android.database.ContentObserver;
import android.os.Binder;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
@@ -247,6 +248,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
            new ConcurrentHashMap<IBinder, ClientDeathRecipient>();

    private int mState;
    private final HandlerThread mBluetoothHandlerThread;
    private final BluetoothHandler mHandler;
    private int mErrorRecoveryRetryCounter;
    private final int mSystemUiUid;
@@ -464,7 +466,10 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
    };

    BluetoothManagerService(Context context) {
        mHandler = new BluetoothHandler(IoThread.get().getLooper());
        mBluetoothHandlerThread = new HandlerThread("BluetoothManagerService");
        mBluetoothHandlerThread.start();

        mHandler = new BluetoothHandler(mBluetoothHandlerThread.getLooper());

        mContext = context;

@@ -541,7 +546,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
        if (airplaneModeRadios == null || airplaneModeRadios.contains(
                Settings.Global.RADIO_BLUETOOTH)) {
            mBluetoothAirplaneModeListener = new BluetoothAirplaneModeListener(
                    this, IoThread.get().getLooper(), context);
                    this, mBluetoothHandlerThread.getLooper(), context);
        }

        int systemUiUid = -1;