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

Unverified Commit 1e32468e authored by Danny Baumann's avatar Danny Baumann Committed by Michael Bestas
Browse files

SystemUI: Add VPN tile



Allows quickly connecting/disconnecting to/from VPNs.

Co-authored-by: default avatarTrogel <trogel@clink.de>
Change-Id: Iaa9413bf1071805be8764d92bc5e2dd3131fdaed
parent 35d9c441
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ interface IVpnManager {
    /** Legacy VPN APIs */
    void startLegacyVpn(in VpnProfile profile);
    LegacyVpnInfo getLegacyVpnInfo(int userId);
    VpnProfile[] getAllLegacyVpns();
    boolean updateLockdownVpn();

    /** Profile store APIs */
+11 −0
Original line number Diff line number Diff line
@@ -816,4 +816,15 @@ public class VpnManager {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * @hide
     */
    public VpnProfile[] getAllLegacyVpns() {
        try {
            return mService.getAllLegacyVpns();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }
}
+15 −0
Original line number Diff line number Diff line
@@ -496,6 +496,21 @@ public final class VpnProfile implements Cloneable, Parcelable {
        }
    }

    /**
     * Returns {@code true} if the VPN type requires username and password.
     *
     * <p>In sync with Settings's ConfigDialog.
     */
    public boolean isUsernamePasswordRequiredVpnProfile() {
        switch (type) {
            case VpnProfile.TYPE_IKEV2_IPSEC_RSA: // fall through
            case VpnProfile.TYPE_IKEV2_IPSEC_PSK:
                return false;
            default:
                return true;
        }
    }

    private boolean isValidLockdownLegacyVpnProfile() {
        return isLegacyType(type) && isServerAddressNumeric() && hasDns()
                && areDnsAddressesNumeric();
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
        package="com.android.systemui">

    <!-- QS Tiles -->
    <uses-permission android:name="android.permission.MAINLINE_NETWORK_STACK" />
    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
    <uses-permission android:name="lineageos.permission.HARDWARE_ABSTRACTION_ACCESS" />
+27 −0
Original line number Diff line number Diff line
<!--
Copyright (C) 2014 The Android Open Source Project

   Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="48dp"
        android:height="48dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M12.09,9C11.11,7.5 9.43,6.5 7.5,6.5C4.46,6.5 2,8.96 2,12c0,3.04 2.46,5.5 5.5,5.5c1.93,0 3.61,-1 4.59,-2.5H14v3h6v-3h2V9H12.09zM20,13h-2v3h-2v-3h-5.16c-0.43,1.44 -1.76,2.5 -3.34,2.5C5.57,15.5 4,13.93 4,12c0,-1.93 1.57,-3.5 3.5,-3.5c1.58,0 2.9,1.06 3.34,2.5H20V13z"/>
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M7.5,12m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"/>
</vector>
Loading