Files
brave-core/android/java/org
Oliver Ddin 798e2ea7a0 [Android] Fix call dispatched on incorrect thread, null string fixes.
When we call into `BraveVpnPrefUtils.setPrefModel`, this function
invokes a method or two that `assert` they're being called on the UI
thread. As a result, previously, the VPN would fail to start in debug
builds as a result of the assertion and could possibly have been causing
breakage in Release builds.

Additionally, a couple of functions have had a null-check added which
causes them to return without doing anything. Prior to this commit, an
exception would be thrown immediately when passed to `setString` which
then resulted in the function not doing anything anyway - along with
negatively impacting any code further up the call chain that didn't
handle the exception.

There was also a problem with the VpnServerSelectionActivity wherein a
member of the class implemented AutoCloseable but was not being closed
in all cases which then resulted in a runtime exception because the
object detected it was freeing its resources by being finalized. A
missing close() has been added and we also handle onDestroy() to close
the object there too.
2025-08-29 18:08:04 +02:00
..