in core/src/main/java/com/github/shadowsocks/aidl/ShadowsocksConnection.kt [141:156]
fun disconnect(context: Context) {
unregisterCallback()
if (connectionActive) try {
context.unbindService(this)
} catch (_: IllegalArgumentException) { } // ignore
connectionActive = false
if (listenForDeath) try {
binder?.unlinkToDeath(this, 0)
} catch (_: NoSuchElementException) { }
binder = null
try {
service?.stopListeningForBandwidth(serviceCallback)
} catch (_: RemoteException) { }
service = null
callback = null
}