Loading android/app/AndroidManifest.xml +0 −13 Original line number Diff line number Diff line Loading @@ -113,7 +113,6 @@ android:name=".opp.BluetoothOppReceiver" android:enabled="@bool/profile_supported_opp"> <intent-filter> <action android:name="android.bluetooth.adapter.action.STATE_CHANGED" /> <action android:name="android.btopp.intent.action.OPEN_RECEIVED_FILES" /> </intent-filter> </receiver> Loading Loading @@ -228,18 +227,6 @@ <action android:name="android.bluetooth.IBluetoothPbap" /> </intent-filter> </service> <receiver android:process="@string/process" android:exported="true" android:name=".pbap.BluetoothPbapReceiver" android:enabled="@bool/profile_supported_pbap"> <intent-filter> <action android:name="android.bluetooth.adapter.action.STATE_CHANGED"/> <action android:name="android.bluetooth.device.action.CONNECTION_ACCESS_REPLY" /> <action android:name="android.bluetooth.device.action.ACL_DISCONNECTED" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </receiver> <service android:process="@string/process" android:name=".map.BluetoothMapService" Loading android/app/src/com/android/bluetooth/btservice/Config.java +17 −23 Original line number Diff line number Diff line Loading @@ -40,6 +40,8 @@ import com.android.bluetooth.mapclient.MapClientService; import com.android.bluetooth.sap.SapService; import com.android.bluetooth.pbapclient.PbapClientService; import com.android.bluetooth.hid.HidDevService; import com.android.bluetooth.pbap.BluetoothPbapService; import com.android.bluetooth.opp.BluetoothOppService; public class Config { private static final String TAG = "AdapterServiceConfig"; Loading @@ -49,32 +51,24 @@ public class Config { @SuppressWarnings("rawtypes") // Do not inclue OPP and PBAP, because their services // are not managed by AdapterService private static final Class[] PROFILE_SERVICES = { HeadsetService.class, A2dpService.class, A2dpSinkService.class, HidService.class, HealthService.class, PanService.class, GattService.class, BluetoothMapService.class, HeadsetClientService.class, AvrcpControllerService.class, SapService.class, PbapClientService.class, MapClientService.class, HidDevService.class}; private static final Class[] PROFILE_SERVICES = {HeadsetService.class, A2dpService.class, A2dpSinkService.class, HidService.class, HealthService.class, PanService.class, GattService.class, BluetoothMapService.class, HeadsetClientService.class, AvrcpControllerService.class, SapService.class, PbapClientService.class, MapClientService.class, HidDevService.class, BluetoothOppService.class, BluetoothPbapService.class}; /** * Resource flag to indicate whether profile is supported or not. */ private static final int[] PROFILE_SERVICES_FLAG = { R.bool.profile_supported_hs_hfp, R.bool.profile_supported_a2dp, R.bool.profile_supported_a2dp_sink, R.bool.profile_supported_hid, R.bool.profile_supported_hdp, R.bool.profile_supported_pan, R.bool.profile_supported_gatt, R.bool.profile_supported_map, R.bool.profile_supported_hfpclient, R.bool.profile_supported_avrcp_controller, R.bool.profile_supported_sap, R.bool.profile_supported_pbapclient, R.bool.profile_supported_mapmce, R.bool.profile_supported_hidd}; private static final int[] PROFILE_SERVICES_FLAG = {R.bool.profile_supported_hs_hfp, R.bool.profile_supported_a2dp, R.bool.profile_supported_a2dp_sink, R.bool.profile_supported_hid, R.bool.profile_supported_hdp, R.bool.profile_supported_pan, R.bool.profile_supported_gatt, R.bool.profile_supported_map, R.bool.profile_supported_hfpclient, R.bool.profile_supported_avrcp_controller, R.bool.profile_supported_sap, R.bool.profile_supported_pbapclient, R.bool.profile_supported_mapmce, R.bool.profile_supported_hidd, R.bool.profile_supported_opp, R.bool.profile_supported_pbap}; private static Class[] SUPPORTED_PROFILES = new Class[0]; Loading android/app/src/com/android/bluetooth/btservice/ProfileService.java +7 −0 Original line number Diff line number Diff line Loading @@ -62,8 +62,10 @@ public abstract class ProfileService extends Service { } protected abstract IProfileServiceBinder initBinder(); protected abstract boolean start(); protected abstract boolean stop(); protected void create() {} protected boolean cleanup() { return true; } Loading Loading @@ -105,6 +107,7 @@ public abstract class ProfileService extends Service { super.onCreate(); mAdapter = BluetoothAdapter.getDefaultAdapter(); mBinder = initBinder(); create(); } public int onStartCommand(Intent intent, int flags, int startId) { Loading Loading @@ -148,6 +151,10 @@ public abstract class ProfileService extends Service { public IBinder onBind(Intent intent) { if (DBG) log("onBind"); if (mAdapter != null && mBinder == null) { // initBinder returned null, you can't bind throw new UnsupportedOperationException("Cannot bind to " + mName); } return mBinder; } Loading android/app/src/com/android/bluetooth/opp/BluetoothOppReceiver.java +1 −29 Original line number Diff line number Diff line Loading @@ -61,35 +61,7 @@ public class BluetoothOppReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { if (BluetoothAdapter.STATE_ON == intent.getIntExtra( BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR)) { if (V) Log.v(TAG, "Received BLUETOOTH_STATE_CHANGED_ACTION, BLUETOOTH_STATE_ON"); context.startService(new Intent(context, BluetoothOppService.class)); // If this is within a sending process, continue the handle // logic to display device picker dialog. synchronized (this) { if (BluetoothOppManager.getInstance(context).mSendingFlag) { // reset the flags BluetoothOppManager.getInstance(context).mSendingFlag = false; Intent in1 = new Intent(BluetoothDevicePicker.ACTION_LAUNCH); in1.putExtra(BluetoothDevicePicker.EXTRA_NEED_AUTH, false); in1.putExtra(BluetoothDevicePicker.EXTRA_FILTER_TYPE, BluetoothDevicePicker.FILTER_TYPE_TRANSFER); in1.putExtra(BluetoothDevicePicker.EXTRA_LAUNCH_PACKAGE, Constants.THIS_PACKAGE_NAME); in1.putExtra(BluetoothDevicePicker.EXTRA_LAUNCH_CLASS, BluetoothOppReceiver.class.getName()); in1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(in1); } } } } else if (action.equals(BluetoothDevicePicker.ACTION_DEVICE_SELECTED)) { if (action.equals(BluetoothDevicePicker.ACTION_DEVICE_SELECTED)) { BluetoothOppManager mOppManager = BluetoothOppManager.getInstance(context); BluetoothDevice remoteDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); Loading android/app/src/com/android/bluetooth/opp/BluetoothOppService.java +47 −40 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import javax.obex.ObexTransport; import android.app.Service; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevicePicker; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.ContentValues; Loading @@ -56,6 +57,9 @@ import android.os.PowerManager; import android.util.Log; import android.os.Process; import com.android.bluetooth.btservice.ProfileService; import com.android.bluetooth.btservice.ProfileService.IProfileServiceBinder; import java.io.IOException; import java.util.ArrayList; Loading @@ -64,7 +68,7 @@ import java.util.ArrayList; * accept incoming OPP connection. */ public class BluetoothOppService extends Service { public class BluetoothOppService extends ProfileService { private static final boolean D = Constants.DEBUG; private static final boolean V = Constants.VERBOSE; Loading Loading @@ -114,8 +118,6 @@ public class BluetoothOppService extends Service { */ private CharArrayBuffer mNewChars; private BluetoothAdapter mAdapter; private PowerManager mPowerManager; private BluetoothOppRfcommListener mSocketListener; Loading @@ -136,15 +138,13 @@ public class BluetoothOppService extends Service { private BluetoothOppObexServerSession mServerSession; @Override public IBinder onBind(Intent arg0) { throw new UnsupportedOperationException("Cannot bind to Bluetooth OPP Service"); protected IProfileServiceBinder initBinder() { return null; } @Override public void onCreate() { super.onCreate(); protected void create() { if (V) Log.v(TAG, "onCreate"); mAdapter = BluetoothAdapter.getDefaultAdapter(); mSocketListener = new BluetoothOppRfcommListener(mAdapter); mShares = Lists.newArrayList(); mBatchs = Lists.newArrayList(); Loading Loading @@ -177,18 +177,17 @@ public class BluetoothOppService extends Service { } @Override public int onStartCommand(Intent intent, int flags, int startId) { if (V) Log.v(TAG, "onStartCommand"); //int retCode = super.onStartCommand(intent, flags, startId); //if (retCode == START_STICKY) { if (mAdapter == null) { Log.w(TAG, "Local BT device is not enabled"); } else { public boolean start() { if (V) Log.v(TAG, "start()"); startListener(); } updateFromProvider(); //} return START_NOT_STICKY; return true; } @Override public boolean stop() { mHandler.sendMessage(mHandler.obtainMessage(STOP_LISTENER)); return true; } private void startListener() { Loading Loading @@ -329,16 +328,14 @@ public class BluetoothOppService extends Service { }; private void startSocketListener() { if (V) Log.v(TAG, "start RfcommListener"); mSocketListener.start(mHandler); if (V) Log.v(TAG, "RfcommListener started"); } @Override public void onDestroy() { public boolean cleanup() { if (V) Log.v(TAG, "onDestroy"); super.onDestroy(); getContentResolver().unregisterContentObserver(mObserver); unregisterReceiver(mBluetoothReceiver); mSocketListener.stop(); Loading @@ -352,6 +349,7 @@ public class BluetoothOppService extends Service { if (mHandler != null) { mHandler.removeCallbacksAndMessages(null); } return true; } /* suppose we auto accept an incoming OPUSH connection */ Loading @@ -370,24 +368,33 @@ public class BluetoothOppService extends Service { if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { switch (intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR)) { case BluetoothAdapter.STATE_ON: if (V) Log.v(TAG, "Receiver BLUETOOTH_STATE_CHANGED_ACTION, BLUETOOTH_STATE_ON"); if (V) Log.v(TAG, "Bluetooth state changed: STATE_ON"); startSocketListener(); break; case BluetoothAdapter.STATE_TURNING_OFF: if (V) Log.v(TAG, "Receiver DISABLED_ACTION "); //FIX: Don't block main thread /* mSocketListener.stop(); mListenStarted = false; synchronized (BluetoothOppService.this) { if (mUpdateThread == null) { stopSelf(); // If this is within a sending process, continue the handle // logic to display device picker dialog. synchronized (this) { if (BluetoothOppManager.getInstance(context).mSendingFlag) { // reset the flags BluetoothOppManager.getInstance(context).mSendingFlag = false; Intent in1 = new Intent(BluetoothDevicePicker.ACTION_LAUNCH); in1.putExtra(BluetoothDevicePicker.EXTRA_NEED_AUTH, false); in1.putExtra(BluetoothDevicePicker.EXTRA_FILTER_TYPE, BluetoothDevicePicker.FILTER_TYPE_TRANSFER); in1.putExtra(BluetoothDevicePicker.EXTRA_LAUNCH_PACKAGE, Constants.THIS_PACKAGE_NAME); in1.putExtra(BluetoothDevicePicker.EXTRA_LAUNCH_CLASS, BluetoothOppReceiver.class.getName()); in1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(in1); } } */ mHandler.sendMessage(mHandler.obtainMessage(STOP_LISTENER)); break; case BluetoothAdapter.STATE_TURNING_OFF: if (V) Log.v(TAG, "Bluetooth state changed: STATE_TURNING_OFF"); mHandler.sendMessage(mHandler.obtainMessage(STOP_LISTENER)); break; } } Loading Loading
android/app/AndroidManifest.xml +0 −13 Original line number Diff line number Diff line Loading @@ -113,7 +113,6 @@ android:name=".opp.BluetoothOppReceiver" android:enabled="@bool/profile_supported_opp"> <intent-filter> <action android:name="android.bluetooth.adapter.action.STATE_CHANGED" /> <action android:name="android.btopp.intent.action.OPEN_RECEIVED_FILES" /> </intent-filter> </receiver> Loading Loading @@ -228,18 +227,6 @@ <action android:name="android.bluetooth.IBluetoothPbap" /> </intent-filter> </service> <receiver android:process="@string/process" android:exported="true" android:name=".pbap.BluetoothPbapReceiver" android:enabled="@bool/profile_supported_pbap"> <intent-filter> <action android:name="android.bluetooth.adapter.action.STATE_CHANGED"/> <action android:name="android.bluetooth.device.action.CONNECTION_ACCESS_REPLY" /> <action android:name="android.bluetooth.device.action.ACL_DISCONNECTED" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </receiver> <service android:process="@string/process" android:name=".map.BluetoothMapService" Loading
android/app/src/com/android/bluetooth/btservice/Config.java +17 −23 Original line number Diff line number Diff line Loading @@ -40,6 +40,8 @@ import com.android.bluetooth.mapclient.MapClientService; import com.android.bluetooth.sap.SapService; import com.android.bluetooth.pbapclient.PbapClientService; import com.android.bluetooth.hid.HidDevService; import com.android.bluetooth.pbap.BluetoothPbapService; import com.android.bluetooth.opp.BluetoothOppService; public class Config { private static final String TAG = "AdapterServiceConfig"; Loading @@ -49,32 +51,24 @@ public class Config { @SuppressWarnings("rawtypes") // Do not inclue OPP and PBAP, because their services // are not managed by AdapterService private static final Class[] PROFILE_SERVICES = { HeadsetService.class, A2dpService.class, A2dpSinkService.class, HidService.class, HealthService.class, PanService.class, GattService.class, BluetoothMapService.class, HeadsetClientService.class, AvrcpControllerService.class, SapService.class, PbapClientService.class, MapClientService.class, HidDevService.class}; private static final Class[] PROFILE_SERVICES = {HeadsetService.class, A2dpService.class, A2dpSinkService.class, HidService.class, HealthService.class, PanService.class, GattService.class, BluetoothMapService.class, HeadsetClientService.class, AvrcpControllerService.class, SapService.class, PbapClientService.class, MapClientService.class, HidDevService.class, BluetoothOppService.class, BluetoothPbapService.class}; /** * Resource flag to indicate whether profile is supported or not. */ private static final int[] PROFILE_SERVICES_FLAG = { R.bool.profile_supported_hs_hfp, R.bool.profile_supported_a2dp, R.bool.profile_supported_a2dp_sink, R.bool.profile_supported_hid, R.bool.profile_supported_hdp, R.bool.profile_supported_pan, R.bool.profile_supported_gatt, R.bool.profile_supported_map, R.bool.profile_supported_hfpclient, R.bool.profile_supported_avrcp_controller, R.bool.profile_supported_sap, R.bool.profile_supported_pbapclient, R.bool.profile_supported_mapmce, R.bool.profile_supported_hidd}; private static final int[] PROFILE_SERVICES_FLAG = {R.bool.profile_supported_hs_hfp, R.bool.profile_supported_a2dp, R.bool.profile_supported_a2dp_sink, R.bool.profile_supported_hid, R.bool.profile_supported_hdp, R.bool.profile_supported_pan, R.bool.profile_supported_gatt, R.bool.profile_supported_map, R.bool.profile_supported_hfpclient, R.bool.profile_supported_avrcp_controller, R.bool.profile_supported_sap, R.bool.profile_supported_pbapclient, R.bool.profile_supported_mapmce, R.bool.profile_supported_hidd, R.bool.profile_supported_opp, R.bool.profile_supported_pbap}; private static Class[] SUPPORTED_PROFILES = new Class[0]; Loading
android/app/src/com/android/bluetooth/btservice/ProfileService.java +7 −0 Original line number Diff line number Diff line Loading @@ -62,8 +62,10 @@ public abstract class ProfileService extends Service { } protected abstract IProfileServiceBinder initBinder(); protected abstract boolean start(); protected abstract boolean stop(); protected void create() {} protected boolean cleanup() { return true; } Loading Loading @@ -105,6 +107,7 @@ public abstract class ProfileService extends Service { super.onCreate(); mAdapter = BluetoothAdapter.getDefaultAdapter(); mBinder = initBinder(); create(); } public int onStartCommand(Intent intent, int flags, int startId) { Loading Loading @@ -148,6 +151,10 @@ public abstract class ProfileService extends Service { public IBinder onBind(Intent intent) { if (DBG) log("onBind"); if (mAdapter != null && mBinder == null) { // initBinder returned null, you can't bind throw new UnsupportedOperationException("Cannot bind to " + mName); } return mBinder; } Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppReceiver.java +1 −29 Original line number Diff line number Diff line Loading @@ -61,35 +61,7 @@ public class BluetoothOppReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { if (BluetoothAdapter.STATE_ON == intent.getIntExtra( BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR)) { if (V) Log.v(TAG, "Received BLUETOOTH_STATE_CHANGED_ACTION, BLUETOOTH_STATE_ON"); context.startService(new Intent(context, BluetoothOppService.class)); // If this is within a sending process, continue the handle // logic to display device picker dialog. synchronized (this) { if (BluetoothOppManager.getInstance(context).mSendingFlag) { // reset the flags BluetoothOppManager.getInstance(context).mSendingFlag = false; Intent in1 = new Intent(BluetoothDevicePicker.ACTION_LAUNCH); in1.putExtra(BluetoothDevicePicker.EXTRA_NEED_AUTH, false); in1.putExtra(BluetoothDevicePicker.EXTRA_FILTER_TYPE, BluetoothDevicePicker.FILTER_TYPE_TRANSFER); in1.putExtra(BluetoothDevicePicker.EXTRA_LAUNCH_PACKAGE, Constants.THIS_PACKAGE_NAME); in1.putExtra(BluetoothDevicePicker.EXTRA_LAUNCH_CLASS, BluetoothOppReceiver.class.getName()); in1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(in1); } } } } else if (action.equals(BluetoothDevicePicker.ACTION_DEVICE_SELECTED)) { if (action.equals(BluetoothDevicePicker.ACTION_DEVICE_SELECTED)) { BluetoothOppManager mOppManager = BluetoothOppManager.getInstance(context); BluetoothDevice remoteDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppService.java +47 −40 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import javax.obex.ObexTransport; import android.app.Service; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevicePicker; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.ContentValues; Loading @@ -56,6 +57,9 @@ import android.os.PowerManager; import android.util.Log; import android.os.Process; import com.android.bluetooth.btservice.ProfileService; import com.android.bluetooth.btservice.ProfileService.IProfileServiceBinder; import java.io.IOException; import java.util.ArrayList; Loading @@ -64,7 +68,7 @@ import java.util.ArrayList; * accept incoming OPP connection. */ public class BluetoothOppService extends Service { public class BluetoothOppService extends ProfileService { private static final boolean D = Constants.DEBUG; private static final boolean V = Constants.VERBOSE; Loading Loading @@ -114,8 +118,6 @@ public class BluetoothOppService extends Service { */ private CharArrayBuffer mNewChars; private BluetoothAdapter mAdapter; private PowerManager mPowerManager; private BluetoothOppRfcommListener mSocketListener; Loading @@ -136,15 +138,13 @@ public class BluetoothOppService extends Service { private BluetoothOppObexServerSession mServerSession; @Override public IBinder onBind(Intent arg0) { throw new UnsupportedOperationException("Cannot bind to Bluetooth OPP Service"); protected IProfileServiceBinder initBinder() { return null; } @Override public void onCreate() { super.onCreate(); protected void create() { if (V) Log.v(TAG, "onCreate"); mAdapter = BluetoothAdapter.getDefaultAdapter(); mSocketListener = new BluetoothOppRfcommListener(mAdapter); mShares = Lists.newArrayList(); mBatchs = Lists.newArrayList(); Loading Loading @@ -177,18 +177,17 @@ public class BluetoothOppService extends Service { } @Override public int onStartCommand(Intent intent, int flags, int startId) { if (V) Log.v(TAG, "onStartCommand"); //int retCode = super.onStartCommand(intent, flags, startId); //if (retCode == START_STICKY) { if (mAdapter == null) { Log.w(TAG, "Local BT device is not enabled"); } else { public boolean start() { if (V) Log.v(TAG, "start()"); startListener(); } updateFromProvider(); //} return START_NOT_STICKY; return true; } @Override public boolean stop() { mHandler.sendMessage(mHandler.obtainMessage(STOP_LISTENER)); return true; } private void startListener() { Loading Loading @@ -329,16 +328,14 @@ public class BluetoothOppService extends Service { }; private void startSocketListener() { if (V) Log.v(TAG, "start RfcommListener"); mSocketListener.start(mHandler); if (V) Log.v(TAG, "RfcommListener started"); } @Override public void onDestroy() { public boolean cleanup() { if (V) Log.v(TAG, "onDestroy"); super.onDestroy(); getContentResolver().unregisterContentObserver(mObserver); unregisterReceiver(mBluetoothReceiver); mSocketListener.stop(); Loading @@ -352,6 +349,7 @@ public class BluetoothOppService extends Service { if (mHandler != null) { mHandler.removeCallbacksAndMessages(null); } return true; } /* suppose we auto accept an incoming OPUSH connection */ Loading @@ -370,24 +368,33 @@ public class BluetoothOppService extends Service { if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { switch (intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR)) { case BluetoothAdapter.STATE_ON: if (V) Log.v(TAG, "Receiver BLUETOOTH_STATE_CHANGED_ACTION, BLUETOOTH_STATE_ON"); if (V) Log.v(TAG, "Bluetooth state changed: STATE_ON"); startSocketListener(); break; case BluetoothAdapter.STATE_TURNING_OFF: if (V) Log.v(TAG, "Receiver DISABLED_ACTION "); //FIX: Don't block main thread /* mSocketListener.stop(); mListenStarted = false; synchronized (BluetoothOppService.this) { if (mUpdateThread == null) { stopSelf(); // If this is within a sending process, continue the handle // logic to display device picker dialog. synchronized (this) { if (BluetoothOppManager.getInstance(context).mSendingFlag) { // reset the flags BluetoothOppManager.getInstance(context).mSendingFlag = false; Intent in1 = new Intent(BluetoothDevicePicker.ACTION_LAUNCH); in1.putExtra(BluetoothDevicePicker.EXTRA_NEED_AUTH, false); in1.putExtra(BluetoothDevicePicker.EXTRA_FILTER_TYPE, BluetoothDevicePicker.FILTER_TYPE_TRANSFER); in1.putExtra(BluetoothDevicePicker.EXTRA_LAUNCH_PACKAGE, Constants.THIS_PACKAGE_NAME); in1.putExtra(BluetoothDevicePicker.EXTRA_LAUNCH_CLASS, BluetoothOppReceiver.class.getName()); in1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(in1); } } */ mHandler.sendMessage(mHandler.obtainMessage(STOP_LISTENER)); break; case BluetoothAdapter.STATE_TURNING_OFF: if (V) Log.v(TAG, "Bluetooth state changed: STATE_TURNING_OFF"); mHandler.sendMessage(mHandler.obtainMessage(STOP_LISTENER)); break; } } Loading