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

Commit 7d655143 authored by Sanket Agarwal's avatar Sanket Agarwal Committed by Gerrit Code Review
Browse files

Merge "Init JNI in Bluetooth Service not the Bluetooth State machine"

parents 2894e3fd df032ead
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -490,6 +490,7 @@ static void classInitNative(JNIEnv* env, jclass clazz) {
}

static void initializeNative(JNIEnv* env, jobject object) {
  ALOGD("%s: HfpClient", __func__);
  const bt_interface_t* btInf = getBluetoothInterface();
  if (btInf == NULL) {
    ALOGE("Bluetooth module is not loaded");
+7 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ public class HeadsetClientService extends ProfileService {
    public static String HFP_CLIENT_STOP_TAG = "hfp_client_stop_tag";

    static {
        NativeInterface.initializeNative();
        NativeInterface.classInitNative();
    }

    @Override
@@ -81,6 +81,12 @@ public class HeadsetClientService extends ProfileService {

    @Override
    protected synchronized boolean start() {
        if (DBG) {
            Log.d(TAG, "start()");
        }
        // Setup the JNI service
        NativeInterface.initializeNative();

        mSmFactory = new HeadsetClientStateMachineFactory();
        mStateMachineMap.clear();

+0 −4
Original line number Diff line number Diff line
@@ -166,10 +166,6 @@ public class HeadsetClientStateMachine extends StateMachine {
        return mDisconnected;
    }

    static {
        NativeInterface.classInitNative();
    }

    public void dump(StringBuilder sb) {
        ProfileService.println(sb, "mCurrentDevice: " + mCurrentDevice);
        ProfileService.println(sb, "mAudioOn: " + mAudioOn);