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

Skip to content
Commit 7b806deb authored by Yeabkal Wubshit's avatar Yeabkal Wubshit
Browse files

Fix checkNotNull error for missing Vpn service in Wear

The VpnManagerService does not work today on Wear devices, so we stopped
starting it in ag/28141663. However, the VpnManager has a checkNotNull
assertion when it tries to access the service. That means, all Wear
callers of Context.getSystemService for VpnManager will experience a
crash since the service is null on Wear.

To fix this, we skip the checkNotNull check on Wear devices by throwing
a ServiceNotFound exception from SystemServiceRegistry. That way, the
registry also knows that the service is not available on the watch
device and avoid retrying the fetch for the service.

Flag: android.server.allow_removing_vpn_service
Test: fetching VpnManager on watch returns null with no crash
Bug: 352607724
Bug: 352607425
Bug: 352614765
Bug: 340928692
Change-Id: I5e554cb082ab4f687ae6755c9ee52fc8372e9bd8
parent 66cb05e9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment