summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author sj.cha <sj.cha@lge.com> 2015-03-23 11:35:24 +0900
committer sj.cha <sj.cha@lge.com> 2015-03-23 11:40:35 +0900
commit08bbca040fa921b99493cd9967453ed90b1b710a (patch)
treec500dda1c4132f461ad820e3eb5a7c4dafa94148
parent38fcaf4037a50225b931551a48c898c7b0bb4db2 (diff)
Add getLegacyVpnInfoPrivileged method
Follows the Google's permission check policy. Add a getLegacyVpnInfoPrivileged method which skips the permission check and change getLegacyVpnInfo to check the permission and then call getLegacyVpnInfoPrivileged. It is already checked in this commit : https://android-review.googlesource.com/#/c/141771/ Signed-off-by: SangJin Cha <sj.cha@lge.com> Change-Id: I83cfaedbd85745574f3ddf118b11b6e0415483c6
-rw-r--r--services/core/java/com/android/server/connectivity/Vpn.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index 8533f69f705b..3174e6927a41 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -1009,6 +1009,14 @@ public class Vpn {
public synchronized LegacyVpnInfo getLegacyVpnInfo() {
// Check if the caller is authorized.
enforceControlPermission();
+ return getLegacyVpnInfoPrivileged();
+ }
+
+ /**
+ * Return the information of the current ongoing legacy VPN.
+ * Callers are responsible for checking permissions if needed.
+ */
+ public synchronized LegacyVpnInfo getLegacyVpnInfoPrivileged() {
if (mLegacyVpnRunner == null) return null;
final LegacyVpnInfo info = new LegacyVpnInfo();