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

Commit 2d5df733 authored by Hansen Kurli's avatar Hansen Kurli Committed by Gerrit Code Review
Browse files

Merge "Clone the VpnProfile in startLegacyVpnPrivileged()" into main

parents 0a6c6ad5 c8dbc5af
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -618,4 +618,14 @@ public final class VpnProfile implements Cloneable, Parcelable {
    public int describeContents() {
        return 0;
    }

    @Override
    public VpnProfile clone() {
        try {
            return (VpnProfile) super.clone();
        } catch (CloneNotSupportedException e) {
            Log.wtf(TAG, e);
            return null;
        }
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -2621,8 +2621,9 @@ public class Vpn {
     *
     * Callers are responsible for checking permissions if needed.
     */
    public void startLegacyVpnPrivileged(VpnProfile profile,
    public void startLegacyVpnPrivileged(VpnProfile profileToStart,
            @Nullable Network underlying, @NonNull LinkProperties egress) {
        final VpnProfile profile = profileToStart.clone();
        UserInfo user = mUserManager.getUserInfo(mUserId);
        if (user.isRestricted() || mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_VPN,
                    new UserHandle(mUserId))) {