From e0da29095c9f1d3ef953190bb72bc0b571ae8e60 Mon Sep 17 00:00:00 2001 From: chiachangwang Date: Tue, 30 May 2023 02:34:10 +0000 Subject: [PATCH] Update the java doc to match the behavior The javadoc of getProvisionedVpnProfileState only describes the VpnProfileState will be null if if there was no profile provisioned by the calling package. The implementation requires the VPN profile being prepared so that the owner UID and package name are well set up. Design is either changed to refer only the package name information and check provisioned VPN profile from VPN profile store, or correct the javadoc. In practice, a VPN app that provision a VPN profile without starting it should know the VPN status which is disconnected. The API should be useful after starting the VPN profile. Update the doc to match the behavior. Bug: 280021394 Test: m (cherry picked from https://android-review.googlesource.com/q/commit:5bca5c2f0384e36e59f8a6ea433831d99ede4e69) Merged-In: I80322ff296661972a442d799812751d5411b665b Change-Id: I80322ff296661972a442d799812751d5411b665b --- core/java/android/net/VpnManager.java | 2 +- services/core/java/com/android/server/VpnManagerService.java | 2 +- services/core/java/com/android/server/connectivity/Vpn.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/net/VpnManager.java b/core/java/android/net/VpnManager.java index 2e64a74a5d672..ff47f3fc30aa6 100644 --- a/core/java/android/net/VpnManager.java +++ b/core/java/android/net/VpnManager.java @@ -444,7 +444,7 @@ public class VpnManager { * Retrieve the VpnProfileState for the profile provisioned by the calling package. * * @return the VpnProfileState with current information, or null if there was no profile - * provisioned by the calling package. + * provisioned and started by the calling package. */ @Nullable public VpnProfileState getProvisionedVpnProfileState() { diff --git a/services/core/java/com/android/server/VpnManagerService.java b/services/core/java/com/android/server/VpnManagerService.java index 2b43ef48b9225..9b4f9683d5506 100644 --- a/services/core/java/com/android/server/VpnManagerService.java +++ b/services/core/java/com/android/server/VpnManagerService.java @@ -406,7 +406,7 @@ public class VpnManagerService extends IVpnManager.Stub { * Retrieve the VpnProfileState for the profile provisioned by the given package. * * @return the VpnProfileState with current information, or null if there was no profile - * provisioned by the given package. + * provisioned and started by the given package. * @hide */ @Override diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java index d4bb445d66acd..7cef7fe132e22 100644 --- a/services/core/java/com/android/server/connectivity/Vpn.java +++ b/services/core/java/com/android/server/connectivity/Vpn.java @@ -5010,7 +5010,7 @@ public class Vpn { * Retrieve the VpnProfileState for the profile provisioned by the given package. * * @return the VpnProfileState with current information, or null if there was no profile - * provisioned by the given package. + * provisioned and started by the given package. */ @Nullable public synchronized VpnProfileState getProvisionedVpnProfileState(