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

Commit d0d9ce3d authored by James Bottomley's avatar James Bottomley Committed by Takuo Kitame
Browse files

Settings: Add openvpn to profile and VPN settings

parent 7bc61d0b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -204,6 +204,9 @@
        <activity android:name=".vpn.VpnEditor"
                android:configChanges="orientation|keyboardHidden">
        </activity>
        <activity android:name=".vpn.OpenvpnEditor$AdvancedSettings"
                android:configChanges="orientation|keyboardHidden">
        </activity>

        <activity android:name="DateTimeSettings" android:label="@string/date_and_time"
                >
+7 −0
Original line number Diff line number Diff line
@@ -342,6 +342,13 @@
        <item>2</item>
    </string-array>

    <!-- openvpn advanced menu protocol entries -->
    <!-- Do not translate. -->
    <string-array name="vpn_openvpn_protocol_entries">
        <item>udp</item>
        <item>tcp</item>
    </string-array>

    <!-- Locales in this list are displayed with the corresponding
         name from special_locale_names instead of using the name
         from Locale.getDisplayName(). -->
+11 −0
Original line number Diff line number Diff line
@@ -2386,6 +2386,17 @@ found in the list of installed applications.</string>
    <string name="vpn_a_l2tp_secret">an L2TP secret</string>
    <string name="vpn_pptp_encryption_title">encryption</string>
    <string name="vpn_pptp_encryption">PPTP encryption</string>
    <string name="vpn_openvpn_port">Port for Server</string>
    <string name="vpn_openvpn_protocol">Protocol to use for Port</string>
    <string name="vpn_openvpn_userauth">User Authentication</string>
    <string name="vpn_openvpn_userauth_summary">Set if additional username/password authentication needs to be used</string>
    <string name="vpn_openvpn_advanced_titlebar">Advanced Openvpn Settings</string>
    <string name="vpn_openvpn_comp_lzo">LZO Compression</string>
    <string name="vpn_openvpn_comp_lzo_summary">Force LZO compression to be set to on</string>
    <string name="vpn_openvpn_set_addr">Remote Sets Addresses</string>
    <string name="vpn_openvpn_set_addr_summary">Uncheck to set tunnel addresses manually</string>
    <string name="vpn_openvpn_set_local_addr">Local IP Address</string>
    <string name="vpn_openvpn_set_remote_addr">Remote IP Address</string>

    <!-- Preference title -->
    <string name="vpn_ipsec_presharedkey_title">Set IPSec pre-shared key</string>
+65 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 James Bottomley <James.Bottomley@suse.de>

     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.
-->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
        android:title="@string/vpn_openvpn_advanced_titlebar">

    <EditTextPreference
       android:key="set_port"
       android:title="@string/vpn_openvpn_port"
       android:dialogTitle="@string/vpn_openvpn_port"
       android:singleLine="true"
       android:inputType="number"
       />

    <ListPreference
       android:key="set_protocol"
       android:title="@string/vpn_openvpn_protocol"
       android:dialogTitle="@string/vpn_openvpn_protocol"
       android:entries="@array/vpn_openvpn_protocol_entries"
       android:entryValues="@array/vpn_openvpn_protocol_entries"
       />

    <CheckBoxPreference
       android:key="set_comp_lzo"
       android:title="@string/vpn_openvpn_comp_lzo"
       android:summary="@string/vpn_openvpn_comp_lzo_summary"
       />

    <CheckBoxPreference
       android:key="set_addr"
       android:title="@string/vpn_openvpn_set_addr"
       android:summary="@string/vpn_openvpn_set_addr_summary"
       android:disableDependentsState="true"
       />

    <EditTextPreference
       android:key="set_local_addr"
       android:title="@string/vpn_openvpn_set_local_addr"
       android:dialogTitle="@string/vpn_openvpn_set_local_addr"
       android:dependency="set_addr"
       android:singleLine="true"
       />

    <EditTextPreference
       android:key="set_remote_addr"
       android:title="@string/vpn_openvpn_set_remote_addr"
       android:dialogTitle="@string/vpn_openvpn_set_remote_addr"
       android:dependency="set_addr"
       android:singleLine="true"
       />
 
</PreferenceScreen>   
+1 −1
Original line number Diff line number Diff line
@@ -121,7 +121,7 @@ public class AuthenticationActor implements VpnProfileActor {
        return mContext;
    }

    private void connect(final String username, final String password) {
    protected void connect(final String username, final String password) {
        mVpnManager.startVpnService();
        ServiceConnection c = new ServiceConnection() {
            public void onServiceConnected(ComponentName className,
Loading