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

Commit 37bd25b2 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Set the Adapter Service onCreate()

We should call setAdapterService(this) inside onCreate() instead of
inside BleOnProcessStart(). The former is more robust.

Change-Id: Ide1d98dfdde148645f3efe246e6fbf95659195a7
parent 78f13f84
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -524,6 +524,8 @@ public class AdapterService extends Service {
        registerReceiver(mAlarmBroadcastReceiver, new IntentFilter(ACTION_ALARM_WAKEUP));
        mProfileObserver = new ProfileObserver(getApplicationContext(), this, new Handler());
        mProfileObserver.start();

        setAdapterService(this);
    }

    @Override
@@ -579,9 +581,6 @@ public class AdapterService extends Service {
            // Ignore.
        }

        //FIXME: Set static instance here???
        setAdapterService(this);

        //Start Gatt service
        setGattProfileServiceState(supportedProfileServices,BluetoothAdapter.STATE_ON);
    }