Loading src/com/android/bluetooth/sap/SapServer.java +9 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.os.SystemClock; import android.os.SystemProperties; import android.telephony.TelephonyManager; import android.util.Log; import android.bluetooth.BluetoothSap; //import com.android.internal.telephony.RIL; import com.google.protobuf.micro.CodedOutputStreamMicro; Loading Loading @@ -314,7 +315,6 @@ public class SapServer extends Thread implements Callback { mRilBtReceiver = new SapRilReceiver(mSapHandler, mSapServiceHandler); mRilBtReceiverThread = new Thread(mRilBtReceiver, "RilBtReceiver"); setNotification(SapMessage.DISC_GRACEFULL,0); boolean done = false; while (!done) { if(VERBOSE) Log.i(TAG, "Waiting for incomming RFCOMM message..."); Loading Loading @@ -790,6 +790,14 @@ public class SapServer extends Thread implements Callback { mState == SAP_STATE.DISCONNECTING) { sapMsg = null; } if (mSapServiceHandler != null && mState == SAP_STATE.CONNECTED) { Message msg = Message.obtain(mSapServiceHandler); msg.what = SapService.MSG_CHANGE_STATE; msg.arg1 = BluetoothSap.STATE_CONNECTED; msg.sendToTarget(); setNotification(SapMessage.DISC_GRACEFULL, 0); if (DEBUG) Log.d(TAG, "MSG_CHANGE_STATE sent out."); } break; default: // Nothing special, just send the message Loading src/com/android/bluetooth/sap/SapService.java +6 −2 Original line number Diff line number Diff line Loading @@ -60,6 +60,8 @@ public class SapService extends ProfileService { public static final int MSG_ACQUIRE_WAKE_LOCK = 5005; public static final int MSG_RELEASE_WAKE_LOCK = 5006; public static final int MSG_CHANGE_STATE = 5007; /* Each time a transaction between the SIM and the BT Client is detected a wakelock is taken. * After an idle period of RELEASE_WAKE_LOCK_DELAY ms the wakelock is released. * Loading Loading @@ -255,8 +257,6 @@ public class SapService extends ProfileService { mWakeLock.acquire(); } setState(BluetoothSap.STATE_CONNECTED); /* Start the SAP I/O thread and associate with message handler */ mSapServer = new SapServer(mSessionStatusHandler, this, mConnSocket.getInputStream(), mConnSocket.getOutputStream()); mSapServer.start(); Loading Loading @@ -440,6 +440,10 @@ public class SapService extends ProfileService { if (DEBUG) Log.i(TAG, " Released Wake Lock by message"); } break; case MSG_CHANGE_STATE: if (DEBUG) Log.d(TAG, "change state message: newState = " + msg.arg1); setState(msg.arg1); break; case SHUTDOWN: /* Ensure to call close from this handler to avoid starting new stuff because of pending messages */ Loading Loading
src/com/android/bluetooth/sap/SapServer.java +9 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.os.SystemClock; import android.os.SystemProperties; import android.telephony.TelephonyManager; import android.util.Log; import android.bluetooth.BluetoothSap; //import com.android.internal.telephony.RIL; import com.google.protobuf.micro.CodedOutputStreamMicro; Loading Loading @@ -314,7 +315,6 @@ public class SapServer extends Thread implements Callback { mRilBtReceiver = new SapRilReceiver(mSapHandler, mSapServiceHandler); mRilBtReceiverThread = new Thread(mRilBtReceiver, "RilBtReceiver"); setNotification(SapMessage.DISC_GRACEFULL,0); boolean done = false; while (!done) { if(VERBOSE) Log.i(TAG, "Waiting for incomming RFCOMM message..."); Loading Loading @@ -790,6 +790,14 @@ public class SapServer extends Thread implements Callback { mState == SAP_STATE.DISCONNECTING) { sapMsg = null; } if (mSapServiceHandler != null && mState == SAP_STATE.CONNECTED) { Message msg = Message.obtain(mSapServiceHandler); msg.what = SapService.MSG_CHANGE_STATE; msg.arg1 = BluetoothSap.STATE_CONNECTED; msg.sendToTarget(); setNotification(SapMessage.DISC_GRACEFULL, 0); if (DEBUG) Log.d(TAG, "MSG_CHANGE_STATE sent out."); } break; default: // Nothing special, just send the message Loading
src/com/android/bluetooth/sap/SapService.java +6 −2 Original line number Diff line number Diff line Loading @@ -60,6 +60,8 @@ public class SapService extends ProfileService { public static final int MSG_ACQUIRE_WAKE_LOCK = 5005; public static final int MSG_RELEASE_WAKE_LOCK = 5006; public static final int MSG_CHANGE_STATE = 5007; /* Each time a transaction between the SIM and the BT Client is detected a wakelock is taken. * After an idle period of RELEASE_WAKE_LOCK_DELAY ms the wakelock is released. * Loading Loading @@ -255,8 +257,6 @@ public class SapService extends ProfileService { mWakeLock.acquire(); } setState(BluetoothSap.STATE_CONNECTED); /* Start the SAP I/O thread and associate with message handler */ mSapServer = new SapServer(mSessionStatusHandler, this, mConnSocket.getInputStream(), mConnSocket.getOutputStream()); mSapServer.start(); Loading Loading @@ -440,6 +440,10 @@ public class SapService extends ProfileService { if (DEBUG) Log.i(TAG, " Released Wake Lock by message"); } break; case MSG_CHANGE_STATE: if (DEBUG) Log.d(TAG, "change state message: newState = " + msg.arg1); setState(msg.arg1); break; case SHUTDOWN: /* Ensure to call close from this handler to avoid starting new stuff because of pending messages */ Loading