diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/net/IVpnManager.aidl | 2 | ||||
| -rw-r--r-- | core/java/android/net/VpnManager.java | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/net/IVpnManager.aidl b/core/java/android/net/IVpnManager.aidl index 070efa363cc0..b4647cabe1bc 100644 --- a/core/java/android/net/IVpnManager.aidl +++ b/core/java/android/net/IVpnManager.aidl @@ -17,6 +17,7 @@ package android.net; import android.net.Network; +import android.net.VpnProfileState; import com.android.internal.net.LegacyVpnInfo; import com.android.internal.net.VpnConfig; @@ -40,6 +41,7 @@ interface IVpnManager { void deleteVpnProfile(String packageName); String startVpnProfile(String packageName); void stopVpnProfile(String packageName); + VpnProfileState getProvisionedVpnProfileState(String packageName); /** Always-on VPN APIs */ boolean isAlwaysOnVpnPackageSupported(int userId, String packageName); diff --git a/core/java/android/net/VpnManager.java b/core/java/android/net/VpnManager.java index 7ffff1a69b06..ae7d91f92cb7 100644 --- a/core/java/android/net/VpnManager.java +++ b/core/java/android/net/VpnManager.java @@ -420,6 +420,21 @@ 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. + */ + @Nullable + public VpnProfileState getProvisionedVpnProfileState() { + try { + return mService.getProvisionedVpnProfileState(mContext.getOpPackageName()); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** * Resets all VPN settings back to factory defaults. * @hide */ |
