Loading android/app/src/com/android/bluetooth/map/BluetoothMapService.java +3 −3 Original line number Diff line number Diff line Loading @@ -263,7 +263,7 @@ public class BluetoothMapService extends ProfileService { } if (mBluetoothMnsObexClient != null) { mBluetoothMnsObexClient.disconnect(); mBluetoothMnsObexClient.shutdown(); mBluetoothMnsObexClient = null; } Loading Loading @@ -324,7 +324,7 @@ public class BluetoothMapService extends ProfileService { mAcceptThread = null; if(mBluetoothMnsObexClient != null) { mBluetoothMnsObexClient.disconnect(); mBluetoothMnsObexClient.shutdown(); mBluetoothMnsObexClient = null; } closeConnectionSocket(); Loading Loading @@ -515,7 +515,7 @@ public class BluetoothMapService extends ProfileService { mServerSession = null; } if(mBluetoothMnsObexClient != null) { mBluetoothMnsObexClient.disconnect(); //FIXME should use shutdown when implemented mBluetoothMnsObexClient.shutdown(); mBluetoothMnsObexClient = null; } closeConnectionSocket(); Loading android/app/src/com/android/bluetooth/map/BluetoothMnsObexClient.java +27 −12 Original line number Diff line number Diff line Loading @@ -112,19 +112,11 @@ public class BluetoothMnsObexClient { return mConnected; } public void disconnect() { /* should shutdown handler thread first to make sure * handleRegistration won't be called when disconnet /** * Disconnect the connection to MNS server. * Call this when the MAS client requests a de-registration on events. */ if (mHandler != null) { // Shut down the thread mHandler.removeCallbacksAndMessages(null); Looper looper = mHandler.getLooper(); if (looper != null) { looper.quit(); } mHandler = null; } public void disconnect() { try { if (mClientSession != null) { mClientSession.disconnect(null); Loading Loading @@ -154,6 +146,28 @@ public class BluetoothMnsObexClient { Log.e(TAG, "mTransport.close error: " + e.getMessage()); } } } /** * Shutdown the MNS. */ public void shutdown() { /* should shutdown handler thread first to make sure * handleRegistration won't be called when disconnet */ if (mHandler != null) { // Shut down the thread mHandler.removeCallbacksAndMessages(null); Looper looper = mHandler.getLooper(); if (looper != null) { looper.quit(); } mHandler = null; } /* Disconnect if connected */ disconnect(); if(mObserverRegistered) { mObserver.unregisterObserver(); mObserverRegistered = false; Loading @@ -180,6 +194,7 @@ public class BluetoothMnsObexClient { if(mObserverRegistered == true) { mObserver.unregisterObserver(); mObserverRegistered = false; disconnect(); } } else if(notificationStatus == BluetoothMapAppParams.NOTIFICATION_STATUS_YES) { /* Connect if we do not have a connection, and start the content observers providing Loading Loading
android/app/src/com/android/bluetooth/map/BluetoothMapService.java +3 −3 Original line number Diff line number Diff line Loading @@ -263,7 +263,7 @@ public class BluetoothMapService extends ProfileService { } if (mBluetoothMnsObexClient != null) { mBluetoothMnsObexClient.disconnect(); mBluetoothMnsObexClient.shutdown(); mBluetoothMnsObexClient = null; } Loading Loading @@ -324,7 +324,7 @@ public class BluetoothMapService extends ProfileService { mAcceptThread = null; if(mBluetoothMnsObexClient != null) { mBluetoothMnsObexClient.disconnect(); mBluetoothMnsObexClient.shutdown(); mBluetoothMnsObexClient = null; } closeConnectionSocket(); Loading Loading @@ -515,7 +515,7 @@ public class BluetoothMapService extends ProfileService { mServerSession = null; } if(mBluetoothMnsObexClient != null) { mBluetoothMnsObexClient.disconnect(); //FIXME should use shutdown when implemented mBluetoothMnsObexClient.shutdown(); mBluetoothMnsObexClient = null; } closeConnectionSocket(); Loading
android/app/src/com/android/bluetooth/map/BluetoothMnsObexClient.java +27 −12 Original line number Diff line number Diff line Loading @@ -112,19 +112,11 @@ public class BluetoothMnsObexClient { return mConnected; } public void disconnect() { /* should shutdown handler thread first to make sure * handleRegistration won't be called when disconnet /** * Disconnect the connection to MNS server. * Call this when the MAS client requests a de-registration on events. */ if (mHandler != null) { // Shut down the thread mHandler.removeCallbacksAndMessages(null); Looper looper = mHandler.getLooper(); if (looper != null) { looper.quit(); } mHandler = null; } public void disconnect() { try { if (mClientSession != null) { mClientSession.disconnect(null); Loading Loading @@ -154,6 +146,28 @@ public class BluetoothMnsObexClient { Log.e(TAG, "mTransport.close error: " + e.getMessage()); } } } /** * Shutdown the MNS. */ public void shutdown() { /* should shutdown handler thread first to make sure * handleRegistration won't be called when disconnet */ if (mHandler != null) { // Shut down the thread mHandler.removeCallbacksAndMessages(null); Looper looper = mHandler.getLooper(); if (looper != null) { looper.quit(); } mHandler = null; } /* Disconnect if connected */ disconnect(); if(mObserverRegistered) { mObserver.unregisterObserver(); mObserverRegistered = false; Loading @@ -180,6 +194,7 @@ public class BluetoothMnsObexClient { if(mObserverRegistered == true) { mObserver.unregisterObserver(); mObserverRegistered = false; disconnect(); } } else if(notificationStatus == BluetoothMapAppParams.NOTIFICATION_STATUS_YES) { /* Connect if we do not have a connection, and start the content observers providing Loading