Add VPN settings classes to Settings app.

PATCH SET 2:
+ Add import com.android.settings.R

PATCH SET 3:
+ Remove @Override interface methods to be compilable by Java 1.5.

PATCH SET 4:
+ Add import android.net.vpn.VpnManager

PATCH SET 5:
+ Add license headers.

PATCH SET 6:
+ Remove Constant.java and move the constants to VpnSettings.
+ Make AuthenticationActor implement DialogInterface's handlers.
+ Remove trailing spaces.

PATCH SET 7:
+ Remove default username.
This commit is contained in:
Hung-ying Tyan
2009-06-10 22:52:44 +08:00
parent 1d09759798
commit 1617706d25
18 changed files with 1867 additions and 0 deletions

27
res/xml/vpn_edit.xml Normal file
View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<EditTextPreference
android:title="@string/vpn_name"
android:dialogTitle="@string/vpn_name"
android:key="vpn_name"
android:summary="@string/vpn_name_summary"
android:singleLine="true"/>
</PreferenceScreen>

36
res/xml/vpn_settings.xml Normal file
View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/vpn_settings_activity_title">
<PreferenceScreen android:key="add_new_vpn"
android:title="@string/vpn_add_new_vpn">
<!--intent
android:action="android.intent.action.MAIN"
android:targetPackage="com.android.settings.vpn"
android:targetClass="com.android.settings.vpn.VpnEditor" /-->
</PreferenceScreen>
<!--CheckBoxPreference android:key="installer_enabled"
android:defaultValue="false"
android:title="@string/installer_enabled"
android:summaryOn="@string/installer_enabled_summary_on"
android:summaryOff="@string/installer_enabled_summary_off" /-->
<PreferenceCategory android:key="vpn_list" android:title="@string/vpns">
</PreferenceCategory>
</PreferenceScreen>

21
res/xml/vpn_type.xml Normal file
View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/vpn_type_title">
</PreferenceScreen>

View File

@@ -52,6 +52,16 @@
android:targetClass="com.android.settings.bluetooth.BluetoothSettings" />
</PreferenceScreen>
<PreferenceScreen
android:title="@string/vpn_settings_title"
android:summary="@string/vpn_settings_summary"
android:dependency="toggle_airplane">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="com.android.settings"
android:targetClass="com.android.settings.vpn.VpnSettings" />
</PreferenceScreen>
<PreferenceScreen
android:title="@string/network_settings_title"
android:summary="@string/network_settings_summary"