summaryrefslogtreecommitdiffhomepage
path: root/android/src/androidTest
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-04-20 20:31:22 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-04-21 16:42:11 +0000
commite346b8ff533d3556fbf97c9201799366a1b4f0db (patch)
treee183049bef34a09dfcb06627620732fc743e0cb5 /android/src/androidTest
parent03832400d7b84de43d626727e28f39685d86e36e (diff)
downloadmullvadvpn-e346b8ff533d3556fbf97c9201799366a1b4f0db.tar.xz
mullvadvpn-e346b8ff533d3556fbf97c9201799366a1b4f0db.zip
Ensure `ListenerReady` handler is registered first
Previously there could be a race condition because the `ServiceConnection` constructor would register itself as an event listener on the service without registering a handler for the `ListenerReady` event sent after the registration is complete. The `MainActivity` would then register the handler, and things would work because the service would send multiple events before sending the `ListenerReady`, giving time for the handler to be registered before the event is received. This commit changes that in order to avoid the race condition. Now the `ServiceConnection` constructor must receive a callback as a parameter, and this callback will be used when registering for the `ListenerReady` event. This allows the constructor to enforce that the handler for the event is configured before the request for registration is sent.
Diffstat (limited to 'android/src/androidTest')
0 files changed, 0 insertions, 0 deletions