diff options
| author | 2024-08-19 03:53:19 +0000 | |
|---|---|---|
| committer | 2024-08-19 03:53:19 +0000 | |
| commit | d3beed3bb0571d08da1bc6a07bbca49e4403cd35 (patch) | |
| tree | 220778f2e00f4b33e06f5f3600380833ed88a19e | |
| parent | 310588ddf8e4aec4128e3e9616d2766cec53a6c3 (diff) | |
Return null instead of throwing ServiceNotFoundException when VPN_MANAGEMENT_SERVICE is not available.
This is to fix the issue that the system service registry throws an exception when the service is not available. There's a wtf log that happens if the UID of the app is a system UID.
Related CL: ag/28292869
Bug: 359924233
Change-Id: I041beac94395e4213443a026e5dbb038a09fa5c8
Test: manual
Flag: android.server.allow_removing_vpn_service
| -rw-r--r-- | core/java/android/app/SystemServiceRegistry.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java index 114a2c4d5649..cb38cf297cf6 100644 --- a/core/java/android/app/SystemServiceRegistry.java +++ b/core/java/android/app/SystemServiceRegistry.java @@ -475,7 +475,7 @@ public final class SystemServiceRegistry { if (service == null && ctx.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH) && android.server.Flags.allowRemovingVpnService()) { - throw new ServiceNotFoundException(Context.VPN_MANAGEMENT_SERVICE); + return null; } return new VpnManager(ctx, service); }}); |