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

Commit e7aed631 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "PBAP: Fix Functionality failure for PBAP"

parents ddff8059 6e404ed3
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -186,15 +186,15 @@ public class BluetoothPbapService extends ProfileService {

    // process the intent from receiver
    private void parseIntent(final Intent intent) {
        String action = intent.getStringExtra("action");
        String action = intent.getAction();
        if (action == null) return;             // Nothing to do
        if (VERBOSE) Log.v(TAG, "action: " + action);

        int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR);
        if (VERBOSE) Log.v(TAG, "state: " + state);

        if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)
                && (state == BluetoothAdapter.STATE_TURNING_OFF)) {
        if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
            if (state == BluetoothAdapter.STATE_TURNING_OFF) {
                // Send any pending timeout now, as this service will be destroyed.
                if (mSessionStatusHandler.hasMessages(USER_TIMEOUT)) {
                    mSessionStatusHandler.removeMessages(USER_TIMEOUT);
@@ -203,6 +203,10 @@ public class BluetoothPbapService extends ProfileService {
                // Release all resources
                closeService();
                return;
            } else if (state == BluetoothAdapter.STATE_ON) {
                // start RFCOMM listener
                mSessionStatusHandler.sendMessage(mSessionStatusHandler.obtainMessage(START_LISTENER));
            }
        }

        if (action.equals(BluetoothDevice.ACTION_ACL_DISCONNECTED) && mIsWaitingAuthorization) {
@@ -612,8 +616,6 @@ public class BluetoothPbapService extends ProfileService {
                case START_LISTENER:
                    if (mAdapter.isEnabled()) {
                        startRfcommSocketListener();
                    } else {
                        closeService();// release all resources
                    }
                    break;
                case USER_TIMEOUT:
@@ -780,8 +782,6 @@ public class BluetoothPbapService extends ProfileService {
        mInterrupted = false;
        BluetoothPbapConfig.init(this);
        mAdapter = BluetoothAdapter.getDefaultAdapter();
        // start RFCOMM listener
        mSessionStatusHandler.sendMessage(mSessionStatusHandler.obtainMessage(START_LISTENER));
        return true;
    }