Loading privacymoduletor/src/main/java/foundation/e/privacymodules/ipscramblermodule/IpScramblerModule.kt +13 −2 Original line number Diff line number Diff line Loading @@ -56,6 +56,18 @@ class IpScramblerModule(private val context: Context): IIpScramblerModule { private val localBroadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { val action = intent.action ?: return if (action == OrbotConstants.ACTION_RUNNING_SYNC) { try { intent.getStringExtra(OrbotConstants.EXTRA_STATUS)?.let { val newStatus = Status.valueOf(it) currentStatus = newStatus } } catch (e: Exception) { Log.e(TAG, "Can't parse Orbot service status.") } return } val msg = messageHandler.obtainMessage() msg.obj = action msg.data = intent.extras Loading Loading @@ -168,8 +180,7 @@ class IpScramblerModule(private val context: Context): IIpScramblerModule { ).commit() if (isServiceRunning()) { sendIntentToService(OrbotConstants.ACTION_STOP_VPN) sendIntentToService(OrbotConstants.ACTION_START_VPN) sendIntentToService(OrbotConstants.ACTION_RESTART_VPN) } } Loading Loading
privacymoduletor/src/main/java/foundation/e/privacymodules/ipscramblermodule/IpScramblerModule.kt +13 −2 Original line number Diff line number Diff line Loading @@ -56,6 +56,18 @@ class IpScramblerModule(private val context: Context): IIpScramblerModule { private val localBroadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { val action = intent.action ?: return if (action == OrbotConstants.ACTION_RUNNING_SYNC) { try { intent.getStringExtra(OrbotConstants.EXTRA_STATUS)?.let { val newStatus = Status.valueOf(it) currentStatus = newStatus } } catch (e: Exception) { Log.e(TAG, "Can't parse Orbot service status.") } return } val msg = messageHandler.obtainMessage() msg.obj = action msg.data = intent.extras Loading Loading @@ -168,8 +180,7 @@ class IpScramblerModule(private val context: Context): IIpScramblerModule { ).commit() if (isServiceRunning()) { sendIntentToService(OrbotConstants.ACTION_STOP_VPN) sendIntentToService(OrbotConstants.ACTION_START_VPN) sendIntentToService(OrbotConstants.ACTION_RESTART_VPN) } } Loading