Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d76e5af0 authored by Guillaume Jacquart's avatar Guillaume Jacquart
Browse files

Fix app whitlist changes not applied while running.

parent bad38091
Loading
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -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
@@ -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)
        }
    }