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

Commit 0011c2ed authored by Hansen Kurli's avatar Hansen Kurli Committed by Automerger Merge Worker
Browse files

Merge "Clone the VpnProfile in startLegacyVpnPrivileged()" into main am: 2d5df733

parents 6a7b7c82 2d5df733
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))) {