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

Commit b3882baf authored by Bhasker Neti's avatar Bhasker Neti
Browse files

Bluetooth: Update the Bluetooth state in STOP_TIMEOUT case

Bluetooth adapter state is getting updated with turn off
but the same intent is not getting broad casted to the
application, so it hanged in turning off state.

Broadcasting the TRUN_OFF intent in STOP_TIMEOUT case.

CRs-fixed: 534372
Change-Id: I4f05a946e56a87ff62c6e505b6bfbfbfe7c8c951
parent b1687752
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ import android.content.Context;

public class AdapterService extends Service {
    private static final String TAG = "BluetoothAdapterService";
    private static final boolean DBG = false;
    private static final boolean DBG = true;
    private static final boolean TRACE_REF = true;
    //For Debugging only
    private static int sRefCount=0;
@@ -315,6 +315,7 @@ public class AdapterService extends Service {

    boolean stopProfileServices() {
        Class[] supportedProfileServices = Config.getSupportedProfiles();
        Log.d(TAG,"mProfilesStarted : " + mProfilesStarted + " supportedProfileServices.length : "+ supportedProfileServices.length);
        if (mProfilesStarted && supportedProfileServices.length>0) {
            setProfileServiceState(supportedProfileServices,BluetoothAdapter.STATE_OFF);
            return true;
+1 −0
Original line number Diff line number Diff line
@@ -339,6 +339,7 @@ final class AdapterState extends StateMachine {
                    errorLog("Error stopping Bluetooth profiles");
                    mPendingCommandState.setTurningOff(false);
                    transitionTo(mOffState);
                    notifyAdapterStateChange(BluetoothAdapter.STATE_OFF);
                    break;
                case DISABLE_TIMEOUT:
                    if (DBG) Log.d(TAG,"CURRENT_STATE=PENDING, MESSAGE = DISABLE_TIMEOUT, isTurningOn=" + isTurningOn + ", isTurningOff=" + isTurningOff);