/** * Implementation of the functionality related to disconnecting our app from the AllJoyn bus. We * expect that this method will only be called in the context of the AllJoyn bus handler thread. * We expect that this method will only be called in the context of the AllJoyn bus handler * thread; and while we are in the CONNECTED state. */ private boolean doDisconnect() { Log.i(TAG, "doDisonnect()"); assert (mBusAttachmentState == BusAttachmentState.CONNECTED); mBus.unregisterBusListener(mBusListener); mBus.disconnect(); mBusAttachmentState = BusAttachmentState.DISCONNECTED; return true; }