Loading android/app/src/com/android/bluetooth/a2dp/A2dpService.java +1 −2 Original line number Diff line number Diff line Loading @@ -36,8 +36,7 @@ public class A2dpService extends ProfileService { } protected boolean start() { mStateMachine = new A2dpStateMachine(this,this); mStateMachine.start(); mStateMachine = A2dpStateMachine.make(this, this); setA2dpService(this); return true; } Loading android/app/src/com/android/bluetooth/a2dp/A2dpStateMachine.java +8 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ final class A2dpStateMachine extends StateMachine { classInitNative(); } A2dpStateMachine(A2dpService svc, Context context) { private A2dpStateMachine(A2dpService svc, Context context) { super(TAG); mService = svc; mContext = context; Loading @@ -130,6 +130,13 @@ final class A2dpStateMachine extends StateMachine { } static A2dpStateMachine make(A2dpService svc, Context context) { Log.d(TAG, "make"); A2dpStateMachine a2dpSm = new A2dpStateMachine(svc, context); a2dpSm.start(); return a2dpSm; } public void doQuit() { quitNow(); } Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +5 −7 Original line number Diff line number Diff line Loading @@ -238,11 +238,10 @@ public class AdapterService extends Service { if (DBG) debugLog("onCreate"); mBinder = new AdapterServiceBinder(this); mAdapterProperties = new AdapterProperties(this); mAdapterStateMachine = new AdapterState(this, mAdapterProperties); mAdapterStateMachine = AdapterState.make(this, mAdapterProperties); mJniCallbacks = new JniCallbacks(mAdapterStateMachine, mAdapterProperties); initNative(); mNativeAvailable=true; mAdapterStateMachine.start(); mCallbacks = new RemoteCallbackList<IBluetoothCallback>(); //Load the name and address getAdapterPropertyNative(AbstractionLayer.BT_PROPERTY_BDADDR); Loading Loading @@ -273,13 +272,12 @@ public class AdapterService extends Service { mProfileServicesState.put(supportedProfileServices[i].getName(),BluetoothAdapter.STATE_OFF); } mRemoteDevices = new RemoteDevices(this); mBondStateMachine = new BondStateMachine(this, mAdapterProperties, mRemoteDevices); mAdapterProperties.init(mRemoteDevices); mJniCallbacks.init(mBondStateMachine,mRemoteDevices); //Start Bond State Machine if (DBG) {debugLog("processStart(): Starting Bond State Machine");} mBondStateMachine.start(); if (DBG) {debugLog("processStart(): Make Bond State Machine");} mBondStateMachine = BondStateMachine.make(this, mAdapterProperties, mRemoteDevices); mJniCallbacks.init(mBondStateMachine,mRemoteDevices); //FIXME: Set static instance here??? setAdapterService(this); Loading android/app/src/com/android/bluetooth/btservice/AdapterState.java +7 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ final class AdapterState extends StateMachine { return isTurningOff; } public AdapterState(AdapterService service,AdapterProperties adapterProperties) { private AdapterState(AdapterService service, AdapterProperties adapterProperties) { super("BluetoothAdapterState:"); addState(mOnState); addState(mOffState); Loading @@ -80,6 +80,12 @@ final class AdapterState extends StateMachine { setInitialState(mOffState); } public static AdapterState make(AdapterService service, AdapterProperties adapterProperties) { Log.d(TAG, "make"); AdapterState as = new AdapterState(service, adapterProperties); as.start(); return as; } public void doQuit() { quitNow(); Loading android/app/src/com/android/bluetooth/btservice/BondStateMachine.java +9 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ final class BondStateMachine extends StateMachine { private PendingCommandState mPendingCommandState = new PendingCommandState(); private StableState mStableState = new StableState(); public BondStateMachine(AdapterService service, private BondStateMachine(AdapterService service, AdapterProperties prop, RemoteDevices remoteDevices) { super("BondStateMachine:"); addState(mStableState); Loading @@ -63,6 +63,14 @@ final class BondStateMachine extends StateMachine { setInitialState(mStableState); } public static BondStateMachine make(AdapterService service, AdapterProperties prop, RemoteDevices remoteDevices) { Log.d(TAG, "make"); BondStateMachine bsm = new BondStateMachine(service, prop, remoteDevices); bsm.start(); return bsm; } public void doQuit() { quitNow(); } Loading Loading
android/app/src/com/android/bluetooth/a2dp/A2dpService.java +1 −2 Original line number Diff line number Diff line Loading @@ -36,8 +36,7 @@ public class A2dpService extends ProfileService { } protected boolean start() { mStateMachine = new A2dpStateMachine(this,this); mStateMachine.start(); mStateMachine = A2dpStateMachine.make(this, this); setA2dpService(this); return true; } Loading
android/app/src/com/android/bluetooth/a2dp/A2dpStateMachine.java +8 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ final class A2dpStateMachine extends StateMachine { classInitNative(); } A2dpStateMachine(A2dpService svc, Context context) { private A2dpStateMachine(A2dpService svc, Context context) { super(TAG); mService = svc; mContext = context; Loading @@ -130,6 +130,13 @@ final class A2dpStateMachine extends StateMachine { } static A2dpStateMachine make(A2dpService svc, Context context) { Log.d(TAG, "make"); A2dpStateMachine a2dpSm = new A2dpStateMachine(svc, context); a2dpSm.start(); return a2dpSm; } public void doQuit() { quitNow(); } Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +5 −7 Original line number Diff line number Diff line Loading @@ -238,11 +238,10 @@ public class AdapterService extends Service { if (DBG) debugLog("onCreate"); mBinder = new AdapterServiceBinder(this); mAdapterProperties = new AdapterProperties(this); mAdapterStateMachine = new AdapterState(this, mAdapterProperties); mAdapterStateMachine = AdapterState.make(this, mAdapterProperties); mJniCallbacks = new JniCallbacks(mAdapterStateMachine, mAdapterProperties); initNative(); mNativeAvailable=true; mAdapterStateMachine.start(); mCallbacks = new RemoteCallbackList<IBluetoothCallback>(); //Load the name and address getAdapterPropertyNative(AbstractionLayer.BT_PROPERTY_BDADDR); Loading Loading @@ -273,13 +272,12 @@ public class AdapterService extends Service { mProfileServicesState.put(supportedProfileServices[i].getName(),BluetoothAdapter.STATE_OFF); } mRemoteDevices = new RemoteDevices(this); mBondStateMachine = new BondStateMachine(this, mAdapterProperties, mRemoteDevices); mAdapterProperties.init(mRemoteDevices); mJniCallbacks.init(mBondStateMachine,mRemoteDevices); //Start Bond State Machine if (DBG) {debugLog("processStart(): Starting Bond State Machine");} mBondStateMachine.start(); if (DBG) {debugLog("processStart(): Make Bond State Machine");} mBondStateMachine = BondStateMachine.make(this, mAdapterProperties, mRemoteDevices); mJniCallbacks.init(mBondStateMachine,mRemoteDevices); //FIXME: Set static instance here??? setAdapterService(this); Loading
android/app/src/com/android/bluetooth/btservice/AdapterState.java +7 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ final class AdapterState extends StateMachine { return isTurningOff; } public AdapterState(AdapterService service,AdapterProperties adapterProperties) { private AdapterState(AdapterService service, AdapterProperties adapterProperties) { super("BluetoothAdapterState:"); addState(mOnState); addState(mOffState); Loading @@ -80,6 +80,12 @@ final class AdapterState extends StateMachine { setInitialState(mOffState); } public static AdapterState make(AdapterService service, AdapterProperties adapterProperties) { Log.d(TAG, "make"); AdapterState as = new AdapterState(service, adapterProperties); as.start(); return as; } public void doQuit() { quitNow(); Loading
android/app/src/com/android/bluetooth/btservice/BondStateMachine.java +9 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ final class BondStateMachine extends StateMachine { private PendingCommandState mPendingCommandState = new PendingCommandState(); private StableState mStableState = new StableState(); public BondStateMachine(AdapterService service, private BondStateMachine(AdapterService service, AdapterProperties prop, RemoteDevices remoteDevices) { super("BondStateMachine:"); addState(mStableState); Loading @@ -63,6 +63,14 @@ final class BondStateMachine extends StateMachine { setInitialState(mStableState); } public static BondStateMachine make(AdapterService service, AdapterProperties prop, RemoteDevices remoteDevices) { Log.d(TAG, "make"); BondStateMachine bsm = new BondStateMachine(service, prop, remoteDevices); bsm.start(); return bsm; } public void doQuit() { quitNow(); } Loading