DO NOT MERGE Replacement sample code for DevicePolicyManager api.

* UI is organized into multiple screens to make it easier to understand
* More feedback about local vs global (aggregate) policies
* Uses preference fragments for modern appearance

Backport of: I075161d389942786e6c95483becbff7ebe847078

Change-Id: Ie88c1577b2ebae124615cc4b45968851cf11187e
This commit is contained in:
Andy Stadler
2011-06-02 16:39:17 -07:00
parent 10c33528e0
commit 547494ef8a
10 changed files with 1177 additions and 1061 deletions

View File

@@ -717,7 +717,7 @@
<!-- Device Admin Samples --> <!-- Device Admin Samples -->
<activity android:name=".app.DeviceAdminSample$Controller" <activity android:name=".app.DeviceAdminSample"
android:label="@string/activity_sample_device_admin"> android:label="@string/activity_sample_device_admin">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@@ -726,7 +726,7 @@
</activity> </activity>
<!-- BEGIN_INCLUDE(device_admin_declaration) --> <!-- BEGIN_INCLUDE(device_admin_declaration) -->
<receiver android:name=".app.DeviceAdminSample" <receiver android:name=".app.DeviceAdminSample$DeviceAdminSampleReceiver"
android:label="@string/sample_device_admin" android:label="@string/sample_device_admin"
android:description="@string/sample_device_admin_description" android:description="@string/sample_device_admin_description"
android:permission="android.permission.BIND_DEVICE_ADMIN"> android:permission="android.permission.BIND_DEVICE_ADMIN">

View File

@@ -1,294 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 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.
-->
<!-- Demonstrates implementation of a DeviceAdmin. -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical" android:padding="4dip"
android:gravity="center_horizontal"
android:layout_width="match_parent" android:layout_height="match_parent">
<TextView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingBottom="4dip"
android:text="@string/sample_device_admin_summary"/>
<LinearLayout android:orientation="horizontal" android:gravity="center"
android:layout_width="match_parent" android:layout_height="wrap_content">
<Button android:id="@+id/enable"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="@string/enable_admin">
<requestFocus />
</Button>
<Button android:id="@+id/disable"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="@string/disable_admin">
</Button>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:gravity="center"
android:layout_width="match_parent" android:layout_height="wrap_content">
<Spinner android:id="@+id/password_quality"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:prompt="@string/password_quality">
</Spinner>
<EditText android:id="@+id/password_length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/password_length_hint"
android:inputType="number">
</EditText>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:gravity="center"
android:layout_width="match_parent" android:layout_height="wrap_content">
<EditText android:id="@+id/password_minimum_letters"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/password_minimum_letters_hint"
android:inputType="number">
</EditText>
<EditText android:id="@+id/password_minimum_numeric"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/password_minimum_numeric_hint"
android:inputType="number">
</EditText>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:gravity="center"
android:layout_width="match_parent" android:layout_height="wrap_content">
<EditText android:id="@+id/password_minimum_lowercase"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/password_minimum_lowercase_hint"
android:inputType="number">
</EditText>
<EditText android:id="@+id/password_minimum_uppercase"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/password_minimum_uppercase_hint"
android:inputType="number">
</EditText>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:gravity="center"
android:layout_width="match_parent" android:layout_height="wrap_content">
<EditText android:id="@+id/password_minimum_symbols"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/password_minimum_symbols_hint"
android:inputType="number">
</EditText>
<EditText android:id="@+id/password_minimum_nonletter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/password_minimum_nonletter_hint"
android:inputType="number">
</EditText>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:gravity="center"
android:layout_width="match_parent" android:layout_height="wrap_content">
<EditText android:id="@+id/password_history_length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/password_history_length_hint"
android:inputType="number">
</EditText>
<Button android:id="@+id/set_password"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android_layout_gravity="east|center_vertical"
android:text="@string/set_password">
</Button>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:gravity="center"
android:layout_width="match_parent" android:layout_height="wrap_content">
<EditText android:id="@+id/password_expiration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/password_expiration_hint"
android:inputType="number">
</EditText>
<Button android:id="@+id/update_expiration_button"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android_layout_gravity="east|center_vertical"
android:text="@string/update_expiration_label">
</Button>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:gravity="center"
android:layout_width="match_parent" android:layout_height="wrap_content">
<TextView android:id="@+id/password_expiration_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button android:id="@+id/update_expiration_status_button"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android_layout_gravity="east|center_vertical"
android:text="@string/update_expiration_status_label" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:gravity="center"
android:layout_width="match_parent" android:layout_height="wrap_content">
<EditText android:id="@+id/password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/password_hint"
android:freezesText="true">
</EditText>
<Button android:id="@+id/reset_password"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0"
android:text="@string/reset_password">
</Button>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:gravity="center"
android:layout_width="match_parent" android:layout_height="wrap_content">
<EditText android:id="@+id/max_failed_pw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/max_failed_pw_hint"
android:inputType="number">
</EditText>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:gravity="center"
android:layout_width="match_parent" android:layout_height="wrap_content">
<Button android:id="@+id/force_lock"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0"
android:text="@string/force_lock">
</Button>
<Button android:id="@+id/wipe_data"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0"
android:text="@string/wipe_data">
</Button>
<Button android:id="@+id/wipe_all_data"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0"
android:text="@string/wipe_all_data">
</Button>
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:gravity="center"
android:layout_width="match_parent" android:layout_height="wrap_content">
<EditText android:id="@+id/timeout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/timeout_hint"
android:inputType="number"
android:freezesText="true">
</EditText>
<Button android:id="@+id/set_timeout"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0"
android:text="@string/set_timeout_label">
</Button>
</LinearLayout>
<!-- Encryption Status Controls -->
<LinearLayout
android:orientation="horizontal"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button android:id="@+id/encryption_enable_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/encryption_enable_label" />
<Button android:id="@+id/encryption_disable_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/encryption_disable_label" />
<Button android:id="@+id/encryption_activate_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/encryption_activate_label" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView android:id="@+id/encryption_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button android:id="@+id/encryption_update_status_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android_layout_gravity="east|center_vertical"
android:text="@string/update_encryption_status_label" />
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@@ -598,6 +598,7 @@
<!-- app/device policies examples strings --> <!-- app/device policies examples strings -->
<!-- ============================== --> <!-- ============================== -->
<!-- Manifest strings -->
<string name="activity_sample_device_admin">App/Device Admin</string> <string name="activity_sample_device_admin">App/Device Admin</string>
<string name="sample_device_admin">Sample Device Admin</string> <string name="sample_device_admin">Sample Device Admin</string>
<string name="sample_device_admin_description">Sample code for writing <string name="sample_device_admin_description">Sample code for writing
@@ -605,36 +606,89 @@
for you to directly control what the DeviceAdmin does with the for you to directly control what the DeviceAdmin does with the
system.</string> system.</string>
<string name="sample_device_admin_summary">Demonstration of a DeviceAdmin <!-- Strings used in preference headers and preference definitions -->
class for administering the user\'s device.</string> <string name="header_general">General</string>
<string name="enable_admin">Enable Admin</string> <string name="header_quality">Password quality</string>
<string name="disable_admin">Disable Admin</string> <string name="header_expiration">Password expiration</string>
<string name="password_quality">Password Quality</string> <string name="header_lock_wipe">Lock screen / Wipe</string>
<string name="password_length_hint">Minimum Length</string> <string name="header_encryption">Encryption</string>
<string name="password_minimum_letters_hint">Minimum Letters</string>
<string name="password_minimum_uppercase_hint">Minimum Uppercase</string>
<string name="password_minimum_lowercase_hint">Minimum Lowercase</string>
<string name="password_minimum_symbols_hint">Minimum Symbols</string>
<string name="password_minimum_numeric_hint">Minimum Numeric</string>
<string name="password_minimum_nonletter_hint">Minimum Non-Letter</string>
<string name="password_history_length_hint">Password History Length</string>
<string name="password_expiration_hint">Password Expiration Timeout (minutes) </string>
<string name="update_expiration_label">Update</string>
<string name="update_expiration_status_label">Update Status</string>
<string name="set_password">Set Password</string>
<string name="password_hint">Password</string>
<string name="reset_password">Reset Password</string>
<string name="max_failed_pw_hint">Password Attempts Wipe Data</string>
<string name="force_lock">Force Lock</string>
<string name="wipe_data">Wipe Data</string>
<string name="wipe_all_data">Wipe All Data</string>
<string name="timeout_hint">Max screen timeout</string>
<string name="set_timeout_label">Set Timeout</string>
<string name="encryption_enable_label">Enable Encryption</string> <string name="enable_admin">Enable admin</string>
<string name="encryption_disable_label">Disable Encryption</string> <string name="password_controls_category">Password controls</string>
<string name="encryption_activate_label">Activate Encryption</string> <string name="set_password_user">Set password (user)</string>
<string name="update_encryption_status_label">Update Status</string> <string name="set_password_api">Set password (via API)</string>
<string name="set_password_api_dialog">Set screen lock password to</string>
<string name="password_quality_category">Password quality</string>
<string name="password_quality">Password quality</string>
<string name="password_minimum_length">Minimum length </string>
<string name="password_minimum_letters">Minimum letters</string>
<string name="password_minimum_numeric">Minimum numeric</string>
<string name="password_minimum_lower_case">Minimum lower case</string>
<string name="password_minimum_upper_case">Minimum upper case</string>
<string name="password_minimum_symbols">Minimum symbols</string>
<string name="password_minimum_non_letter">Minimum non-letter</string>
<string name="password_expiration_category">Password history / Expiration</string>
<string name="password_history_depth">Password history depth</string>
<string name="password_expiration_timeout">Password expiration timeout (minutes)</string>
<string name="password_expiration_status">Password expiration status</string>
<string name="lock_wipe_category">Lock screen / Wipe</string>
<string name="maximum_lock_time">Max time to screen lock (minutes)</string>
<string name="maximum_password_fails">Max password failures for local wipe</string>
<string name="lock_screen">Lock screen now</string>
<string name="wipe_data">Wipe data</string>
<string name="wipe_data_summary">Wipe internal data, like a factory reset</string>
<string name="wipe_all_data">Wipe all data</string>
<string name="wipe_all_data_summary">Wipe internal data and external storage</string>
<string name="encryption_category">Encryption</string>
<string name="require_encryption">Require encryption</string>
<string name="activate_encryption">Activate encryption</string>
<!-- Strings used by DeviceAdminSample controller code -->
<string name="password_sufficient">Current password meets policy requirements</string>
<string name="password_insufficient">Current password does not meet policy requirements</string>
<string name="monkey_reset_password">You can\'t reset my password, you are a monkey!</string>
<string name="monkey_lock_screen">You can\'t lock my screen, you are a monkey!</string>
<string name="monkey_encryption">You can\'t start encryption, you are a monkey!</string>
<string name="monkey_wipe_data">You can\'t wipe my data, you are a monkey!</string>
<string name="monkey_ok">I admit defeat</string>
<string name="reset_password_warning">
You have just reset your screen lock password to \"%1$s\""</string>
<string name="reset_password_ok">Don\'t forget it</string>
<string name="add_admin_extra_app_text">
Additional text explaining why this needs to be added.</string>
<string name="status_local_global">Local=%1$s / Global=%2$s</string>
<string name="status_device_encryption">Device encryption status=%1$s</string>
<string name="status_days_hours_minutes">%1$sd %2$sh %3$sm</string>
<string name="number_format_warning">Bad value \"%1$s\""</string>
<string name="wipe_warning_first">This will erase all of your data. Are you sure?</string>
<string name="wipe_warning_first_ok">Yes</string>
<string name="wipe_warning_first_no">No</string>
<string name="wipe_warning_second">This is not a test. This WILL erase all of your data!
Are you really absolutely sure?</string>
<string name="wipe_warning_second_full">This is not a test. This WILL erase all of your data,
including external storage! Are you really absolutely sure?</string>
<string name="wipe_warning_second_ok">BOOM!</string>
<string name="wipe_warning_second_no">Oops, run away!</string>
<string name="encryption_not_supported">Encryption is not supported on this device.</string>
<string name="encryption_not_supported_ok">OK</string>
<string name="encryption_status_unknown">unknown</string>
<string name="encryption_status_unsupported">unsupported</string>
<string name="encryption_status_inactive">inactive</string>
<string name="encryption_status_activating">activating</string>
<string name="encryption_status_active">active</string>
<string name="expiration_status_none">None</string>
<string name="expiration_status_past">Password expired %1$s ago</string>
<string name="expiration_status_future">Password will expire %1$s from now</string>
<!-- Strings used by the sample DeviceAdminReceiver -->
<string name="admin_receiver_status">Sample Device Admin: %1$s</string>
<string name="admin_receiver_status_enabled">enabled</string>
<string name="admin_receiver_status_disabled">disabled</string>
<string name="admin_receiver_status_pw_changed">pw changed</string>
<string name="admin_receiver_status_pw_failed">pw failed</string>
<string name="admin_receiver_status_pw_succeeded">pw succeeded</string>
<string name="admin_receiver_status_disable_warning">
This is an optional message to warn the user about disabling.</string>
<!-- ============================== --> <!-- ============================== -->
<!-- app/voice recognition examples strings --> <!-- app/voice recognition examples strings -->

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->
<!-- A set of preferences used to exercise the DevicePolicyManager API. -->
<!-- This screen is shown for the "Encryption" header. -->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory
android:key="key_category_encryption"
android:title="@string/encryption_category" >
<CheckBoxPreference
android:key="key_require_encryption"
android:title="@string/require_encryption" />
<PreferenceScreen
android:key="key_activate_encryption"
android:title="@string/activate_encryption" />
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->
<!-- A set of preferences used to exercise the DevicePolicyManager API. -->
<!-- This screen is shown for the "Password Expiration" header. -->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory
android:title="@string/password_controls_category" >
<PreferenceScreen
android:key="key_set_password"
android:title="@string/set_password_user" />
<EditTextPreference
android:key="key_reset_password"
android:title="@string/set_password_api"
android:dialogTitle="@string/set_password_api_dialog" />
</PreferenceCategory>
<PreferenceCategory
android:key="key_category_expiration"
android:title="@string/password_expiration_category" >
<EditTextPreference
android:key="key_history"
android:title="@string/password_history_depth"
android:dialogTitle="@string/password_history_depth"
android:inputType="number" />
<EditTextPreference
android:key="key_expiration_timeout"
android:title="@string/password_expiration_timeout"
android:dialogTitle="@string/password_expiration_timeout"
android:inputType="number" />
<PreferenceScreen
android:key="key_expiration_status"
android:title="@string/password_expiration_status" />
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->
<!-- A set of preferences used to exercise the DevicePolicyManager API. -->
<!-- This screen is shown for the "General" header. -->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory
android:title="@string/enable_admin" >
<CheckBoxPreference
android:key="key_enable_admin"
android:title="@string/enable_admin" />
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->
<!-- Headers for a set of preferences used to exercise the DevicePolicyManager API. -->
<preference-headers
xmlns:android="http://schemas.android.com/apk/res/android" >
<header
android:fragment="com.example.android.apis.app.DeviceAdminSample$GeneralFragment"
android:title="@string/header_general" />
<header
android:fragment="com.example.android.apis.app.DeviceAdminSample$QualityFragment"
android:title="@string/header_quality" />
<header
android:fragment="com.example.android.apis.app.DeviceAdminSample$ExpirationFragment"
android:title="@string/header_expiration" />
<header
android:fragment="com.example.android.apis.app.DeviceAdminSample$LockWipeFragment"
android:title="@string/header_lock_wipe" />
<header
android:fragment="com.example.android.apis.app.DeviceAdminSample$EncryptionFragment"
android:title="@string/header_encryption" />
</preference-headers>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->
<!-- A set of preferences used to exercise the DevicePolicyManager API. -->
<!-- This screen is shown for the "Lock / Wipe" header. -->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory
android:key="key_category_lock_wipe"
android:title="@string/lock_wipe_category" >
<EditTextPreference
android:key="key_max_time_screen_lock"
android:title="@string/maximum_lock_time"
android:dialogTitle="@string/maximum_lock_time"
android:inputType="number" />
<EditTextPreference
android:key="key_max_fails_before_wipe"
android:title="@string/maximum_password_fails"
android:dialogTitle="@string/maximum_password_fails"
android:inputType="number" />
<PreferenceScreen
android:key="key_lock_screen"
android:title="@string/lock_screen" />
<PreferenceScreen
android:key="key_wipe_data"
android:title="@string/wipe_data"
android:summary="@string/wipe_data_summary" />
<PreferenceScreen
android:key="key_wipe_data_all"
android:title="@string/wipe_all_data"
android:summary="@string/wipe_all_data_summary" />
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->
<!-- A set of preferences used to exercise the DevicePolicyManager API. -->
<!-- This screen is shown for the "Password Quality" header. -->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory
android:title="@string/password_controls_category" >
<PreferenceScreen
android:key="key_set_password"
android:title="@string/set_password_user" />
<EditTextPreference
android:key="key_reset_password"
android:title="@string/set_password_api"
android:dialogTitle="@string/set_password_api_dialog" />
</PreferenceCategory>
<PreferenceCategory
android:key="key_category_quality"
android:title="@string/password_quality_category" >
<ListPreference
android:key="key_quality"
android:title="@string/password_quality"
android:entries="@array/password_qualities"
android:dialogTitle="@string/password_quality" />
<EditTextPreference
android:key="key_minimum_length"
android:title="@string/password_minimum_length"
android:dialogTitle="@string/password_minimum_length"
android:inputType="number" />
<EditTextPreference
android:key="key_minimum_letters"
android:title="@string/password_minimum_letters"
android:dialogTitle="@string/password_minimum_letters" />
<EditTextPreference
android:key="key_minimum_numeric"
android:title="@string/password_minimum_numeric"
android:dialogTitle="@string/password_minimum_numeric"
android:inputType="number" />
<EditTextPreference
android:key="key_minimum_lower_case"
android:title="@string/password_minimum_lower_case"
android:dialogTitle="@string/password_minimum_lower_case"
android:inputType="number" />
<EditTextPreference
android:key="key_minimum_upper_case"
android:title="@string/password_minimum_upper_case"
android:dialogTitle="@string/password_minimum_upper_case"
android:inputType="number" />
<EditTextPreference
android:key="key_minimum_symbols"
android:title="@string/password_minimum_symbols"
android:dialogTitle="@string/password_minimum_symbols"
android:inputType="number" />
<EditTextPreference
android:key="key_minimum_non_letter"
android:title="@string/password_minimum_non_letter"
android:dialogTitle="@string/password_minimum_non_letter"
android:inputType="number" />
</PreferenceCategory>
</PreferenceScreen>