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

Commit 217b5159 authored by David Duarte's avatar David Duarte Committed by Gerrit Code Review
Browse files

Merge "BluetoothPbapService: Remove mContext" into main

parents 3c99c706 6df23373
Loading
Loading
Loading
Loading
+19 −20
Original line number Diff line number Diff line
@@ -173,8 +173,6 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect

    private int mSdpHandle = -1;

    protected Context mContext;

    private PbapHandler mSessionStatusHandler;
    private HandlerThread mHandlerThread;
    @VisibleForTesting
@@ -495,7 +493,7 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect
                    }
                    createSdpRecord();
                    // fetch Pbap Params to check if significant change has happened to Database
                    BluetoothPbapUtils.fetchPbapParams(mContext);
                    BluetoothPbapUtils.fetchPbapParams(BluetoothPbapService.this);
                    break;
                case USER_TIMEOUT:
                    Intent intent = new Intent(BluetoothDevice.ACTION_CONNECTION_ACCESS_CANCEL);
@@ -712,7 +710,6 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect
        // Enable owned Activity component
        setComponentAvailable(PBAP_ACTIVITY, true);

        mContext = this;
        mContactsLoaded = false;
        mHandlerThread = new HandlerThread("PbapHandlerThread");
        BluetoothMethodProxy mp = BluetoothMethodProxy.getInstance();
@@ -991,11 +988,12 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect

    private void loadAllContacts() {
        if (mThreadLoadContacts == null) {
            Runnable r = new Runnable() {
            Runnable r =
                    new Runnable() {
                        @Override
                        public void run() {
                    BluetoothPbapUtils.loadAllContacts(mContext,
                            mSessionStatusHandler);
                            BluetoothPbapUtils.loadAllContacts(
                                    BluetoothPbapService.this, mSessionStatusHandler);
                            mThreadLoadContacts = null;
                        }
                    };
@@ -1006,11 +1004,12 @@ public class BluetoothPbapService extends ProfileService implements IObexConnect

    private void updateSecondaryVersion() {
        if (mThreadUpdateSecVersionCounter == null) {
            Runnable r = new Runnable() {
            Runnable r =
                    new Runnable() {
                        @Override
                        public void run() {
                    BluetoothPbapUtils.updateSecondaryVersionCounter(mContext,
                            mSessionStatusHandler);
                            BluetoothPbapUtils.updateSecondaryVersionCounter(
                                    BluetoothPbapService.this, mSessionStatusHandler);
                            mThreadUpdateSecVersionCounter = null;
                        }
                    };