Android Open Source - android-bluetooth-serial Thread Manager

From Project

Back to project page android-bluetooth-serial.


The source code is released under:

GNU General Public License

If you think the Android project android-bluetooth-serial listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

//from  w ww  . jav  a 2 s .  co  m
import android.util.Log;

public class ThreadManager extends Thread {
  private BTRemoteDeviceInfo mRemoteDeviceInfo = null;
  private static final String TAG = ThreadManager.class.getName();
  private BTDoctor mBtDoctor = null;
  public ThreadManager (BTRemoteDeviceInfo remoteDeviceInfo) {
    this.mRemoteDeviceInfo = remoteDeviceInfo;
  public BTDoctor getBtDoctor() {
    return mBtDoctor;

  public void setBtDoctor(BTDoctor btDoctor) {
    this.mBtDoctor = btDoctor;

  public void run() {
    int threadCounter = 0;
    while (true) {
      try {
      } catch (InterruptedException e) {
        Log.e(TAG, "error while sleeping!");
      if (mRemoteDeviceInfo.getmConnStatus() == false) {
        Log.w(TAG, "connection is false, start new client[" + threadCounter + "]:");
        ConnectThread connectThread = new ConnectThread(mRemoteDeviceInfo);

Java Source Code List