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

Commit 08bbca04 authored by sj.cha's avatar sj.cha
Browse files

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: default avatarSangJin Cha <sj.cha@lge.com>
Change-Id: I83cfaedbd85745574f3ddf118b11b6e0415483c6
parent 38fcaf40
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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();