Merge "Updated user_add_user_message_long"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 2484831..564bf1f 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1299,10 +1299,12 @@
</intent-filter>
</activity>
- <activity android:name="ConfirmLockPattern"/>
+ <activity android:name="ConfirmLockPattern"
+ android:theme="@style/Theme.ConfirmDeviceCredentials"/>
<activity android:name="ConfirmLockPassword"
- android:windowSoftInputMode="stateVisible|adjustResize"/>
+ android:windowSoftInputMode="stateVisible|adjustResize"
+ android:theme="@style/Theme.ConfirmDeviceCredentials"/>
<activity android:name="FingerprintSettings" android:exported="false"/>
<activity android:name="FingerprintEnroll" android:exported="false"/>
@@ -1415,15 +1417,31 @@
<category android:name="android.intent.category.VOICE_LAUNCH" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.deviceinfo.Memory" />
+ android:value="com.android.settings.deviceinfo.StorageSettings" />
<meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
android:resource="@id/storage_settings" />
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
</activity>
- <activity android:name=".deviceinfo.MiscFilesHandler"
- android:theme="@style/Theme.SubSettingsDialogWhenLarge"/>
+ <activity
+ android:name="Settings$StorageVolumeSettingsActivity"
+ android:label="@string/storage_settings_title"
+ android:taskAffinity="com.android.settings"
+ android:parentActivityName="Settings$StorageSettingsActivity">
+ <intent-filter>
+ <action android:name="android.provider.action.DOCUMENT_ROOT_SETTINGS" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data
+ android:scheme="content"
+ android:host="com.android.externalstorage.documents"
+ android:mimeType="vnd.android.document/root" />
+ </intent-filter>
+ <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+ android:value="com.android.settings.deviceinfo.PublicVolumeSettings" />
+ <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
+ android:resource="@id/storage_settings" />
+ </activity>
<activity android:name="ApnEditor"
android:label="@string/apn_edit">
@@ -2059,23 +2077,6 @@
android:resource="@id/security_settings" />
</activity>
- <activity android:name="Settings$ConditionProviderSettingsActivity"
- android:label="@string/manage_condition_providers"
- android:taskAffinity="">
- <intent-filter android:priority="1">
- <action android:name="android.settings.ACTION_CONDITION_PROVIDER_SETTINGS" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
- <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
- android:value="com.android.settings.notification.ConditionProviderSettings" />
- <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
- android:resource="@id/notification_settings" />
- </activity>
-
<activity android:name="Settings$NotificationSettingsActivity"
android:label="@string/notification_settings"
android:exported="true"
diff --git a/CleanSpec.mk b/CleanSpec.mk
index be2e221..6ead46e 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -45,6 +45,7 @@
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Settings_intermediates)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Settings_intermediates)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
diff --git a/res/drawable-hdpi/ic_settings_about.png b/res/drawable-hdpi/ic_settings_about.png
deleted file mode 100644
index f4596ed..0000000
--- a/res/drawable-hdpi/ic_settings_about.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_about_alpha.png b/res/drawable-hdpi/ic_settings_about_alpha.png
new file mode 100644
index 0000000..1e38ba5
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_about_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_accessibility.png b/res/drawable-hdpi/ic_settings_accessibility.png
deleted file mode 100644
index 202ec9d..0000000
--- a/res/drawable-hdpi/ic_settings_accessibility.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_accessibility_alpha.png b/res/drawable-hdpi/ic_settings_accessibility_alpha.png
new file mode 100644
index 0000000..74ca88e
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_accessibility_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_accounts.png b/res/drawable-hdpi/ic_settings_accounts.png
deleted file mode 100644
index cdeb8b0..0000000
--- a/res/drawable-hdpi/ic_settings_accounts.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_accounts_alpha.png b/res/drawable-hdpi/ic_settings_accounts_alpha.png
new file mode 100644
index 0000000..c36216c
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_accounts_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_applications.png b/res/drawable-hdpi/ic_settings_applications.png
deleted file mode 100644
index 627b7cb..0000000
--- a/res/drawable-hdpi/ic_settings_applications.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_applications_alpha.png b/res/drawable-hdpi/ic_settings_applications_alpha.png
new file mode 100644
index 0000000..1c46133
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_applications_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_backup.png b/res/drawable-hdpi/ic_settings_backup.png
deleted file mode 100644
index 701b6cf..0000000
--- a/res/drawable-hdpi/ic_settings_backup.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_backup_alpha.png b/res/drawable-hdpi/ic_settings_backup_alpha.png
new file mode 100644
index 0000000..ef8acea
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_backup_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_battery.png b/res/drawable-hdpi/ic_settings_battery.png
deleted file mode 100644
index 75a2af9..0000000
--- a/res/drawable-hdpi/ic_settings_battery.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_battery_alpha.png b/res/drawable-hdpi/ic_settings_battery_alpha.png
new file mode 100644
index 0000000..89013cf
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_battery_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_bluetooth.png b/res/drawable-hdpi/ic_settings_bluetooth.png
deleted file mode 100644
index 3d9015f..0000000
--- a/res/drawable-hdpi/ic_settings_bluetooth.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_bluetooth2.png b/res/drawable-hdpi/ic_settings_bluetooth2.png
deleted file mode 100644
index 9afe435..0000000
--- a/res/drawable-hdpi/ic_settings_bluetooth2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_bluetooth2_alpha.png b/res/drawable-hdpi/ic_settings_bluetooth2_alpha.png
new file mode 100644
index 0000000..9dbc509
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_bluetooth2_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_bluetooth_alpha.png b/res/drawable-hdpi/ic_settings_bluetooth_alpha.png
new file mode 100644
index 0000000..a21982e
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_bluetooth_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_data_usage.png b/res/drawable-hdpi/ic_settings_data_usage.png
deleted file mode 100644
index b274f4f..0000000
--- a/res/drawable-hdpi/ic_settings_data_usage.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_data_usage_alpha.png b/res/drawable-hdpi/ic_settings_data_usage_alpha.png
new file mode 100644
index 0000000..68e0d8a
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_data_usage_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_date_time.png b/res/drawable-hdpi/ic_settings_date_time.png
deleted file mode 100644
index 5a84c33..0000000
--- a/res/drawable-hdpi/ic_settings_date_time.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_date_time_alpha.png b/res/drawable-hdpi/ic_settings_date_time_alpha.png
new file mode 100644
index 0000000..edea4ac
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_date_time_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_development.png b/res/drawable-hdpi/ic_settings_development.png
deleted file mode 100644
index 7f38de0..0000000
--- a/res/drawable-hdpi/ic_settings_development.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_development_alpha.png b/res/drawable-hdpi/ic_settings_development_alpha.png
new file mode 100644
index 0000000..44cfb57
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_development_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_display_am.png b/res/drawable-hdpi/ic_settings_display_am.png
deleted file mode 100644
index 24719b1..0000000
--- a/res/drawable-hdpi/ic_settings_display_am.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_display_am_alpha.png b/res/drawable-hdpi/ic_settings_display_am_alpha.png
new file mode 100644
index 0000000..7b8f909
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_display_am_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_dock.png b/res/drawable-hdpi/ic_settings_dock.png
deleted file mode 100644
index bdeaee7..0000000
--- a/res/drawable-hdpi/ic_settings_dock.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_dock_alpha.png b/res/drawable-hdpi/ic_settings_dock_alpha.png
new file mode 100644
index 0000000..98ef4e8
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_dock_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_home.png b/res/drawable-hdpi/ic_settings_home.png
deleted file mode 100644
index 6a0564a..0000000
--- a/res/drawable-hdpi/ic_settings_home.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_home_alpha.png b/res/drawable-hdpi/ic_settings_home_alpha.png
new file mode 100644
index 0000000..4ab9ae0
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_home_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_language.png b/res/drawable-hdpi/ic_settings_language.png
deleted file mode 100644
index e27035a..0000000
--- a/res/drawable-hdpi/ic_settings_language.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_language_alpha.png b/res/drawable-hdpi/ic_settings_language_alpha.png
new file mode 100644
index 0000000..5a65a5b
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_language_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_location.png b/res/drawable-hdpi/ic_settings_location.png
deleted file mode 100644
index 968253c..0000000
--- a/res/drawable-hdpi/ic_settings_location.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_location_alpha.png b/res/drawable-hdpi/ic_settings_location_alpha.png
new file mode 100644
index 0000000..f90ce84
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_location_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_more.png b/res/drawable-hdpi/ic_settings_more.png
deleted file mode 100644
index 61bb00c..0000000
--- a/res/drawable-hdpi/ic_settings_more.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_more_alpha.png b/res/drawable-hdpi/ic_settings_more_alpha.png
new file mode 100644
index 0000000..38255a2
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_more_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_multiuser.png b/res/drawable-hdpi/ic_settings_multiuser.png
deleted file mode 100644
index c1a6e63..0000000
--- a/res/drawable-hdpi/ic_settings_multiuser.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_multiuser_alpha.png b/res/drawable-hdpi/ic_settings_multiuser_alpha.png
new file mode 100644
index 0000000..c2efeba
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_multiuser_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_nfc_payment_am.png b/res/drawable-hdpi/ic_settings_nfc_payment_am.png
deleted file mode 100644
index 7431cb0..0000000
--- a/res/drawable-hdpi/ic_settings_nfc_payment_am.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_nfc_payment_am_alpha.png b/res/drawable-hdpi/ic_settings_nfc_payment_am_alpha.png
new file mode 100644
index 0000000..0a71416
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_nfc_payment_am_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_notifications.png b/res/drawable-hdpi/ic_settings_notifications.png
deleted file mode 100644
index 6dd91bb..0000000
--- a/res/drawable-hdpi/ic_settings_notifications.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_notifications_alpha.png b/res/drawable-hdpi/ic_settings_notifications_alpha.png
new file mode 100644
index 0000000..fd6df67
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_notifications_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_print.png b/res/drawable-hdpi/ic_settings_print.png
deleted file mode 100644
index 62624ee..0000000
--- a/res/drawable-hdpi/ic_settings_print.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_print_alpha.png b/res/drawable-hdpi/ic_settings_print_alpha.png
new file mode 100644
index 0000000..06f8dac
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_print_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_security.png b/res/drawable-hdpi/ic_settings_security.png
deleted file mode 100644
index abbf3fa..0000000
--- a/res/drawable-hdpi/ic_settings_security.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_security_alpha.png b/res/drawable-hdpi/ic_settings_security_alpha.png
new file mode 100644
index 0000000..33c9505
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_security_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_sound.png b/res/drawable-hdpi/ic_settings_sound.png
deleted file mode 100644
index dec290a..0000000
--- a/res/drawable-hdpi/ic_settings_sound.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_sound_alpha.png b/res/drawable-hdpi/ic_settings_sound_alpha.png
new file mode 100644
index 0000000..beac382
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_sound_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_storage.png b/res/drawable-hdpi/ic_settings_storage.png
deleted file mode 100644
index 5444eeb..0000000
--- a/res/drawable-hdpi/ic_settings_storage.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_storage_alpha.png b/res/drawable-hdpi/ic_settings_storage_alpha.png
new file mode 100644
index 0000000..a25da20
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_storage_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_sync.png b/res/drawable-hdpi/ic_settings_sync.png
deleted file mode 100644
index 96254d6..0000000
--- a/res/drawable-hdpi/ic_settings_sync.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_sync_alpha.png b/res/drawable-hdpi/ic_settings_sync_alpha.png
new file mode 100644
index 0000000..f7c0cc2
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_sync_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_wifi.png b/res/drawable-hdpi/ic_settings_wifi.png
deleted file mode 100644
index b8c3eaa..0000000
--- a/res/drawable-hdpi/ic_settings_wifi.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_wifi_alpha.png b/res/drawable-hdpi/ic_settings_wifi_alpha.png
new file mode 100644
index 0000000..a21982e
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_wifi_alpha.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_wireless.png b/res/drawable-hdpi/ic_settings_wireless.png
deleted file mode 100644
index 5c82e8b..0000000
--- a/res/drawable-hdpi/ic_settings_wireless.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_wireless_alpha.png b/res/drawable-hdpi/ic_settings_wireless_alpha.png
new file mode 100644
index 0000000..e5ad5ba
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_wireless_alpha.png
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/ic_settings_sound.png b/res/drawable-ldrtl-hdpi/ic_settings_sound.png
deleted file mode 100755
index b703b4e..0000000
--- a/res/drawable-ldrtl-hdpi/ic_settings_sound.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/ic_settings_sound_alpha.png b/res/drawable-ldrtl-hdpi/ic_settings_sound_alpha.png
new file mode 100644
index 0000000..cebb01f
--- /dev/null
+++ b/res/drawable-ldrtl-hdpi/ic_settings_sound_alpha.png
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/ic_settings_sound.png b/res/drawable-ldrtl-mdpi/ic_settings_sound.png
deleted file mode 100644
index 419868f..0000000
--- a/res/drawable-ldrtl-mdpi/ic_settings_sound.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/ic_settings_sound_alpha.png b/res/drawable-ldrtl-mdpi/ic_settings_sound_alpha.png
new file mode 100644
index 0000000..c7fe326
--- /dev/null
+++ b/res/drawable-ldrtl-mdpi/ic_settings_sound_alpha.png
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/ic_settings_sound.png b/res/drawable-ldrtl-xhdpi/ic_settings_sound.png
deleted file mode 100644
index 8d04d42..0000000
--- a/res/drawable-ldrtl-xhdpi/ic_settings_sound.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/ic_settings_sound_alpha.png b/res/drawable-ldrtl-xhdpi/ic_settings_sound_alpha.png
new file mode 100644
index 0000000..7503f50
--- /dev/null
+++ b/res/drawable-ldrtl-xhdpi/ic_settings_sound_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_about.png b/res/drawable-mdpi/ic_settings_about.png
deleted file mode 100644
index 8c5206e..0000000
--- a/res/drawable-mdpi/ic_settings_about.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_about_alpha.png b/res/drawable-mdpi/ic_settings_about_alpha.png
new file mode 100644
index 0000000..4065701
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_about_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_accessibility.png b/res/drawable-mdpi/ic_settings_accessibility.png
deleted file mode 100644
index d0229f6..0000000
--- a/res/drawable-mdpi/ic_settings_accessibility.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_accessibility_alpha.png b/res/drawable-mdpi/ic_settings_accessibility_alpha.png
new file mode 100644
index 0000000..c040ba0
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_accessibility_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_accounts.png b/res/drawable-mdpi/ic_settings_accounts.png
deleted file mode 100644
index 65008ce..0000000
--- a/res/drawable-mdpi/ic_settings_accounts.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_accounts_alpha.png b/res/drawable-mdpi/ic_settings_accounts_alpha.png
new file mode 100644
index 0000000..769b46a
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_accounts_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_applications.png b/res/drawable-mdpi/ic_settings_applications.png
deleted file mode 100644
index 60ebf38..0000000
--- a/res/drawable-mdpi/ic_settings_applications.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_applications_alpha.png b/res/drawable-mdpi/ic_settings_applications_alpha.png
new file mode 100644
index 0000000..f2ea795
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_applications_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_backup.png b/res/drawable-mdpi/ic_settings_backup.png
deleted file mode 100644
index 4595bda..0000000
--- a/res/drawable-mdpi/ic_settings_backup.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_backup_alpha.png b/res/drawable-mdpi/ic_settings_backup_alpha.png
new file mode 100644
index 0000000..932d354
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_backup_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_battery.png b/res/drawable-mdpi/ic_settings_battery.png
deleted file mode 100644
index 7a001fc..0000000
--- a/res/drawable-mdpi/ic_settings_battery.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_battery_alpha.png b/res/drawable-mdpi/ic_settings_battery_alpha.png
new file mode 100644
index 0000000..970e6ed
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_battery_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_bluetooth.png b/res/drawable-mdpi/ic_settings_bluetooth.png
deleted file mode 100644
index 8cf80c0..0000000
--- a/res/drawable-mdpi/ic_settings_bluetooth.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_bluetooth2.png b/res/drawable-mdpi/ic_settings_bluetooth2.png
deleted file mode 100644
index f556bb4..0000000
--- a/res/drawable-mdpi/ic_settings_bluetooth2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_bluetooth2_alpha.png b/res/drawable-mdpi/ic_settings_bluetooth2_alpha.png
new file mode 100644
index 0000000..f51e5ca
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_bluetooth2_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_bluetooth_alpha.png b/res/drawable-mdpi/ic_settings_bluetooth_alpha.png
new file mode 100644
index 0000000..31be004
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_bluetooth_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_data_usage.png b/res/drawable-mdpi/ic_settings_data_usage.png
deleted file mode 100644
index e5d464d..0000000
--- a/res/drawable-mdpi/ic_settings_data_usage.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_data_usage_alpha.png b/res/drawable-mdpi/ic_settings_data_usage_alpha.png
new file mode 100644
index 0000000..a368371
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_data_usage_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_date_time.png b/res/drawable-mdpi/ic_settings_date_time.png
deleted file mode 100644
index 80be678..0000000
--- a/res/drawable-mdpi/ic_settings_date_time.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_date_time_alpha.png b/res/drawable-mdpi/ic_settings_date_time_alpha.png
new file mode 100644
index 0000000..6837c11
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_date_time_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_development.png b/res/drawable-mdpi/ic_settings_development.png
deleted file mode 100644
index 44aaa29..0000000
--- a/res/drawable-mdpi/ic_settings_development.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_development_alpha.png b/res/drawable-mdpi/ic_settings_development_alpha.png
new file mode 100644
index 0000000..cdc3ffe
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_development_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_display_am.png b/res/drawable-mdpi/ic_settings_display_am.png
deleted file mode 100644
index c794f76..0000000
--- a/res/drawable-mdpi/ic_settings_display_am.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_display_am_alpha.png b/res/drawable-mdpi/ic_settings_display_am_alpha.png
new file mode 100644
index 0000000..f894832
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_display_am_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_dock.png b/res/drawable-mdpi/ic_settings_dock.png
deleted file mode 100644
index 62ccb3c..0000000
--- a/res/drawable-mdpi/ic_settings_dock.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_dock_alpha.png b/res/drawable-mdpi/ic_settings_dock_alpha.png
new file mode 100644
index 0000000..3ef7ab2
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_dock_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_home.png b/res/drawable-mdpi/ic_settings_home.png
deleted file mode 100644
index b18ca3e..0000000
--- a/res/drawable-mdpi/ic_settings_home.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_home_alpha.png b/res/drawable-mdpi/ic_settings_home_alpha.png
new file mode 100644
index 0000000..ad90fb8
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_home_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_language.png b/res/drawable-mdpi/ic_settings_language.png
deleted file mode 100644
index 604a710..0000000
--- a/res/drawable-mdpi/ic_settings_language.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_language_alpha.png b/res/drawable-mdpi/ic_settings_language_alpha.png
new file mode 100644
index 0000000..9149bb1
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_language_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_location.png b/res/drawable-mdpi/ic_settings_location.png
deleted file mode 100644
index de70e6f..0000000
--- a/res/drawable-mdpi/ic_settings_location.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_location_alpha.png b/res/drawable-mdpi/ic_settings_location_alpha.png
new file mode 100644
index 0000000..0b42099
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_location_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_more.png b/res/drawable-mdpi/ic_settings_more.png
deleted file mode 100644
index bad02c8..0000000
--- a/res/drawable-mdpi/ic_settings_more.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_more_alpha.png b/res/drawable-mdpi/ic_settings_more_alpha.png
new file mode 100644
index 0000000..809bf53
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_more_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_multiuser.png b/res/drawable-mdpi/ic_settings_multiuser.png
deleted file mode 100644
index d6f8501..0000000
--- a/res/drawable-mdpi/ic_settings_multiuser.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_multiuser_alpha.png b/res/drawable-mdpi/ic_settings_multiuser_alpha.png
new file mode 100644
index 0000000..4a90287
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_multiuser_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_nfc_payment_am.png b/res/drawable-mdpi/ic_settings_nfc_payment_am.png
deleted file mode 100644
index 1cf5e86..0000000
--- a/res/drawable-mdpi/ic_settings_nfc_payment_am.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_nfc_payment_am_alpha.png b/res/drawable-mdpi/ic_settings_nfc_payment_am_alpha.png
new file mode 100644
index 0000000..1a66a30
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_nfc_payment_am_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_notifications.png b/res/drawable-mdpi/ic_settings_notifications.png
deleted file mode 100644
index 407ec8c..0000000
--- a/res/drawable-mdpi/ic_settings_notifications.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_notifications_alpha.png b/res/drawable-mdpi/ic_settings_notifications_alpha.png
new file mode 100644
index 0000000..8e255ae
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_notifications_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_print.png b/res/drawable-mdpi/ic_settings_print.png
deleted file mode 100644
index 76234a6..0000000
--- a/res/drawable-mdpi/ic_settings_print.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_print_alpha.png b/res/drawable-mdpi/ic_settings_print_alpha.png
new file mode 100644
index 0000000..e65113d
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_print_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_security.png b/res/drawable-mdpi/ic_settings_security.png
deleted file mode 100644
index cd65dd2..0000000
--- a/res/drawable-mdpi/ic_settings_security.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_security_alpha.png b/res/drawable-mdpi/ic_settings_security_alpha.png
new file mode 100644
index 0000000..b1a7cd0
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_security_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_sound.png b/res/drawable-mdpi/ic_settings_sound.png
deleted file mode 100644
index 17b2cc4..0000000
--- a/res/drawable-mdpi/ic_settings_sound.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_sound_alpha.png b/res/drawable-mdpi/ic_settings_sound_alpha.png
new file mode 100644
index 0000000..4a292ee
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_sound_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_storage.png b/res/drawable-mdpi/ic_settings_storage.png
deleted file mode 100644
index ff6af99..0000000
--- a/res/drawable-mdpi/ic_settings_storage.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_storage_alpha.png b/res/drawable-mdpi/ic_settings_storage_alpha.png
new file mode 100644
index 0000000..ddbde7c
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_storage_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_sync.png b/res/drawable-mdpi/ic_settings_sync.png
deleted file mode 100644
index fbd03ba..0000000
--- a/res/drawable-mdpi/ic_settings_sync.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_sync_alpha.png b/res/drawable-mdpi/ic_settings_sync_alpha.png
new file mode 100644
index 0000000..850e594
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_sync_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_wifi.png b/res/drawable-mdpi/ic_settings_wifi.png
deleted file mode 100644
index e8f3129..0000000
--- a/res/drawable-mdpi/ic_settings_wifi.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_wifi_alpha.png b/res/drawable-mdpi/ic_settings_wifi_alpha.png
new file mode 100644
index 0000000..31be004
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_wifi_alpha.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_wireless.png b/res/drawable-mdpi/ic_settings_wireless.png
deleted file mode 100644
index 6b81932f..0000000
--- a/res/drawable-mdpi/ic_settings_wireless.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_settings_wireless_alpha.png b/res/drawable-mdpi/ic_settings_wireless_alpha.png
new file mode 100644
index 0000000..7bb2dfb
--- /dev/null
+++ b/res/drawable-mdpi/ic_settings_wireless_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_about.png b/res/drawable-xhdpi/ic_settings_about.png
deleted file mode 100644
index 188b362..0000000
--- a/res/drawable-xhdpi/ic_settings_about.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_about_alpha.png b/res/drawable-xhdpi/ic_settings_about_alpha.png
new file mode 100644
index 0000000..c64616f
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_about_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_accessibility.png b/res/drawable-xhdpi/ic_settings_accessibility.png
deleted file mode 100644
index 297a08b..0000000
--- a/res/drawable-xhdpi/ic_settings_accessibility.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_accessibility_alpha.png b/res/drawable-xhdpi/ic_settings_accessibility_alpha.png
new file mode 100644
index 0000000..d7f5c4d
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_accessibility_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_accounts.png b/res/drawable-xhdpi/ic_settings_accounts.png
deleted file mode 100644
index 8538036..0000000
--- a/res/drawable-xhdpi/ic_settings_accounts.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_accounts_alpha.png b/res/drawable-xhdpi/ic_settings_accounts_alpha.png
new file mode 100644
index 0000000..6937eb1
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_accounts_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_applications.png b/res/drawable-xhdpi/ic_settings_applications.png
deleted file mode 100644
index f8122ba..0000000
--- a/res/drawable-xhdpi/ic_settings_applications.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_applications_alpha.png b/res/drawable-xhdpi/ic_settings_applications_alpha.png
new file mode 100644
index 0000000..1d022e6
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_applications_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_backup.png b/res/drawable-xhdpi/ic_settings_backup.png
deleted file mode 100644
index 73d718b..0000000
--- a/res/drawable-xhdpi/ic_settings_backup.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_backup_alpha.png b/res/drawable-xhdpi/ic_settings_backup_alpha.png
new file mode 100644
index 0000000..93e7399
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_backup_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_battery.png b/res/drawable-xhdpi/ic_settings_battery.png
deleted file mode 100644
index 6825b71..0000000
--- a/res/drawable-xhdpi/ic_settings_battery.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_battery_alpha.png b/res/drawable-xhdpi/ic_settings_battery_alpha.png
new file mode 100644
index 0000000..16d290d
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_battery_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_bluetooth.png b/res/drawable-xhdpi/ic_settings_bluetooth.png
deleted file mode 100644
index a75b550..0000000
--- a/res/drawable-xhdpi/ic_settings_bluetooth.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_bluetooth2.png b/res/drawable-xhdpi/ic_settings_bluetooth2.png
deleted file mode 100644
index 3767382..0000000
--- a/res/drawable-xhdpi/ic_settings_bluetooth2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_bluetooth2_alpha.png b/res/drawable-xhdpi/ic_settings_bluetooth2_alpha.png
new file mode 100644
index 0000000..a3e09db
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_bluetooth2_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_bluetooth_alpha.png b/res/drawable-xhdpi/ic_settings_bluetooth_alpha.png
new file mode 100644
index 0000000..cee4e67
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_bluetooth_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_data_usage.png b/res/drawable-xhdpi/ic_settings_data_usage.png
deleted file mode 100644
index 57cf2b1..0000000
--- a/res/drawable-xhdpi/ic_settings_data_usage.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_data_usage_alpha.png b/res/drawable-xhdpi/ic_settings_data_usage_alpha.png
new file mode 100644
index 0000000..8ef9d09
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_data_usage_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_date_time.png b/res/drawable-xhdpi/ic_settings_date_time.png
deleted file mode 100644
index 8a40de8..0000000
--- a/res/drawable-xhdpi/ic_settings_date_time.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_date_time_alpha.png b/res/drawable-xhdpi/ic_settings_date_time_alpha.png
new file mode 100644
index 0000000..ad45114
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_date_time_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_development.png b/res/drawable-xhdpi/ic_settings_development.png
deleted file mode 100644
index 22050369..0000000
--- a/res/drawable-xhdpi/ic_settings_development.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_development_alpha.png b/res/drawable-xhdpi/ic_settings_development_alpha.png
new file mode 100644
index 0000000..3a4b3d9
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_development_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_display_am.png b/res/drawable-xhdpi/ic_settings_display_am.png
deleted file mode 100644
index be367f3..0000000
--- a/res/drawable-xhdpi/ic_settings_display_am.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_display_am_alpha.png b/res/drawable-xhdpi/ic_settings_display_am_alpha.png
new file mode 100644
index 0000000..05e82fb
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_display_am_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_dock.png b/res/drawable-xhdpi/ic_settings_dock.png
deleted file mode 100644
index e7eb120..0000000
--- a/res/drawable-xhdpi/ic_settings_dock.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_dock_alpha.png b/res/drawable-xhdpi/ic_settings_dock_alpha.png
new file mode 100644
index 0000000..eb01a66
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_dock_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_home.png b/res/drawable-xhdpi/ic_settings_home.png
deleted file mode 100644
index 3cb118d..0000000
--- a/res/drawable-xhdpi/ic_settings_home.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_home_alpha.png b/res/drawable-xhdpi/ic_settings_home_alpha.png
new file mode 100644
index 0000000..7098fbf
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_home_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_language.png b/res/drawable-xhdpi/ic_settings_language.png
deleted file mode 100644
index 4e44c01..0000000
--- a/res/drawable-xhdpi/ic_settings_language.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_language_alpha.png b/res/drawable-xhdpi/ic_settings_language_alpha.png
new file mode 100644
index 0000000..9b922e3
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_language_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_location.png b/res/drawable-xhdpi/ic_settings_location.png
deleted file mode 100644
index cd2e7b5..0000000
--- a/res/drawable-xhdpi/ic_settings_location.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_location_alpha.png b/res/drawable-xhdpi/ic_settings_location_alpha.png
new file mode 100644
index 0000000..fca5cf2
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_location_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_more.png b/res/drawable-xhdpi/ic_settings_more.png
deleted file mode 100644
index 8b9fe07..0000000
--- a/res/drawable-xhdpi/ic_settings_more.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_more_alpha.png b/res/drawable-xhdpi/ic_settings_more_alpha.png
new file mode 100644
index 0000000..0747c87
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_more_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_multiuser.png b/res/drawable-xhdpi/ic_settings_multiuser.png
deleted file mode 100644
index e1b3932..0000000
--- a/res/drawable-xhdpi/ic_settings_multiuser.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_multiuser_alpha.png b/res/drawable-xhdpi/ic_settings_multiuser_alpha.png
new file mode 100644
index 0000000..b51072e
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_multiuser_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_nfc_payment_am.png b/res/drawable-xhdpi/ic_settings_nfc_payment_am.png
deleted file mode 100644
index 4cf007d..0000000
--- a/res/drawable-xhdpi/ic_settings_nfc_payment_am.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_nfc_payment_am_alpha.png b/res/drawable-xhdpi/ic_settings_nfc_payment_am_alpha.png
new file mode 100644
index 0000000..9aa2fd2
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_nfc_payment_am_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_notifications.png b/res/drawable-xhdpi/ic_settings_notifications.png
deleted file mode 100644
index a67930e..0000000
--- a/res/drawable-xhdpi/ic_settings_notifications.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_notifications_alpha.png b/res/drawable-xhdpi/ic_settings_notifications_alpha.png
new file mode 100644
index 0000000..a5fd6ae
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_notifications_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_print.png b/res/drawable-xhdpi/ic_settings_print.png
deleted file mode 100644
index 9ea3b85..0000000
--- a/res/drawable-xhdpi/ic_settings_print.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_print_alpha.png b/res/drawable-xhdpi/ic_settings_print_alpha.png
new file mode 100644
index 0000000..9afa8d2
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_print_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_security.png b/res/drawable-xhdpi/ic_settings_security.png
deleted file mode 100644
index 5ead24e..0000000
--- a/res/drawable-xhdpi/ic_settings_security.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_security_alpha.png b/res/drawable-xhdpi/ic_settings_security_alpha.png
new file mode 100644
index 0000000..cc79239
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_security_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_sound.png b/res/drawable-xhdpi/ic_settings_sound.png
deleted file mode 100644
index 644e593..0000000
--- a/res/drawable-xhdpi/ic_settings_sound.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_sound_alpha.png b/res/drawable-xhdpi/ic_settings_sound_alpha.png
new file mode 100644
index 0000000..603bc71
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_sound_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_storage.png b/res/drawable-xhdpi/ic_settings_storage.png
deleted file mode 100644
index 51ded7e..0000000
--- a/res/drawable-xhdpi/ic_settings_storage.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_storage_alpha.png b/res/drawable-xhdpi/ic_settings_storage_alpha.png
new file mode 100644
index 0000000..556abdf
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_storage_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_sync.png b/res/drawable-xhdpi/ic_settings_sync.png
deleted file mode 100644
index 50f3bf8..0000000
--- a/res/drawable-xhdpi/ic_settings_sync.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_sync_alpha.png b/res/drawable-xhdpi/ic_settings_sync_alpha.png
new file mode 100644
index 0000000..87e01fb
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_sync_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_wifi.png b/res/drawable-xhdpi/ic_settings_wifi.png
deleted file mode 100644
index 2bd4648..0000000
--- a/res/drawable-xhdpi/ic_settings_wifi.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_wifi_alpha.png b/res/drawable-xhdpi/ic_settings_wifi_alpha.png
new file mode 100644
index 0000000..cee4e67
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_wifi_alpha.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_wireless.png b/res/drawable-xhdpi/ic_settings_wireless.png
deleted file mode 100644
index ad6a98e..0000000
--- a/res/drawable-xhdpi/ic_settings_wireless.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_wireless_alpha.png b/res/drawable-xhdpi/ic_settings_wireless_alpha.png
new file mode 100644
index 0000000..cd7c175
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_wireless_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_about.png b/res/drawable-xxhdpi/ic_settings_about.png
deleted file mode 100644
index ae91bad..0000000
--- a/res/drawable-xxhdpi/ic_settings_about.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_about_alpha.png b/res/drawable-xxhdpi/ic_settings_about_alpha.png
new file mode 100644
index 0000000..f4cbde6
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_about_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_accessibility.png b/res/drawable-xxhdpi/ic_settings_accessibility.png
deleted file mode 100644
index 08ee9c4..0000000
--- a/res/drawable-xxhdpi/ic_settings_accessibility.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_accessibility_alpha.png b/res/drawable-xxhdpi/ic_settings_accessibility_alpha.png
new file mode 100644
index 0000000..b3dbab6
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_accessibility_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_accounts.png b/res/drawable-xxhdpi/ic_settings_accounts.png
deleted file mode 100644
index 6371c62..0000000
--- a/res/drawable-xxhdpi/ic_settings_accounts.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_accounts_alpha.png b/res/drawable-xxhdpi/ic_settings_accounts_alpha.png
new file mode 100644
index 0000000..b7ebc4b
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_accounts_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_applications.png b/res/drawable-xxhdpi/ic_settings_applications.png
deleted file mode 100644
index db8c9c4..0000000
--- a/res/drawable-xxhdpi/ic_settings_applications.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_applications_alpha.png b/res/drawable-xxhdpi/ic_settings_applications_alpha.png
new file mode 100644
index 0000000..cb1caf9
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_applications_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_backup.png b/res/drawable-xxhdpi/ic_settings_backup.png
deleted file mode 100644
index d7add84..0000000
--- a/res/drawable-xxhdpi/ic_settings_backup.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_backup_alpha.png b/res/drawable-xxhdpi/ic_settings_backup_alpha.png
new file mode 100644
index 0000000..762095d
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_backup_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_battery.png b/res/drawable-xxhdpi/ic_settings_battery.png
deleted file mode 100644
index 1648ee4..0000000
--- a/res/drawable-xxhdpi/ic_settings_battery.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_battery_alpha.png b/res/drawable-xxhdpi/ic_settings_battery_alpha.png
new file mode 100644
index 0000000..733a787
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_battery_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_bluetooth2.png b/res/drawable-xxhdpi/ic_settings_bluetooth2.png
deleted file mode 100644
index ad5e802..0000000
--- a/res/drawable-xxhdpi/ic_settings_bluetooth2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_bluetooth2_alpha.png b/res/drawable-xxhdpi/ic_settings_bluetooth2_alpha.png
new file mode 100644
index 0000000..2cc0577
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_bluetooth2_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_data_usage.png b/res/drawable-xxhdpi/ic_settings_data_usage.png
deleted file mode 100644
index 4460509..0000000
--- a/res/drawable-xxhdpi/ic_settings_data_usage.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_data_usage_alpha.png b/res/drawable-xxhdpi/ic_settings_data_usage_alpha.png
new file mode 100644
index 0000000..6586a5c
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_data_usage_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_date_time.png b/res/drawable-xxhdpi/ic_settings_date_time.png
deleted file mode 100644
index dd13084..0000000
--- a/res/drawable-xxhdpi/ic_settings_date_time.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_date_time_alpha.png b/res/drawable-xxhdpi/ic_settings_date_time_alpha.png
new file mode 100644
index 0000000..875e1dd
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_date_time_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_development.png b/res/drawable-xxhdpi/ic_settings_development.png
deleted file mode 100644
index 35555d4..0000000
--- a/res/drawable-xxhdpi/ic_settings_development.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_development_alpha.png b/res/drawable-xxhdpi/ic_settings_development_alpha.png
new file mode 100644
index 0000000..fc23084
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_development_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_display_am.png b/res/drawable-xxhdpi/ic_settings_display_am.png
deleted file mode 100644
index a16ee17..0000000
--- a/res/drawable-xxhdpi/ic_settings_display_am.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_display_am_alpha.png b/res/drawable-xxhdpi/ic_settings_display_am_alpha.png
new file mode 100644
index 0000000..9dd90a1
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_display_am_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_dock.png b/res/drawable-xxhdpi/ic_settings_dock.png
deleted file mode 100644
index 24f2351..0000000
--- a/res/drawable-xxhdpi/ic_settings_dock.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_dock_alpha.png b/res/drawable-xxhdpi/ic_settings_dock_alpha.png
new file mode 100644
index 0000000..f8550be
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_dock_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_home.png b/res/drawable-xxhdpi/ic_settings_home.png
deleted file mode 100644
index 5a7e813..0000000
--- a/res/drawable-xxhdpi/ic_settings_home.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_home_alpha.png b/res/drawable-xxhdpi/ic_settings_home_alpha.png
new file mode 100644
index 0000000..653c08c
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_home_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_language.png b/res/drawable-xxhdpi/ic_settings_language.png
deleted file mode 100644
index 3d6559d..0000000
--- a/res/drawable-xxhdpi/ic_settings_language.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_language_alpha.png b/res/drawable-xxhdpi/ic_settings_language_alpha.png
new file mode 100644
index 0000000..9db2b5d
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_language_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_location.png b/res/drawable-xxhdpi/ic_settings_location.png
deleted file mode 100644
index 3fe4b9d..0000000
--- a/res/drawable-xxhdpi/ic_settings_location.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_location_alpha.png b/res/drawable-xxhdpi/ic_settings_location_alpha.png
new file mode 100644
index 0000000..b7c2776
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_location_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_more.png b/res/drawable-xxhdpi/ic_settings_more.png
deleted file mode 100644
index 0e0ba13..0000000
--- a/res/drawable-xxhdpi/ic_settings_more.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_more_alpha.png b/res/drawable-xxhdpi/ic_settings_more_alpha.png
new file mode 100644
index 0000000..7b44cac
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_more_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_multiuser.png b/res/drawable-xxhdpi/ic_settings_multiuser.png
deleted file mode 100644
index b5155d7..0000000
--- a/res/drawable-xxhdpi/ic_settings_multiuser.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_multiuser_alpha.png b/res/drawable-xxhdpi/ic_settings_multiuser_alpha.png
new file mode 100644
index 0000000..25ba926
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_multiuser_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_nfc_payment_am.png b/res/drawable-xxhdpi/ic_settings_nfc_payment_am.png
deleted file mode 100644
index 0b9e41e..0000000
--- a/res/drawable-xxhdpi/ic_settings_nfc_payment_am.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_nfc_payment_am_alpha.png b/res/drawable-xxhdpi/ic_settings_nfc_payment_am_alpha.png
new file mode 100644
index 0000000..6e09248
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_nfc_payment_am_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_notifications.png b/res/drawable-xxhdpi/ic_settings_notifications.png
deleted file mode 100644
index 3f0e063..0000000
--- a/res/drawable-xxhdpi/ic_settings_notifications.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_notifications_alpha.png b/res/drawable-xxhdpi/ic_settings_notifications_alpha.png
new file mode 100644
index 0000000..946c31a
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_notifications_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_print.png b/res/drawable-xxhdpi/ic_settings_print.png
deleted file mode 100644
index a0058dc..0000000
--- a/res/drawable-xxhdpi/ic_settings_print.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_print_alpha.png b/res/drawable-xxhdpi/ic_settings_print_alpha.png
new file mode 100644
index 0000000..4fe082e
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_print_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_security.png b/res/drawable-xxhdpi/ic_settings_security.png
deleted file mode 100644
index 0c317aa..0000000
--- a/res/drawable-xxhdpi/ic_settings_security.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_security_alpha.png b/res/drawable-xxhdpi/ic_settings_security_alpha.png
new file mode 100644
index 0000000..c815e43
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_security_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_sound.png b/res/drawable-xxhdpi/ic_settings_sound.png
deleted file mode 100644
index 5283caf..0000000
--- a/res/drawable-xxhdpi/ic_settings_sound.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_sound_alpha.png b/res/drawable-xxhdpi/ic_settings_sound_alpha.png
new file mode 100644
index 0000000..4461c1f
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_sound_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_storage.png b/res/drawable-xxhdpi/ic_settings_storage.png
deleted file mode 100644
index 45c42a7..0000000
--- a/res/drawable-xxhdpi/ic_settings_storage.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_storage_alpha.png b/res/drawable-xxhdpi/ic_settings_storage_alpha.png
new file mode 100644
index 0000000..ec53b8a
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_storage_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_sync.png b/res/drawable-xxhdpi/ic_settings_sync.png
deleted file mode 100644
index 2a09495..0000000
--- a/res/drawable-xxhdpi/ic_settings_sync.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_sync_alpha.png b/res/drawable-xxhdpi/ic_settings_sync_alpha.png
new file mode 100644
index 0000000..3a36ef3
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_sync_alpha.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_wireless.png b/res/drawable-xxhdpi/ic_settings_wireless.png
deleted file mode 100644
index 3058e98..0000000
--- a/res/drawable-xxhdpi/ic_settings_wireless.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_wireless_alpha.png b/res/drawable-xxhdpi/ic_settings_wireless_alpha.png
new file mode 100644
index 0000000..3640551
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_wireless_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_about.png b/res/drawable-xxxhdpi/ic_settings_about.png
deleted file mode 100644
index b39842f..0000000
--- a/res/drawable-xxxhdpi/ic_settings_about.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_about_alpha.png b/res/drawable-xxxhdpi/ic_settings_about_alpha.png
new file mode 100644
index 0000000..746900d
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_about_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_accessibility.png b/res/drawable-xxxhdpi/ic_settings_accessibility.png
deleted file mode 100644
index d289f02..0000000
--- a/res/drawable-xxxhdpi/ic_settings_accessibility.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_accessibility_alpha.png b/res/drawable-xxxhdpi/ic_settings_accessibility_alpha.png
new file mode 100644
index 0000000..1da61c9
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_accessibility_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_accounts.png b/res/drawable-xxxhdpi/ic_settings_accounts.png
deleted file mode 100644
index d1c389b..0000000
--- a/res/drawable-xxxhdpi/ic_settings_accounts.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_accounts_alpha.png b/res/drawable-xxxhdpi/ic_settings_accounts_alpha.png
new file mode 100644
index 0000000..c479acc
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_accounts_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_applications.png b/res/drawable-xxxhdpi/ic_settings_applications.png
deleted file mode 100644
index 07f5785..0000000
--- a/res/drawable-xxxhdpi/ic_settings_applications.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_applications_alpha.png b/res/drawable-xxxhdpi/ic_settings_applications_alpha.png
new file mode 100644
index 0000000..133f363
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_applications_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_backup.png b/res/drawable-xxxhdpi/ic_settings_backup.png
deleted file mode 100644
index 2a3f313..0000000
--- a/res/drawable-xxxhdpi/ic_settings_backup.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_backup_alpha.png b/res/drawable-xxxhdpi/ic_settings_backup_alpha.png
new file mode 100644
index 0000000..01efd94
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_backup_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_battery.png b/res/drawable-xxxhdpi/ic_settings_battery.png
deleted file mode 100644
index d45c6ef..0000000
--- a/res/drawable-xxxhdpi/ic_settings_battery.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_battery_alpha.png b/res/drawable-xxxhdpi/ic_settings_battery_alpha.png
new file mode 100644
index 0000000..6a060c7
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_battery_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_bluetooth2.png b/res/drawable-xxxhdpi/ic_settings_bluetooth2.png
deleted file mode 100644
index d354eb6..0000000
--- a/res/drawable-xxxhdpi/ic_settings_bluetooth2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_bluetooth2_alpha.png b/res/drawable-xxxhdpi/ic_settings_bluetooth2_alpha.png
new file mode 100644
index 0000000..284c94e
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_bluetooth2_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_data_usage.png b/res/drawable-xxxhdpi/ic_settings_data_usage.png
deleted file mode 100644
index 54d464b..0000000
--- a/res/drawable-xxxhdpi/ic_settings_data_usage.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_data_usage_alpha.png b/res/drawable-xxxhdpi/ic_settings_data_usage_alpha.png
new file mode 100644
index 0000000..55941d4
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_data_usage_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_date_time.png b/res/drawable-xxxhdpi/ic_settings_date_time.png
deleted file mode 100644
index 736bb3f..0000000
--- a/res/drawable-xxxhdpi/ic_settings_date_time.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_date_time_alpha.png b/res/drawable-xxxhdpi/ic_settings_date_time_alpha.png
new file mode 100644
index 0000000..4a5d491
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_date_time_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_development.png b/res/drawable-xxxhdpi/ic_settings_development.png
deleted file mode 100644
index eaf1f2c..0000000
--- a/res/drawable-xxxhdpi/ic_settings_development.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_development_alpha.png b/res/drawable-xxxhdpi/ic_settings_development_alpha.png
new file mode 100644
index 0000000..47f4547
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_development_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_display_am.png b/res/drawable-xxxhdpi/ic_settings_display_am.png
deleted file mode 100644
index 4f6933d..0000000
--- a/res/drawable-xxxhdpi/ic_settings_display_am.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_display_am_alpha.png b/res/drawable-xxxhdpi/ic_settings_display_am_alpha.png
new file mode 100644
index 0000000..ba90acc
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_display_am_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_dock.png b/res/drawable-xxxhdpi/ic_settings_dock.png
deleted file mode 100644
index 56aac4b..0000000
--- a/res/drawable-xxxhdpi/ic_settings_dock.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_dock_alpha.png b/res/drawable-xxxhdpi/ic_settings_dock_alpha.png
new file mode 100644
index 0000000..d5e4855
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_dock_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_home.png b/res/drawable-xxxhdpi/ic_settings_home.png
deleted file mode 100644
index 5d37a94..0000000
--- a/res/drawable-xxxhdpi/ic_settings_home.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_home_alpha.png b/res/drawable-xxxhdpi/ic_settings_home_alpha.png
new file mode 100644
index 0000000..2242f5e
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_home_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_language.png b/res/drawable-xxxhdpi/ic_settings_language.png
deleted file mode 100644
index c9447bd..0000000
--- a/res/drawable-xxxhdpi/ic_settings_language.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_language_alpha.png b/res/drawable-xxxhdpi/ic_settings_language_alpha.png
new file mode 100644
index 0000000..b5135c8
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_language_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_location.png b/res/drawable-xxxhdpi/ic_settings_location.png
deleted file mode 100644
index 67f5bad..0000000
--- a/res/drawable-xxxhdpi/ic_settings_location.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_location_alpha.png b/res/drawable-xxxhdpi/ic_settings_location_alpha.png
new file mode 100644
index 0000000..5ff19aa
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_location_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_more.png b/res/drawable-xxxhdpi/ic_settings_more.png
deleted file mode 100644
index b2083ba..0000000
--- a/res/drawable-xxxhdpi/ic_settings_more.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_more_alpha.png b/res/drawable-xxxhdpi/ic_settings_more_alpha.png
new file mode 100644
index 0000000..36384be
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_more_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_multiuser.png b/res/drawable-xxxhdpi/ic_settings_multiuser.png
deleted file mode 100644
index aad5c64..0000000
--- a/res/drawable-xxxhdpi/ic_settings_multiuser.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_multiuser_alpha.png b/res/drawable-xxxhdpi/ic_settings_multiuser_alpha.png
new file mode 100644
index 0000000..51fb328
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_multiuser_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_nfc_payment_am.png b/res/drawable-xxxhdpi/ic_settings_nfc_payment_am.png
deleted file mode 100644
index 01e1e0b..0000000
--- a/res/drawable-xxxhdpi/ic_settings_nfc_payment_am.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_nfc_payment_am_alpha.png b/res/drawable-xxxhdpi/ic_settings_nfc_payment_am_alpha.png
new file mode 100644
index 0000000..6c29a53
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_nfc_payment_am_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_notifications.png b/res/drawable-xxxhdpi/ic_settings_notifications.png
deleted file mode 100644
index 1619240..0000000
--- a/res/drawable-xxxhdpi/ic_settings_notifications.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_notifications_alpha.png b/res/drawable-xxxhdpi/ic_settings_notifications_alpha.png
new file mode 100644
index 0000000..bd3bebe
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_notifications_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_print.png b/res/drawable-xxxhdpi/ic_settings_print.png
deleted file mode 100644
index f0ffb52..0000000
--- a/res/drawable-xxxhdpi/ic_settings_print.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_print_alpha.png b/res/drawable-xxxhdpi/ic_settings_print_alpha.png
new file mode 100644
index 0000000..8634ca1
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_print_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_security.png b/res/drawable-xxxhdpi/ic_settings_security.png
deleted file mode 100644
index 9a3959b..0000000
--- a/res/drawable-xxxhdpi/ic_settings_security.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_security_alpha.png b/res/drawable-xxxhdpi/ic_settings_security_alpha.png
new file mode 100644
index 0000000..6abec60
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_security_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_sound.png b/res/drawable-xxxhdpi/ic_settings_sound.png
deleted file mode 100644
index 15352de..0000000
--- a/res/drawable-xxxhdpi/ic_settings_sound.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_sound_alpha.png b/res/drawable-xxxhdpi/ic_settings_sound_alpha.png
new file mode 100644
index 0000000..3292db8
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_sound_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_storage.png b/res/drawable-xxxhdpi/ic_settings_storage.png
deleted file mode 100644
index be02ffb..0000000
--- a/res/drawable-xxxhdpi/ic_settings_storage.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_storage_alpha.png b/res/drawable-xxxhdpi/ic_settings_storage_alpha.png
new file mode 100644
index 0000000..48581a6
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_storage_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_sync.png b/res/drawable-xxxhdpi/ic_settings_sync.png
deleted file mode 100644
index 7a741a7..0000000
--- a/res/drawable-xxxhdpi/ic_settings_sync.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_sync_alpha.png b/res/drawable-xxxhdpi/ic_settings_sync_alpha.png
new file mode 100644
index 0000000..450647a
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_sync_alpha.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_wireless.png b/res/drawable-xxxhdpi/ic_settings_wireless.png
deleted file mode 100644
index bcc4233..0000000
--- a/res/drawable-xxxhdpi/ic_settings_wireless.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_settings_wireless_alpha.png b/res/drawable-xxxhdpi/ic_settings_wireless_alpha.png
new file mode 100644
index 0000000..a5d14b3
--- /dev/null
+++ b/res/drawable-xxxhdpi/ic_settings_wireless_alpha.png
Binary files differ
diff --git a/res/drawable/ic_fingerprint.xml b/res/drawable/ic_fingerprint.xml
new file mode 100644
index 0000000..2f27753
--- /dev/null
+++ b/res/drawable/ic_fingerprint.xml
@@ -0,0 +1,36 @@
+<!--
+ ~ Copyright (C) 2015 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="32dp"
+ android:height="32dp"
+ android:viewportWidth="32.0"
+ android:viewportHeight="32.0">
+ <path
+ android:fillColor="#ffffff"
+ android:pathData="M23.7,5.9c-0.1,0.0 -0.2,0.0 -0.3,-0.1C21.0,4.5 18.6,3.9 16.0,3.9c-2.5,0.0 -4.6,0.6 -6.9,1.9C8.8,6.0 8.3,5.9 8.1,5.5C7.9,5.2 8.0,4.7 8.4,4.5c2.5,-1.4 4.9,-2.1 7.7,-2.1c2.8,0.0 5.4,0.7 8.0,2.1c0.4,0.2 0.5,0.6 0.3,1.0C24.2,5.7 24.0,5.9 23.7,5.9z"/>
+ <path
+ android:fillColor="#ffffff"
+ android:pathData="M5.3,13.2c-0.1,0.0 -0.3,0.0 -0.4,-0.1c-0.3,-0.2 -0.4,-0.7 -0.2,-1.0c1.3,-1.9 2.9,-3.4 4.9,-4.5c4.1,-2.2 9.3,-2.2 13.4,0.0c1.9,1.1 3.6,2.5 4.9,4.4c0.2,0.3 0.1,0.8 -0.2,1.0c-0.3,0.2 -0.8,0.1 -1.0,-0.2c-1.2,-1.7 -2.6,-3.0 -4.3,-4.0c-3.7,-2.0 -8.3,-2.0 -12.0,0.0c-1.7,0.9 -3.2,2.3 -4.3,4.0C5.7,13.1 5.5,13.2 5.3,13.2z"/>
+ <path
+ android:fillColor="#ffffff"
+ android:pathData="M13.3,29.6c-0.2,0.0 -0.4,-0.1 -0.5,-0.2c-1.1,-1.2 -1.7,-2.0 -2.6,-3.6c-0.9,-1.7 -1.4,-3.7 -1.4,-5.9c0.0,-4.1 3.3,-7.4 7.4,-7.4c4.1,0.0 7.4,3.3 7.4,7.4c0.0,0.4 -0.3,0.7 -0.7,0.7s-0.7,-0.3 -0.7,-0.7c0.0,-3.3 -2.7,-5.9 -5.9,-5.9c-3.3,0.0 -5.9,2.7 -5.9,5.9c0.0,2.0 0.4,3.8 1.2,5.2c0.8,1.6 1.4,2.2 2.4,3.3c0.3,0.3 0.3,0.8 0.0,1.0C13.7,29.5 13.5,29.6 13.3,29.6z"/>
+ <path
+ android:fillColor="#ffffff"
+ android:pathData="M22.6,27.1c-1.6,0.0 -2.9,-0.4 -4.1,-1.2c-1.9,-1.4 -3.1,-3.6 -3.1,-6.0c0.0,-0.4 0.3,-0.7 0.7,-0.7s0.7,0.3 0.7,0.7c0.0,1.9 0.9,3.7 2.5,4.8c0.9,0.6 1.9,1.0 3.2,1.0c0.3,0.0 0.8,0.0 1.3,-0.1c0.4,-0.1 0.8,0.2 0.8,0.6c0.1,0.4 -0.2,0.8 -0.6,0.8C23.4,27.1 22.8,27.1 22.6,27.1z"/>
+ <path
+ android:fillColor="#ffffff"
+ android:pathData="M20.0,29.9c-0.1,0.0 -0.1,0.0 -0.2,0.0c-2.1,-0.6 -3.4,-1.4 -4.8,-2.9c-1.8,-1.9 -2.8,-4.4 -2.8,-7.1c0.0,-2.2 1.8,-4.1 4.1,-4.1c2.2,0.0 4.1,1.8 4.1,4.1c0.0,1.4 1.2,2.6 2.6,2.6c1.4,0.0 2.6,-1.2 2.6,-2.6c0.0,-5.1 -4.2,-9.3 -9.3,-9.3c-3.6,0.0 -6.9,2.1 -8.4,5.4C7.3,17.1 7.0,18.4 7.0,19.8c0.0,1.1 0.1,2.7 0.9,4.9c0.1,0.4 -0.1,0.8 -0.4,0.9c-0.4,0.1 -0.8,-0.1 -0.9,-0.4c-0.6,-1.8 -0.9,-3.6 -0.9,-5.4c0.0,-1.6 0.3,-3.1 0.9,-4.4c1.7,-3.8 5.6,-6.3 9.8,-6.3c5.9,0.0 10.7,4.8 10.7,10.7c0.0,2.2 -1.8,4.1 -4.1,4.1s-4.0,-1.8 -4.0,-4.1c0.0,-1.4 -1.2,-2.6 -2.6,-2.6c-1.4,0.0 -2.6,1.2 -2.6,2.6c0.0,2.3 0.9,4.5 2.4,6.1c1.2,1.3 2.4,2.0 4.2,2.5c0.4,0.1 0.6,0.5 0.5,0.9C20.6,29.7 20.3,29.9 20.0,29.9z"/>
+</vector>
diff --git a/res/drawable/ic_fingerprint_error.xml b/res/drawable/ic_fingerprint_error.xml
new file mode 100644
index 0000000..d00280d
--- /dev/null
+++ b/res/drawable/ic_fingerprint_error.xml
@@ -0,0 +1,30 @@
+<!--
+ ~ Copyright (C) 2015 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="32dp"
+ android:height="32dp"
+ android:viewportWidth="32.0"
+ android:viewportHeight="32.0">
+ <path
+ android:fillColor="@color/warning"
+ android:pathData="M15.99,2.5C8.53,2.5 2.5,8.54 2.5,16.0s6.03,13.5 13.49,13.5S29.5,23.46 29.5,16.0S23.45,2.5 15.99,2.5zM16.0,26.8c-5.97,0.0 -10.8,-4.83 -10.8,-10.8S10.03,5.2 16.0,5.2S26.8,10.03 26.8,16.0S21.97,26.8 16.0,26.8z"/>
+ <path
+ android:fillColor="@color/warning"
+ android:pathData="M14.65,20.05l2.7,0.0l0.0,2.7l-2.7,0.0z"/>
+ <path
+ android:fillColor="@color/warning"
+ android:pathData="M14.65,9.25l2.7,0.0l0.0,8.1l-2.7,0.0z"/>
+</vector>
diff --git a/res/drawable/ic_settings_about.xml b/res/drawable/ic_settings_about.xml
new file mode 100644
index 0000000..8266b90
--- /dev/null
+++ b/res/drawable/ic_settings_about.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_about_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_accessibility.xml b/res/drawable/ic_settings_accessibility.xml
new file mode 100644
index 0000000..63a8f77
--- /dev/null
+++ b/res/drawable/ic_settings_accessibility.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_accessibility_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_accounts.xml b/res/drawable/ic_settings_accounts.xml
new file mode 100644
index 0000000..bdd569d
--- /dev/null
+++ b/res/drawable/ic_settings_accounts.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_accounts_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_applications.xml b/res/drawable/ic_settings_applications.xml
new file mode 100644
index 0000000..e56fe7e
--- /dev/null
+++ b/res/drawable/ic_settings_applications.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_applications_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_backup.xml b/res/drawable/ic_settings_backup.xml
new file mode 100644
index 0000000..23f8081
--- /dev/null
+++ b/res/drawable/ic_settings_backup.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_backup_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_battery.xml b/res/drawable/ic_settings_battery.xml
new file mode 100644
index 0000000..a983b69
--- /dev/null
+++ b/res/drawable/ic_settings_battery.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_battery_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_bluetooth.xml b/res/drawable/ic_settings_bluetooth.xml
new file mode 100644
index 0000000..a76cd2c
--- /dev/null
+++ b/res/drawable/ic_settings_bluetooth.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_bluetooth_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_bluetooth2.xml b/res/drawable/ic_settings_bluetooth2.xml
new file mode 100644
index 0000000..df0f866
--- /dev/null
+++ b/res/drawable/ic_settings_bluetooth2.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_bluetooth2_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_data_usage.xml b/res/drawable/ic_settings_data_usage.xml
new file mode 100644
index 0000000..16da024
--- /dev/null
+++ b/res/drawable/ic_settings_data_usage.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_data_usage_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_date_time.xml b/res/drawable/ic_settings_date_time.xml
new file mode 100644
index 0000000..c722fce
--- /dev/null
+++ b/res/drawable/ic_settings_date_time.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_date_time_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_development.xml b/res/drawable/ic_settings_development.xml
new file mode 100644
index 0000000..42d043e
--- /dev/null
+++ b/res/drawable/ic_settings_development.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_development_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_display.xml b/res/drawable/ic_settings_display.xml
index 29cc3e4..ad846ce 100644
--- a/res/drawable/ic_settings_display.xml
+++ b/res/drawable/ic_settings_display.xml
@@ -1,23 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-/*
- * Copyright 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.
- */
+ Copyright (C) 2015 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.
-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_settings_display_am"
- android:autoMirrored="true"
- />
+ android:src="@drawable/ic_settings_display_am_alpha"
+ android:tint="?android:attr/colorAccent"
+ android:autoMirrored="true" />
+
diff --git a/res/drawable/ic_settings_dock.xml b/res/drawable/ic_settings_dock.xml
new file mode 100644
index 0000000..c6d6571
--- /dev/null
+++ b/res/drawable/ic_settings_dock.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_dock_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_home.xml b/res/drawable/ic_settings_home.xml
new file mode 100644
index 0000000..86e108f
--- /dev/null
+++ b/res/drawable/ic_settings_home.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_home_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_language.xml b/res/drawable/ic_settings_language.xml
new file mode 100644
index 0000000..0130baa
--- /dev/null
+++ b/res/drawable/ic_settings_language.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_language_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_location.xml b/res/drawable/ic_settings_location.xml
new file mode 100644
index 0000000..da64367
--- /dev/null
+++ b/res/drawable/ic_settings_location.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_location_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_more.xml b/res/drawable/ic_settings_more.xml
new file mode 100644
index 0000000..7df6e1d
--- /dev/null
+++ b/res/drawable/ic_settings_more.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_more_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_multiuser.xml b/res/drawable/ic_settings_multiuser.xml
new file mode 100644
index 0000000..b793360
--- /dev/null
+++ b/res/drawable/ic_settings_multiuser.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_multiuser_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_nfc_payment.xml b/res/drawable/ic_settings_nfc_payment.xml
index 10672a9..897cd8b 100644
--- a/res/drawable/ic_settings_nfc_payment.xml
+++ b/res/drawable/ic_settings_nfc_payment.xml
@@ -1,23 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-/*
- * Copyright 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.
- */
+ Copyright (C) 2015 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.
-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_settings_nfc_payment_am"
- android:autoMirrored="true"
- />
+ android:src="@drawable/ic_settings_nfc_payment_am_alpha"
+ android:tint="?android:attr/colorAccent"
+ android:autoMirrored="true" />
+
diff --git a/res/drawable/ic_settings_notifications.xml b/res/drawable/ic_settings_notifications.xml
new file mode 100644
index 0000000..da5aa38
--- /dev/null
+++ b/res/drawable/ic_settings_notifications.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_notifications_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_print.xml b/res/drawable/ic_settings_print.xml
new file mode 100644
index 0000000..4f30edf
--- /dev/null
+++ b/res/drawable/ic_settings_print.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_print_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_security.xml b/res/drawable/ic_settings_security.xml
new file mode 100644
index 0000000..fd23658
--- /dev/null
+++ b/res/drawable/ic_settings_security.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_security_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_sound.xml b/res/drawable/ic_settings_sound.xml
new file mode 100644
index 0000000..b84c224
--- /dev/null
+++ b/res/drawable/ic_settings_sound.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_sound_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_storage.xml b/res/drawable/ic_settings_storage.xml
new file mode 100644
index 0000000..b6714a9
--- /dev/null
+++ b/res/drawable/ic_settings_storage.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_storage_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_sync.xml b/res/drawable/ic_settings_sync.xml
new file mode 100644
index 0000000..2d30dac
--- /dev/null
+++ b/res/drawable/ic_settings_sync.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_sync_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_wifi.xml b/res/drawable/ic_settings_wifi.xml
new file mode 100644
index 0000000..9b58909
--- /dev/null
+++ b/res/drawable/ic_settings_wifi.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_wifi_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/drawable/ic_settings_wireless.xml b/res/drawable/ic_settings_wireless.xml
new file mode 100644
index 0000000..f663599
--- /dev/null
+++ b/res/drawable/ic_settings_wireless.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_settings_wireless_alpha"
+ android:tint="?android:attr/colorAccent" />
+
diff --git a/res/layout-land/confirm_lock_password.xml b/res/layout-land/confirm_lock_password.xml
index 4158c88..d8da8fe 100644
--- a/res/layout-land/confirm_lock_password.xml
+++ b/res/layout-land/confirm_lock_password.xml
@@ -1,104 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 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.
-*/
+<!-- Copyright (C) 2015 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.
-->
-<!-- This is basically the same layout as choose_lock_password. -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/topLayout"
android:orientation="vertical"
- android:gravity="center_horizontal">
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
- <LinearLayout
- android:layout_width="match_parent"
+ <TextView
+ style="@android:style/TextAppearance.Material.Title"
+ android:id="@+id/headerText"
+ android:layout_marginStart="24dp"
+ android:layout_marginEnd="24dp"
+ android:layout_marginTop="12dp"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:orientation="horizontal">
- <!-- "Enter PIN(Password) to unlock" -->
- <TextView android:id="@+id/headerText"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="horizontal"
- android:layout_marginEnd="6dip"
- android:layout_marginStart="6dip"
- android:layout_marginTop="10dip"
- android:layout_marginBottom="10dip"
- android:gravity="start"
- android:ellipsize="marquee"
- android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/colorAccent"/>
+
+ <TextView
+ style="@android:style/TextAppearance.Material.Body1"
+ android:id="@+id/detailsText"
+ android:layout_marginStart="24dp"
+ android:layout_marginEnd="24dp"
+ android:layout_marginTop="8dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
/>
- <!-- Password entry field -->
- <EditText android:id="@+id/password_entry"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_marginTop="5dip"
- android:layout_marginBottom="5dip"
- android:layout_gravity="center"
- android:layout_weight="1"
- android:inputType="textPassword"
- android:imeOptions="actionNext"
- android:gravity="center"
- android:textSize="24sp"
- style="@style/TextAppearance.PasswordEntry"
- />
- </LinearLayout>
-
- <!-- Spacer between password entry and keyboard -->
<View
android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1" />
+ android:layout_height="0dp"
+ android:layout_weight="1"/>
- <!-- Alphanumeric keyboard -->
- <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
- android:layout_alignParentBottom="true"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="#00000000"
- android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
- android:visibility="gone"
- />
-
- <RelativeLayout
+ <FrameLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:background="@android:drawable/bottom_bar"
- android:visibility="gone">
+ android:orientation="horizontal">
- <Button android:id="@+id/cancel_button"
- android:layout_width="150dip"
+ <Button
+ style="@android:style/Widget.Material.Button.Borderless"
+ android:id="@+id/cancelButton"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_margin="5dip"
- android:layout_alignParentStart="true"
- android:text="@string/lockpassword_cancel_label"
- />
+ android:layout_gravity="start|bottom"
+ android:text="@string/cancel"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp"
+ android:layout_marginBottom="14dp"/>
- <Button android:id="@+id/next_button"
- android:layout_width="150dip"
+ <EditText android:id="@+id/password_entry"
+ android:layout_width="208dp"
android:layout_height="wrap_content"
- android:layout_margin="5dip"
- android:layout_alignParentEnd="true"
- android:drawableEnd="@drawable/ic_btn_next"
- android:drawablePadding="10dip"
- android:text="@string/lockpassword_continue_label"
- />
+ android:layout_gravity="center_horizontal|bottom"
+ android:layout_marginBottom="26dp"
+ android:inputType="textPassword"
+ android:imeOptions="actionNext|flagNoFullscreen"
+ android:gravity="center"
+ android:textSize="16sp"
+ style="@style/TextAppearance.PasswordEntry"/>
- </RelativeLayout>
+ <TextView style="@style/TextAppearance.ConfirmDeviceCredentialsErrorText"
+ android:id="@+id/errorText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal|bottom"
+ android:layout_marginBottom="10dp"/>
-</LinearLayout>
+ <ImageView
+ android:id="@+id/fingerprintIcon"
+ android:layout_gravity="end|bottom"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="28dp"
+ android:layout_marginEnd="20dp"
+ android:visibility="gone"/>
+ </FrameLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout-land/confirm_lock_pattern.xml b/res/layout-land/confirm_lock_pattern.xml
index b58b46f..0567fad 100644
--- a/res/layout-land/confirm_lock_pattern.xml
+++ b/res/layout-land/confirm_lock_pattern.xml
@@ -13,56 +13,102 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
- xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/topLayout"
android:orientation="horizontal"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:clipChildren="false"
+ android:clipToPadding="false">
- <!-- left side: instructions and messages -->
<LinearLayout
- android:orientation="vertical"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1.0"
- >
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1"
+ android:orientation="vertical">
- <!-- header message -->
- <TextView android:id="@+id/headerText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="16dp"
- android:gravity="center"
- android:textSize="18sp"/>
+ <TextView
+ style="@android:style/TextAppearance.Material.Headline"
+ android:id="@+id/headerText"
+ android:layout_marginStart="32dp"
+ android:layout_marginEnd="32dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="?android:attr/colorAccent"/>
- <!-- fill space between header and button below -->
- <View
- android:layout_weight="1.0"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- />
+ <TextView
+ style="@android:style/TextAppearance.Material.Body1"
+ android:id="@+id/detailsText"
+ android:layout_marginStart="32dp"
+ android:layout_marginEnd="32dp"
+ android:layout_marginTop="12dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
- <!-- footer message -->
- <TextView android:id="@+id/footerText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:textSize="14sp"/>
+ <Button
+ style="@android:style/Widget.Material.Button.Borderless"
+ android:id="@+id/cancelButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/cancel"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginTop="16dp"/>
</LinearLayout>
- <View
- android:background="@*android:drawable/code_lock_left"
- android:layout_width="2dip"
- android:layout_height="match_parent" />
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:orientation="horizontal"
+ android:clipChildren="false"
+ android:clipToPadding="false">
- <!-- right side: lock pattern -->
- <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/lock_pattern_background" />
+ <View
+ android:id="@+id/leftSpacer"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="0.4"/>
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:clipChildren="false"
+ android:clipToPadding="false">
+
+ <com.android.internal.widget.LockPatternView
+ android:id="@+id/lockPattern"
+ android:layout_width="288dp"
+ android:layout_height="288dp"
+ android:layout_marginStart="-42dp"
+ android:layout_marginEnd="-42dp"
+ android:layout_gravity="center_vertical"/>
+
+ <TextView
+ style="@style/TextAppearance.ConfirmDeviceCredentialsErrorText"
+ android:id="@+id/errorText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom|center_horizontal"
+ android:layout_marginBottom="24dp"/>
+ </FrameLayout>
+
+ <View
+ android:id="@+id/rightSpacer"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"/>
+
+ <ImageView
+ android:id="@+id/fingerprintIcon"
+ android:layout_gravity="center_vertical"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:visibility="gone"/>
+ </LinearLayout>
</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
diff --git a/res/layout-sw600dp-land/confirm_lock_password.xml b/res/layout-sw600dp-land/confirm_lock_password.xml
deleted file mode 100644
index cbaad7a..0000000
--- a/res/layout-sw600dp-land/confirm_lock_password.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 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.
-*/
--->
-
-<!-- This is the same layout as choose_lock_password. TODO: find out why merge tag fails -->
-<RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="20dip"
- android:orientation="horizontal">
-
- <!-- "Enter PIN(Password) to unlock" -->
- <TextView android:id="@+id/headerText"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="horizontal"
- android:layout_marginEnd="6dip"
- android:layout_marginStart="6dip"
- android:layout_marginTop="10dip"
- android:layout_marginBottom="10dip"
- android:gravity="start"
- android:ellipsize="marquee"
- android:textAppearance="?android:attr/textAppearanceMedium"
- />
-
- <!-- Password entry field -->
- <EditText android:id="@+id/password_entry"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_marginTop="5dip"
- android:layout_marginBottom="5dip"
- android:layout_gravity="center"
- android:layout_weight="1"
- android:inputType="textPassword"
- android:imeOptions="actionNext"
- android:gravity="center"
- android:textSize="24sp"
- style="@style/TextAppearance.PasswordEntry"
- />
- </LinearLayout>
-
- <!-- confirm / restart buttons -->
- <LinearLayout
- style="@style/SecurityPreferenceButtonContainer"
- android:layout_alignParentEnd="true"
- android:layout_alignParentBottom="true"
- android:orientation="horizontal">
-
- <!-- left / top button: skip, or re-try -->
- <Button android:id="@+id/cancel_button"
- style="@style/SecurityPreferenceButton"
- android:text="@string/lockpassword_cancel_label"/>
-
- <!-- right / bottom button: confirm or ok -->
- <Button android:id="@+id/next_button"
- style="@style/SecurityPreferenceButton"
- android:text="@string/lockpassword_continue_label"/>
-
- </LinearLayout>
- <!-- Alphanumeric keyboard -->
- <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
- android:layout_alignParentBottom="true"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="#00000000"
- android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
- android:visibility="gone"
- />
-
-</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout-sw600dp-land/confirm_lock_pattern.xml b/res/layout-sw600dp-land/confirm_lock_pattern.xml
deleted file mode 100644
index a090a6f..0000000
--- a/res/layout-sw600dp-land/confirm_lock_pattern.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?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.
--->
-<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/topLayout"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:gravity="center_horizontal">
-
- <!-- header message -->
- <ScrollView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:layout_marginTop="40dip">
-
- <TextView android:id="@+id/headerText"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:textAppearance="?android:attr/textAppearanceMedium"/>
-
- </ScrollView>
-
- <!-- footer message -->
- <TextView android:id="@+id/footerText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="16dip"
- android:textAppearance="?android:attr/textAppearanceMedium"/>
-
- <View
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="0.6"/>
-
- <!-- lock pattern widget -->
- <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
- android:layout_width="354dip"
- android:layout_height="354dip"
- android:background="@color/lock_pattern_background"
- aspect="square"/>
-
- <View
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1"/>
-
-</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
-
diff --git a/res/layout-sw600dp/confirm_lock_password.xml b/res/layout-sw600dp/confirm_lock_password.xml
index 12b6ab2..1649aaa 100644
--- a/res/layout-sw600dp/confirm_lock_password.xml
+++ b/res/layout-sw600dp/confirm_lock_password.xml
@@ -1,103 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-**
-** Copyright 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.
-*/
--->
+ ~ Copyright (C) 2015 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
+ -->
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingTop="48dp">
-<!-- This is the same layout as choose_lock_password -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical"
- android:gravity="center_horizontal">
-
- <!-- header text ('Enter Pin') -->
- <TextView android:id="@+id/headerText"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:textAppearance="?android:attr/textAppearanceMedium"/>
-
- <!-- spacer above text entry field -->
- <View
- android:id="@+id/spacerBottom"
- android:layout_width="fill_parent"
- android:layout_height="1dip"
- android:layout_marginTop="6dip"
- android:background="@android:drawable/divider_horizontal_dark"
- />
-
- <!-- Password entry field -->
- <EditText android:id="@+id/password_entry"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="15dip"
- android:layout_marginStart="30dip"
- android:layout_marginEnd="30dip"
- android:layout_gravity="center"
- android:inputType="textPassword"
- android:imeOptions="actionNext"
- android:gravity="center"
- android:textSize="32sp"
- style="@style/TextAppearance.PasswordEntry"
- />
-
- <!-- Spacer between password entry and keyboard -->
- <View
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1" />
-
- <!-- Alphanumeric keyboard -->
- <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
- android:layout_alignParentBottom="true"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="#00000000"
- android:layout_marginBottom="30dip"
- android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
- android:visibility="gone"
- />
-
- <View
- android:layout_width="match_parent"
- android:layout_height="0dip"
- />
-
- <RelativeLayout
- android:layout_height="wrap_content"
- android:layout_width="match_parent">
-
- <LinearLayout
- style="@style/SecurityPreferenceButtonContainer"
- android:layout_alignParentEnd="true"
- android:orientation="horizontal">
-
- <Button android:id="@+id/cancel_button"
- style="@style/SecurityPreferenceButton"
- android:text="@string/lockpassword_cancel_label"/>
-
- <Button android:id="@+id/next_button"
- style="@style/SecurityPreferenceButton"
- android:text="@string/lockpassword_continue_label"/>
-
- </LinearLayout>
-
- </RelativeLayout>
-
-</LinearLayout>
-
+ <include layout="@layout/confirm_lock_password_base"
+ android:layout_width="328dp"
+ android:layout_height="match_parent"
+ android:layout_gravity="center_horizontal"/>
+</FrameLayout>
diff --git a/res/layout-sw600dp/confirm_lock_pattern.xml b/res/layout-sw600dp/confirm_lock_pattern.xml
index 12e2b86..5c93ccd 100644
--- a/res/layout-sw600dp/confirm_lock_pattern.xml
+++ b/res/layout-sw600dp/confirm_lock_pattern.xml
@@ -13,48 +13,19 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/topLayout"
- android:orientation="vertical"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:gravity="center_horizontal">
+ android:paddingTop="48dp"
+ android:background="#80000000">
- <!-- top: instructions and buttons -->
- <!-- header message -->
- <ScrollView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:layout_marginTop="96dip">
+ <View android:layout_width="328dp"
+ android:layout_height="match_parent"
+ android:background="@color/confirm_device_credential_dark_background"
+ android:layout_gravity="center_horizontal"/>
- <TextView android:id="@+id/headerText"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:textAppearance="?android:attr/textAppearanceMedium"/>
-
- </ScrollView>
-
- <!-- footer message -->
- <TextView android:id="@+id/footerText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="16dip"
- android:textAppearance="?android:attr/textAppearanceMedium"/>
-
- <!-- bottom: lock pattern -->
- <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
- android:layout_width="354dip"
- android:layout_height="354dip"
- android:layout_marginTop="80dip"
- android:background="@color/lock_pattern_background"
- aspect="square"/>
-
- <View
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1"/>
-
-</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
+ <include layout="@layout/confirm_lock_pattern_base"
+ android:layout_width="328dp"
+ android:layout_height="match_parent"
+ android:layout_gravity="center_horizontal"/>
+</FrameLayout>
diff --git a/res/layout/confirm_lock_password.xml b/res/layout/confirm_lock_password.xml
deleted file mode 100644
index c9a0bbe..0000000
--- a/res/layout/confirm_lock_password.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 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.
-*/
--->
-
-<!-- This is the same layout as choose_lock_password -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical"
- android:gravity="center_horizontal">
-
- <!-- header text ('Enter Pin') -->
- <TextView android:id="@+id/headerText"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:textAppearance="?android:attr/textAppearanceMedium"/>
-
- <!-- Password entry field -->
- <EditText android:id="@+id/password_entry"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginStart="30dip"
- android:layout_marginEnd="30dip"
- android:layout_gravity="center"
- android:inputType="textPassword"
- android:imeOptions="actionNext"
- android:gravity="center"
- android:textSize="24sp"
- style="@style/TextAppearance.PasswordEntry"
- />
-
- <!-- Spacer between password entry and keyboard -->
- <View
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1" />
-
- <!-- Alphanumeric keyboard -->
- <com.android.internal.widget.PasswordEntryKeyboardView android:id="@+id/keyboard"
- android:layout_alignParentBottom="true"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="#00000000"
- android:keyBackground="@*android:drawable/btn_keyboard_key_fulltrans"
- android:visibility="gone"
- />
-
- <View
- android:layout_width="match_parent"
- android:layout_height="0dip"
- />
-
- <LinearLayout
- style="@style/SecurityPreferenceButtonContainer"
- android:layout_alignParentEnd="true"
- android:layout_alignParentBottom="true"
- android:orientation="horizontal">
-
- <!-- left / top button: skip, or re-try -->
- <Button android:id="@+id/cancel_button"
- style="@style/SecurityPreferenceButton"
- android:text="@string/lockpattern_tutorial_cancel_label"/>
-
- <!-- right / bottom button: confirm or ok -->
- <Button android:id="@+id/next_button"
- style="@style/SecurityPreferenceButton"
- android:text="@string/lockpattern_tutorial_continue_label"/>
-
- </LinearLayout>
-
-</LinearLayout>
-
diff --git a/res/layout/confirm_lock_password_base.xml b/res/layout/confirm_lock_password_base.xml
new file mode 100644
index 0000000..af4ffe8
--- /dev/null
+++ b/res/layout/confirm_lock_password_base.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/topLayout"
+ android:orientation="vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+
+ <TextView
+ style="@android:style/TextAppearance.Material.Headline"
+ android:id="@+id/headerText"
+ android:layout_marginStart="?attr/confirmDeviceCredentialsSideMargin"
+ android:layout_marginEnd="?attr/confirmDeviceCredentialsSideMargin"
+ android:layout_marginTop="?attr/confirmDeviceCredentialsTopMargin"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="?android:attr/colorAccent"/>
+
+ <TextView
+ style="@android:style/TextAppearance.Material.Body1"
+ android:id="@+id/detailsText"
+ android:layout_marginStart="?attr/confirmDeviceCredentialsSideMargin"
+ android:layout_marginEnd="?attr/confirmDeviceCredentialsSideMargin"
+ android:layout_marginTop="12dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
+
+ <Button
+ style="@android:style/Widget.Material.Button.Borderless"
+ android:id="@+id/cancelButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/cancel"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginTop="16dp"/>
+
+ <View android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"/>
+
+ <EditText
+ android:id="@+id/password_entry"
+ android:layout_width="208dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="-40dp"
+ android:inputType="textPassword"
+ android:imeOptions="actionNext"
+ android:gravity="center"
+ android:textSize="16sp"
+ style="@style/TextAppearance.PasswordEntry"/>
+
+ <TextView
+ style="@style/TextAppearance.ConfirmDeviceCredentialsErrorText"
+ android:id="@+id/errorText"
+ android:layout_width="wrap_content"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginStart="12dp"
+ android:layout_marginEnd="12dp"
+ android:gravity="center_vertical"/>
+
+ <ImageView
+ android:id="@+id/fingerprintIcon"
+ android:layout_gravity="center_horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_marginBottom="24dp"
+ android:visibility="gone"/>
+
+</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
\ No newline at end of file
diff --git a/res/layout/confirm_lock_pattern.xml b/res/layout/confirm_lock_pattern.xml
deleted file mode 100644
index 4426242..0000000
--- a/res/layout/confirm_lock_pattern.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?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.
--->
-<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/topLayout"
- android:orientation="vertical"
- android:layout_width="wrap_content"
- android:layout_height="match_parent">
-
- <TextView android:id="@+id/headerText"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1.0"
- android:gravity="center"
- android:textSize="18sp"/>
-
- <com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/lock_pattern_background" />
-
- <TextView android:id="@+id/footerText"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1.0"
- android:gravity="center"
- android:textSize="14sp"/>
-
-</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
diff --git a/res/layout/confirm_lock_pattern_base.xml b/res/layout/confirm_lock_pattern_base.xml
new file mode 100644
index 0000000..029b856
--- /dev/null
+++ b/res/layout/confirm_lock_pattern_base.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+<com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/topLayout"
+ android:orientation="vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+
+ <TextView
+ style="@android:style/TextAppearance.Material.Headline"
+ android:id="@+id/headerText"
+ android:layout_marginStart="?attr/confirmDeviceCredentialsSideMargin"
+ android:layout_marginEnd="?attr/confirmDeviceCredentialsSideMargin"
+ android:layout_marginTop="?attr/confirmDeviceCredentialsTopMargin"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="?android:attr/colorAccent"/>
+
+ <TextView
+ style="@android:style/TextAppearance.Material.Body1"
+ android:id="@+id/detailsText"
+ android:layout_marginStart="?attr/confirmDeviceCredentialsSideMargin"
+ android:layout_marginEnd="?attr/confirmDeviceCredentialsSideMargin"
+ android:layout_marginTop="12dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
+
+ <Button
+ style="@android:style/Widget.Material.Button.Borderless"
+ android:id="@+id/cancelButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/cancel"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginTop="16dp"/>
+
+ <View android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="0.5"/>
+
+ <com.android.internal.widget.LockPatternView
+ android:id="@+id/lockPattern"
+ android:layout_width="312dp"
+ android:layout_height="312dp"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="-46dp"
+ android:layout_marginBottom="-46dp"/>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:orientation="vertical">
+
+ <TextView
+ style="@style/TextAppearance.ConfirmDeviceCredentialsErrorText"
+ android:id="@+id/errorText"
+ android:layout_width="wrap_content"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="12dp"
+ android:layout_marginStart="12dp"
+ android:layout_marginEnd="12dp"
+ android:gravity="center_vertical"/>
+
+ <ImageView
+ android:id="@+id/fingerprintIcon"
+ android:layout_gravity="center_horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_marginBottom="24dp"
+ android:visibility="gone"/>
+ </LinearLayout>
+
+</com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient>
\ No newline at end of file
diff --git a/res/layout/loading_container.xml b/res/layout/loading_container.xml
new file mode 100644
index 0000000..eb67044
--- /dev/null
+++ b/res/layout/loading_container.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/loading_container"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="gone"
+ android:gravity="center">
+
+ <ProgressBar style="?android:attr/progressBarStyleLarge"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <TextView android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:text="@string/settings_safetylegal_activity_loading"
+ android:paddingTop="4dip"
+ android:singleLine="true" />
+
+</LinearLayout>
diff --git a/res/layout/manage_applications_apps.xml b/res/layout/manage_applications_apps.xml
index 1e0518d..044cdb4 100644
--- a/res/layout/manage_applications_apps.xml
+++ b/res/layout/manage_applications_apps.xml
@@ -52,25 +52,7 @@
</LinearLayout>
- <LinearLayout android:id="@+id/loading_container"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone"
- android:gravity="center">
-
- <ProgressBar style="?android:attr/progressBarStyleLarge"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
-
- <TextView android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:text="@string/settings_safetylegal_activity_loading"
- android:paddingTop="4dip"
- android:singleLine="true" />
-
- </LinearLayout>
+ <include layout="@layout/loading_container" />
</FrameLayout>
diff --git a/res/layout/manage_applications_running.xml b/res/layout/manage_applications_running.xml
index 485523a..6a9d4e5 100644
--- a/res/layout/manage_applications_running.xml
+++ b/res/layout/manage_applications_running.xml
@@ -29,25 +29,7 @@
android:layout_height="match_parent"
android:visibility="gone" />
- <LinearLayout android:id="@+id/loading_container"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone"
- android:gravity="center">
-
- <ProgressBar style="?android:attr/progressBarStyleLarge"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
-
- <TextView android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:text="@string/settings_safetylegal_activity_loading"
- android:paddingTop="4dip"
- android:singleLine="true" />
-
- </LinearLayout>
+ <include layout="@layout/loading_container" />
</FrameLayout>
diff --git a/res/layout/preference_list_fragment.xml b/res/layout/preference_list_fragment.xml
index b47e175..6e8ad91 100644
--- a/res/layout/preference_list_fragment.xml
+++ b/res/layout/preference_list_fragment.xml
@@ -29,20 +29,27 @@
android:layout_height="wrap_content"
android:visibility="gone" />
- <ListView android:id="@android:id/list"
- style="@style/PreferenceFragmentListSinglePane"
- android:layout_width="match_parent"
- android:layout_height="0px"
- android:layout_weight="1"
- android:paddingStart="@dimen/settings_side_margin"
- android:paddingEnd="@dimen/settings_side_margin"
- android:paddingTop="@dimen/dashboard_padding_top"
- android:paddingBottom="@dimen/dashboard_padding_bottom"
- android:scrollbarStyle="@*android:integer/preference_fragment_scrollbarStyle"
- android:clipToPadding="false"
- android:drawSelectorOnTop="false"
- android:elevation="@dimen/dashboard_category_elevation"
- android:scrollbarAlwaysDrawVerticalTrack="true" />
+ <FrameLayout android:layout_height="0px"
+ android:layout_weight="1"
+ android:layout_width="match_parent">
+
+ <ListView android:id="@android:id/list"
+ style="@style/PreferenceFragmentListSinglePane"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingStart="@dimen/settings_side_margin"
+ android:paddingEnd="@dimen/settings_side_margin"
+ android:paddingTop="@dimen/dashboard_padding_top"
+ android:paddingBottom="@dimen/dashboard_padding_bottom"
+ android:scrollbarStyle="@*android:integer/preference_fragment_scrollbarStyle"
+ android:clipToPadding="false"
+ android:drawSelectorOnTop="false"
+ android:elevation="@dimen/dashboard_category_elevation"
+ android:scrollbarAlwaysDrawVerticalTrack="true" />
+
+ <include layout="@layout/loading_container" />
+
+ </FrameLayout>
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
diff --git a/res/layout/preference_storage_action.xml b/res/layout/preference_storage_action.xml
new file mode 100644
index 0000000..10f138b
--- /dev/null
+++ b/res/layout/preference_storage_action.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
+
+ <TextView
+ android:id="@+id/unmount"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:paddingStart="16dip"
+ android:paddingEnd="16dip"
+ android:contentDescription="@string/storage_menu_unmount"
+ android:layout_gravity="center"
+ android:gravity="center"
+ android:textSize="30sp"
+ android:background="?android:attr/selectableItemBackground" />
+
+ <!--
+ <ImageView
+ android:id="@+id/eject"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:paddingStart="16dip"
+ android:paddingEnd="16dip"
+ android:src="@drawable/ic_sync_green_holo"
+ android:contentDescription="@string/storage_menu_eject"
+ android:layout_gravity="center"
+ android:background="?android:attr/selectableItemBackground" />
+ -->
+</LinearLayout>
diff --git a/res/menu/storage_volume.xml b/res/menu/storage_volume.xml
new file mode 100644
index 0000000..093a4bb
--- /dev/null
+++ b/res/menu/storage_volume.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/storage_rename"
+ android:title="@string/storage_menu_rename" />
+ <item
+ android:id="@+id/storage_mount"
+ android:title="@string/storage_menu_mount" />
+ <item
+ android:id="@+id/storage_unmount"
+ android:title="@string/storage_menu_unmount" />
+ <item
+ android:id="@+id/storage_format"
+ android:title="@string/storage_menu_format" />
+ <item
+ android:id="@+id/storage_usb"
+ android:title="@string/storage_menu_usb" />
+</menu>
diff --git a/res/values-land/themes.xml b/res/values-land/themes.xml
new file mode 100644
index 0000000..8f407c6
--- /dev/null
+++ b/res/values-land/themes.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2015 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
+ -->
+<resources>
+ <style name="Theme.ConfirmDeviceCredentials" parent="Theme.SubSettings">
+ <item name="android:windowActionBar">false</item>
+ <item name="android:windowNoTitle">true</item>
+ </style>
+</resources>
\ No newline at end of file
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index e1bb33e..a26c99b 100755
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -87,4 +87,6 @@
<dimen name="wifi_assistant_padding_start_end">24dp</dimen>
<dimen name="wifi_assistant_padding">25dp</dimen>
<dimen name="wifi_assistant_text_padding">24dp</dimen>
+
+ <dimen name="confirm_credentials_security_method_margin">72dp</dimen>
</resources>
diff --git a/res/values-sw600dp/styles.xml b/res/values-sw600dp/styles.xml
index d09b23e..8cf0e86 100644
--- a/res/values-sw600dp/styles.xml
+++ b/res/values-sw600dp/styles.xml
@@ -68,5 +68,4 @@
<style name="KeyguardAppWidgetItem">
<item name="android:textSize">16sp</item>
</style>
-
</resources>
diff --git a/res/values-sw600dp/themes.xml b/res/values-sw600dp/themes.xml
new file mode 100644
index 0000000..833e36e
--- /dev/null
+++ b/res/values-sw600dp/themes.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2015 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
+ -->
+<resources>
+ <style name="Theme.ConfirmDeviceCredentials" parent="Theme.SubSettings">
+ </style>
+</resources>
\ No newline at end of file
diff --git a/res/values/aliases.xml b/res/values/aliases.xml
index 97a50c5..248ac71 100644
--- a/res/values/aliases.xml
+++ b/res/values/aliases.xml
@@ -15,7 +15,8 @@
-->
<resources>
- <item name="notification_app_section" type="layout">@*android:layout/preference_category_material
- </item>
+ <item name="notification_app_section" type="layout">@*android:layout/preference_category_material</item>
+ <item name="confirm_lock_pattern" type="layout">@layout/confirm_lock_pattern_base</item>
+ <item name="confirm_lock_password" type="layout">@layout/confirm_lock_password_base</item>
</resources>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 4f1eb97..16f1970 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -316,6 +316,12 @@
<item>TTLS</item>
<!-- Do not translate. -->
<item>PWD</item>
+ <!-- Do not translate. -->
+ <item>SIM</item>
+ <!-- Do not translate. -->
+ <item>AKA</item>
+ <!-- Do not translate. -->
+ <item>AKA\'</item>
</string-array>
<!-- Wi-Fi WPS setup for p2p connections. -->
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 1fe36d6..248cf92 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -109,4 +109,8 @@
<attr name="switchBarMarginEnd" format="dimension" />
<attr name="preferenceBackgroundColor" format="color" />
+
+ <!-- Confirm device credentials screen -->
+ <attr name="confirmDeviceCredentialsSideMargin" format="dimension" />
+ <attr name="confirmDeviceCredentialsTopMargin" format="dimension" />
</resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 97ba2ed..2d0c741 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -53,7 +53,9 @@
<color name="lock_pattern_background">#00000000</color>
<color name="lock_pattern_view_regular_color">#ff37474f</color>
- <color name="lock_pattern_view_error_color">#fff4511e</color>
+ <color name="lock_pattern_view_error_color">@color/warning</color>
+
+ <color name="lock_pattern_view_regular_color_dark">#ffffff</color>
<color name="unlock_pattern_view_regular_color">@android:color/white</color>
<color name="unlock_pattern_view_error_color">#fff4511e</color>
@@ -76,4 +78,6 @@
<color name="wifi_divider">#ffe0e0e0</color>
<color name="sim_noitification">@*android:color/material_deep_teal_500</color>
+ <color name="warning">#ff5621</color>
+ <color name="confirm_device_credential_dark_background">#263238</color>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 1fd22e0..07e6957 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -238,4 +238,5 @@
<dimen name="fingerprint_ring_radius">96dip</dimen>
<dimen name="fingerprint_ring_thickness">4dip</dimen>
+ <dimen name="confirm_credentials_security_method_margin">48dp</dimen>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index a8a163f..ed2fbcc 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -593,6 +593,9 @@
<!-- Button label for generic forget action [CHAR LIMIT=20] -->
<string name="forget">Forget</string>
+ <!-- Button label for generic save action [CHAR LIMIT=20] -->
+ <string name="save">Save</string>
+
<!-- Title of the Settings activity shown within the application itself. -->
<string name="settings_label">Settings</string>
<!-- Title of the Settings activity shown in the Launcher. [CHAR LIMIT=20] -->
@@ -832,12 +835,6 @@
<string name="crypt_keeper_dialog_need_password_message">You need to set a lock screen PIN or
password before you can start encryption.</string>
- <!-- String at bottom of screen when prompting for pattern.
- Note: This is only for the pattern case. -->
- <string name="crypt_keeper_confirm_encrypt">
- You need to draw your unlock pattern to confirm encrypting your device.
- </string>
-
<!-- Title of the final confirmation screen before starting device encryption -->
<string name="crypt_keeper_confirm_title">Encrypt?</string>
<!-- Warning text in the final confirmation screen before starting device encryption -->
@@ -1815,12 +1812,10 @@
<string-array name="wifi_calling_mode_choices">
<item>Wi-Fi preferred</item>
<item>Cellular preferred</item>
- <item>Wi-Fi only</item>
</string-array>
<string-array name="wifi_calling_mode_values">
<item>"2"</item>
<item>"1"</item>
- <item>"0"</item>
</string-array>
<!-- Wi-Fi Calling settings. Text displayed when Wi-Fi Calling is off -->
<string name="wifi_calling_off_explanation">When Wi-Fi calling is on, your phone can route calls via Wi-Fi networks or your carrier\'s network, depending on your preference and which signal is stronger. Before turning on this feature, check with your carrier regarding fees and other details.</string>
@@ -2187,7 +2182,7 @@
<!-- SD card & phone storage settings summary. Displayed when the total memory usage is being calculated. Will be replaced with a number like "12.3 GB" when finished calucating. [CHAR LIMIT=30] -->
<string name="memory_calculating_size">Calculating\u2026</string>
<!-- SD card & phone storage settings title. Displayed as a title when showing the total usage of applications installed. Below it will be a number like "123.4 MB" indicating used storage. [CHAR LIMIT=50] -->
- <string name="memory_apps_usage">Apps (app data & media content)</string>
+ <string name="memory_apps_usage">Apps & app data</string>
<!-- SD card & phone storage settings title. Displayed as a title when showing the total usage of media on the device. Below it will be a number like "123.4 MB" indicating used storage. [CHAR LIMIT=50] -->
<string name="memory_media_usage">Media</string>
<!-- SD card & phone storage settings title. Displayed as a title when showing the total usage of /sdcard/Download on the device. Below it will be a number like "123.4 MB" indicating used storage. [CHAR LIMIT=50] -->
@@ -2197,7 +2192,7 @@
<!-- SD card & phone storage settings title. Displayed as a title when showing the total usage of audio files in /sdcard on the device. Below it will be a number like "123.4 MB" indicating used storage. [CHAR LIMIT=50] -->
<string name="memory_music_usage">Audio (music, ringtones, podcasts, etc.)</string>
<!-- SD card & phone storage settings title. Displayed as a title when showing the total usage of misc files on the device. Below it will be a number like "123.4 MB" indicating used storage. [CHAR LIMIT=50] -->
- <string name="memory_media_misc_usage">Misc.</string>
+ <string name="memory_media_misc_usage">Other files</string>
<!-- Storage item representing all cached data on device. [CHAR LIMIT=48] -->
<string name="memory_media_cache_usage">Cached data</string>
<!-- SD card & phone storage settings item title that will result in the phone unmounting the SD card. This will be done before the user phyiscally removes the SD card from the phone. Kind of like the "Safely remove" on some operating systems. [CHAR LIMIT=25] -->
@@ -2272,6 +2267,16 @@
<!-- Settings item summary when storage is running low [CHAR LIMIT=NONE] -->
<string name="storage_low_summary">Some system functions, such as syncing, may not work correctly. Try to free space by deleting or unpinning items, such as apps or media content.</string>
+ <!-- Storage setting. Menu option for renaming a storage device [CHAR LIMIT=30]-->
+ <string name="storage_menu_rename">Rename</string>
+ <!-- Storage setting. Menu option for mounting a storage device [CHAR LIMIT=30]-->
+ <string name="storage_menu_mount">Mount</string>
+ <!-- Storage setting. Menu option for unmounting a storage device [CHAR LIMIT=30]-->
+ <string name="storage_menu_unmount">Eject</string>
+ <!-- Storage setting. Menu option for erasing and formatting a storage device [CHAR LIMIT=30]-->
+ <string name="storage_menu_format">Erase & format</string>
+ <!-- Storage setting. Menu option for erasing and formatting a storage device [CHAR LIMIT=30]-->
+ <string name="storage_menu_format_internal">Erase & format as internal storage</string>
<!-- Storage setting. Menu option for USB transfer settings [CHAR LIMIT=30]-->
<string name="storage_menu_usb">USB computer connection</string>
@@ -2295,6 +2300,32 @@
<!-- Section header above list of other users storage [CHAR LIMIT=32] -->
<string name="storage_other_users">Other users</string>
+ <!-- Section header above list of internal storage devices [CHAR LIMIT=30]-->
+ <string name="storage_internal_title">Device storage</string>
+ <!-- Section header above list of external storage devices [CHAR LIMIT=30]-->
+ <string name="storage_external_title">Removable storage</string>
+
+ <!-- Summary of a single storage volume, constrasting available and total storage space. [CHAR LIMIT=48]-->
+ <string name="storage_volume_summary"><xliff:g id="free" example="1.2GB">%1$s</xliff:g> free (Total <xliff:g id="total" example="32GB">%2$s</xliff:g>)</string>
+
+ <!-- Toast informing that storage mount operation was successful. [CHAR LIMIT=64]-->
+ <string name="storage_mount_success"><xliff:g id="name" example="SD card">%1$s</xliff:g> is mounted</string>
+ <!-- Toast informing that storage unmount operation failed. [CHAR LIMIT=64]-->
+ <string name="storage_mount_failure">Couldn\'t mount <xliff:g id="name" example="SD card">%1$s</xliff:g></string>
+
+ <!-- Toast informing that storage unmount operation was successful. [CHAR LIMIT=64]-->
+ <string name="storage_unmount_success"><xliff:g id="name" example="SD card">%1$s</xliff:g> is safely ejected</string>
+ <!-- Toast informing that storage unmount operation failed. [CHAR LIMIT=64]-->
+ <string name="storage_unmount_failure">Couldn\'t safely eject <xliff:g id="name" example="SD card">%1$s</xliff:g></string>
+
+ <!-- Toast informing that storage format operation was successful. [CHAR LIMIT=64]-->
+ <string name="storage_format_success"><xliff:g id="name" example="SD card">%1$s</xliff:g> is formatted</string>
+ <!-- Toast informing that storage format operation failed. [CHAR LIMIT=64]-->
+ <string name="storage_format_failure">Couldn\'t format <xliff:g id="name" example="SD card">%1$s</xliff:g></string>
+
+ <!-- Title of dialog prompting user to rename a storage volume [CHAR LIMIT=32]-->
+ <string name="storage_rename_title">Rename storage</string>
+
<!-- Phone info screen, section titles: -->
<string name="battery_status_title">Battery status</string>
<!-- Phone info screen, section titles: -->
@@ -2386,19 +2417,17 @@
<!-- SD card & phone storage settings screen, setting option name under Backup & Restore heading -->
<string name="reset_network_title">Network settings reset</string>
<!-- SD card & phone storage settings screen, message on screen after user selects Reset network settings [CHAR LIMIT=NONE] -->
- <string name="reset_network_desc">This will reset all settings related to networking to the factory defaults, including:\n\n<li>Wifi</li>\n<li>Mobile data</li>\n<li>Bluetooth</li>"</string>
+ <string name="reset_network_desc">This will reset all network settings, including:\n\n<li>Wi\u2011Fi</li>\n<li>Cellular data</li>\n<li>Bluetooth</li>"</string>
<!-- SD card & phone storage settings screen, button on screen after user selects Reset network settings -->
<string name="reset_network_button_text">Reset settings</string>
<!-- SD card & phone storage settings screen, message on screen after user selects Reset settings button -->
- <string name="reset_network_final_desc">Reset all network settings? You can\'t reverse this action!</string>
+ <string name="reset_network_final_desc">Reset all network settings? You can\'t undo this action!</string>
<!-- SD card & phone storage settings screen, button on screen after user selects Reset settings button -->
<string name="reset_network_final_button_text">Reset settings</string>
- <!-- Explanation of drawing unlock pattern to reset settings -->
- <string name="reset_network_gesture_explanation">You need to draw your unlock pattern to confirm a network settings reset.</string>
<!-- Reset settings confirmation screen title [CHAR LIMIT=30] -->
<string name="reset_network_confirm_title">Reset?</string>
<!-- Reset settings complete toast text [CHAR LIMIT=75] -->
- <string name="reset_network_complete_toast">Network settings reset</string>
+ <string name="reset_network_complete_toast">Network settings have been reset</string>
<!-- Master Clear -->
<!-- SD card & phone storage settings screen, setting option name under Internal phone storage heading [CHAR LIMIT=30] -->
@@ -2432,11 +2461,9 @@
<!-- SD card & phone storage settings screen, button on screen after user selects Factory data reset -->
<string name="master_clear_button_text" product="default">Reset phone</string>
<!-- SD card & phone storage settings screen, message on screen after user selects Reset phone button -->
- <string name="master_clear_final_desc">Erase all your personal information and downloaded apps? You can\'t reverse this action!</string>
+ <string name="master_clear_final_desc">Erase all your personal information and downloaded apps? You can\'t undo this action!</string>
<!-- SD card & phone storage settings screen, button on screen after user selects Reset phone button -->
<string name="master_clear_final_button_text">Erase everything</string>
- <!-- Explanation of drawing unlock pattern to reset phone -->
- <string name="master_clear_gesture_explanation">You need to draw your unlock pattern to confirm a factory data reset.</string>
<!-- Master clear failed message -->
<string name="master_clear_failed">No reset was performed because the System Clear service isn\'t available.</string>
<!-- Master clear confirmation screen title [CHAR LIMIT=30] -->
@@ -2471,10 +2498,6 @@
<string name="media_format_final_desc" product="default">Erase the SD card, deleting all files stored there? You can\'t reverse this action!</string>
<!-- SD card & phone storage settings screen, button on screen after user selects Format media button -->
<string name="media_format_final_button_text">Erase everything</string>
- <!-- Explanation of drawing unlock pattern to format card [CHAR LIMIT=NONE] -->
- <string name="media_format_gesture_explanation" product="nosdcard">You need to draw your unlock pattern to confirm that you want to erase the USB storage.</string>
- <!-- Explanation of drawing unlock pattern to format card [CHAR LIMIT=NONE] -->
- <string name="media_format_gesture_explanation" product="default">You need to draw your unlock pattern to confirm that you want to erase the SD card.</string>
<!-- Main settings screen, Call settings title for item to go into the call settings -->
<string name="call_settings_title">Call settings</string>
@@ -2727,6 +2750,26 @@
<!-- Toast shown if setting pattern was successful -->
<string name="lockpassword_pattern_set_toast">Pattern has been set</string>
+ <!-- Message to be used to explain the user that he needs to enter his pattern to continue a
+ particular operation. [CHAR LIMIT=70]-->
+ <string name="lockpassword_confirm_your_pattern_generic">Use your device pattern to continue.</string>
+ <!-- Message to be used to explain the user that he needs to enter his PIN to continue a
+ particular operation. [CHAR LIMIT=70]-->
+ <string name="lockpassword_confirm_your_pin_generic">Enter your device PIN to continue.</string>
+ <!-- Message to be used to explain the user that he needs to enter his password to continue a
+ particular operation. [CHAR LIMIT=70]-->
+ <string name="lockpassword_confirm_your_password_generic">Enter your device password to continue.</string>
+
+ <!-- Security & location settings screen, change security method screen instruction if user
+ enters incorrect PIN [CHAR LIMIT=30] -->
+ <string name="lockpassword_invalid_pin">Wrong PIN</string>
+ <!-- Security & location settings screen, change security method screen instruction if user
+ enters incorrect password [CHAR LIMIT=30] -->
+ <string name="lockpassword_invalid_password">Wrong password</string>
+ <!-- Security & location settings screen, change unlock pattern screen instruction if user
+ draws incorrect pattern [CHAR LIMIT=30] -->
+ <string name="lockpattern_need_to_unlock_wrong">Wrong pattern</string>
+
<!-- Lock Pattern settings -->
<!-- Security & location settings screen, header -->
<string name="lock_settings_title">Device security</string>
@@ -2734,14 +2777,6 @@
<string name="lockpattern_change_lock_pattern_label">Change unlock pattern</string>
<!-- Security & location settings screen, change unlock pattern screen instruction when the user chooses "Change unlock pattern". We first ask the user toe nter the current pattern, and this is the message seen -->
<string name="lockpattern_change_lock_pin_label">Change unlock PIN</string>
- <!-- Security & location settings screen, change unlock pattern screen instruction when the user chooses "Change unlock pattern". We first ask the user toe nter the current pattern, and this is the message seen -->
- <string name="lockpattern_need_to_unlock">Confirm saved pattern</string>
- <!-- Do not translate. -->
- <string name="lockpattern_need_to_unlock_footer" />
- <!-- Security & location settings screen, change unlock pattern screen instruction if user draws incorrect pattern -->
- <string name="lockpattern_need_to_unlock_wrong">Try again:</string>
- <!-- Do not translate. -->
- <string name="lockpattern_need_to_unlock_wrong_footer" />
<!-- Security & location settings screen, change unlock pattern screen instruction on top of screen. This si when they are supposed to draw a new unlock pattern (for example, if they are changing their unlock patterns)..-->
<string name="lockpattern_recording_intro_header">Draw an unlock pattern</string>
<!-- Security & location settings screen, change unlock pattern screen hint on bottom of screen. We are telling them to press the menu button to see more options or help. -->
@@ -2783,10 +2818,9 @@
<string name="lockpattern_settings_change_lock_pattern">Change unlock pattern</string>
<!-- Security & location settings screen, the help instructions (an animation) caption -->
<string name="lockpattern_settings_help_how_to_record">How to draw an unlock pattern</string>
- <!-- Security & location settings screen, change unlock pattern screen instruction on top of screen after too many incorrect attempts -->
- <string name="lockpattern_too_many_failed_confirmation_attempts_header">Too many incorrect attempts!</string>
- <!-- Security & location settings screen, change unlock pattern screen countdown hint on bottom of screen after too many incorrect attempts -->
- <string name="lockpattern_too_many_failed_confirmation_attempts_footer">Try again in <xliff:g id="number">%d</xliff:g> seconds.</string>
+ <!-- Security & location settings screen, confirm unlock pattern screen hint at the bottom after
+ too many incorrect attempts [CHAR LIMIT=120]-->
+ <string name="lockpattern_too_many_failed_confirmation_attempts">Too many incorrect attempts. Try again in <xliff:g id="number">%d</xliff:g> seconds.</string>
<!-- Displayed when user launches a widget configuration activity that was uninstalled -->
<string name="activity_not_found">Application is not installed on your phone.</string>
@@ -3373,10 +3407,6 @@
<string name="oem_unlock_enable">OEM unlocking</string>
<!-- setting Checkbox summary whether to enable OEM unlock [CHAR_LIMIT=50] -->
<string name="oem_unlock_enable_summary">Allow the bootloader to be unlocked</string>
- <!-- Message to enter device PIN to enable OEM unlock -->
- <string name="oem_unlock_enable_pin_prompt">Enter your PIN</string>
- <!-- Explanation to enter device pin to enable OEM unlock -->
- <string name="oem_unlock_enable_pin_description">Enter your device PIN to enable OEM unlock</string>
<!-- Confirmation dialog title to ensure user wishes to enable OEM unlock and disable theft protection features -->
<string name="confirm_enable_oem_unlock_title">Allow OEM unlocking?</string>
<!-- Warning dialog message to confirm user wishes to enable OEM unlock and disable theft protection features -->
@@ -4351,9 +4381,6 @@
<!-- Error message for users that aren't allowed to see or modify credentials [CHAR LIMIT=none] -->
<string name="credentials_settings_not_available">Credentials are not available for this user</string>
- <!-- Explanation of drawing unlock pattern to install credentials -->
- <string name="credentials_install_gesture_explanation">You need to draw your unlock pattern to confirm credential installation.</string>
-
<!-- Title of dialog to enable credential storage [CHAR LIMIT=30] -->
<string name="credentials_unlock"></string>
<!-- Description of dialog to enable credential storage [CHAR LIMIT=NONE] -->
@@ -5651,6 +5678,7 @@
<string name="keywords_emergency_app">emergency ice app default</string>
<string name="keywords_all_apps">apps download applications system</string>
<string name="keywords_app_permissions">apps permissions security</string>
+ <string name="keywords_default_apps">apps default</string>
<!-- Search keywords for different screen unlock modes : slide to unlock, password, pattern and PIN [CHAR LIMIT=none] -->
<string name="keywords_lockscreen">slide password pattern pin</string>
@@ -5693,7 +5721,7 @@
<string name="notification_volume_option_title">Notification volume</string>
<!-- Sound & notification > Sound section: Title for the Interruptions option and associated settings page. [CHAR LIMIT=30] -->
- <string name="zen_mode_settings_title">@*android:string/zen_mode_feature_name</string>
+ <string name="zen_mode_settings_title" translatable="false">@*android:string/zen_mode_feature_name</string>
<!-- Sound & notification > Sound section: Title for the Priority interruptions option and associated settings page. [CHAR LIMIT=30] -->
<string name="zen_mode_priority_settings_title">Priority only allows</string>
@@ -6186,4 +6214,16 @@
<item quantity="other"><xliff:g id="count" example="10">%d</xliff:g> apps can open their domain URLs</item>
</plurals>
+ <!-- Fingerprint hint message when finger was not recognized.-->
+ <string name="fingerprint_not_recognized">Not recognized</string>
+
+ <!-- Title for Default Apps settings [CHAR LIMIT=30] -->
+ <string name="default_apps_title">Default Apps</string>
+
+ <!-- Title for Default Browser settings [CHAR LIMIT=30] -->
+ <string name="default_browser_title">Default Browser</string>
+
+ <!-- Summary for No Default Browser settings [CHAR LIMIT=45] -->
+ <string name="default_browser_title_none">No default Browser</string>
+
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 78a3572..22061e6 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -78,7 +78,6 @@
<style name="TextAppearance.PasswordEntry" parent="android:TextAppearance.Material">
<item name="android:gravity">center</item>
<item name="android:singleLine">true</item>
- <item name="android:textStyle">bold</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
@@ -350,6 +349,11 @@
<item name="android:textColor">@color/fingerprint_message_color</item>
</style>
+ <style name="TextAppearance.ConfirmDeviceCredentialsErrorText"
+ parent="android:TextAppearance.Material.Caption">
+ <item name="android:textColor">@color/warning</item>
+ </style>
+
<style name="TextAppearance.Small.SwitchBar">
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textStyle">normal</item>
diff --git a/res/values/themes.xml b/res/values/themes.xml
index 48c5457..379c36a 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -211,4 +211,24 @@
<item name="android:colorAccent">@color/switch_accent_color</item>
</style>
+ <style name="Theme.ConfirmDeviceCredentials" parent="Theme.SubSettings">
+ <item name="confirmDeviceCredentialsSideMargin">16dp</item>
+ <item name="confirmDeviceCredentialsTopMargin">16dp</item>
+ </style>
+
+ <style name="Theme.ConfirmDeviceCredentialsDark" parent="@android:style/Theme.Material">
+ <item name="android:colorPrimary">@*android:color/material_blue_grey_900</item>
+ <item name="android:colorPrimaryDark">@*android:color/material_blue_grey_950</item>
+ <item name="android:windowActionBar">false</item>
+ <item name="android:windowNoTitle">true</item>
+ <item name="preferenceBackgroundColor">@color/confirm_device_credential_dark_background</item>
+
+ <item name="confirmDeviceCredentialsSideMargin">32dp</item>
+ <item name="confirmDeviceCredentialsTopMargin">32dp</item>
+
+ <!-- LockPatternView colors -->
+ <item name="@*android:regularColor">@color/lock_pattern_view_regular_color_dark</item>
+ <item name="@*android:successColor">@color/lock_pattern_view_regular_color_dark</item>
+ <item name="@*android:errorColor">@color/lock_pattern_view_error_color</item>
+ </style>
</resources>
diff --git a/res/xml/advanced_apps.xml b/res/xml/advanced_apps.xml
index 682ab2d..0307a60 100644
--- a/res/xml/advanced_apps.xml
+++ b/res/xml/advanced_apps.xml
@@ -20,6 +20,12 @@
android:key="applications_settings">
<PreferenceScreen
+ android:key="default_apps"
+ android:fragment="com.android.settings.applications.ManageDefaultApps"
+ android:title="@string/default_apps_title"
+ settings:keywords="@string/keywords_default_apps" />
+
+ <PreferenceScreen
android:key="manage_perms"
android:fragment="com.android.settings.applications.ManagePermissions"
android:title="@string/app_permissions"
diff --git a/res/xml/dashboard_categories.xml b/res/xml/dashboard_categories.xml
index 0d8c1ac..78fe0e7 100644
--- a/res/xml/dashboard_categories.xml
+++ b/res/xml/dashboard_categories.xml
@@ -106,7 +106,7 @@
<dashboard-tile
android:id="@+id/storage_settings"
android:title="@string/storage_settings"
- android:fragment="com.android.settings.deviceinfo.Memory"
+ android:fragment="com.android.settings.deviceinfo.StorageSettings"
android:icon="@drawable/ic_settings_storage"
/>
diff --git a/res/xml/default_apps.xml b/res/xml/default_apps.xml
new file mode 100644
index 0000000..00c2fc0
--- /dev/null
+++ b/res/xml/default_apps.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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:key="default_apps">
+
+ <com.android.settings.applications.DefaultBrowserPreference
+ android:key="default_browser"
+ android:title="@string/default_browser_title"
+ android:summary="@string/default_browser_title_none"
+ />
+
+</PreferenceScreen>
diff --git a/res/xml/device_info_storage.xml b/res/xml/device_info_storage.xml
new file mode 100644
index 0000000..19c5982
--- /dev/null
+++ b/res/xml/device_info_storage.xml
@@ -0,0 +1,31 @@
+<?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/storage_settings"
+ settings:keywords="@string/keywords_storage">
+
+ <PreferenceCategory
+ android:key="storage_internal"
+ android:title="@string/storage_internal_title" />
+
+ <PreferenceCategory
+ android:key="storage_external"
+ android:title="@string/storage_external_title" />
+
+</PreferenceScreen>
diff --git a/res/xml/device_info_memory.xml b/res/xml/device_info_storage_volume.xml
similarity index 64%
rename from res/xml/device_info_memory.xml
rename to res/xml/device_info_storage_volume.xml
index 38cc94a..35435d7 100644
--- a/res/xml/device_info_memory.xml
+++ b/res/xml/device_info_storage_volume.xml
@@ -4,9 +4,9 @@
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.
@@ -14,11 +14,10 @@
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/storage_settings"
- settings:keywords="@string/keywords_storage">
-
-<!-- Preference categories are dynamically created based on the list of available storage volumes -->
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
+ android:title="@string/storage_settings"
+ settings:keywords="@string/keywords_storage">
</PreferenceScreen>
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java
index 479baf7..f4e3c4e 100644
--- a/src/com/android/settings/ChooseLockGeneric.java
+++ b/src/com/android/settings/ChooseLockGeneric.java
@@ -145,7 +145,8 @@
} else if (!mWaitingForConfirmation) {
ChooseLockSettingsHelper helper =
new ChooseLockSettingsHelper(this.getActivity(), this);
- if (!helper.launchConfirmationActivity(CONFIRM_EXISTING_REQUEST, null, null)) {
+ if (!helper.launchConfirmationActivity(CONFIRM_EXISTING_REQUEST,
+ getString(R.string.unlock_set_unlock_launch_picker_title))) {
mPasswordConfirmed = true; // no password set, so no need to confirm
updatePreferencesOrFinish();
} else {
diff --git a/src/com/android/settings/ChooseLockPassword.java b/src/com/android/settings/ChooseLockPassword.java
index 6d7b71d..8838286 100644
--- a/src/com/android/settings/ChooseLockPassword.java
+++ b/src/com/android/settings/ChooseLockPassword.java
@@ -243,7 +243,7 @@
updateStage(Stage.Introduction);
if (confirmCredentials) {
mChooseLockSettingsHelper.launchConfirmationActivity(CONFIRM_EXISTING_REQUEST,
- null, null);
+ getString(R.string.unlock_set_unlock_launch_picker_title));
}
} else {
mFirstPin = savedInstanceState.getString(KEY_FIRST_PIN);
diff --git a/src/com/android/settings/ChooseLockPattern.java b/src/com/android/settings/ChooseLockPattern.java
index 1865a6b..8892346 100644
--- a/src/com/android/settings/ChooseLockPattern.java
+++ b/src/com/android/settings/ChooseLockPattern.java
@@ -379,7 +379,8 @@
updateStage(Stage.NeedToConfirm);
boolean launchedConfirmationActivity =
mChooseLockSettingsHelper.launchConfirmationActivity(
- CONFIRM_EXISTING_REQUEST, null, null);
+ CONFIRM_EXISTING_REQUEST,
+ getString(R.string.unlock_set_unlock_launch_picker_title));
if (!launchedConfirmationActivity) {
updateStage(Stage.Introduction);
}
diff --git a/src/com/android/settings/ChooseLockSettingsHelper.java b/src/com/android/settings/ChooseLockSettingsHelper.java
index bba45ce..65697f6 100644
--- a/src/com/android/settings/ChooseLockSettingsHelper.java
+++ b/src/com/android/settings/ChooseLockSettingsHelper.java
@@ -16,13 +16,14 @@
package com.android.settings;
-import com.android.internal.widget.LockPatternUtils;
-
+import android.annotation.Nullable;
import android.app.Activity;
import android.app.Fragment;
import android.app.admin.DevicePolicyManager;
import android.content.Intent;
+import com.android.internal.widget.LockPatternUtils;
+
public final class ChooseLockSettingsHelper {
static final String EXTRA_KEY_TYPE = "type";
@@ -48,64 +49,77 @@
/**
* If a pattern, password or PIN exists, prompt the user before allowing them to change it.
- * @param message optional message to display about the action about to be done
- * @param details optional detail message to display
+ *
+ * @param title title of the confirmation screen; shown in the action bar
* @return true if one exists and we launched an activity to confirm it
- * @see #onActivityResult(int, int, android.content.Intent)
+ * @see Activity#onActivityResult(int, int, android.content.Intent)
*/
- boolean launchConfirmationActivity(int request, CharSequence message, CharSequence details) {
- return launchConfirmationActivity(request, message, details, false);
+ boolean launchConfirmationActivity(int request, CharSequence title) {
+ return launchConfirmationActivity(request, title, null, null, false, false);
}
/**
* If a pattern, password or PIN exists, prompt the user before allowing them to change it.
- * @param message optional message to display about the action about to be done
- * @param details optional detail message to display
+ *
+ * @param title title of the confirmation screen; shown in the action bar
* @param returnCredentials if true, put credentials into intent. Note that if this is true,
- this can only be called internally.
+ * this can only be called internally.
* @return true if one exists and we launched an activity to confirm it
- * @see #onActivityResult(int, int, android.content.Intent)
+ * @see Activity#onActivityResult(int, int, android.content.Intent)
*/
- boolean launchConfirmationActivity(int request, CharSequence message, CharSequence details,
- boolean returnCredentials) {
+ boolean launchConfirmationActivity(int request, CharSequence title, boolean returnCredentials) {
+ return launchConfirmationActivity(request, title, null, null, returnCredentials, false);
+ }
+
+ /**
+ * If a pattern, password or PIN exists, prompt the user before allowing them to change it.
+ *
+ * @param title title of the confirmation screen; shown in the action bar
+ * @param header header of the confirmation screen; shown as large text
+ * @param description description of the confirmation screen
+ * @param returnCredentials if true, put credentials into intent. Note that if this is true,
+ * this can only be called internally.
+ * @param external specifies whether this activity is launched externally, meaning that it will
+ * get a dark theme and allow fingerprint authentication
+ * @return true if one exists and we launched an activity to confirm it
+ * @see Activity#onActivityResult(int, int, android.content.Intent)
+ */
+ boolean launchConfirmationActivity(int request, @Nullable CharSequence title,
+ @Nullable CharSequence header, @Nullable CharSequence description,
+ boolean returnCredentials, boolean external) {
boolean launched = false;
switch (mLockPatternUtils.getKeyguardStoredPasswordQuality()) {
case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
- launched = confirmPattern(request, message, details, returnCredentials);
+ launched = launchConfirmationActivity(request, title, header, description,
+ returnCredentials
+ ? ConfirmLockPattern.InternalActivity.class
+ : ConfirmLockPattern.class, external);
break;
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC:
case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX:
case DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC:
case DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC:
case DevicePolicyManager.PASSWORD_QUALITY_COMPLEX:
- // TODO: update UI layout for ConfirmPassword to show message and details
- launched = confirmPassword(request, message, returnCredentials);
+ launched = launchConfirmationActivity(request, title, header, description,
+ returnCredentials
+ ? ConfirmLockPassword.InternalActivity.class
+ : ConfirmLockPassword.class, external);
break;
}
return launched;
}
- /**
- * Launch screen to confirm the existing lock pattern.
- * @param message shown in header of ConfirmLockPattern if not null
- * @param details shown in footer of ConfirmLockPattern if not null
- * @param returnCredentials if true, put credentials into intent.
- * @see #onActivityResult(int, int, android.content.Intent)
- * @return true if we launched an activity to confirm pattern
- */
- private boolean confirmPattern(int request, CharSequence message,
- CharSequence details, boolean returnCredentials) {
- if (!mLockPatternUtils.isLockPatternEnabled()) {
- return false;
- }
+ private boolean launchConfirmationActivity(int request, CharSequence title, CharSequence header,
+ CharSequence message, Class<?> activityClass, boolean external) {
final Intent intent = new Intent();
- // supply header and footer text in the intent
- intent.putExtra(ConfirmLockPattern.HEADER_TEXT, message);
- intent.putExtra(ConfirmLockPattern.FOOTER_TEXT, details);
- intent.setClassName("com.android.settings",
- returnCredentials
- ? ConfirmLockPattern.InternalActivity.class.getName()
- : ConfirmLockPattern.class.getName());
+ intent.putExtra(ConfirmDeviceCredentialBaseFragment.TITLE_TEXT, title);
+ intent.putExtra(ConfirmDeviceCredentialBaseFragment.HEADER_TEXT, header);
+ intent.putExtra(ConfirmDeviceCredentialBaseFragment.DETAILS_TEXT, message);
+ intent.putExtra(ConfirmDeviceCredentialBaseFragment.ALLOW_FP_AUTHENTICATION, external);
+ intent.putExtra(ConfirmDeviceCredentialBaseFragment.DARK_THEME, external);
+ intent.putExtra(ConfirmDeviceCredentialBaseFragment.SHOW_CANCEL_BUTTON, external);
+ intent.putExtra(ConfirmDeviceCredentialBaseFragment.SHOW_WHEN_LOCKED, external);
+ intent.setClassName(ConfirmDeviceCredentialBaseFragment.PACKAGE, activityClass.getName());
if (mFragment != null) {
mFragment.startActivityForResult(intent, request);
} else {
@@ -113,31 +127,4 @@
}
return true;
}
-
- /**
- * Launch screen to confirm the existing lock password.
- * @param message shown in header of ConfirmLockPassword if not null
- * @param returnCredentials if true, put credentials into intent.
- * @see #onActivityResult(int, int, android.content.Intent)
- * @return true if we launched an activity to confirm password
- */
- private boolean confirmPassword(int request, CharSequence message,
- boolean returnCredentials) {
- if (!mLockPatternUtils.isLockPasswordEnabled()) return false;
- final Intent intent = new Intent();
- // supply header text in the intent
- intent.putExtra(ConfirmLockPattern.HEADER_TEXT, message);
- intent.setClassName("com.android.settings",
- returnCredentials
- ? ConfirmLockPassword.InternalActivity.class.getName()
- : ConfirmLockPassword.class.getName());
- if (mFragment != null) {
- mFragment.startActivityForResult(intent, request);
- } else {
- mActivity.startActivityForResult(intent, request);
- }
- return true;
- }
-
-
}
diff --git a/src/com/android/settings/ConfirmDeviceCredentialActivity.java b/src/com/android/settings/ConfirmDeviceCredentialActivity.java
index beb2d97..9a7f843 100644
--- a/src/com/android/settings/ConfirmDeviceCredentialActivity.java
+++ b/src/com/android/settings/ConfirmDeviceCredentialActivity.java
@@ -48,7 +48,8 @@
String details = intent.getStringExtra(KeyguardManager.EXTRA_DESCRIPTION);
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(this);
- if (!helper.launchConfirmationActivity(0 /* request code */, title, details)) {
+ if (!helper.launchConfirmationActivity(0 /* request code */, null /* title */, title,
+ details, false /* returnCredentials */, true /* isExternal */)) {
Log.d(TAG, "No pattern, password or PIN set.");
setResult(Activity.RESULT_OK);
finish();
diff --git a/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java b/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
new file mode 100644
index 0000000..fe3de97
--- /dev/null
+++ b/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2015 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
+ */
+
+package com.android.settings;
+
+import android.app.KeyguardManager;
+import android.os.Bundle;
+import android.view.MenuItem;
+import android.view.WindowManager;
+
+public class ConfirmDeviceCredentialBaseActivity extends SettingsActivity {
+
+ @Override
+ protected void onCreate(Bundle savedState) {
+ if (getIntent().getBooleanExtra(ConfirmDeviceCredentialBaseFragment.DARK_THEME, false)) {
+ setTheme(R.style.Theme_ConfirmDeviceCredentialsDark);
+ }
+ super.onCreate(savedState);
+ boolean deviceLocked = getSystemService(KeyguardManager.class).isKeyguardLocked();
+ if (deviceLocked && getIntent().getBooleanExtra(
+ ConfirmDeviceCredentialBaseFragment.SHOW_WHEN_LOCKED, false)) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
+ }
+ CharSequence msg = getIntent().getStringExtra(
+ ConfirmDeviceCredentialBaseFragment.TITLE_TEXT);
+ setTitle(msg);
+ if (getActionBar() != null) {
+ getActionBar().setDisplayHomeAsUpEnabled(true);
+ getActionBar().setHomeButtonEnabled(true);
+ }
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == android.R.id.home) {
+ finish();
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+}
diff --git a/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java b/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java
new file mode 100644
index 0000000..f9908b0
--- /dev/null
+++ b/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2015 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
+ */
+
+package com.android.settings;
+
+import android.annotation.Nullable;
+import android.app.Fragment;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+/**
+ * Base fragment to be shared for PIN/Pattern/Password confirmation fragments.
+ */
+public abstract class ConfirmDeviceCredentialBaseFragment extends InstrumentedFragment
+ implements FingerprintUiHelper.Callback {
+
+ public static final String PACKAGE = "com.android.settings";
+ public static final String TITLE_TEXT = PACKAGE + ".ConfirmCredentials.title";
+ public static final String HEADER_TEXT = PACKAGE + ".ConfirmCredentials.header";
+ public static final String DETAILS_TEXT = PACKAGE + ".ConfirmCredentials.details";
+ public static final String ALLOW_FP_AUTHENTICATION =
+ PACKAGE + ".ConfirmCredentials.allowFpAuthentication";
+ public static final String DARK_THEME = PACKAGE + ".ConfirmCredentials.darkTheme";
+ public static final String SHOW_CANCEL_BUTTON =
+ PACKAGE + ".ConfirmCredentials.showCancelButton";
+ public static final String SHOW_WHEN_LOCKED =
+ PACKAGE + ".ConfirmCredentials.showWhenLocked";
+
+ private FingerprintUiHelper mFingerprintHelper;
+ private boolean mAllowFpAuthentication;
+
+ @Override
+ public void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mAllowFpAuthentication = getActivity().getIntent().getBooleanExtra(
+ ALLOW_FP_AUTHENTICATION, false);
+ }
+
+ @Override
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ mFingerprintHelper = new FingerprintUiHelper(
+ (ImageView) view.findViewById(R.id.fingerprintIcon),
+ (TextView) view.findViewById(R.id.errorText), this);
+ boolean showCancelButton = getActivity().getIntent().getBooleanExtra(
+ SHOW_CANCEL_BUTTON, false);
+ Button cancelButton = (Button) view.findViewById(R.id.cancelButton);
+ cancelButton.setVisibility(showCancelButton ? View.VISIBLE : View.GONE);
+ cancelButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ getActivity().finish();
+ }
+ });
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ if (mAllowFpAuthentication) {
+ mFingerprintHelper.startListening();
+ }
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ if (mAllowFpAuthentication) {
+ mFingerprintHelper.stopListening();
+ }
+ }
+
+ @Override
+ public void onAuthenticated() {
+ // Check whether we are still active.
+ if (getActivity() != null && getActivity().isResumed()) {
+ authenticationSucceeded(null /* password */);
+ }
+ }
+
+ protected abstract void authenticationSucceeded(@Nullable String password);
+
+ @Override
+ public void onFingerprintIconVisibilityChanged(boolean visible) {
+ }
+}
diff --git a/src/com/android/settings/ConfirmLockPassword.java b/src/com/android/settings/ConfirmLockPassword.java
index b49dc6e..44c599b 100644
--- a/src/com/android/settings/ConfirmLockPassword.java
+++ b/src/com/android/settings/ConfirmLockPassword.java
@@ -16,14 +16,11 @@
package com.android.settings;
+import android.annotation.Nullable;
import android.text.TextUtils;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.widget.LockPatternUtils;
-import com.android.internal.widget.PasswordEntryKeyboardHelper;
-import com.android.internal.widget.PasswordEntryKeyboardView;
-import android.app.Activity;
-import android.app.Fragment;
import android.app.admin.DevicePolicyManager;
import android.content.Intent;
import android.os.Bundle;
@@ -31,23 +28,18 @@
import android.os.Handler;
import android.os.SystemClock;
import android.os.storage.StorageManager;
-import android.text.Editable;
import android.text.InputType;
-import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.LayoutInflater;
+import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
-import android.widget.Button;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
-public class ConfirmLockPassword extends SettingsActivity {
-
- public static final String PACKAGE = "com.android.settings";
- public static final String HEADER_TEXT = PACKAGE + ".ConfirmLockPattern.header";
+public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
public static class InternalActivity extends ConfirmLockPassword {
}
@@ -65,28 +57,17 @@
return false;
}
- @Override
- public void onCreate(Bundle savedInstanceState) {
- // Disable IME on our window since we provide our own keyboard
- //getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
- //WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
- super.onCreate(savedInstanceState);
- CharSequence msg = getText(R.string.lockpassword_confirm_your_password_header);
- setTitle(msg);
- }
-
- public static class ConfirmLockPasswordFragment extends InstrumentedFragment
- implements OnClickListener, OnEditorActionListener, TextWatcher {
+ public static class ConfirmLockPasswordFragment extends ConfirmDeviceCredentialBaseFragment
+ implements OnClickListener, OnEditorActionListener {
private static final String KEY_NUM_WRONG_CONFIRM_ATTEMPTS
= "confirm_lock_password_fragment.key_num_wrong_confirm_attempts";
private static final long ERROR_MESSAGE_TIMEOUT = 3000;
private TextView mPasswordEntry;
private LockPatternUtils mLockPatternUtils;
- private TextView mHeaderText;
+ private TextView mHeaderTextView;
+ private TextView mDetailsTextView;
+ private TextView mErrorTextView;
private Handler mHandler = new Handler();
- private PasswordEntryKeyboardHelper mKeyboardHelper;
- private PasswordEntryKeyboardView mKeyboardView;
- private Button mContinueButton;
private int mNumWrongConfirmAttempts;
private CountDownTimer mCountdownTimer;
private boolean mIsAlpha;
@@ -111,51 +92,35 @@
Bundle savedInstanceState) {
final int storedQuality = mLockPatternUtils.getKeyguardStoredPasswordQuality();
View view = inflater.inflate(R.layout.confirm_lock_password, null);
- // Disable IME on our window since we provide our own keyboard
-
- view.findViewById(R.id.cancel_button).setOnClickListener(this);
- mContinueButton = (Button) view.findViewById(R.id.next_button);
- mContinueButton.setOnClickListener(this);
- mContinueButton.setEnabled(false); // disable until the user enters at least one char
mPasswordEntry = (TextView) view.findViewById(R.id.password_entry);
mPasswordEntry.setOnEditorActionListener(this);
- mPasswordEntry.addTextChangedListener(this);
- mKeyboardView = (PasswordEntryKeyboardView) view.findViewById(R.id.keyboard);
- mHeaderText = (TextView) view.findViewById(R.id.headerText);
+ mHeaderTextView = (TextView) view.findViewById(R.id.headerText);
+ mDetailsTextView = (TextView) view.findViewById(R.id.detailsText);
+ mErrorTextView = (TextView) view.findViewById(R.id.errorText);
mIsAlpha = DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC == storedQuality
|| DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC == storedQuality
|| DevicePolicyManager.PASSWORD_QUALITY_COMPLEX == storedQuality;
Intent intent = getActivity().getIntent();
if (intent != null) {
- CharSequence headerMessage = intent.getCharSequenceExtra(HEADER_TEXT);
+ CharSequence headerMessage = intent.getCharSequenceExtra(
+ ConfirmDeviceCredentialBaseFragment.HEADER_TEXT);
+ CharSequence detailsMessage = intent.getCharSequenceExtra(
+ ConfirmDeviceCredentialBaseFragment.DETAILS_TEXT);
if (TextUtils.isEmpty(headerMessage)) {
headerMessage = getString(getDefaultHeader());
}
- mHeaderText.setText(headerMessage);
+ if (TextUtils.isEmpty(detailsMessage)) {
+ detailsMessage = getString(getDefaultDetails());
+ }
+ mHeaderTextView.setText(headerMessage);
+ mDetailsTextView.setText(detailsMessage);
}
-
- final Activity activity = getActivity();
- mKeyboardHelper = new PasswordEntryKeyboardHelper(activity,
- mKeyboardView, mPasswordEntry);
- mKeyboardHelper.setKeyboardMode(mIsAlpha ?
- PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA
- : PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC);
- mKeyboardView.requestFocus();
-
int currentType = mPasswordEntry.getInputType();
mPasswordEntry.setInputType(mIsAlpha ? currentType
: (InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD));
-
- if (activity instanceof SettingsActivity) {
- final SettingsActivity sa = (SettingsActivity) activity;
- int id = getDefaultHeader();
- CharSequence title = getText(id);
- sa.setTitle(title);
- }
-
return view;
}
@@ -164,10 +129,19 @@
: R.string.lockpassword_confirm_your_pin_header;
}
+ private int getDefaultDetails() {
+ return mIsAlpha ? R.string.lockpassword_confirm_your_password_generic
+ : R.string.lockpassword_confirm_your_pin_generic;
+ }
+
+ private int getErrorMessage() {
+ return mIsAlpha ? R.string.lockpassword_invalid_password
+ : R.string.lockpassword_invalid_pin;
+ }
+
@Override
public void onPause() {
super.onPause();
- mKeyboardView.requestFocus();
if (mCountdownTimer != null) {
mCountdownTimer.cancel();
mCountdownTimer = null;
@@ -181,9 +155,7 @@
@Override
public void onResume() {
- // TODO Auto-generated method stub
super.onResume();
- mKeyboardView.requestFocus();
long deadline = mLockPatternUtils.getLockoutAttemptDeadline();
if (deadline != 0) {
handleAttemptLockout(deadline);
@@ -196,33 +168,35 @@
outState.putInt(KEY_NUM_WRONG_CONFIRM_ATTEMPTS, mNumWrongConfirmAttempts);
}
+ @Override
+ protected void authenticationSucceeded(@Nullable String password) {
+ Intent intent = new Intent();
+ if (getActivity() instanceof ConfirmLockPassword.InternalActivity) {
+ intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_TYPE,
+ mIsAlpha ? StorageManager.CRYPT_TYPE_PASSWORD
+ : StorageManager.CRYPT_TYPE_PIN);
+ intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD, password);
+ }
+ getActivity().setResult(RESULT_OK, intent);
+ getActivity().finish();
+ }
+
private void handleNext() {
final String pin = mPasswordEntry.getText().toString();
if (mLockPatternUtils.checkPassword(pin)) {
-
- Intent intent = new Intent();
- if (getActivity() instanceof ConfirmLockPassword.InternalActivity) {
- intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_TYPE,
- mIsAlpha ? StorageManager.CRYPT_TYPE_PASSWORD
- : StorageManager.CRYPT_TYPE_PIN);
- intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD, pin);
- }
-
- getActivity().setResult(RESULT_OK, intent);
- getActivity().finish();
+ authenticationSucceeded(pin);
} else {
if (++mNumWrongConfirmAttempts >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) {
long deadline = mLockPatternUtils.setLockoutAttemptDeadline();
handleAttemptLockout(deadline);
} else {
- showError(R.string.lockpattern_need_to_unlock_wrong);
+ showError(getErrorMessage());
}
}
}
private void handleAttemptLockout(long elapsedRealtimeDeadline) {
long elapsedRealtime = SystemClock.elapsedRealtime();
- showError(R.string.lockpattern_too_many_failed_confirmation_attempts_header, 0);
mPasswordEntry.setEnabled(false);
mCountdownTimer = new CountDownTimer(
elapsedRealtimeDeadline - elapsedRealtime,
@@ -231,15 +205,15 @@
@Override
public void onTick(long millisUntilFinished) {
final int secondsCountdown = (int) (millisUntilFinished / 1000);
- mHeaderText.setText(getString(
- R.string.lockpattern_too_many_failed_confirmation_attempts_footer,
- secondsCountdown));
+ showError(getString(
+ R.string.lockpattern_too_many_failed_confirmation_attempts,
+ secondsCountdown), 0);
}
@Override
public void onFinish() {
mPasswordEntry.setEnabled(true);
- mHeaderText.setText(getDefaultHeader());
+ mErrorTextView.setText("");
mNumWrongConfirmAttempts = 0;
}
}.start();
@@ -264,13 +238,13 @@
private final Runnable mResetErrorRunnable = new Runnable() {
public void run() {
- mHeaderText.setText(getDefaultHeader());
+ mErrorTextView.setText("");
}
};
- private void showError(int msg, long timeout) {
- mHeaderText.setText(msg);
- mHeaderText.announceForAccessibility(mHeaderText.getText());
+ private void showError(CharSequence msg, long timeout) {
+ mErrorTextView.setText(msg);
+ mErrorTextView.announceForAccessibility(mErrorTextView.getText());
mPasswordEntry.setText(null);
mHandler.removeCallbacks(mResetErrorRunnable);
if (timeout != 0) {
@@ -278,6 +252,10 @@
}
}
+ private void showError(int msg, long timeout) {
+ showError(getText(msg), timeout);
+ }
+
// {@link OnEditorActionListener} methods.
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
// Check if this was the result of hitting the enter or "done" key
@@ -289,16 +267,5 @@
}
return false;
}
-
- // {@link TextWatcher} methods.
- public void beforeTextChanged(CharSequence s, int start, int count, int after) {
- }
-
- public void onTextChanged(CharSequence s, int start, int before, int count) {
- }
-
- public void afterTextChanged(Editable s) {
- mContinueButton.setEnabled(mPasswordEntry.getText().length() > 0);
- }
}
}
diff --git a/src/com/android/settings/ConfirmLockPattern.java b/src/com/android/settings/ConfirmLockPattern.java
index b5d444b..8c4fabc 100644
--- a/src/com/android/settings/ConfirmLockPattern.java
+++ b/src/com/android/settings/ConfirmLockPattern.java
@@ -22,13 +22,14 @@
import com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient;
import com.android.internal.widget.LockPatternView.Cell;
+import android.annotation.Nullable;
import android.app.Activity;
-import android.app.Fragment;
import android.content.Intent;
import android.os.CountDownTimer;
import android.os.SystemClock;
import android.os.Bundle;
import android.os.storage.StorageManager;
+import android.view.MenuItem;
import android.widget.TextView;
import android.view.LayoutInflater;
import android.view.View;
@@ -42,23 +43,11 @@
* Sets an activity result of {@link Activity#RESULT_OK} when the user
* successfully confirmed their pattern.
*/
-public class ConfirmLockPattern extends SettingsActivity {
+public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
public static class InternalActivity extends ConfirmLockPattern {
}
- /**
- * Names of {@link CharSequence} fields within the originating {@link Intent}
- * that are used to configure the keyguard confirmation view's labeling.
- * The view will use the system-defined resource strings for any labels that
- * the caller does not supply.
- */
- public static final String PACKAGE = "com.android.settings";
- public static final String HEADER_TEXT = PACKAGE + ".ConfirmLockPattern.header";
- public static final String FOOTER_TEXT = PACKAGE + ".ConfirmLockPattern.footer";
- public static final String HEADER_WRONG_TEXT = PACKAGE + ".ConfirmLockPattern.header_wrong";
- public static final String FOOTER_WRONG_TEXT = PACKAGE + ".ConfirmLockPattern.footer_wrong";
-
private enum Stage {
NeedToUnlock,
NeedToUnlockWrong,
@@ -66,13 +55,6 @@
}
@Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- CharSequence msg = getText(R.string.lockpassword_confirm_your_pattern_header);
- setTitle(msg);
- }
-
- @Override
public Intent getIntent() {
Intent modIntent = new Intent(super.getIntent());
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, ConfirmLockPatternFragment.class.getName());
@@ -85,7 +67,7 @@
return false;
}
- public static class ConfirmLockPatternFragment extends InstrumentedFragment {
+ public static class ConfirmLockPatternFragment extends ConfirmDeviceCredentialBaseFragment {
// how long we wait to clear a wrong pattern
private static final int WRONG_PATTERN_CLEAR_TIMEOUT_MS = 2000;
@@ -98,13 +80,14 @@
private CountDownTimer mCountdownTimer;
private TextView mHeaderTextView;
- private TextView mFooterTextView;
+ private TextView mDetailsTextView;
+ private TextView mErrorTextView;
+ private View mLeftSpacerLandscape;
+ private View mRightSpacerLandscape;
// caller-supplied text for various prompts
private CharSequence mHeaderText;
- private CharSequence mFooterText;
- private CharSequence mHeaderWrongText;
- private CharSequence mFooterWrongText;
+ private CharSequence mDetailsText;
// required constructor for fragments
public ConfirmLockPatternFragment() {
@@ -123,7 +106,10 @@
View view = inflater.inflate(R.layout.confirm_lock_pattern, null);
mHeaderTextView = (TextView) view.findViewById(R.id.headerText);
mLockPatternView = (LockPatternView) view.findViewById(R.id.lockPattern);
- mFooterTextView = (TextView) view.findViewById(R.id.footerText);
+ mDetailsTextView = (TextView) view.findViewById(R.id.detailsText);
+ mErrorTextView = (TextView) view.findViewById(R.id.errorText);
+ mLeftSpacerLandscape = view.findViewById(R.id.leftSpacer);
+ mRightSpacerLandscape = view.findViewById(R.id.rightSpacer);
// make it so unhandled touch events within the unlock screen go to the
// lock pattern view.
@@ -133,10 +119,10 @@
Intent intent = getActivity().getIntent();
if (intent != null) {
- mHeaderText = intent.getCharSequenceExtra(HEADER_TEXT);
- mFooterText = intent.getCharSequenceExtra(FOOTER_TEXT);
- mHeaderWrongText = intent.getCharSequenceExtra(HEADER_WRONG_TEXT);
- mFooterWrongText = intent.getCharSequenceExtra(FOOTER_WRONG_TEXT);
+ mHeaderText = intent.getCharSequenceExtra(
+ ConfirmDeviceCredentialBaseFragment.HEADER_TEXT);
+ mDetailsText = intent.getCharSequenceExtra(
+ ConfirmDeviceCredentialBaseFragment.DETAILS_TEXT);
}
mLockPatternView.setTactileFeedbackEnabled(mLockPatternUtils.isTactileFeedbackEnabled());
@@ -199,28 +185,21 @@
if (mHeaderText != null) {
mHeaderTextView.setText(mHeaderText);
} else {
- mHeaderTextView.setText(R.string.lockpattern_need_to_unlock);
+ mHeaderTextView.setText(R.string.lockpassword_confirm_your_pattern_header);
}
- if (mFooterText != null) {
- mFooterTextView.setText(mFooterText);
+ if (mDetailsText != null) {
+ mDetailsTextView.setText(mDetailsText);
} else {
- mFooterTextView.setText(R.string.lockpattern_need_to_unlock_footer);
+ mDetailsTextView.setText(
+ R.string.lockpassword_confirm_your_pattern_generic);
}
+ mErrorTextView.setText("");
mLockPatternView.setEnabled(true);
mLockPatternView.enableInput();
break;
case NeedToUnlockWrong:
- if (mHeaderWrongText != null) {
- mHeaderTextView.setText(mHeaderWrongText);
- } else {
- mHeaderTextView.setText(R.string.lockpattern_need_to_unlock_wrong);
- }
- if (mFooterWrongText != null) {
- mFooterTextView.setText(mFooterWrongText);
- } else {
- mFooterTextView.setText(R.string.lockpattern_need_to_unlock_wrong_footer);
- }
+ mErrorTextView.setText(R.string.lockpattern_need_to_unlock_wrong);
mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Wrong);
mLockPatternView.setEnabled(true);
@@ -252,6 +231,28 @@
mLockPatternView.postDelayed(mClearPatternRunnable, WRONG_PATTERN_CLEAR_TIMEOUT_MS);
}
+ @Override
+ protected void authenticationSucceeded(@Nullable String password) {
+ Intent intent = new Intent();
+ if (getActivity() instanceof ConfirmLockPattern.InternalActivity) {
+ intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_TYPE,
+ StorageManager.CRYPT_TYPE_PATTERN);
+ intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD, password);
+ }
+ getActivity().setResult(Activity.RESULT_OK, intent);
+ getActivity().finish();
+ }
+
+ @Override
+ public void onFingerprintIconVisibilityChanged(boolean visible) {
+ if (mLeftSpacerLandscape != null && mRightSpacerLandscape != null) {
+
+ // In landscape, adjust spacing depending on fingerprint icon visibility.
+ mLeftSpacerLandscape.setVisibility(visible ? View.GONE : View.VISIBLE);
+ mRightSpacerLandscape.setVisibility(visible ? View.GONE : View.VISIBLE);
+ }
+ }
+
/**
* The pattern listener that responds according to a user confirming
* an existing lock pattern.
@@ -273,17 +274,7 @@
public void onPatternDetected(List<LockPatternView.Cell> pattern) {
if (mLockPatternUtils.checkPattern(pattern)) {
-
- Intent intent = new Intent();
- if (getActivity() instanceof ConfirmLockPattern.InternalActivity) {
- intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_TYPE,
- StorageManager.CRYPT_TYPE_PATTERN);
- intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD,
- LockPatternUtils.patternToString(pattern));
- }
-
- getActivity().setResult(Activity.RESULT_OK, intent);
- getActivity().finish();
+ authenticationSucceeded(LockPatternUtils.patternToString(pattern));
} else {
if (pattern.size() >= LockPatternUtils.MIN_PATTERN_REGISTER_FAIL &&
++mNumWrongConfirmAttempts
@@ -308,10 +299,9 @@
@Override
public void onTick(long millisUntilFinished) {
- mHeaderTextView.setText(R.string.lockpattern_too_many_failed_confirmation_attempts_header);
final int secondsCountdown = (int) (millisUntilFinished / 1000);
- mFooterTextView.setText(getString(
- R.string.lockpattern_too_many_failed_confirmation_attempts_footer,
+ mErrorTextView.setText(getString(
+ R.string.lockpattern_too_many_failed_confirmation_attempts,
secondsCountdown));
}
diff --git a/src/com/android/settings/CredentialStorage.java b/src/com/android/settings/CredentialStorage.java
index 45d3d11..8506964 100644
--- a/src/com/android/settings/CredentialStorage.java
+++ b/src/com/android/settings/CredentialStorage.java
@@ -439,9 +439,8 @@
private boolean confirmKeyGuard() {
Resources res = getResources();
boolean launched = new ChooseLockSettingsHelper(this)
- .launchConfirmationActivity(CONFIRM_KEY_GUARD_REQUEST, null,
- res.getText(R.string.credentials_install_gesture_explanation),
- true);
+ .launchConfirmationActivity(CONFIRM_KEY_GUARD_REQUEST,
+ res.getText(R.string.credentials_title), true);
return launched;
}
diff --git a/src/com/android/settings/CryptKeeperSettings.java b/src/com/android/settings/CryptKeeperSettings.java
index 3fb60e3..2e4aeb8 100644
--- a/src/com/android/settings/CryptKeeperSettings.java
+++ b/src/com/android/settings/CryptKeeperSettings.java
@@ -166,9 +166,8 @@
return true;
}
- return helper.launchConfirmationActivity(request, null,
- res.getText(R.string.crypt_keeper_confirm_encrypt),
- true);
+ return helper.launchConfirmationActivity(request,
+ res.getText(R.string.crypt_keeper_encrypt_title), true);
}
@Override
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java
index 5fafc92..5c7e0e9 100644
--- a/src/com/android/settings/DevelopmentSettings.java
+++ b/src/com/android/settings/DevelopmentSettings.java
@@ -1610,10 +1610,8 @@
}
private boolean showKeyguardConfirmation(Resources resources, int requestCode) {
- return new ChooseLockSettingsHelper(getActivity(), this)
- .launchConfirmationActivity(requestCode,
- resources.getString(R.string.oem_unlock_enable_pin_prompt),
- resources.getString(R.string.oem_unlock_enable_pin_description));
+ return new ChooseLockSettingsHelper(getActivity(), this).launchConfirmationActivity(
+ requestCode, resources.getString(R.string.oem_unlock_enable));
}
@Override
diff --git a/src/com/android/settings/FingerprintEnroll.java b/src/com/android/settings/FingerprintEnroll.java
index 96e612b..a6424e5 100644
--- a/src/com/android/settings/FingerprintEnroll.java
+++ b/src/com/android/settings/FingerprintEnroll.java
@@ -254,7 +254,7 @@
case EnrollingStart:
mEnrollmentSteps = -1;
long challenge = 0x12345; // TODO: get from keyguard confirmation
- mFingerprintManager.enroll(challenge, mEnrollmentCallback, mEnrollmentCancel,0);
+ mFingerprintManager.enroll(challenge, mEnrollmentCancel, mEnrollmentCallback, 0);
mProgressBar.setProgress(0);
mEnrolling = true;
startFingerprintAnimator(); // XXX hack - this should follow fingerprint detection
diff --git a/src/com/android/settings/FingerprintSettings.java b/src/com/android/settings/FingerprintSettings.java
index c134cfb..b4d6a4f 100644
--- a/src/com/android/settings/FingerprintSettings.java
+++ b/src/com/android/settings/FingerprintSettings.java
@@ -24,6 +24,7 @@
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
+import android.os.CancellationSignal;
import android.os.Handler;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
@@ -92,8 +93,10 @@
private FingerprintManager mFingerprintManager;
private EditText mDialogTextField;
private PreferenceGroup mManageCategory;
+ private CancellationSignal mFingerprintCancel;
+ private int mMaxFingerprintAttempts;
+
private AuthenticationCallback mAuthCallback = new AuthenticationCallback() {
- int mAttempts;
@Override
public void onAuthenticationSucceeded(AuthenticationResult result) {
mHandler.obtainMessage(MSG_HIGHLIGHT_FINGERPRINT_ITEM,
@@ -101,20 +104,16 @@
retryFingerprint(true);
}
+ public void onAuthenticationFailed() {
+ retryFingerprint(true);
+ };
+
@Override
public void onAuthenticationError(int errMsgId, CharSequence errString) {
Toast.makeText(getActivity(), errString, Toast.LENGTH_SHORT);
- retryFingerprint(false);
- }
-
- private void retryFingerprint(boolean resetAttempts) {
- if (resetAttempts) {
- mAttempts = 0;
+ if (errMsgId != FingerprintManager.FINGERPRINT_ERROR_CANCELED) {
+ retryFingerprint(false);
}
- if (mAttempts < MAX_RETRY_ATTEMPTS) {
- mFingerprintManager.authenticate(null, mAuthCallback, null, 0);
- }
- mAttempts++;
}
@Override
@@ -148,6 +147,24 @@
};
};
+ private void stopFingerprint() {
+ if (mFingerprintCancel != null) {
+ mFingerprintCancel.cancel();
+ mFingerprintCancel = null;
+ }
+ }
+
+ private void retryFingerprint(boolean resetAttempts) {
+ if (resetAttempts) {
+ mMaxFingerprintAttempts = 0;
+ }
+ if (mMaxFingerprintAttempts < MAX_RETRY_ATTEMPTS) {
+ mFingerprintCancel = new CancellationSignal();
+ mFingerprintManager.authenticate(null, mFingerprintCancel, mAuthCallback, 0);
+ }
+ mMaxFingerprintAttempts++;
+ }
+
@Override
protected int getMetricsCategory() {
return MetricsLogger.FINGERPRINT;
@@ -158,7 +175,6 @@
super.onCreate(savedInstanceState);
mFingerprintManager = (FingerprintManager) getActivity().getSystemService(
Context.FINGERPRINT_SERVICE);
- mFingerprintManager.authenticate(null, mAuthCallback, null, 0);
}
protected void removeFingerprintPreference(int fingerprintId) {
@@ -252,6 +268,13 @@
// Make sure we reload the preference hierarchy since fingerprints may be added,
// deleted or renamed.
createPreferenceHierarchy();
+ retryFingerprint(true);
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ stopFingerprint();
}
@Override
@@ -260,6 +283,7 @@
if (KEY_FINGERPRINT_ADD.equals(key)) {
Intent intent = new Intent();
intent.setClassName("com.android.settings", FingerprintEnroll.class.getName());
+ stopFingerprint();
startActivityForResult(intent, ADD_FINGERPRINT_REQUEST);
} else if (pref instanceof FingerprintPreference) {
FingerprintPreference fpref = (FingerprintPreference) pref;
diff --git a/src/com/android/settings/FingerprintUiHelper.java b/src/com/android/settings/FingerprintUiHelper.java
new file mode 100644
index 0000000..20ad7fc
--- /dev/null
+++ b/src/com/android/settings/FingerprintUiHelper.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2015 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
+ */
+
+package com.android.settings;
+
+import android.hardware.fingerprint.FingerprintManager;
+import android.os.CancellationSignal;
+import android.os.Vibrator;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+/**
+ * Small helper class to manage text/icon around fingerprint authentication UI.
+ */
+public class FingerprintUiHelper extends FingerprintManager.AuthenticationCallback {
+
+ private static final long ERROR_TIMEOUT = 1300;
+ private static final long[] FP_ERROR_VIBRATE_PATTERN = new long[] {0, 30, 100, 30};
+ private static final long[] FP_SUCCESS_VIBRATE_PATTERN = new long[] {0, 30};
+
+ private ImageView mIcon;
+ private TextView mErrorTextView;
+ private CancellationSignal mCancellationSignal;
+
+ private Callback mCallback;
+ private FingerprintManager mFingerprintManager;
+
+ public FingerprintUiHelper(ImageView icon, TextView errorTextView, Callback callback) {
+ mFingerprintManager = icon.getContext().getSystemService(FingerprintManager.class);
+ mIcon = icon;
+ mErrorTextView = errorTextView;
+ mCallback = callback;
+ }
+
+ public void startListening() {
+ if (mFingerprintManager.getEnrolledFingerprints().size() > 0) {
+ mCancellationSignal = new CancellationSignal();
+ mFingerprintManager.authenticate(null, mCancellationSignal, this, 0 /* flags */);
+ setFingerprintIconVisibility(true);
+ mIcon.setImageResource(R.drawable.ic_fingerprint);
+ }
+ }
+
+ public void stopListening() {
+ mCancellationSignal.cancel();
+ mCancellationSignal = null;
+ }
+
+ private void setFingerprintIconVisibility(boolean visible) {
+ mIcon.setVisibility(visible ? View.VISIBLE : View.GONE);
+ mCallback.onFingerprintIconVisibilityChanged(visible);
+ }
+
+ @Override
+ public void onAuthenticationError(int errMsgId, CharSequence errString) {
+ showError(errString);
+ setFingerprintIconVisibility(false);
+ }
+
+ @Override
+ public void onAuthenticationHelp(int helpMsgId, CharSequence helpString) {
+ showError(helpString);
+ }
+
+ @Override
+ public void onAuthenticationFailed() {
+ showError(mIcon.getResources().getString(
+ R.string.fingerprint_not_recognized));
+ }
+
+ @Override
+ public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
+ vibrateFingerprintSuccess();
+ mCallback.onAuthenticated();
+ }
+
+ private void showError(CharSequence error) {
+ vibrateFingerprintError();
+ mIcon.setImageResource(R.drawable.ic_fingerprint_error);
+ mErrorTextView.setText(error);
+ mErrorTextView.removeCallbacks(mResetErrorTextRunnable);
+ mErrorTextView.postDelayed(mResetErrorTextRunnable, ERROR_TIMEOUT);
+ }
+
+ private void vibrateFingerprintError() {
+ mIcon.getContext().getSystemService(Vibrator.class).vibrate(FP_ERROR_VIBRATE_PATTERN, -1);
+ }
+
+ private void vibrateFingerprintSuccess() {
+ mIcon.getContext().getSystemService(Vibrator.class).vibrate(FP_SUCCESS_VIBRATE_PATTERN, -1);
+ }
+
+ private Runnable mResetErrorTextRunnable = new Runnable() {
+ @Override
+ public void run() {
+ mErrorTextView.setText("");
+ mIcon.setImageResource(R.drawable.ic_fingerprint);
+ }
+ };
+
+ public interface Callback {
+ void onAuthenticated();
+ void onFingerprintIconVisibilityChanged(boolean visible);
+ }
+}
diff --git a/src/com/android/settings/InstrumentedFragment.java b/src/com/android/settings/InstrumentedFragment.java
index 604af18..ff6f219 100644
--- a/src/com/android/settings/InstrumentedFragment.java
+++ b/src/com/android/settings/InstrumentedFragment.java
@@ -23,9 +23,11 @@
* Instrumented fragment that logs visibility state.
*/
public abstract class InstrumentedFragment extends PreferenceFragment {
- // Declare new temproary categories here, starting after this value.
+ // Declare new temporary categories here, starting after this value.
public static final int VIEW_CATEGORY_UNDECLARED = 100000;
+ public static final int VIEW_CATEGORY_DEFAULT_APPS = VIEW_CATEGORY_UNDECLARED + 1;
+
/**
* Declare the view of this category.
*
diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java
index 1b6468f..23f6812 100644
--- a/src/com/android/settings/MasterClear.java
+++ b/src/com/android/settings/MasterClear.java
@@ -75,8 +75,8 @@
*/
private boolean runKeyguardConfirmation(int request) {
Resources res = getActivity().getResources();
- return new ChooseLockSettingsHelper(getActivity(), this).launchConfirmationActivity(request,
- null, res.getText(R.string.master_clear_gesture_explanation));
+ return new ChooseLockSettingsHelper(getActivity(), this).launchConfirmationActivity(
+ request, res.getText(R.string.master_clear_title));
}
@Override
diff --git a/src/com/android/settings/MediaFormat.java b/src/com/android/settings/MediaFormat.java
index 20dac8e..517ec2d 100644
--- a/src/com/android/settings/MediaFormat.java
+++ b/src/com/android/settings/MediaFormat.java
@@ -72,9 +72,8 @@
* component as a subactivity
*/
private boolean runKeyguardConfirmation(int request) {
- return new ChooseLockSettingsHelper(this)
- .launchConfirmationActivity(request, null,
- getText(R.string.media_format_gesture_explanation));
+ return new ChooseLockSettingsHelper(this).launchConfirmationActivity(request,
+ getText(R.string.media_format_title));
}
@Override
diff --git a/src/com/android/settings/ResetNetwork.java b/src/com/android/settings/ResetNetwork.java
index a3376d3..587b8e8 100644
--- a/src/com/android/settings/ResetNetwork.java
+++ b/src/com/android/settings/ResetNetwork.java
@@ -78,8 +78,8 @@
*/
private boolean runKeyguardConfirmation(int request) {
Resources res = getActivity().getResources();
- return new ChooseLockSettingsHelper(getActivity(), this).launchConfirmationActivity(request,
- null, res.getText(R.string.reset_network_gesture_explanation));
+ return new ChooseLockSettingsHelper(getActivity(), this).launchConfirmationActivity(
+ request, res.getText(R.string.reset_network_title));
}
@Override
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index c74c90a..fd99536 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -603,8 +603,9 @@
ChooseLockSettingsHelper helper =
new ChooseLockSettingsHelper(this.getActivity(), this);
mTrustAgentClickIntent = preference.getIntent();
- if (!helper.launchConfirmationActivity(CHANGE_TRUST_AGENT_SETTINGS, null, null) &&
- mTrustAgentClickIntent != null) {
+ boolean confirmationLaunched = helper.launchConfirmationActivity(
+ CHANGE_TRUST_AGENT_SETTINGS, preference.getTitle());
+ if (!confirmationLaunched&& mTrustAgentClickIntent != null) {
// If this returns false, it means no password confirmation is required.
startActivity(mTrustAgentClickIntent);
mTrustAgentClickIntent = null;
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index b58159e..fe0df59 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -33,6 +33,7 @@
public static class VpnSettingsActivity extends SettingsActivity { /* empty */ }
public static class DateTimeSettingsActivity extends SettingsActivity { /* empty */ }
public static class StorageSettingsActivity extends SettingsActivity { /* empty */ }
+ public static class StorageVolumeSettingsActivity extends SettingsActivity { /* empty */ }
public static class WifiSettingsActivity extends SettingsActivity { /* empty */ }
public static class WifiP2pSettingsActivity extends SettingsActivity { /* empty */ }
public static class InputMethodAndLanguageSettingsActivity extends SettingsActivity { /* empty */ }
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 24209b0..7bfd249 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -82,7 +82,8 @@
import com.android.settings.dashboard.DashboardTile;
import com.android.settings.dashboard.NoHomeDialogFragment;
import com.android.settings.dashboard.SearchResultsSummary;
-import com.android.settings.deviceinfo.Memory;
+import com.android.settings.deviceinfo.PublicVolumeSettings;
+import com.android.settings.deviceinfo.StorageSettings;
import com.android.settings.deviceinfo.UsbSettings;
import com.android.settings.fuelgauge.BatterySaverSettings;
import com.android.settings.fuelgauge.PowerUsageSummary;
@@ -305,7 +306,8 @@
CaptionPropertiesFragment.class.getName(),
com.android.settings.accessibility.ToggleDaltonizerPreferenceFragment.class.getName(),
TextToSpeechSettings.class.getName(),
- Memory.class.getName(),
+ StorageSettings.class.getName(),
+ PublicVolumeSettings.class.getName(),
DevelopmentSettings.class.getName(),
UsbSettings.class.getName(),
AndroidBeam.class.getName(),
diff --git a/src/com/android/settings/SettingsPreferenceFragment.java b/src/com/android/settings/SettingsPreferenceFragment.java
index bf41c80..130e29d 100644
--- a/src/com/android/settings/SettingsPreferenceFragment.java
+++ b/src/com/android/settings/SettingsPreferenceFragment.java
@@ -158,6 +158,11 @@
unregisterObserverIfNeeded();
}
+ public void showLoadingWhenEmpty() {
+ View loading = getView().findViewById(R.id.loading_container);
+ getListView().setEmptyView(loading);
+ }
+
public void registerObserverIfNeeded() {
if (!mIsDataSetObserverRegistered) {
if (mCurrentRootAdapter != null) {
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index 23b2c85..dc4b484 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -39,8 +39,8 @@
import android.content.pm.Signature;
import android.content.pm.UserInfo;
import android.content.res.Resources;
-import android.content.res.TypedArray;
import android.content.res.Resources.NotFoundException;
+import android.content.res.TypedArray;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -74,6 +74,9 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.animation.Animation;
+import android.view.animation.Animation.AnimationListener;
+import android.view.animation.AnimationUtils;
import android.widget.ListView;
import android.widget.TabWidget;
@@ -1158,4 +1161,39 @@
? R.string.launch_defaults_some
: R.string.launch_defaults_none);
}
+
+ public static void handleLoadingContainer(View loading, View doneLoading, boolean done,
+ boolean animate) {
+ setViewShown(loading, !done, animate);
+ setViewShown(doneLoading, done, animate);
+ }
+
+ private static void setViewShown(final View view, boolean shown, boolean animate) {
+ if (animate) {
+ Animation animation = AnimationUtils.loadAnimation(view.getContext(),
+ shown ? android.R.anim.fade_in : android.R.anim.fade_out);
+ if (shown) {
+ view.setVisibility(View.VISIBLE);
+ } else {
+ animation.setAnimationListener(new AnimationListener() {
+ @Override
+ public void onAnimationStart(Animation animation) {
+ }
+
+ @Override
+ public void onAnimationRepeat(Animation animation) {
+ }
+
+ @Override
+ public void onAnimationEnd(Animation animation) {
+ view.setVisibility(View.INVISIBLE);
+ }
+ });
+ }
+ view.startAnimation(animation);
+ } else {
+ view.clearAnimation();
+ view.setVisibility(shown ? View.VISIBLE : View.INVISIBLE);
+ }
+ }
}
diff --git a/src/com/android/settings/applications/DefaultBrowserPreference.java b/src/com/android/settings/applications/DefaultBrowserPreference.java
new file mode 100644
index 0000000..b9ea9c0
--- /dev/null
+++ b/src/com/android/settings/applications/DefaultBrowserPreference.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+package com.android.settings.applications;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.net.Uri;
+import android.os.UserHandle;
+import android.preference.ListPreference;
+import android.util.ArrayMap;
+import android.util.AttributeSet;
+
+import com.android.settings.R;
+
+import java.util.List;
+
+public class DefaultBrowserPreference extends ListPreference {
+
+ final private PackageManager mPm;
+
+ public DefaultBrowserPreference(Context context, AttributeSet attrs) {
+ super(context, attrs);
+
+ mPm = context.getPackageManager();
+ loadBrowserApps();
+ }
+
+ private void loadBrowserApps() {
+ ArrayMap<String, CharSequence> browsers = resolveBrowserApps();
+
+ setEntries(browsers.values().toArray(new CharSequence[browsers.size()]));
+ setEntryValues(browsers.keySet().toArray(new String[browsers.size()]));
+ }
+
+ private ArrayMap<String, CharSequence> resolveBrowserApps() {
+ ArrayMap<String, CharSequence> result = new ArrayMap<>();
+
+ // Create an Intent that will match ALL Browser Apps
+ Intent intent = new Intent();
+ intent.setAction(Intent.ACTION_VIEW);
+ intent.addCategory(Intent.CATEGORY_BROWSABLE);
+ intent.setData(Uri.parse("http:"));
+
+ // Resolve that intent and check that the handleAllWebDataURI boolean is set
+ PackageManager packageManager = getContext().getPackageManager();
+ List<ResolveInfo> list = packageManager.queryIntentActivitiesAsUser(intent, 0,
+ UserHandle.myUserId());
+
+ final int count = list.size();
+ for (int i=0; i<count; i++) {
+ ResolveInfo info = list.get(i);
+ if (info.activityInfo == null || result.containsKey(info.activityInfo.packageName)
+ || !info.handleAllWebDataURI) {
+ continue;
+ }
+
+ String packageName = info.activityInfo.packageName;
+ CharSequence label = info.activityInfo.applicationInfo.loadLabel(packageManager);
+
+ result.put(packageName, label);
+ }
+
+ return result;
+ }
+}
diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java
index b0b35ab..4acbedb 100644
--- a/src/com/android/settings/applications/ManageApplications.java
+++ b/src/com/android/settings/applications/ManageApplications.java
@@ -358,6 +358,7 @@
updateOptionsMenu();
if (mApplications != null) {
mApplications.resume(mSortOrder);
+ mApplications.updateLoading();
}
}
@@ -746,17 +747,20 @@
}
notifyDataSetChanged();
- if (entries == null) {
- mManageApplications.mListContainer.setVisibility(View.INVISIBLE);
- mManageApplications.mLoadingContainer.setVisibility(View.VISIBLE);
- } else {
- mManageApplications.mListContainer.setVisibility(View.VISIBLE);
- mManageApplications.mLoadingContainer.setVisibility(View.GONE);
+ if (mEntries.size() != 0
+ && mManageApplications.mListContainer.getVisibility() != View.VISIBLE) {
+ Utils.handleLoadingContainer(mManageApplications.mLoadingContainer,
+ mManageApplications.mListContainer, true, true);
}
mManageApplications.setHasDisabled(hasDisabledApps());
}
+ private void updateLoading() {
+ Utils.handleLoadingContainer(mManageApplications.mLoadingContainer,
+ mManageApplications.mListContainer, mEntries.size() != 0, false);
+ }
+
private boolean hasDisabledApps() {
ArrayList<AppEntry> allApps = mSession.getAllApps();
for (int i = 0; i < allApps.size(); i++) {
diff --git a/src/com/android/settings/applications/ManageDefaultApps.java b/src/com/android/settings/applications/ManageDefaultApps.java
new file mode 100644
index 0000000..87fc78e
--- /dev/null
+++ b/src/com/android/settings/applications/ManageDefaultApps.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+package com.android.settings.applications;
+
+import android.annotation.Nullable;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.os.Bundle;
+import android.os.UserHandle;
+import android.preference.Preference;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.View;
+import com.android.settings.InstrumentedFragment;
+import com.android.settings.SettingsPreferenceFragment;
+
+import com.android.settings.R;
+
+public class ManageDefaultApps extends SettingsPreferenceFragment
+ implements Preference.OnPreferenceClickListener {
+
+ private static final String TAG = ManageDefaultApps.class.getSimpleName();
+
+ private static final String KEY_DEFAULT_BROWSER = "default_browser";
+
+ private DefaultBrowserPreference mDefaultBrowserPreference;
+ private PackageManager mPm;
+ private int myUserId;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ addPreferencesFromResource(R.xml.default_apps);
+
+ mPm = getPackageManager();
+ myUserId = UserHandle.myUserId();
+
+ mDefaultBrowserPreference = (DefaultBrowserPreference) findPreference(KEY_DEFAULT_BROWSER);
+ mDefaultBrowserPreference.setOnPreferenceClickListener(
+ new Preference.OnPreferenceClickListener() {
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ final CharSequence packageName = mDefaultBrowserPreference.getValue();
+ if (TextUtils.isEmpty(packageName)) {
+ return false;
+ }
+ return mPm.setDefaultBrowserPackageName(packageName.toString(), myUserId);
+ }
+ });
+ }
+
+ @Override
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+
+ String packageName = getPackageManager().getDefaultBrowserPackageName(
+ UserHandle.myUserId());
+ if (!TextUtils.isEmpty(packageName)) {
+ // Check if the package is still there
+ Intent intent = new Intent();
+ intent.setPackage(packageName);
+ ResolveInfo info = mPm.resolveActivityAsUser(intent, 0, myUserId);
+ if (info != null) {
+ mDefaultBrowserPreference.setValue(packageName);
+ } else {
+ // Otherwise select the first one
+ mDefaultBrowserPreference.setValueIndex(0);
+ }
+ } else {
+ Log.d(TAG, "Cannot set empty default Browser value!");
+ }
+ }
+
+ @Override
+ protected int getMetricsCategory() {
+ return InstrumentedFragment.VIEW_CATEGORY_DEFAULT_APPS;
+ }
+
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ return false;
+ }
+}
diff --git a/src/com/android/settings/applications/ManagePermissions.java b/src/com/android/settings/applications/ManagePermissions.java
index 8fb3e62..a6d29c5 100644
--- a/src/com/android/settings/applications/ManagePermissions.java
+++ b/src/com/android/settings/applications/ManagePermissions.java
@@ -36,7 +36,6 @@
private static final String TAG = "ManagePermissions";
- private boolean mLoadComplete;
private PermissionsInfo mPermissionsInfo;
@Override
@@ -46,6 +45,13 @@
mPermissionsInfo = new PermissionsInfo(getActivity(), this);
}
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+
+ showLoadingWhenEmpty();
+ }
+
private void refreshUi() {
PreferenceScreen screen = getPreferenceScreen();
if (screen == null) {
diff --git a/src/com/android/settings/applications/RunningServices.java b/src/com/android/settings/applications/RunningServices.java
index a4cd4a7..1841f13 100644
--- a/src/com/android/settings/applications/RunningServices.java
+++ b/src/com/android/settings/applications/RunningServices.java
@@ -23,9 +23,9 @@
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
-import android.view.animation.AnimationUtils;
import com.android.settings.R;
+import com.android.settings.Utils;
public class RunningServices extends Fragment {
@@ -69,12 +69,7 @@
public void onResume() {
super.onResume();
boolean haveData = mRunningProcessesView.doResume(this, mRunningProcessesAvail);
- if (haveData) {
- mRunningProcessesView.setVisibility(View.VISIBLE);
- mLoadingContainer.setVisibility(View.INVISIBLE);
- } else {
- mLoadingContainer.setVisibility(View.VISIBLE);
- }
+ Utils.handleLoadingContainer(mLoadingContainer, mRunningProcessesView, haveData, false);
}
@Override
@@ -110,19 +105,10 @@
mOptionsMenu.findItem(SHOW_BACKGROUND_PROCESSES).setVisible(!showingBackground);
}
- private void handleRunningProcessesAvail() {
- mLoadingContainer.startAnimation(AnimationUtils.loadAnimation(getActivity(),
- android.R.anim.fade_out));
- mRunningProcessesView.startAnimation(AnimationUtils.loadAnimation(getActivity(),
- android.R.anim.fade_in));
- mRunningProcessesView.setVisibility(View.VISIBLE);
- mLoadingContainer.setVisibility(View.GONE);
- }
-
private final Runnable mRunningProcessesAvail = new Runnable() {
@Override
public void run() {
- handleRunningProcessesAvail();
+ Utils.handleLoadingContainer(mLoadingContainer, mRunningProcessesView, true, true);
}
};
diff --git a/src/com/android/settings/deviceinfo/Memory.java b/src/com/android/settings/deviceinfo/Memory.java
deleted file mode 100644
index a07f7c2..0000000
--- a/src/com/android/settings/deviceinfo/Memory.java
+++ /dev/null
@@ -1,509 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.settings.deviceinfo;
-
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.DialogFragment;
-import android.content.ActivityNotFoundException;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.IPackageDataObserver;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
-import android.hardware.usb.UsbManager;
-import android.os.Bundle;
-import android.os.Environment;
-import android.os.IBinder;
-import android.os.RemoteException;
-import android.os.ServiceManager;
-import android.os.UserManager;
-import android.os.storage.IMountService;
-import android.os.storage.StorageEventListener;
-import android.os.storage.StorageManager;
-import android.os.storage.StorageVolume;
-import android.preference.Preference;
-import android.preference.PreferenceScreen;
-import android.util.Log;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.widget.Toast;
-
-import com.android.internal.logging.MetricsLogger;
-import com.android.settings.R;
-import com.android.settings.SettingsActivity;
-import com.android.settings.SettingsPreferenceFragment;
-import com.android.settings.Utils;
-import com.android.settings.search.BaseSearchIndexProvider;
-import com.android.settings.search.Indexable;
-import com.android.settings.search.SearchIndexableRaw;
-import com.google.android.collect.Lists;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Panel showing storage usage on disk for known {@link StorageVolume} returned
- * by {@link StorageManager}. Calculates and displays usage of data types.
- */
-public class Memory extends SettingsPreferenceFragment implements Indexable {
- private static final String TAG = "MemorySettings";
-
- private static final String TAG_CONFIRM_CLEAR_CACHE = "confirmClearCache";
-
- private static final int DLG_CONFIRM_UNMOUNT = 1;
- private static final int DLG_ERROR_UNMOUNT = 2;
-
- // The mountToggle Preference that has last been clicked.
- // Assumes no two successive unmount event on 2 different volumes are performed before the first
- // one's preference is disabled
- private static Preference sLastClickedMountToggle;
- private static String sClickedMountPoint;
-
- // Access using getMountService()
- private IMountService mMountService;
- private StorageManager mStorageManager;
- private UsbManager mUsbManager;
-
- private ArrayList<StorageVolumePreferenceCategory> mCategories = Lists.newArrayList();
-
- @Override
- protected int getMetricsCategory() {
- return MetricsLogger.DEVICEINFO_MEMORY;
- }
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
-
- final Context context = getActivity();
-
- mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
-
- mStorageManager = StorageManager.from(context);
- mStorageManager.registerListener(mStorageListener);
-
- addPreferencesFromResource(R.xml.device_info_memory);
-
- addCategory(StorageVolumePreferenceCategory.buildForInternal(context));
-
- final StorageVolume[] storageVolumes = mStorageManager.getVolumeList();
- for (StorageVolume volume : storageVolumes) {
- if (!volume.isEmulated()) {
- addCategory(StorageVolumePreferenceCategory.buildForPhysical(context, volume));
- }
- }
-
- setHasOptionsMenu(true);
- }
-
- private void addCategory(StorageVolumePreferenceCategory category) {
- mCategories.add(category);
- getPreferenceScreen().addPreference(category);
- category.init();
- }
-
- private boolean isMassStorageEnabled() {
- // Mass storage is enabled if primary volume supports it
- final StorageVolume[] volumes = mStorageManager.getVolumeList();
- final StorageVolume primary = StorageManager.getPrimaryVolume(volumes);
- return primary != null && primary.allowMassStorage();
- }
-
- @Override
- public void onResume() {
- super.onResume();
- IntentFilter intentFilter = new IntentFilter(Intent.ACTION_MEDIA_SCANNER_STARTED);
- intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED);
- intentFilter.addDataScheme("file");
- getActivity().registerReceiver(mMediaScannerReceiver, intentFilter);
-
- intentFilter = new IntentFilter();
- intentFilter.addAction(UsbManager.ACTION_USB_STATE);
- getActivity().registerReceiver(mMediaScannerReceiver, intentFilter);
-
- for (StorageVolumePreferenceCategory category : mCategories) {
- category.onResume();
- }
- }
-
- StorageEventListener mStorageListener = new StorageEventListener() {
- @Override
- public void onStorageStateChanged(String path, String oldState, String newState) {
- Log.i(TAG, "Received storage state changed notification that " + path +
- " changed state from " + oldState + " to " + newState);
- for (StorageVolumePreferenceCategory category : mCategories) {
- final StorageVolume volume = category.getStorageVolume();
- if (volume != null && path.equals(volume.getPath())) {
- category.onStorageStateChanged();
- break;
- }
- }
- }
- };
-
- @Override
- public void onPause() {
- super.onPause();
- getActivity().unregisterReceiver(mMediaScannerReceiver);
- for (StorageVolumePreferenceCategory category : mCategories) {
- category.onPause();
- }
- }
-
- @Override
- public void onDestroy() {
- if (mStorageManager != null && mStorageListener != null) {
- mStorageManager.unregisterListener(mStorageListener);
- }
- super.onDestroy();
- }
-
- @Override
- public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
- inflater.inflate(R.menu.storage, menu);
- }
-
- @Override
- public void onPrepareOptionsMenu(Menu menu) {
- final MenuItem usb = menu.findItem(R.id.storage_usb);
- UserManager um = (UserManager)getActivity().getSystemService(Context.USER_SERVICE);
- boolean usbItemVisible = !isMassStorageEnabled()
- && !um.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER);
- usb.setVisible(usbItemVisible);
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case R.id.storage_usb:
- if (getActivity() instanceof SettingsActivity) {
- ((SettingsActivity) getActivity()).startPreferencePanel(
- UsbSettings.class.getCanonicalName(),
- null, R.string.storage_title_usb, null, this, 0);
- } else {
- startFragment(this, UsbSettings.class.getCanonicalName(),
- R.string.storage_title_usb, -1, null);
- }
- return true;
- }
- return super.onOptionsItemSelected(item);
- }
-
- private synchronized IMountService getMountService() {
- if (mMountService == null) {
- IBinder service = ServiceManager.getService("mount");
- if (service != null) {
- mMountService = IMountService.Stub.asInterface(service);
- } else {
- Log.e(TAG, "Can't get mount service");
- }
- }
- return mMountService;
- }
-
- @Override
- public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
- if (StorageVolumePreferenceCategory.KEY_CACHE.equals(preference.getKey())) {
- ConfirmClearCacheFragment.show(this);
- return true;
- }
-
- for (StorageVolumePreferenceCategory category : mCategories) {
- Intent intent = category.intentForClick(preference);
- if (intent != null) {
- // Don't go across app boundary if monkey is running
- if (!Utils.isMonkeyRunning()) {
- try {
- startActivity(intent);
- } catch (ActivityNotFoundException anfe) {
- Log.w(TAG, "No activity found for intent " + intent);
- }
- }
- return true;
- }
-
- final StorageVolume volume = category.getStorageVolume();
- if (volume != null && category.mountToggleClicked(preference)) {
- sLastClickedMountToggle = preference;
- sClickedMountPoint = volume.getPath();
- String state = mStorageManager.getVolumeState(volume.getPath());
- if (Environment.MEDIA_MOUNTED.equals(state) ||
- Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
- unmount();
- } else {
- mount();
- }
- return true;
- }
- }
-
- return false;
- }
-
- private final BroadcastReceiver mMediaScannerReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
- if (action.equals(UsbManager.ACTION_USB_STATE)) {
- boolean isUsbConnected = intent.getBooleanExtra(UsbManager.USB_CONNECTED, false);
- String usbFunction = mUsbManager.getDefaultFunction();
- for (StorageVolumePreferenceCategory category : mCategories) {
- category.onUsbStateChanged(isUsbConnected, usbFunction);
- }
- } else if (action.equals(Intent.ACTION_MEDIA_SCANNER_FINISHED)) {
- for (StorageVolumePreferenceCategory category : mCategories) {
- category.onMediaScannerFinished();
- }
- }
- }
- };
-
- @Override
- public Dialog onCreateDialog(int id) {
- switch (id) {
- case DLG_CONFIRM_UNMOUNT:
- return new AlertDialog.Builder(getActivity())
- .setTitle(R.string.dlg_confirm_unmount_title)
- .setPositiveButton(R.string.dlg_ok, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- doUnmount();
- }})
- .setNegativeButton(R.string.cancel, null)
- .setMessage(R.string.dlg_confirm_unmount_text)
- .create();
- case DLG_ERROR_UNMOUNT:
- return new AlertDialog.Builder(getActivity())
- .setTitle(R.string.dlg_error_unmount_title)
- .setNeutralButton(R.string.dlg_ok, null)
- .setMessage(R.string.dlg_error_unmount_text)
- .create();
- }
- return null;
- }
-
- private void doUnmount() {
- // Present a toast here
- Toast.makeText(getActivity(), R.string.unmount_inform_text, Toast.LENGTH_SHORT).show();
- IMountService mountService = getMountService();
- try {
- sLastClickedMountToggle.setEnabled(false);
- sLastClickedMountToggle.setTitle(getString(R.string.sd_ejecting_title));
- sLastClickedMountToggle.setSummary(getString(R.string.sd_ejecting_summary));
- mountService.unmountVolume(sClickedMountPoint, true, false);
- } catch (RemoteException e) {
- // Informative dialog to user that unmount failed.
- showDialogInner(DLG_ERROR_UNMOUNT);
- }
- }
-
- private void showDialogInner(int id) {
- removeDialog(id);
- showDialog(id);
- }
-
- private boolean hasAppsAccessingStorage() throws RemoteException {
- IMountService mountService = getMountService();
- int stUsers[] = mountService.getStorageUsers(sClickedMountPoint);
- if (stUsers != null && stUsers.length > 0) {
- return true;
- }
- // TODO FIXME Parameterize with mountPoint and uncomment.
- // On HC-MR2, no apps can be installed on sd and the emulated internal storage is not
- // removable: application cannot interfere with unmount
- /*
- ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
- List<ApplicationInfo> list = am.getRunningExternalApplications();
- if (list != null && list.size() > 0) {
- return true;
- }
- */
- // Better safe than sorry. Assume the storage is used to ask for confirmation.
- return true;
- }
-
- private void unmount() {
- // Check if external media is in use.
- try {
- if (hasAppsAccessingStorage()) {
- // Present dialog to user
- showDialogInner(DLG_CONFIRM_UNMOUNT);
- } else {
- doUnmount();
- }
- } catch (RemoteException e) {
- // Very unlikely. But present an error dialog anyway
- Log.e(TAG, "Is MountService running?");
- showDialogInner(DLG_ERROR_UNMOUNT);
- }
- }
-
- private void mount() {
- IMountService mountService = getMountService();
- try {
- if (mountService != null) {
- mountService.mountVolume(sClickedMountPoint);
- } else {
- Log.e(TAG, "Mount service is null, can't mount");
- }
- } catch (RemoteException ex) {
- // Not much can be done
- }
- }
-
- private void onCacheCleared() {
- for (StorageVolumePreferenceCategory category : mCategories) {
- category.onCacheCleared();
- }
- }
-
- private static class ClearCacheObserver extends IPackageDataObserver.Stub {
- private final Memory mTarget;
- private int mRemaining;
-
- public ClearCacheObserver(Memory target, int remaining) {
- mTarget = target;
- mRemaining = remaining;
- }
-
- @Override
- public void onRemoveCompleted(final String packageName, final boolean succeeded) {
- synchronized (this) {
- if (--mRemaining == 0) {
- mTarget.onCacheCleared();
- }
- }
- }
- }
-
- /**
- * Dialog to request user confirmation before clearing all cache data.
- */
- public static class ConfirmClearCacheFragment extends DialogFragment {
- public static void show(Memory parent) {
- if (!parent.isAdded()) return;
-
- final ConfirmClearCacheFragment dialog = new ConfirmClearCacheFragment();
- dialog.setTargetFragment(parent, 0);
- dialog.show(parent.getFragmentManager(), TAG_CONFIRM_CLEAR_CACHE);
- }
-
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- final Context context = getActivity();
-
- final AlertDialog.Builder builder = new AlertDialog.Builder(context);
- builder.setTitle(R.string.memory_clear_cache_title);
- builder.setMessage(getString(R.string.memory_clear_cache_message));
-
- builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- final Memory target = (Memory) getTargetFragment();
- final PackageManager pm = context.getPackageManager();
- final List<PackageInfo> infos = pm.getInstalledPackages(0);
- final ClearCacheObserver observer = new ClearCacheObserver(
- target, infos.size());
- for (PackageInfo info : infos) {
- pm.deleteApplicationCacheFiles(info.packageName, observer);
- }
- }
- });
- builder.setNegativeButton(android.R.string.cancel, null);
-
- return builder.create();
- }
- }
-
- /**
- * Enable indexing of searchable data
- */
- public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
- new BaseSearchIndexProvider() {
- @Override
- public List<SearchIndexableRaw> getRawDataToIndex(Context context, boolean enabled) {
- final List<SearchIndexableRaw> result = new ArrayList<SearchIndexableRaw>();
-
- SearchIndexableRaw data = new SearchIndexableRaw(context);
- data.title = context.getString(R.string.storage_settings);
- data.screenTitle = context.getString(R.string.storage_settings);
- result.add(data);
-
- data = new SearchIndexableRaw(context);
- data.title = context.getString(R.string.internal_storage);
- data.screenTitle = context.getString(R.string.storage_settings);
- result.add(data);
-
- data = new SearchIndexableRaw(context);
- final StorageVolume[] storageVolumes = StorageManager.from(context).getVolumeList();
- for (StorageVolume volume : storageVolumes) {
- if (!volume.isEmulated()) {
- data.title = volume.getDescription(context);
- data.screenTitle = context.getString(R.string.storage_settings);
- result.add(data);
- }
- }
-
- data = new SearchIndexableRaw(context);
- data.title = context.getString(R.string.memory_size);
- data.screenTitle = context.getString(R.string.storage_settings);
- result.add(data);
-
- data = new SearchIndexableRaw(context);
- data.title = context.getString(R.string.memory_available);
- data.screenTitle = context.getString(R.string.storage_settings);
- result.add(data);
-
- data = new SearchIndexableRaw(context);
- data.title = context.getString(R.string.memory_apps_usage);
- data.screenTitle = context.getString(R.string.storage_settings);
- result.add(data);
-
- data = new SearchIndexableRaw(context);
- data.title = context.getString(R.string.memory_dcim_usage);
- data.screenTitle = context.getString(R.string.storage_settings);
- result.add(data);
-
- data = new SearchIndexableRaw(context);
- data.title = context.getString(R.string.memory_music_usage);
- data.screenTitle = context.getString(R.string.storage_settings);
- result.add(data);
-
- data = new SearchIndexableRaw(context);
- data.title = context.getString(R.string.memory_downloads_usage);
- data.screenTitle = context.getString(R.string.storage_settings);
- result.add(data);
-
- data = new SearchIndexableRaw(context);
- data.title = context.getString(R.string.memory_media_cache_usage);
- data.screenTitle = context.getString(R.string.storage_settings);
- result.add(data);
-
- data = new SearchIndexableRaw(context);
- data.title = context.getString(R.string.memory_media_misc_usage);
- data.screenTitle = context.getString(R.string.storage_settings);
- result.add(data);
-
- return result;
- }
- };
-
-}
diff --git a/src/com/android/settings/deviceinfo/MiscFilesHandler.java b/src/com/android/settings/deviceinfo/MiscFilesHandler.java
deleted file mode 100644
index 93e352b..0000000
--- a/src/com/android/settings/deviceinfo/MiscFilesHandler.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.settings.deviceinfo;
-
-import android.app.Activity;
-import android.app.ListActivity;
-import android.content.Context;
-import android.os.Bundle;
-import android.os.storage.StorageVolume;
-import android.text.format.Formatter;
-import android.util.Log;
-import android.util.SparseBooleanArray;
-import android.view.ActionMode;
-import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.View.OnLongClickListener;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
-import android.widget.CompoundButton;
-import android.widget.CompoundButton.OnCheckedChangeListener;
-import android.widget.ListView;
-
-import com.android.settings.R;
-import com.android.settings.deviceinfo.StorageMeasurement.FileInfo;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This class handles the selection and removal of Misc files.
- */
-public class MiscFilesHandler extends ListActivity {
- private static final String TAG = "MemorySettings";
- private String mNumSelectedFormat;
- private String mNumBytesSelectedFormat;
- private MemoryMearurementAdapter mAdapter;
- private LayoutInflater mInflater;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setFinishOnTouchOutside(true);
- setTitle(R.string.misc_files);
- mNumSelectedFormat = getString(R.string.misc_files_selected_count);
- mNumBytesSelectedFormat = getString(R.string.misc_files_selected_count_bytes);
- mAdapter = new MemoryMearurementAdapter(this);
- mInflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- setContentView(R.layout.settings_storage_miscfiles_list);
- ListView lv = getListView();
- lv.setItemsCanFocus(true);
- lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);
- lv.setMultiChoiceModeListener(new ModeCallback(this));
- setListAdapter(mAdapter);
- }
-
- private class ModeCallback implements ListView.MultiChoiceModeListener {
- private int mDataCount;
- private final Context mContext;
-
- public ModeCallback(Context context) {
- mContext = context;
- mDataCount = mAdapter.getCount();
- }
-
- public boolean onCreateActionMode(ActionMode mode, Menu menu) {
- final MenuInflater inflater = getMenuInflater();
- inflater.inflate(R.menu.misc_files_menu, menu);
- return true;
- }
-
- public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
- return true;
- }
-
- public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
- ListView lv = getListView();
- switch (item.getItemId()) {
- case R.id.action_delete:
- // delete the files selected
- SparseBooleanArray checkedItems = lv.getCheckedItemPositions();
- int checkedCount = getListView().getCheckedItemCount();
- if (checkedCount > mDataCount) {
- throw new IllegalStateException("checked item counts do not match. " +
- "checkedCount: " + checkedCount + ", dataSize: " + mDataCount);
- }
- if (mDataCount > 0) {
- ArrayList<Object> toRemove = new ArrayList<Object>();
- for (int i = 0; i < mDataCount; i++) {
- if (!checkedItems.get(i)) {
- //item not selected
- continue;
- }
- if (StorageMeasurement.LOGV) {
- Log.i(TAG, "deleting: " + mAdapter.getItem(i));
- }
- // delete the file
- File file = new File(mAdapter.getItem(i).mFileName);
- if (file.isDirectory()) {
- deleteDir(file);
- } else {
- file.delete();
- }
- toRemove.add(mAdapter.getItem(i));
- }
- mAdapter.removeAll(toRemove);
- mAdapter.notifyDataSetChanged();
- mDataCount = mAdapter.getCount();
- }
- mode.finish();
- break;
-
- case R.id.action_select_all:
- // check ALL items
- for (int i = 0; i < mDataCount; i++) {
- lv.setItemChecked(i, true);
- }
- // update the title and subtitle with number selected and numberBytes selected
- onItemCheckedStateChanged(mode, 1, 0, true);
- break;
- }
- return true;
- }
-
- // Deletes all files and subdirectories under given dir.
- // Returns true if all deletions were successful.
- // If a deletion fails, the method stops attempting to delete and returns false.
- private boolean deleteDir(File dir) {
- String[] children = dir.list();
- if (children != null) {
- for (int i=0; i < children.length; i++) {
- boolean success = deleteDir(new File(dir, children[i]));
- if (!success) {
- return false;
- }
- }
- }
- // The directory is now empty so delete it
- return dir.delete();
- }
-
- public void onDestroyActionMode(ActionMode mode) {
- // This block intentionally left blank
- }
-
- public void onItemCheckedStateChanged(ActionMode mode, int position, long id,
- boolean checked) {
- ListView lv = getListView();
- int numChecked = lv.getCheckedItemCount();
- mode.setTitle(String.format(mNumSelectedFormat, numChecked, mAdapter.getCount()));
-
- // total the sizes of all items selected so far
- SparseBooleanArray checkedItems = lv.getCheckedItemPositions();
- long selectedDataSize = 0;
- if (numChecked > 0) {
- for (int i = 0; i < mDataCount; i++) {
- if (checkedItems.get(i)) {
- // item is checked
- selectedDataSize += mAdapter.getItem(i).mSize;
- }
- }
- }
- mode.setSubtitle(String.format(mNumBytesSelectedFormat,
- Formatter.formatFileSize(mContext, selectedDataSize),
- Formatter.formatFileSize(mContext, mAdapter.getDataSize())));
- }
- }
-
- class MemoryMearurementAdapter extends BaseAdapter {
- private ArrayList<StorageMeasurement.FileInfo> mData = null;
- private long mDataSize = 0;
- private Context mContext;
-
- public MemoryMearurementAdapter(Activity activity) {
- mContext = activity;
- final StorageVolume storageVolume = activity.getIntent().getParcelableExtra(
- StorageVolume.EXTRA_STORAGE_VOLUME);
- StorageMeasurement mMeasurement = StorageMeasurement.getInstance(
- activity, storageVolume);
- if (mMeasurement == null) return;
- mData = (ArrayList<StorageMeasurement.FileInfo>) mMeasurement.mFileInfoForMisc;
- if (mData != null) {
- for (StorageMeasurement.FileInfo info : mData) {
- mDataSize += info.mSize;
- }
- }
- }
-
- @Override
- public int getCount() {
- return (mData == null) ? 0 : mData.size();
- }
-
- @Override
- public StorageMeasurement.FileInfo getItem(int position) {
- if (mData == null || mData.size() <= position) {
- return null;
- }
- return mData.get(position);
- }
-
- @Override
- public long getItemId(int position) {
- if (mData == null || mData.size() <= position) {
- return 0;
- }
- return mData.get(position).mId;
- }
-
- public void removeAll(List<Object> objs) {
- if (mData == null) {
- return;
- }
- for (Object o : objs) {
- mData.remove(o);
- mDataSize -= ((StorageMeasurement.FileInfo) o).mSize;
- }
- }
-
- public long getDataSize() {
- return mDataSize;
- }
-
- @Override
- public void notifyDataSetChanged() {
- super.notifyDataSetChanged();
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- final FileItemInfoLayout view = (convertView == null) ?
- (FileItemInfoLayout) mInflater.inflate(R.layout.settings_storage_miscfiles,
- parent, false) : (FileItemInfoLayout) convertView;
- FileInfo item = getItem(position);
- view.setFileName(item.mFileName);
- view.setFileSize(Formatter.formatFileSize(mContext, item.mSize));
- final ListView listView = (ListView) parent;
- final int listPosition = position;
- view.getCheckBox().setOnCheckedChangeListener(new OnCheckedChangeListener() {
-
- @Override
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- listView.setItemChecked(listPosition, isChecked);
- }
-
- });
- view.setOnLongClickListener(new OnLongClickListener() {
- @Override
- public boolean onLongClick(View v) {
- if (listView.getCheckedItemCount() > 0) {
- return false;
- }
- listView.setItemChecked(listPosition, !view.isChecked());
- return true;
- }
- });
- view.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- if (listView.getCheckedItemCount() > 0) {
- listView.setItemChecked(listPosition, !view.isChecked());
- }
- }
- });
- return view;
- }
- }
-}
diff --git a/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
new file mode 100644
index 0000000..efb9a07
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
@@ -0,0 +1,548 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+package com.android.settings.deviceinfo;
+
+import static com.android.settings.deviceinfo.StorageSettings.EXTRA_VOLUME_ID;
+import static com.android.settings.deviceinfo.StorageSettings.TAG;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.DialogFragment;
+import android.app.DownloadManager;
+import android.content.ActivityNotFoundException;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.IPackageDataObserver;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.UserInfo;
+import android.os.Bundle;
+import android.os.Environment;
+import android.os.UserHandle;
+import android.os.UserManager;
+import android.os.storage.StorageEventListener;
+import android.os.storage.StorageManager;
+import android.os.storage.VolumeInfo;
+import android.preference.Preference;
+import android.preference.PreferenceScreen;
+import android.provider.MediaStore;
+import android.text.TextUtils;
+import android.text.format.Formatter;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.EditText;
+
+import com.android.internal.logging.MetricsLogger;
+import com.android.internal.util.Preconditions;
+import com.android.settings.R;
+import com.android.settings.Settings;
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.deviceinfo.StorageMeasurement.MeasurementDetails;
+import com.android.settings.deviceinfo.StorageMeasurement.MeasurementReceiver;
+import com.android.settings.deviceinfo.StorageSettings.FormatTask;
+import com.android.settings.deviceinfo.StorageSettings.MountTask;
+import com.android.settings.deviceinfo.StorageSettings.UnmountTask;
+import com.google.android.collect.Lists;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * Panel showing summary and actions for a {@link VolumeInfo#TYPE_PRIVATE}
+ * storage volume.
+ */
+public class PrivateVolumeSettings extends SettingsPreferenceFragment {
+ // TODO: disable unmount when providing over MTP/PTP
+
+ private static final String TAG_RENAME = "rename";
+ private static final String TAG_CONFIRM_CLEAR_CACHE = "confirmClearCache";
+
+ private StorageManager mStorageManager;
+ private UserManager mUserManager;
+
+ private VolumeInfo mVolume;
+ private VolumeInfo mSharedVolume;
+
+ private StorageMeasurement mMeasure;
+
+ private UserInfo mCurrentUser;
+
+ private int mNextOrder = 0;
+
+ private UsageBarPreference mGraph;
+ private StorageItemPreference mTotal;
+ private StorageItemPreference mAvailable;
+ private StorageItemPreference mApps;
+ private StorageItemPreference mDcim;
+ private StorageItemPreference mMusic;
+ private StorageItemPreference mDownloads;
+ private StorageItemPreference mCache;
+ private StorageItemPreference mMisc;
+ private List<StorageItemPreference> mUsers = Lists.newArrayList();
+
+ private long mTotalSize;
+ private long mAvailSize;
+
+ @Override
+ protected int getMetricsCategory() {
+ return MetricsLogger.DEVICEINFO_STORAGE;
+ }
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ final Context context = getActivity();
+
+ mUserManager = context.getSystemService(UserManager.class);
+ mStorageManager = context.getSystemService(StorageManager.class);
+
+ final String volId = getArguments().getString(EXTRA_VOLUME_ID);
+ mVolume = Preconditions.checkNotNull(mStorageManager.findVolumeById(volId));
+ Preconditions.checkState(mVolume.type == VolumeInfo.TYPE_PRIVATE);
+
+ addPreferencesFromResource(R.xml.device_info_storage_volume);
+
+ // Find the emulated shared storage layered above this private volume
+ mSharedVolume = mStorageManager.findVolumeById(
+ mVolume.id.replace("private", "emulated"));
+
+ mMeasure = new StorageMeasurement(context, mVolume, mSharedVolume);
+ mMeasure.setReceiver(mReceiver);
+
+ mGraph = buildGraph();
+ mTotal = buildItem(R.string.memory_size, 0);
+ mAvailable = buildItem(R.string.memory_available, R.color.memory_avail);
+
+ mApps = buildItem(R.string.memory_apps_usage, R.color.memory_apps_usage);
+ mDcim = buildItem(R.string.memory_dcim_usage, R.color.memory_dcim);
+ mMusic = buildItem(R.string.memory_music_usage, R.color.memory_music);
+ mDownloads = buildItem(R.string.memory_downloads_usage, R.color.memory_downloads);
+ mCache = buildItem(R.string.memory_media_cache_usage, R.color.memory_cache);
+ mMisc = buildItem(R.string.memory_media_misc_usage, R.color.memory_misc);
+
+ mCurrentUser = mUserManager.getUserInfo(UserHandle.myUserId());
+ final List<UserInfo> otherUsers = getUsersExcluding(mCurrentUser);
+ for (int i = 0; i < otherUsers.size(); i++) {
+ final UserInfo user = otherUsers.get(i);
+ final int colorRes = i % 2 == 0 ? R.color.memory_user_light
+ : R.color.memory_user_dark;
+ final StorageItemPreference userPref = new StorageItemPreference(
+ context, user.name, colorRes, user.id);
+ mUsers.add(userPref);
+ }
+
+ setHasOptionsMenu(true);
+ }
+
+ public void refresh() {
+ getActivity().setTitle(mStorageManager.getBestVolumeDescription(mVolume.id));
+
+ // Valid options may have changed
+ getFragmentManager().invalidateOptionsMenu();
+
+ final Context context = getActivity();
+ final PreferenceScreen screen = getPreferenceScreen();
+
+ screen.removeAll();
+
+ if (mVolume.state != VolumeInfo.STATE_MOUNTED) {
+ return;
+ }
+
+ screen.addPreference(mGraph);
+ screen.addPreference(mTotal);
+ screen.addPreference(mAvailable);
+
+ final boolean showUsers = !mUsers.isEmpty();
+ if (showUsers) {
+ screen.addPreference(new PreferenceHeader(context, mCurrentUser.name));
+ }
+
+ screen.addPreference(mApps);
+ screen.addPreference(mDcim);
+ screen.addPreference(mMusic);
+ screen.addPreference(mDownloads);
+ screen.addPreference(mCache);
+ screen.addPreference(mMisc);
+
+ if (showUsers) {
+ screen.addPreference(new PreferenceHeader(context, R.string.storage_other_users));
+ for (Preference pref : mUsers) {
+ screen.addPreference(pref);
+ }
+ }
+
+ for (int i = 0; i < screen.getPreferenceCount(); i++) {
+ final Preference pref = screen.getPreference(i);
+ if (pref instanceof StorageItemPreference) {
+ ((StorageItemPreference) pref).setLoading();
+ }
+ }
+
+ final File file = new File(mVolume.path);
+ mTotalSize = file.getTotalSpace();
+ mAvailSize = file.getFreeSpace();
+
+ mTotal.setSummary(Formatter.formatFileSize(context, mTotalSize));
+ mAvailable.setSummary(Formatter.formatFileSize(context, mAvailSize));
+
+ mGraph.clear();
+ mGraph.addEntry(0, (mTotalSize - mAvailSize) / (float) mTotalSize,
+ android.graphics.Color.GRAY);
+ mGraph.commit();
+
+ mMeasure.forceMeasure();
+ }
+
+ private UsageBarPreference buildGraph() {
+ final UsageBarPreference pref = new UsageBarPreference(getActivity());
+ pref.setOrder(mNextOrder++);
+ return pref;
+ }
+
+ private StorageItemPreference buildItem(int titleRes, int colorRes) {
+ final StorageItemPreference pref = new StorageItemPreference(getActivity(), titleRes,
+ colorRes);
+ pref.setOrder(mNextOrder++);
+ return pref;
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ mStorageManager.registerListener(mStorageListener);
+ refresh();
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ mStorageManager.unregisterListener(mStorageListener);
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ mMeasure.onDestroy();
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ inflater.inflate(R.menu.storage_volume, menu);
+ }
+
+ @Override
+ public void onPrepareOptionsMenu(Menu menu) {
+ final MenuItem rename = menu.findItem(R.id.storage_rename);
+ final MenuItem mount = menu.findItem(R.id.storage_mount);
+ final MenuItem unmount = menu.findItem(R.id.storage_unmount);
+ final MenuItem format = menu.findItem(R.id.storage_format);
+ final MenuItem usb = menu.findItem(R.id.storage_usb);
+
+ // Actions live in menu for non-internal private volumes; they're shown
+ // as preference items for public volumes.
+ if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(mVolume.id)) {
+ rename.setVisible(false);
+ mount.setVisible(false);
+ unmount.setVisible(false);
+ format.setVisible(false);
+ } else {
+ rename.setVisible(mVolume.type == VolumeInfo.TYPE_PRIVATE);
+ mount.setVisible(mVolume.state == VolumeInfo.STATE_UNMOUNTED);
+ unmount.setVisible(mVolume.state == VolumeInfo.STATE_MOUNTED);
+ format.setVisible(true);
+ }
+
+ // TODO: show usb if we jumped past first screen
+ usb.setVisible(false);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ final Context context = getActivity();
+ switch (item.getItemId()) {
+ case R.id.storage_rename:
+ RenameFragment.show(this);
+ return true;
+ case R.id.storage_mount:
+ new MountTask(context, mVolume.id).execute();
+ return true;
+ case R.id.storage_unmount:
+ new UnmountTask(context, mVolume.id).execute();
+ return true;
+ case R.id.storage_format:
+ new FormatTask(context, mVolume.id).execute();
+ return true;
+ case R.id.storage_usb:
+ startFragment(this, UsbSettings.class.getCanonicalName(),
+ R.string.storage_title_usb, 0, null);
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference pref) {
+ // TODO: launch better intents for specific volume
+
+ Intent intent = null;
+ if (pref == mApps) {
+ intent = new Intent(Intent.ACTION_MANAGE_PACKAGE_STORAGE);
+ intent.setClass(getActivity(), Settings.ManageApplicationsActivity.class);
+
+ } else if (pref == mDownloads) {
+ intent = new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS).putExtra(
+ DownloadManager.INTENT_EXTRAS_SORT_BY_SIZE, true);
+
+ } else if (pref == mMusic) {
+ intent = new Intent(Intent.ACTION_GET_CONTENT);
+ intent.setType("audio/mp3");
+
+ } else if (pref == mDcim) {
+ intent = new Intent(Intent.ACTION_VIEW);
+ intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
+ intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
+
+ } else if (pref == mCache) {
+ ConfirmClearCacheFragment.show(this);
+ return true;
+
+ } else if (pref == mMisc) {
+ intent = StorageSettings.buildBrowseIntent(mSharedVolume);
+ }
+
+ if (intent != null) {
+ try {
+ startActivity(intent);
+ } catch (ActivityNotFoundException e) {
+ Log.w(TAG, "No activity found for " + intent);
+ }
+ return true;
+ }
+ return super.onPreferenceTreeClick(preferenceScreen, pref);
+ }
+
+ private final MeasurementReceiver mReceiver = new MeasurementReceiver() {
+ @Override
+ public void onDetailsChanged(MeasurementDetails details) {
+ updateDetails(details);
+ }
+ };
+
+ private void updateDetails(MeasurementDetails details) {
+ mGraph.clear();
+
+ updatePreference(mApps, details.appsSize);
+
+ final long dcimSize = totalValues(details.mediaSize, Environment.DIRECTORY_DCIM,
+ Environment.DIRECTORY_MOVIES, Environment.DIRECTORY_PICTURES);
+ updatePreference(mDcim, dcimSize);
+
+ final long musicSize = totalValues(details.mediaSize, Environment.DIRECTORY_MUSIC,
+ Environment.DIRECTORY_ALARMS, Environment.DIRECTORY_NOTIFICATIONS,
+ Environment.DIRECTORY_RINGTONES, Environment.DIRECTORY_PODCASTS);
+ updatePreference(mMusic, musicSize);
+
+ final long downloadsSize = totalValues(details.mediaSize, Environment.DIRECTORY_DOWNLOADS);
+ updatePreference(mDownloads, downloadsSize);
+
+ updatePreference(mCache, details.cacheSize);
+ updatePreference(mMisc, details.miscSize);
+
+ for (StorageItemPreference userPref : mUsers) {
+ final long userSize = details.usersSize.get(userPref.userHandle);
+ updatePreference(userPref, userSize);
+ }
+
+ mGraph.commit();
+ }
+
+ private void updatePreference(StorageItemPreference pref, long size) {
+ pref.setSummary(Formatter.formatFileSize(getActivity(), size));
+ if (size > 0) {
+ final int order = pref.getOrder();
+ mGraph.addEntry(order, size / (float) mTotalSize, pref.color);
+ }
+ }
+
+ /**
+ * Return list of other users, excluding the current user.
+ */
+ private List<UserInfo> getUsersExcluding(UserInfo excluding) {
+ final List<UserInfo> users = mUserManager.getUsers();
+ final Iterator<UserInfo> i = users.iterator();
+ while (i.hasNext()) {
+ if (i.next().id == excluding.id) {
+ i.remove();
+ }
+ }
+ return users;
+ }
+
+ private static long totalValues(HashMap<String, Long> map, String... keys) {
+ long total = 0;
+ for (String key : keys) {
+ if (map.containsKey(key)) {
+ total += map.get(key);
+ }
+ }
+ return total;
+ }
+
+ private final StorageEventListener mStorageListener = new StorageEventListener() {
+ @Override
+ public void onVolumeStateChanged(VolumeInfo vol, int oldState, int newState) {
+ if (Objects.equals(mVolume.id, vol.id)) {
+ mVolume = vol;
+ refresh();
+ }
+ }
+ };
+
+ /**
+ * Dialog that allows editing of volume nickname.
+ */
+ public static class RenameFragment extends DialogFragment {
+ public static void show(PrivateVolumeSettings parent) {
+ if (!parent.isAdded()) return;
+
+ final RenameFragment dialog = new RenameFragment();
+ dialog.setTargetFragment(parent, 0);
+ dialog.setArguments(parent.getArguments());
+ dialog.show(parent.getFragmentManager(), TAG_RENAME);
+ }
+
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ final Context context = getActivity();
+ final StorageManager storageManager = context.getSystemService(StorageManager.class);
+
+ final String volId = getArguments().getString(EXTRA_VOLUME_ID);
+ final VolumeInfo vol = storageManager.findVolumeById(volId);
+
+ final AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ final LayoutInflater dialogInflater = LayoutInflater.from(builder.getContext());
+
+ final View view = dialogInflater.inflate(R.layout.dialog_edittext, null, false);
+ final EditText nickname = (EditText) view.findViewById(R.id.edittext);
+
+ if (!TextUtils.isEmpty(vol.nickname)) {
+ nickname.setText(vol.nickname);
+ } else {
+ nickname.setText(storageManager.getBestVolumeDescription(volId));
+ }
+
+ builder.setTitle(R.string.storage_rename_title);
+ builder.setView(view);
+
+ builder.setPositiveButton(R.string.save,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ // TODO: persist the edited nickname!
+ }
+ });
+ builder.setNegativeButton(R.string.cancel, null);
+
+ return builder.create();
+ }
+ }
+
+ /**
+ * Dialog to request user confirmation before clearing all cache data.
+ */
+ public static class ConfirmClearCacheFragment extends DialogFragment {
+ public static void show(PrivateVolumeSettings parent) {
+ if (!parent.isAdded()) return;
+
+ final ConfirmClearCacheFragment dialog = new ConfirmClearCacheFragment();
+ dialog.setTargetFragment(parent, 0);
+ dialog.show(parent.getFragmentManager(), TAG_CONFIRM_CLEAR_CACHE);
+ }
+
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ final Context context = getActivity();
+
+ final AlertDialog.Builder builder = new AlertDialog.Builder(context);
+ builder.setTitle(R.string.memory_clear_cache_title);
+ builder.setMessage(getString(R.string.memory_clear_cache_message));
+
+ builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ final PrivateVolumeSettings target = (PrivateVolumeSettings) getTargetFragment();
+ final PackageManager pm = context.getPackageManager();
+ final List<PackageInfo> infos = pm.getInstalledPackages(0);
+ final ClearCacheObserver observer = new ClearCacheObserver(
+ target, infos.size());
+ for (PackageInfo info : infos) {
+ pm.deleteApplicationCacheFiles(info.packageName, observer);
+ }
+ }
+ });
+ builder.setNegativeButton(android.R.string.cancel, null);
+
+ return builder.create();
+ }
+ }
+
+ private static class ClearCacheObserver extends IPackageDataObserver.Stub {
+ private final PrivateVolumeSettings mTarget;
+ private int mRemaining;
+
+ public ClearCacheObserver(PrivateVolumeSettings target, int remaining) {
+ mTarget = target;
+ mRemaining = remaining;
+ }
+
+ @Override
+ public void onRemoveCompleted(final String packageName, final boolean succeeded) {
+ synchronized (this) {
+ if (--mRemaining == 0) {
+ mTarget.refresh();
+ }
+ }
+ }
+ }
+
+ public static class PreferenceHeader extends Preference {
+ public PreferenceHeader(Context context, int titleRes) {
+ super(context, null, com.android.internal.R.attr.preferenceCategoryStyle);
+ setTitle(titleRes);
+ }
+
+ public PreferenceHeader(Context context, CharSequence title) {
+ super(context, null, com.android.internal.R.attr.preferenceCategoryStyle);
+ setTitle(title);
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return false;
+ }
+ }
+}
diff --git a/src/com/android/settings/deviceinfo/PublicVolumeSettings.java b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
new file mode 100644
index 0000000..6edfc92
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
@@ -0,0 +1,205 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+package com.android.settings.deviceinfo;
+
+import static com.android.settings.deviceinfo.StorageSettings.EXTRA_VOLUME_ID;
+
+import android.content.Context;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.SystemProperties;
+import android.os.storage.StorageEventListener;
+import android.os.storage.StorageManager;
+import android.os.storage.VolumeInfo;
+import android.preference.Preference;
+import android.preference.PreferenceScreen;
+import android.provider.DocumentsContract;
+import android.text.format.Formatter;
+
+import com.android.internal.logging.MetricsLogger;
+import com.android.internal.util.Preconditions;
+import com.android.settings.R;
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.deviceinfo.StorageSettings.FormatTask;
+import com.android.settings.deviceinfo.StorageSettings.MountTask;
+import com.android.settings.deviceinfo.StorageSettings.UnmountTask;
+
+import java.io.File;
+import java.util.Objects;
+
+/**
+ * Panel showing summary and actions for a {@link VolumeInfo#TYPE_PUBLIC}
+ * storage volume.
+ */
+public class PublicVolumeSettings extends SettingsPreferenceFragment {
+ // TODO: disable unmount when providing over MTP/PTP
+
+ private static final String PREF_FORMAT_INTERNAL = "debug.format_internal";
+
+ private StorageManager mStorageManager;
+
+ private VolumeInfo mVolume;
+
+ private int mNextOrder = 0;
+
+ private UsageBarPreference mGraph;
+ private StorageItemPreference mTotal;
+ private StorageItemPreference mAvailable;
+
+ private Preference mMount;
+ private Preference mUnmount;
+ private Preference mFormat;
+ private Preference mFormatInternal;
+
+ private long mTotalSize;
+ private long mAvailSize;
+
+ @Override
+ protected int getMetricsCategory() {
+ return MetricsLogger.DEVICEINFO_STORAGE;
+ }
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ final Context context = getActivity();
+
+ mStorageManager = context.getSystemService(StorageManager.class);
+
+ if (DocumentsContract.ACTION_DOCUMENT_ROOT_SETTINGS.equals(
+ getActivity().getIntent().getAction())) {
+ final Uri rootUri = getActivity().getIntent().getData();
+ final String fsUuid = DocumentsContract.getRootId(rootUri);
+ mVolume = mStorageManager.findVolumeByUuid(fsUuid);
+ } else {
+ final String volId = getArguments().getString(EXTRA_VOLUME_ID);
+ mVolume = mStorageManager.findVolumeById(volId);
+ }
+
+ Preconditions.checkNotNull(mVolume);
+ Preconditions.checkState(mVolume.type == VolumeInfo.TYPE_PUBLIC);
+
+ addPreferencesFromResource(R.xml.device_info_storage_volume);
+
+ mGraph = buildGraph();
+ mTotal = buildItem(R.string.memory_size, 0);
+ mAvailable = buildItem(R.string.memory_available, R.color.memory_avail);
+
+ mMount = buildAction(R.string.storage_menu_mount);
+ mUnmount = buildAction(R.string.storage_menu_unmount);
+ mFormat = buildAction(R.string.storage_menu_format);
+ mFormatInternal = buildAction(R.string.storage_menu_format_internal);
+ }
+
+ public void refresh() {
+ getActivity().setTitle(mStorageManager.getBestVolumeDescription(mVolume.id));
+
+ final Context context = getActivity();
+ final PreferenceScreen screen = getPreferenceScreen();
+
+ screen.removeAll();
+
+ if (mVolume.state == VolumeInfo.STATE_MOUNTED) {
+ screen.addPreference(mGraph);
+ screen.addPreference(mTotal);
+ screen.addPreference(mAvailable);
+ }
+
+ if (mVolume.state == VolumeInfo.STATE_UNMOUNTED) {
+ screen.addPreference(mMount);
+ }
+ if (mVolume.state == VolumeInfo.STATE_MOUNTED) {
+ screen.addPreference(mUnmount);
+ }
+ screen.addPreference(mFormat);
+ if (SystemProperties.getBoolean(PREF_FORMAT_INTERNAL, false)) {
+ screen.addPreference(mFormatInternal);
+ }
+
+ final File file = new File(mVolume.path);
+ mTotalSize = file.getTotalSpace();
+ mAvailSize = file.getFreeSpace();
+
+ mTotal.setSummary(Formatter.formatFileSize(context, mTotalSize));
+ mAvailable.setSummary(Formatter.formatFileSize(context, mAvailSize));
+
+ mGraph.clear();
+ mGraph.addEntry(0, (mTotalSize - mAvailSize) / (float) mTotalSize,
+ android.graphics.Color.GRAY);
+ mGraph.commit();
+ }
+
+ private UsageBarPreference buildGraph() {
+ final UsageBarPreference pref = new UsageBarPreference(getActivity());
+ pref.setOrder(mNextOrder++);
+ return pref;
+ }
+
+ private StorageItemPreference buildItem(int titleRes, int colorRes) {
+ final StorageItemPreference pref = new StorageItemPreference(getActivity(), titleRes,
+ colorRes);
+ pref.setOrder(mNextOrder++);
+ return pref;
+ }
+
+ private Preference buildAction(int titleRes) {
+ final Preference pref = new Preference(getActivity());
+ pref.setTitle(titleRes);
+ pref.setOrder(mNextOrder++);
+ return pref;
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ mStorageManager.registerListener(mStorageListener);
+ refresh();
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ mStorageManager.unregisterListener(mStorageListener);
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference pref) {
+ final Context context = getActivity();
+ if (pref == mMount) {
+ new MountTask(context, mVolume.id).execute();
+ } else if (pref == mUnmount) {
+ new UnmountTask(context, mVolume.id).execute();
+ } else if (pref == mFormat) {
+ new FormatTask(context, mVolume.id).execute();
+ } else if (pref == mFormatInternal) {
+ // TODO: implement this
+ }
+
+ return super.onPreferenceTreeClick(preferenceScreen, pref);
+ }
+
+ private final StorageEventListener mStorageListener = new StorageEventListener() {
+ @Override
+ public void onVolumeStateChanged(VolumeInfo vol, int oldState, int newState) {
+ if (Objects.equals(mVolume.id, vol.id)) {
+ mVolume = vol;
+ refresh();
+ }
+ }
+ };
+}
diff --git a/src/com/android/settings/deviceinfo/StorageItemPreference.java b/src/com/android/settings/deviceinfo/StorageItemPreference.java
index 87e827e..8d48cf0 100644
--- a/src/com/android/settings/deviceinfo/StorageItemPreference.java
+++ b/src/com/android/settings/deviceinfo/StorageItemPreference.java
@@ -62,4 +62,8 @@
shape.getPaint().setColor(color);
return shape;
}
+
+ public void setLoading() {
+ setSummary(R.string.memory_calculating_size);
+ }
}
diff --git a/src/com/android/settings/deviceinfo/StorageMeasurement.java b/src/com/android/settings/deviceinfo/StorageMeasurement.java
index 34ef62b..db91fdb 100644
--- a/src/com/android/settings/deviceinfo/StorageMeasurement.java
+++ b/src/com/android/settings/deviceinfo/StorageMeasurement.java
@@ -27,7 +27,6 @@
import android.content.pm.PackageStats;
import android.content.pm.UserInfo;
import android.os.Environment;
-import android.os.Environment.UserEnvironment;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
@@ -36,23 +35,22 @@
import android.os.UserHandle;
import android.os.UserManager;
import android.os.storage.StorageVolume;
+import android.os.storage.VolumeInfo;
import android.util.Log;
import android.util.SparseLongArray;
import com.android.internal.app.IMediaContainerService;
-import com.google.android.collect.Maps;
+import com.android.internal.util.ArrayUtils;
import com.google.android.collect.Sets;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.List;
+import java.util.Objects;
import java.util.Set;
-import javax.annotation.concurrent.GuardedBy;
-
/**
* Utility for measuring the disk usage of internal storage or a physical
* {@link StorageVolume}. Connects with a remote {@link IMediaContainerService}
@@ -77,28 +75,7 @@
Environment.DIRECTORY_RINGTONES, Environment.DIRECTORY_PODCASTS,
Environment.DIRECTORY_DOWNLOADS, Environment.DIRECTORY_ANDROID);
- @GuardedBy("sInstances")
- private static HashMap<StorageVolume, StorageMeasurement> sInstances = Maps.newHashMap();
-
- /**
- * Obtain shared instance of {@link StorageMeasurement} for given physical
- * {@link StorageVolume}, or internal storage if {@code null}.
- */
- public static StorageMeasurement getInstance(Context context, StorageVolume volume) {
- synchronized (sInstances) {
- StorageMeasurement value = sInstances.get(volume);
- if (value == null) {
- value = new StorageMeasurement(context.getApplicationContext(), volume);
- sInstances.put(volume, value);
- }
- return value;
- }
- }
-
public static class MeasurementDetails {
- public long totalSize;
- public long availSize;
-
/**
* Total apps disk usage.
* <p>
@@ -128,7 +105,7 @@
* When measuring a physical {@link StorageVolume}, this reflects media
* on that volume.
*/
- public HashMap<String, Long> mediaSize = Maps.newHashMap();
+ public HashMap<String, Long> mediaSize = new HashMap<>();
/**
* Misc external disk usage for the current user, unaccounted in
@@ -144,34 +121,31 @@
}
public interface MeasurementReceiver {
- public void updateApproximate(StorageMeasurement meas, long totalSize, long availSize);
- public void updateDetails(StorageMeasurement meas, MeasurementDetails details);
+ public void onDetailsChanged(MeasurementDetails details);
}
- private volatile WeakReference<MeasurementReceiver> mReceiver;
+ private WeakReference<MeasurementReceiver> mReceiver;
- /** Physical volume being measured, or {@code null} for internal. */
- private final StorageVolume mVolume;
+ private final Context mContext;
- private final boolean mIsInternal;
- private final boolean mIsPrimary;
+ private final VolumeInfo mVolume;
+ private final VolumeInfo mSharedVolume;
- private final MeasurementHandler mHandler;
+ private final MainHandler mMainHandler;
+ private final MeasurementHandler mMeasurementHandler;
- private long mTotalSize;
- private long mAvailSize;
+ public StorageMeasurement(Context context, VolumeInfo volume, VolumeInfo sharedVolume) {
+ mContext = context.getApplicationContext();
- List<FileInfo> mFileInfoForMisc;
-
- private StorageMeasurement(Context context, StorageVolume volume) {
mVolume = volume;
- mIsInternal = volume == null;
- mIsPrimary = volume != null ? volume.isPrimary() : false;
+ mSharedVolume = sharedVolume;
// Start the thread that will measure the disk usage.
final HandlerThread handlerThread = new HandlerThread("MemoryMeasurement");
handlerThread.start();
- mHandler = new MeasurementHandler(context, handlerThread.getLooper());
+
+ mMainHandler = new MainHandler();
+ mMeasurementHandler = new MeasurementHandler(handlerThread.getLooper());
}
public void setReceiver(MeasurementReceiver receiver) {
@@ -180,52 +154,38 @@
}
}
+ public void forceMeasure() {
+ invalidate();
+ measure();
+ }
+
public void measure() {
- if (!mHandler.hasMessages(MeasurementHandler.MSG_MEASURE)) {
- mHandler.sendEmptyMessage(MeasurementHandler.MSG_MEASURE);
+ if (!mMeasurementHandler.hasMessages(MeasurementHandler.MSG_MEASURE)) {
+ mMeasurementHandler.sendEmptyMessage(MeasurementHandler.MSG_MEASURE);
}
}
- public void cleanUp() {
+ public void onDestroy() {
mReceiver = null;
- mHandler.removeMessages(MeasurementHandler.MSG_MEASURE);
- mHandler.sendEmptyMessage(MeasurementHandler.MSG_DISCONNECT);
+ mMeasurementHandler.removeMessages(MeasurementHandler.MSG_MEASURE);
+ mMeasurementHandler.sendEmptyMessage(MeasurementHandler.MSG_DISCONNECT);
}
- public void invalidate() {
- mHandler.sendEmptyMessage(MeasurementHandler.MSG_INVALIDATE);
- }
-
- private void sendInternalApproximateUpdate() {
- MeasurementReceiver receiver = (mReceiver != null) ? mReceiver.get() : null;
- if (receiver == null) {
- return;
- }
- receiver.updateApproximate(this, mTotalSize, mAvailSize);
- }
-
- private void sendExactUpdate(MeasurementDetails details) {
- MeasurementReceiver receiver = (mReceiver != null) ? mReceiver.get() : null;
- if (receiver == null) {
- if (LOGV) {
- Log.i(TAG, "measurements dropped because receiver is null! wasted effort");
- }
- return;
- }
- receiver.updateDetails(this, details);
+ private void invalidate() {
+ mMeasurementHandler.sendEmptyMessage(MeasurementHandler.MSG_INVALIDATE);
}
private static class StatsObserver extends IPackageStatsObserver.Stub {
- private final boolean mIsInternal;
+ private final boolean mIsPrivate;
private final MeasurementDetails mDetails;
private final int mCurrentUser;
private final Message mFinished;
private int mRemaining;
- public StatsObserver(boolean isInternal, MeasurementDetails details, int currentUser,
+ public StatsObserver(boolean isPrivate, MeasurementDetails details, int currentUser,
Message finished, int remaining) {
- mIsInternal = isInternal;
+ mIsPrivate = isPrivate;
mDetails = details;
mCurrentUser = currentUser;
mFinished = finished;
@@ -245,7 +205,7 @@
}
private void addStatsLocked(PackageStats stats) {
- if (mIsInternal) {
+ if (mIsPrivate) {
long codeSize = stats.codeSize;
long dataSize = stats.dataSize;
long cacheSize = stats.cacheSize;
@@ -279,6 +239,17 @@
}
}
+ private class MainHandler extends Handler {
+ @Override
+ public void handleMessage(Message msg) {
+ final MeasurementDetails details = (MeasurementDetails) msg.obj;
+ final MeasurementReceiver receiver = (mReceiver != null) ? mReceiver.get() : null;
+ if (receiver != null) {
+ receiver.onDetailsChanged(details);
+ }
+ }
+ }
+
private class MeasurementHandler extends Handler {
public static final int MSG_MEASURE = 1;
public static final int MSG_CONNECTED = 2;
@@ -294,8 +265,6 @@
private MeasurementDetails mCached;
- private final WeakReference<Context> mContext;
-
private final ServiceConnection mDefContainerConn = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
@@ -313,9 +282,8 @@
}
};
- public MeasurementHandler(Context context, Looper looper) {
+ public MeasurementHandler(Looper looper) {
super(looper);
- mContext = new WeakReference<Context>(context);
}
@Override
@@ -323,50 +291,39 @@
switch (msg.what) {
case MSG_MEASURE: {
if (mCached != null) {
- sendExactUpdate(mCached);
+ mMainHandler.obtainMessage(0, mCached).sendToTarget();
break;
}
- final Context context = (mContext != null) ? mContext.get() : null;
- if (context == null) {
- return;
- }
-
synchronized (mLock) {
if (mBound) {
removeMessages(MSG_DISCONNECT);
sendMessage(obtainMessage(MSG_CONNECTED, mDefaultContainer));
} else {
Intent service = new Intent().setComponent(DEFAULT_CONTAINER_COMPONENT);
- context.bindServiceAsUser(service, mDefContainerConn, Context.BIND_AUTO_CREATE,
- UserHandle.OWNER);
+ mContext.bindServiceAsUser(service, mDefContainerConn,
+ Context.BIND_AUTO_CREATE, UserHandle.OWNER);
}
}
break;
}
case MSG_CONNECTED: {
- IMediaContainerService imcs = (IMediaContainerService) msg.obj;
- measureApproximateStorage(imcs);
+ final IMediaContainerService imcs = (IMediaContainerService) msg.obj;
measureExactStorage(imcs);
break;
}
case MSG_DISCONNECT: {
synchronized (mLock) {
if (mBound) {
- final Context context = (mContext != null) ? mContext.get() : null;
- if (context == null) {
- return;
- }
-
mBound = false;
- context.unbindService(mDefContainerConn);
+ mContext.unbindService(mDefContainerConn);
}
}
break;
}
case MSG_COMPLETED: {
mCached = (MeasurementDetails) msg.obj;
- sendExactUpdate(mCached);
+ mMainHandler.obtainMessage(0, mCached).sendToTarget();
break;
}
case MSG_INVALIDATE: {
@@ -375,88 +332,75 @@
}
}
}
+ }
- private void measureApproximateStorage(IMediaContainerService imcs) {
- final String path = mVolume != null ? mVolume.getPath()
- : Environment.getDataDirectory().getPath();
- try {
- final long[] stats = imcs.getFileSystemStats(path);
- mTotalSize = stats[0];
- mAvailSize = stats[1];
- } catch (Exception e) {
- Log.w(TAG, "Problem in container service", e);
- }
+ private void measureExactStorage(IMediaContainerService imcs) {
+ final UserManager userManager = mContext.getSystemService(UserManager.class);
+ final PackageManager packageManager = mContext.getPackageManager();
- sendInternalApproximateUpdate();
- }
+ final List<UserInfo> users = userManager.getUsers();
+ final int currentUser = ActivityManager.getCurrentUser();
- private void measureExactStorage(IMediaContainerService imcs) {
- final Context context = mContext != null ? mContext.get() : null;
- if (context == null) {
- return;
- }
+ final MeasurementDetails details = new MeasurementDetails();
+ final Message finished = mMeasurementHandler.obtainMessage(MeasurementHandler.MSG_COMPLETED,
+ details);
- final MeasurementDetails details = new MeasurementDetails();
- final Message finished = obtainMessage(MSG_COMPLETED, details);
-
- details.totalSize = mTotalSize;
- details.availSize = mAvailSize;
-
- final UserManager userManager = (UserManager) context.getSystemService(
- Context.USER_SERVICE);
- final List<UserInfo> users = userManager.getUsers();
-
- final int currentUser = ActivityManager.getCurrentUser();
- final UserEnvironment currentEnv = new UserEnvironment(currentUser);
+ if (mSharedVolume != null && mSharedVolume.state == VolumeInfo.STATE_MOUNTED) {
+ final File basePath = mSharedVolume.getPathForUser(currentUser);
// Measure media types for emulated storage, or for primary physical
// external volume
- final boolean measureMedia = (mIsInternal && Environment.isExternalStorageEmulated())
- || mIsPrimary;
- if (measureMedia) {
- for (String type : sMeasureMediaTypes) {
- final File path = currentEnv.getExternalStoragePublicDirectory(type);
- final long size = getDirectorySize(imcs, path);
- details.mediaSize.put(type, size);
- }
+ for (String type : sMeasureMediaTypes) {
+ final File path = new File(basePath, type);
+ final long size = getDirectorySize(imcs, path);
+ details.mediaSize.put(type, size);
}
// Measure misc files not counted under media
- if (measureMedia) {
- final File path = mIsInternal ? currentEnv.getExternalStorageDirectory()
- : mVolume.getPathFile();
- details.miscSize = measureMisc(imcs, path);
- }
+ details.miscSize = measureMisc(imcs, basePath);
- // Measure total emulated storage of all users; internal apps data
- // will be spliced in later
- for (UserInfo user : users) {
- final UserEnvironment userEnv = new UserEnvironment(user.id);
- final long size = getDirectorySize(imcs, userEnv.getExternalStorageDirectory());
- addValue(details.usersSize, user.id, size);
- }
-
- // Measure all apps for all users
- final PackageManager pm = context.getPackageManager();
- if (mIsInternal || mIsPrimary) {
- final List<ApplicationInfo> apps = pm.getInstalledApplications(
- PackageManager.GET_UNINSTALLED_PACKAGES
- | PackageManager.GET_DISABLED_COMPONENTS);
-
- final int count = users.size() * apps.size();
- final StatsObserver observer = new StatsObserver(
- mIsInternal, details, currentUser, finished, count);
-
+ if (mSharedVolume.type == VolumeInfo.TYPE_EMULATED) {
+ // Measure total emulated storage of all users; internal apps data
+ // will be spliced in later
for (UserInfo user : users) {
- for (ApplicationInfo app : apps) {
- pm.getPackageSizeInfo(app.packageName, user.id, observer);
- }
+ final File userPath = mSharedVolume.getPathForUser(user.id);
+ final long size = getDirectorySize(imcs, userPath);
+ addValue(details.usersSize, user.id, size);
}
-
- } else {
- finished.sendToTarget();
}
}
+
+ // Measure all apps hosted on this volume for all users
+ if (mVolume.type == VolumeInfo.TYPE_PRIVATE) {
+ final List<ApplicationInfo> apps = packageManager.getInstalledApplications(
+ PackageManager.GET_UNINSTALLED_PACKAGES
+ | PackageManager.GET_DISABLED_COMPONENTS);
+
+ final List<ApplicationInfo> volumeApps = new ArrayList<>();
+ for (ApplicationInfo app : apps) {
+ if (Objects.equals(app.volumeUuid, mVolume.fsUuid)) {
+ volumeApps.add(app);
+ }
+ }
+
+ final int count = users.size() * volumeApps.size();
+ if (count == 0) {
+ finished.sendToTarget();
+ return;
+ }
+
+ final StatsObserver observer = new StatsObserver(
+ true, details, currentUser, finished, count);
+ for (UserInfo user : users) {
+ for (ApplicationInfo app : volumeApps) {
+ packageManager.getPackageSizeInfo(app.packageName, user.id, observer);
+ }
+ }
+
+ } else {
+ finished.sendToTarget();
+ return;
+ }
}
private static long getDirectorySize(IMediaContainerService imcs, File path) {
@@ -471,64 +415,26 @@
}
private long measureMisc(IMediaContainerService imcs, File dir) {
- mFileInfoForMisc = new ArrayList<FileInfo>();
-
final File[] files = dir.listFiles();
- if (files == null) return 0;
+ if (ArrayUtils.isEmpty(files)) return 0;
// Get sizes of all top level nodes except the ones already computed
- long counter = 0;
long miscSize = 0;
-
for (File file : files) {
- final String path = file.getAbsolutePath();
final String name = file.getName();
if (sMeasureMediaTypes.contains(name)) {
continue;
}
if (file.isFile()) {
- final long fileSize = file.length();
- mFileInfoForMisc.add(new FileInfo(path, fileSize, counter++));
- miscSize += fileSize;
+ miscSize += file.length();
} else if (file.isDirectory()) {
- final long dirSize = getDirectorySize(imcs, file);
- mFileInfoForMisc.add(new FileInfo(path, dirSize, counter++));
- miscSize += dirSize;
- } else {
- // Non directory, non file: not listed
+ miscSize += getDirectorySize(imcs, file);
}
}
-
- // sort the list of FileInfo objects collected above in descending order of their sizes
- Collections.sort(mFileInfoForMisc);
-
return miscSize;
}
- static class FileInfo implements Comparable<FileInfo> {
- final String mFileName;
- final long mSize;
- final long mId;
-
- FileInfo(String fileName, long size, long id) {
- mFileName = fileName;
- mSize = size;
- mId = id;
- }
-
- @Override
- public int compareTo(FileInfo that) {
- if (this == that || mSize == that.mSize) return 0;
- else return (mSize < that.mSize) ? 1 : -1; // for descending sort
- }
-
- @Override
- public String toString() {
- return mFileName + " : " + mSize + ", id:" + mId;
- }
- }
-
private static void addValue(SparseLongArray array, int key, long value) {
array.put(key, array.get(key) + value);
}
diff --git a/src/com/android/settings/deviceinfo/StorageSettings.java b/src/com/android/settings/deviceinfo/StorageSettings.java
new file mode 100644
index 0000000..001f00d
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/StorageSettings.java
@@ -0,0 +1,421 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+package com.android.settings.deviceinfo;
+
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.os.UserManager;
+import android.os.storage.StorageEventListener;
+import android.os.storage.StorageManager;
+import android.os.storage.VolumeInfo;
+import android.preference.Preference;
+import android.preference.PreferenceCategory;
+import android.preference.PreferenceScreen;
+import android.provider.DocumentsContract;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.widget.Toast;
+
+import com.android.internal.logging.MetricsLogger;
+import com.android.settings.R;
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settings.search.Indexable;
+import com.android.settings.search.SearchIndexableRaw;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * Panel showing both internal storage (both built-in storage and private
+ * volumes) and removable storage (public volumes).
+ */
+public class StorageSettings extends SettingsPreferenceFragment implements Indexable {
+ static final String TAG = "StorageSettings";
+
+ // TODO: badging to indicate devices running low on storage
+ // TODO: show currently ejected private volumes
+
+ public static final String EXTRA_VOLUME_ID = "volume_id";
+
+ private static final String DOCUMENT_AUTHORITY = "com.android.externalstorage.documents";
+ private static final String DOCUMENT_ROOT_PRIMARY_EMULATED = "primary";
+
+ /**
+ * Build an intent to browse the contents of given {@link VolumeInfo}.
+ */
+ public static Intent buildBrowseIntent(VolumeInfo vol) {
+ final Uri uri;
+ if (vol.type == VolumeInfo.TYPE_PUBLIC) {
+ uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY, vol.fsUuid);
+ } else if (VolumeInfo.ID_EMULATED_INTERNAL.equals(vol.id)) {
+ uri = DocumentsContract.buildRootUri(DOCUMENT_AUTHORITY,
+ DOCUMENT_ROOT_PRIMARY_EMULATED);
+ } else if (vol.type == VolumeInfo.TYPE_EMULATED) {
+ // TODO: build intent once supported
+ uri = null;
+ } else {
+ throw new IllegalArgumentException();
+ }
+
+ final Intent intent = new Intent(DocumentsContract.ACTION_BROWSE_DOCUMENT_ROOT);
+ intent.addCategory(Intent.CATEGORY_DEFAULT);
+ intent.setData(uri);
+ return intent;
+ }
+
+ private UserManager mUserManager;
+ private StorageManager mStorageManager;
+
+ private PreferenceCategory mInternalCategory;
+ private PreferenceCategory mExternalCategory;
+
+ @Override
+ protected int getMetricsCategory() {
+ return MetricsLogger.DEVICEINFO_STORAGE;
+ }
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ final Context context = getActivity();
+
+ mUserManager = context.getSystemService(UserManager.class);
+
+ mStorageManager = context.getSystemService(StorageManager.class);
+ mStorageManager.registerListener(mStorageListener);
+
+ addPreferencesFromResource(R.xml.device_info_storage);
+
+ mInternalCategory = (PreferenceCategory) findPreference("storage_internal");
+ mExternalCategory = (PreferenceCategory) findPreference("storage_external");
+
+ // TODO: if only one volume visible, shortcut into it
+
+ setHasOptionsMenu(true);
+ }
+
+ private static final Comparator<VolumeInfo> sVolumeComparator = new Comparator<VolumeInfo>() {
+ @Override
+ public int compare(VolumeInfo lhs, VolumeInfo rhs) {
+ if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(lhs.id)) {
+ return -1;
+ } else if (lhs.getDescription() == null) {
+ return 1;
+ } else {
+ return lhs.getDescription().compareTo(rhs.getDescription());
+ }
+ }
+ };
+
+ private final StorageEventListener mStorageListener = new StorageEventListener() {
+ @Override
+ public void onVolumeStateChanged(VolumeInfo vol, int oldState, int newState) {
+ if (isInteresting(vol)) {
+ refresh();
+ }
+ }
+ };
+
+ private static boolean isInteresting(VolumeInfo vol) {
+ return vol.type == VolumeInfo.TYPE_PRIVATE || vol.type == VolumeInfo.TYPE_PUBLIC;
+ }
+
+ private void refresh() {
+ final Context context = getActivity();
+
+ getPreferenceScreen().removeAll();
+ mInternalCategory.removeAll();
+ mExternalCategory.removeAll();
+
+ final List<VolumeInfo> volumes = mStorageManager.getVolumes();
+ Collections.sort(volumes, sVolumeComparator);
+
+ for (VolumeInfo vol : volumes) {
+ if (vol.type == VolumeInfo.TYPE_PRIVATE) {
+ mInternalCategory.addPreference(new StorageVolumePreference(context, vol));
+ } else if (vol.type == VolumeInfo.TYPE_PUBLIC) {
+ mExternalCategory.addPreference(new StorageVolumePreference(context, vol));
+ }
+ }
+
+ if (mInternalCategory.getPreferenceCount() > 0) {
+ getPreferenceScreen().addPreference(mInternalCategory);
+ }
+ if (mExternalCategory.getPreferenceCount() > 0) {
+ getPreferenceScreen().addPreference(mExternalCategory);
+ }
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ mStorageManager.registerListener(mStorageListener);
+ refresh();
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ mStorageManager.unregisterListener(mStorageListener);
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ inflater.inflate(R.menu.storage, menu);
+ }
+
+ @Override
+ public void onPrepareOptionsMenu(Menu menu) {
+ final MenuItem usb = menu.findItem(R.id.storage_usb);
+
+ usb.setVisible(!mUserManager.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER));
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.storage_usb:
+ startFragment(this, UsbSettings.class.getCanonicalName(),
+ R.string.storage_title_usb, 0, null);
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference pref) {
+ final String volId = pref.getKey();
+ final VolumeInfo vol = mStorageManager.findVolumeById(volId);
+ if (vol == null) {
+ return false;
+
+ } else if (vol.type == VolumeInfo.TYPE_PRIVATE) {
+ final Bundle args = new Bundle();
+ args.putString(EXTRA_VOLUME_ID, volId);
+ startFragment(this, PrivateVolumeSettings.class.getCanonicalName(),
+ -1, 0, args);
+ return true;
+
+ } else if (vol.type == VolumeInfo.TYPE_PUBLIC) {
+ if (vol.state == VolumeInfo.STATE_MOUNTED) {
+ final Intent intent = buildBrowseIntent(vol);
+ startActivity(intent);
+ return true;
+ } else {
+ final Bundle args = new Bundle();
+ args.putString(EXTRA_VOLUME_ID, volId);
+ startFragment(this, PublicVolumeSettings.class.getCanonicalName(),
+ -1, 0, args);
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static class MountTask extends AsyncTask<Void, Void, Exception> {
+ private final Context mContext;
+ private final StorageManager mStorageManager;
+ private final String mVolumeId;
+ private final String mDescription;
+
+ public MountTask(Context context, String volumeId) {
+ mContext = context.getApplicationContext();
+ mStorageManager = mContext.getSystemService(StorageManager.class);
+ mVolumeId = volumeId;
+ mDescription = mStorageManager.getBestVolumeDescription(mVolumeId);
+ }
+
+ @Override
+ protected Exception doInBackground(Void... params) {
+ try {
+ mStorageManager.mount(mVolumeId);
+ return null;
+ } catch (Exception e) {
+ return e;
+ }
+ }
+
+ @Override
+ protected void onPostExecute(Exception e) {
+ if (e == null) {
+ Toast.makeText(mContext, mContext.getString(R.string.storage_mount_success,
+ mDescription), Toast.LENGTH_SHORT).show();
+ } else {
+ Log.e(TAG, "Failed to mount " + mVolumeId, e);
+ Toast.makeText(mContext, mContext.getString(R.string.storage_mount_failure,
+ mDescription), Toast.LENGTH_SHORT).show();
+ }
+ }
+ }
+
+ public static class UnmountTask extends AsyncTask<Void, Void, Exception> {
+ private final Context mContext;
+ private final StorageManager mStorageManager;
+ private final String mVolumeId;
+ private final String mDescription;
+
+ public UnmountTask(Context context, String volumeId) {
+ mContext = context.getApplicationContext();
+ mStorageManager = mContext.getSystemService(StorageManager.class);
+ mVolumeId = volumeId;
+ mDescription = mStorageManager.getBestVolumeDescription(mVolumeId);
+ }
+
+ @Override
+ protected Exception doInBackground(Void... params) {
+ try {
+ mStorageManager.unmount(mVolumeId);
+ return null;
+ } catch (Exception e) {
+ return e;
+ }
+ }
+
+ @Override
+ protected void onPostExecute(Exception e) {
+ if (e == null) {
+ Toast.makeText(mContext, mContext.getString(R.string.storage_unmount_success,
+ mDescription), Toast.LENGTH_SHORT).show();
+ } else {
+ Log.e(TAG, "Failed to unmount " + mVolumeId, e);
+ Toast.makeText(mContext, mContext.getString(R.string.storage_unmount_failure,
+ mDescription), Toast.LENGTH_SHORT).show();
+ }
+ }
+ }
+
+ public static class FormatTask extends AsyncTask<Void, Void, Exception> {
+ private final Context mContext;
+ private final StorageManager mStorageManager;
+ private final String mVolumeId;
+ private final String mDescription;
+
+ public FormatTask(Context context, String volumeId) {
+ mContext = context.getApplicationContext();
+ mStorageManager = mContext.getSystemService(StorageManager.class);
+ mVolumeId = volumeId;
+ mDescription = mStorageManager.getBestVolumeDescription(mVolumeId);
+ }
+
+ @Override
+ protected Exception doInBackground(Void... params) {
+ try {
+ mStorageManager.format(mVolumeId);
+ mStorageManager.mount(mVolumeId);
+ return null;
+ } catch (Exception e) {
+ return e;
+ }
+ }
+
+ @Override
+ protected void onPostExecute(Exception e) {
+ if (e == null) {
+ Toast.makeText(mContext, mContext.getString(R.string.storage_format_success,
+ mDescription), Toast.LENGTH_SHORT).show();
+ } else {
+ Log.e(TAG, "Failed to format " + mVolumeId, e);
+ Toast.makeText(mContext, mContext.getString(R.string.storage_format_failure,
+ mDescription), Toast.LENGTH_SHORT).show();
+ }
+ }
+ }
+
+ /**
+ * Enable indexing of searchable data
+ */
+ public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+ new BaseSearchIndexProvider() {
+ @Override
+ public List<SearchIndexableRaw> getRawDataToIndex(Context context, boolean enabled) {
+ final List<SearchIndexableRaw> result = new ArrayList<SearchIndexableRaw>();
+
+ SearchIndexableRaw data = new SearchIndexableRaw(context);
+ data.title = context.getString(R.string.storage_settings);
+ data.screenTitle = context.getString(R.string.storage_settings);
+ result.add(data);
+
+ data = new SearchIndexableRaw(context);
+ data.title = context.getString(R.string.internal_storage);
+ data.screenTitle = context.getString(R.string.storage_settings);
+ result.add(data);
+
+ data = new SearchIndexableRaw(context);
+ final StorageManager storage = context.getSystemService(StorageManager.class);
+ final List<VolumeInfo> vols = storage.getVolumes();
+ for (VolumeInfo vol : vols) {
+ if (isInteresting(vol)) {
+ data.title = storage.getBestVolumeDescription(vol.id);
+ data.screenTitle = context.getString(R.string.storage_settings);
+ result.add(data);
+ }
+ }
+
+ data = new SearchIndexableRaw(context);
+ data.title = context.getString(R.string.memory_size);
+ data.screenTitle = context.getString(R.string.storage_settings);
+ result.add(data);
+
+ data = new SearchIndexableRaw(context);
+ data.title = context.getString(R.string.memory_available);
+ data.screenTitle = context.getString(R.string.storage_settings);
+ result.add(data);
+
+ data = new SearchIndexableRaw(context);
+ data.title = context.getString(R.string.memory_apps_usage);
+ data.screenTitle = context.getString(R.string.storage_settings);
+ result.add(data);
+
+ data = new SearchIndexableRaw(context);
+ data.title = context.getString(R.string.memory_dcim_usage);
+ data.screenTitle = context.getString(R.string.storage_settings);
+ result.add(data);
+
+ data = new SearchIndexableRaw(context);
+ data.title = context.getString(R.string.memory_music_usage);
+ data.screenTitle = context.getString(R.string.storage_settings);
+ result.add(data);
+
+ data = new SearchIndexableRaw(context);
+ data.title = context.getString(R.string.memory_downloads_usage);
+ data.screenTitle = context.getString(R.string.storage_settings);
+ result.add(data);
+
+ data = new SearchIndexableRaw(context);
+ data.title = context.getString(R.string.memory_media_cache_usage);
+ data.screenTitle = context.getString(R.string.storage_settings);
+ result.add(data);
+
+ data = new SearchIndexableRaw(context);
+ data.title = context.getString(R.string.memory_media_misc_usage);
+ data.screenTitle = context.getString(R.string.storage_settings);
+ result.add(data);
+
+ return result;
+ }
+ };
+}
diff --git a/src/com/android/settings/deviceinfo/StorageVolumePreference.java b/src/com/android/settings/deviceinfo/StorageVolumePreference.java
new file mode 100644
index 0000000..fbe34f6
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/StorageVolumePreference.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+package com.android.settings.deviceinfo;
+
+import android.content.Context;
+import android.os.storage.StorageManager;
+import android.os.storage.VolumeInfo;
+import android.preference.Preference;
+import android.text.format.Formatter;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.TextView;
+
+import com.android.settings.R;
+import com.android.settings.deviceinfo.StorageSettings.UnmountTask;
+
+import java.io.File;
+
+/**
+ * Preference line representing a single {@link VolumeInfo}, possibly including
+ * quick actions like unmounting.
+ */
+public class StorageVolumePreference extends Preference {
+ private final StorageManager mStorageManager;
+ private final VolumeInfo mVolume;
+
+ public StorageVolumePreference(Context context, VolumeInfo volume) {
+ super(context);
+
+ mStorageManager = context.getSystemService(StorageManager.class);
+ mVolume = volume;
+
+ setKey(volume.id);
+ setTitle(mStorageManager.getBestVolumeDescription(volume.id));
+
+ switch (volume.state) {
+ case VolumeInfo.STATE_MOUNTED:
+ // TODO: move statfs() to background thread
+ final File path = new File(volume.path);
+ final String free = Formatter.formatFileSize(context, path.getFreeSpace());
+ final String total = Formatter.formatFileSize(context, path.getTotalSpace());
+ setSummary(context.getString(R.string.storage_volume_summary, free, total));
+ break;
+ }
+
+ // TODO: better icons
+ if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(volume.id)) {
+ setIcon(context.getDrawable(R.drawable.ic_settings_storage));
+ } else {
+ setIcon(context.getDrawable(R.drawable.ic_sim_sd));
+ }
+
+ if (volume.type == VolumeInfo.TYPE_PUBLIC && volume.state == VolumeInfo.STATE_MOUNTED) {
+ setWidgetLayoutResource(R.layout.preference_storage_action);
+ }
+ }
+
+ @Override
+ protected void onBindView(View view) {
+ final TextView unmount = (TextView) view.findViewById(R.id.unmount);
+ if (unmount != null) {
+ unmount.setText("\u23CF");
+ unmount.setOnClickListener(mUnmountListener);
+ }
+
+ super.onBindView(view);
+ }
+
+ private final View.OnClickListener mUnmountListener = new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ new UnmountTask(getContext(), mVolume.id).execute();
+ }
+ };
+}
diff --git a/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java b/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java
deleted file mode 100644
index a98f8d9..0000000
--- a/src/com/android/settings/deviceinfo/StorageVolumePreferenceCategory.java
+++ /dev/null
@@ -1,483 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.settings.deviceinfo;
-
-import android.app.ActivityManagerNative;
-import android.app.ActivityThread;
-import android.app.DownloadManager;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.IPackageManager;
-import android.content.pm.UserInfo;
-import android.content.res.Resources;
-import android.hardware.usb.UsbManager;
-import android.os.Environment;
-import android.os.Handler;
-import android.os.Message;
-import android.os.RemoteException;
-import android.os.UserManager;
-import android.os.storage.StorageManager;
-import android.os.storage.StorageVolume;
-import android.preference.Preference;
-import android.preference.PreferenceCategory;
-import android.provider.MediaStore;
-import android.text.format.Formatter;
-
-import com.android.settings.R;
-import com.android.settings.Settings;
-import com.android.settings.deviceinfo.StorageMeasurement.MeasurementDetails;
-import com.android.settings.deviceinfo.StorageMeasurement.MeasurementReceiver;
-import com.google.android.collect.Lists;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-public class StorageVolumePreferenceCategory extends PreferenceCategory {
- public static final String KEY_CACHE = "cache";
-
- private static final int ORDER_USAGE_BAR = -2;
- private static final int ORDER_STORAGE_LOW = -1;
-
- /** Physical volume being measured, or {@code null} for internal. */
- private final StorageVolume mVolume;
- private final StorageMeasurement mMeasure;
-
- private final Resources mResources;
- private final StorageManager mStorageManager;
- private final UserManager mUserManager;
-
- private UsageBarPreference mUsageBarPreference;
- private Preference mMountTogglePreference;
- private Preference mFormatPreference;
- private Preference mStorageLow;
-
- private StorageItemPreference mItemTotal;
- private StorageItemPreference mItemAvailable;
- private StorageItemPreference mItemApps;
- private StorageItemPreference mItemDcim;
- private StorageItemPreference mItemMusic;
- private StorageItemPreference mItemDownloads;
- private StorageItemPreference mItemCache;
- private StorageItemPreference mItemMisc;
- private List<StorageItemPreference> mItemUsers = Lists.newArrayList();
-
- private boolean mUsbConnected;
- private String mUsbFunction;
-
- private long mTotalSize;
-
- private static final int MSG_UI_UPDATE_APPROXIMATE = 1;
- private static final int MSG_UI_UPDATE_DETAILS = 2;
-
- private Handler mUpdateHandler = new Handler() {
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case MSG_UI_UPDATE_APPROXIMATE: {
- final long[] size = (long[]) msg.obj;
- updateApproximate(size[0], size[1]);
- break;
- }
- case MSG_UI_UPDATE_DETAILS: {
- final MeasurementDetails details = (MeasurementDetails) msg.obj;
- updateDetails(details);
- break;
- }
- }
- }
- };
-
- /**
- * Build category to summarize internal storage, including any emulated
- * {@link StorageVolume}.
- */
- public static StorageVolumePreferenceCategory buildForInternal(Context context) {
- return new StorageVolumePreferenceCategory(context, null);
- }
-
- /**
- * Build category to summarize specific physical {@link StorageVolume}.
- */
- public static StorageVolumePreferenceCategory buildForPhysical(
- Context context, StorageVolume volume) {
- return new StorageVolumePreferenceCategory(context, volume);
- }
-
- private StorageVolumePreferenceCategory(Context context, StorageVolume volume) {
- super(context);
-
- mVolume = volume;
- mMeasure = StorageMeasurement.getInstance(context, volume);
-
- mResources = context.getResources();
- mStorageManager = StorageManager.from(context);
- mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
-
- setTitle(volume != null ? volume.getDescription(context)
- : context.getText(R.string.internal_storage));
- }
-
- private StorageItemPreference buildItem(int titleRes, int colorRes) {
- return new StorageItemPreference(getContext(), titleRes, colorRes);
- }
-
- public void init() {
- final Context context = getContext();
-
- removeAll();
-
- final UserInfo currentUser;
- try {
- currentUser = ActivityManagerNative.getDefault().getCurrentUser();
- } catch (RemoteException e) {
- throw new RuntimeException("Failed to get current user");
- }
-
- final List<UserInfo> otherUsers = getUsersExcluding(currentUser);
- final boolean showUsers = mVolume == null && otherUsers.size() > 0;
-
- mUsageBarPreference = new UsageBarPreference(context);
- mUsageBarPreference.setOrder(ORDER_USAGE_BAR);
- addPreference(mUsageBarPreference);
-
- mItemTotal = buildItem(R.string.memory_size, 0);
- mItemAvailable = buildItem(R.string.memory_available, R.color.memory_avail);
- addPreference(mItemTotal);
- addPreference(mItemAvailable);
-
- mItemApps = buildItem(R.string.memory_apps_usage, R.color.memory_apps_usage);
- mItemDcim = buildItem(R.string.memory_dcim_usage, R.color.memory_dcim);
- mItemMusic = buildItem(R.string.memory_music_usage, R.color.memory_music);
- mItemDownloads = buildItem(R.string.memory_downloads_usage, R.color.memory_downloads);
- mItemCache = buildItem(R.string.memory_media_cache_usage, R.color.memory_cache);
- mItemMisc = buildItem(R.string.memory_media_misc_usage, R.color.memory_misc);
-
- mItemCache.setKey(KEY_CACHE);
-
- final boolean showDetails = mVolume == null || mVolume.isPrimary();
- if (showDetails) {
- if (showUsers) {
- addPreference(new PreferenceHeader(context, currentUser.name));
- }
-
- addPreference(mItemApps);
- addPreference(mItemDcim);
- addPreference(mItemMusic);
- addPreference(mItemDownloads);
- addPreference(mItemCache);
- addPreference(mItemMisc);
-
- if (showUsers) {
- addPreference(new PreferenceHeader(context, R.string.storage_other_users));
-
- int count = 0;
- for (UserInfo info : otherUsers) {
- final int colorRes = count++ % 2 == 0 ? R.color.memory_user_light
- : R.color.memory_user_dark;
- final StorageItemPreference userPref = new StorageItemPreference(
- getContext(), info.name, colorRes, info.id);
- mItemUsers.add(userPref);
- addPreference(userPref);
- }
- }
- }
-
- final boolean isRemovable = mVolume != null ? mVolume.isRemovable() : false;
- // Always create the preference since many code rely on it existing
- mMountTogglePreference = new Preference(context);
- if (isRemovable) {
- mMountTogglePreference.setTitle(R.string.sd_eject);
- mMountTogglePreference.setSummary(R.string.sd_eject_summary);
- addPreference(mMountTogglePreference);
- }
-
- final boolean allowFormat = mVolume != null;
- if (allowFormat) {
- mFormatPreference = new Preference(context);
- mFormatPreference.setTitle(R.string.sd_format);
- mFormatPreference.setSummary(R.string.sd_format_summary);
- addPreference(mFormatPreference);
- }
-
- final IPackageManager pm = ActivityThread.getPackageManager();
- try {
- if (pm.isStorageLow()) {
- mStorageLow = new Preference(context);
- mStorageLow.setOrder(ORDER_STORAGE_LOW);
- mStorageLow.setTitle(R.string.storage_low_title);
- mStorageLow.setSummary(R.string.storage_low_summary);
- addPreference(mStorageLow);
- } else if (mStorageLow != null) {
- removePreference(mStorageLow);
- mStorageLow = null;
- }
- } catch (RemoteException e) {
- }
- }
-
- public StorageVolume getStorageVolume() {
- return mVolume;
- }
-
- private void updatePreferencesFromState() {
- // Only update for physical volumes
- if (mVolume == null) return;
-
- mMountTogglePreference.setEnabled(true);
-
- final String state = mStorageManager.getVolumeState(mVolume.getPath());
-
- if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
- mItemAvailable.setTitle(R.string.memory_available_read_only);
- } else {
- mItemAvailable.setTitle(R.string.memory_available);
- }
-
- if (Environment.MEDIA_MOUNTED.equals(state)
- || Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
- mMountTogglePreference.setEnabled(true);
- mMountTogglePreference.setTitle(mResources.getString(R.string.sd_eject));
- mMountTogglePreference.setSummary(mResources.getString(R.string.sd_eject_summary));
- addPreference(mUsageBarPreference);
- addPreference(mItemTotal);
- addPreference(mItemAvailable);
- } else {
- if (Environment.MEDIA_UNMOUNTED.equals(state) || Environment.MEDIA_NOFS.equals(state)
- || Environment.MEDIA_UNMOUNTABLE.equals(state)) {
- mMountTogglePreference.setEnabled(true);
- mMountTogglePreference.setTitle(mResources.getString(R.string.sd_mount));
- mMountTogglePreference.setSummary(mResources.getString(R.string.sd_mount_summary));
- } else {
- mMountTogglePreference.setEnabled(false);
- mMountTogglePreference.setTitle(mResources.getString(R.string.sd_mount));
- mMountTogglePreference.setSummary(mResources.getString(R.string.sd_insert_summary));
- }
-
- removePreference(mUsageBarPreference);
- removePreference(mItemTotal);
- removePreference(mItemAvailable);
- }
-
- if (mUsbConnected && (UsbManager.USB_FUNCTION_MTP.equals(mUsbFunction) ||
- UsbManager.USB_FUNCTION_PTP.equals(mUsbFunction))) {
- mMountTogglePreference.setEnabled(false);
- if (Environment.MEDIA_MOUNTED.equals(state)
- || Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
- mMountTogglePreference.setSummary(
- mResources.getString(R.string.mtp_ptp_mode_summary));
- }
-
- if (mFormatPreference != null) {
- mFormatPreference.setEnabled(false);
- mFormatPreference.setSummary(mResources.getString(R.string.mtp_ptp_mode_summary));
- }
- } else if (mFormatPreference != null) {
- mFormatPreference.setEnabled(mMountTogglePreference.isEnabled());
- mFormatPreference.setSummary(mResources.getString(R.string.sd_format_summary));
- }
- }
-
- public void updateApproximate(long totalSize, long availSize) {
- mItemTotal.setSummary(formatSize(totalSize));
- mItemAvailable.setSummary(formatSize(availSize));
-
- mTotalSize = totalSize;
-
- final long usedSize = totalSize - availSize;
-
- mUsageBarPreference.clear();
- mUsageBarPreference.addEntry(0, usedSize / (float) totalSize, android.graphics.Color.GRAY);
- mUsageBarPreference.commit();
-
- updatePreferencesFromState();
- }
-
- private static long totalValues(HashMap<String, Long> map, String... keys) {
- long total = 0;
- for (String key : keys) {
- if (map.containsKey(key)) {
- total += map.get(key);
- }
- }
- return total;
- }
-
- public void updateDetails(MeasurementDetails details) {
- final boolean showDetails = mVolume == null || mVolume.isPrimary();
- if (!showDetails) return;
-
- // Count caches as available space, since system manages them
- mItemTotal.setSummary(formatSize(details.totalSize));
- mItemAvailable.setSummary(formatSize(details.availSize));
-
- mUsageBarPreference.clear();
-
- updatePreference(mItemApps, details.appsSize);
-
- final long dcimSize = totalValues(details.mediaSize, Environment.DIRECTORY_DCIM,
- Environment.DIRECTORY_MOVIES, Environment.DIRECTORY_PICTURES);
- updatePreference(mItemDcim, dcimSize);
-
- final long musicSize = totalValues(details.mediaSize, Environment.DIRECTORY_MUSIC,
- Environment.DIRECTORY_ALARMS, Environment.DIRECTORY_NOTIFICATIONS,
- Environment.DIRECTORY_RINGTONES, Environment.DIRECTORY_PODCASTS);
- updatePreference(mItemMusic, musicSize);
-
- final long downloadsSize = totalValues(details.mediaSize, Environment.DIRECTORY_DOWNLOADS);
- updatePreference(mItemDownloads, downloadsSize);
-
- updatePreference(mItemCache, details.cacheSize);
- updatePreference(mItemMisc, details.miscSize);
-
- for (StorageItemPreference userPref : mItemUsers) {
- final long userSize = details.usersSize.get(userPref.userHandle);
- updatePreference(userPref, userSize);
- }
-
- mUsageBarPreference.commit();
- }
-
- private void updatePreference(StorageItemPreference pref, long size) {
- if (size > 0) {
- pref.setSummary(formatSize(size));
- final int order = pref.getOrder();
- mUsageBarPreference.addEntry(order, size / (float) mTotalSize, pref.color);
- } else {
- removePreference(pref);
- }
- }
-
- private void measure() {
- mMeasure.invalidate();
- mMeasure.measure();
- }
-
- public void onResume() {
- mMeasure.setReceiver(mReceiver);
- measure();
- }
-
- public void onStorageStateChanged() {
- init();
- measure();
- }
-
- public void onUsbStateChanged(boolean isUsbConnected, String usbFunction) {
- mUsbConnected = isUsbConnected;
- mUsbFunction = usbFunction;
- measure();
- }
-
- public void onMediaScannerFinished() {
- measure();
- }
-
- public void onCacheCleared() {
- measure();
- }
-
- public void onPause() {
- mMeasure.cleanUp();
- }
-
- private String formatSize(long size) {
- return Formatter.formatFileSize(getContext(), size);
- }
-
- private MeasurementReceiver mReceiver = new MeasurementReceiver() {
- @Override
- public void updateApproximate(StorageMeasurement meas, long totalSize, long availSize) {
- mUpdateHandler.obtainMessage(MSG_UI_UPDATE_APPROXIMATE, new long[] {
- totalSize, availSize }).sendToTarget();
- }
-
- @Override
- public void updateDetails(StorageMeasurement meas, MeasurementDetails details) {
- mUpdateHandler.obtainMessage(MSG_UI_UPDATE_DETAILS, details).sendToTarget();
- }
- };
-
- public boolean mountToggleClicked(Preference preference) {
- return preference == mMountTogglePreference;
- }
-
- public Intent intentForClick(Preference pref) {
- Intent intent = null;
-
- // TODO The current "delete" story is not fully handled by the respective applications.
- // When it is done, make sure the intent types below are correct.
- // If that cannot be done, remove these intents.
- final String key = pref.getKey();
- if (pref == mFormatPreference) {
- intent = new Intent(Intent.ACTION_VIEW);
- intent.setClass(getContext(), com.android.settings.MediaFormat.class);
- intent.putExtra(StorageVolume.EXTRA_STORAGE_VOLUME, mVolume);
- } else if (pref == mItemApps) {
- intent = new Intent(Intent.ACTION_MANAGE_PACKAGE_STORAGE);
- intent.setClass(getContext(), Settings.ManageApplicationsActivity.class);
- } else if (pref == mItemDownloads) {
- intent = new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS).putExtra(
- DownloadManager.INTENT_EXTRAS_SORT_BY_SIZE, true);
- } else if (pref == mItemMusic) {
- intent = new Intent(Intent.ACTION_GET_CONTENT);
- intent.setType("audio/mp3");
- } else if (pref == mItemDcim) {
- intent = new Intent(Intent.ACTION_VIEW);
- intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
- // TODO Create a Videos category, MediaStore.Video.Media.EXTERNAL_CONTENT_URI
- intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
- } else if (pref == mItemMisc) {
- Context context = getContext().getApplicationContext();
- intent = new Intent(context, MiscFilesHandler.class);
- intent.putExtra(StorageVolume.EXTRA_STORAGE_VOLUME, mVolume);
- }
-
- return intent;
- }
-
- public static class PreferenceHeader extends Preference {
- public PreferenceHeader(Context context, int titleRes) {
- super(context, null, com.android.internal.R.attr.preferenceCategoryStyle);
- setTitle(titleRes);
- }
-
- public PreferenceHeader(Context context, CharSequence title) {
- super(context, null, com.android.internal.R.attr.preferenceCategoryStyle);
- setTitle(title);
- }
-
- @Override
- public boolean isEnabled() {
- return false;
- }
- }
-
- /**
- * Return list of other users, excluding the current user.
- */
- private List<UserInfo> getUsersExcluding(UserInfo excluding) {
- final List<UserInfo> users = mUserManager.getUsers();
- final Iterator<UserInfo> i = users.iterator();
- while (i.hasNext()) {
- if (i.next().id == excluding.id) {
- i.remove();
- }
- }
- return users;
- }
-}
diff --git a/src/com/android/settings/notification/ConditionProviderSettings.java b/src/com/android/settings/notification/ConditionProviderSettings.java
index 259e53c..76576ab 100644
--- a/src/com/android/settings/notification/ConditionProviderSettings.java
+++ b/src/com/android/settings/notification/ConditionProviderSettings.java
@@ -21,8 +21,6 @@
import android.provider.Settings;
import android.service.notification.ConditionProviderService;
-import com.android.settings.R;
-
public class ConditionProviderSettings extends ManagedServiceSettings {
private static final String TAG = ConditionProviderSettings.class.getSimpleName();
private static final Config CONFIG = getConditionProviderConfig();
@@ -34,9 +32,6 @@
c.intentAction = ConditionProviderService.SERVICE_INTERFACE;
c.permission = android.Manifest.permission.BIND_CONDITION_PROVIDER_SERVICE;
c.noun = "condition provider";
- c.warningDialogTitle = R.string.condition_provider_security_warning_title;
- c.warningDialogSummary = R.string.condition_provider_security_warning_summary;
- c.emptyText = R.string.no_condition_providers;
return c;
}
diff --git a/src/com/android/settings/search/Ranking.java b/src/com/android/settings/search/Ranking.java
index f37e1fc..2143d0d 100644
--- a/src/com/android/settings/search/Ranking.java
+++ b/src/com/android/settings/search/Ranking.java
@@ -32,7 +32,7 @@
import com.android.settings.accessibility.AccessibilitySettings;
import com.android.settings.applications.AdvancedAppSettings;
import com.android.settings.bluetooth.BluetoothSettings;
-import com.android.settings.deviceinfo.Memory;
+import com.android.settings.deviceinfo.StorageSettings;
import com.android.settings.deviceinfo.UsbSettings;
import com.android.settings.fuelgauge.BatterySaverSettings;
import com.android.settings.fuelgauge.PowerUsageSummary;
@@ -129,7 +129,7 @@
sRankMap.put(ZenModeAutomationSettings.class.getName(), RANK_NOTIFICATIONS);
// Storage
- sRankMap.put(Memory.class.getName(), RANK_STORAGE);
+ sRankMap.put(StorageSettings.class.getName(), RANK_STORAGE);
sRankMap.put(UsbSettings.class.getName(), RANK_STORAGE);
// Battery
diff --git a/src/com/android/settings/search/SearchIndexableResources.java b/src/com/android/settings/search/SearchIndexableResources.java
index dae8860..b7bb062 100644
--- a/src/com/android/settings/search/SearchIndexableResources.java
+++ b/src/com/android/settings/search/SearchIndexableResources.java
@@ -34,7 +34,7 @@
import com.android.settings.accessibility.AccessibilitySettings;
import com.android.settings.applications.AdvancedAppSettings;
import com.android.settings.bluetooth.BluetoothSettings;
-import com.android.settings.deviceinfo.Memory;
+import com.android.settings.deviceinfo.StorageSettings;
import com.android.settings.deviceinfo.UsbSettings;
import com.android.settings.fuelgauge.BatterySaverSettings;
import com.android.settings.fuelgauge.PowerUsageSummary;
@@ -170,11 +170,11 @@
ZenModePrioritySettings.class.getName(),
R.drawable.ic_settings_notifications));
- sResMap.put(Memory.class.getName(),
+ sResMap.put(StorageSettings.class.getName(),
new SearchIndexableResource(
- Ranking.getRankForClassName(Memory.class.getName()),
+ Ranking.getRankForClassName(StorageSettings.class.getName()),
NO_DATA_RES_ID,
- Memory.class.getName(),
+ StorageSettings.class.getName(),
R.drawable.ic_settings_storage));
sResMap.put(UsbSettings.class.getName(),
diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java
index cc8481d..1503c63 100644
--- a/src/com/android/settings/wifi/WifiConfigController.java
+++ b/src/com/android/settings/wifi/WifiConfigController.java
@@ -88,6 +88,9 @@
public static final int WIFI_EAP_METHOD_TLS = 1;
public static final int WIFI_EAP_METHOD_TTLS = 2;
public static final int WIFI_EAP_METHOD_PWD = 3;
+ public static final int WIFI_EAP_METHOD_SIM = 4;
+ public static final int WIFI_EAP_METHOD_AKA = 5;
+ public static final int WIFI_EAP_METHOD_AKA_PRIME = 6;
/* These values come from "wifi_peap_phase2_entries" resource array */
public static final int WIFI_PEAP_PHASE2_NONE = 0;
@@ -734,9 +737,23 @@
mView.findViewById(R.id.l_anonymous).setVisibility(View.VISIBLE);
setUserCertInvisible();
break;
+ case WIFI_EAP_METHOD_SIM:
+ case WIFI_EAP_METHOD_AKA:
+ case WIFI_EAP_METHOD_AKA_PRIME:
+ setPhase2Invisible();
+ setAnonymousIdentInvisible();
+ setUserCertInvisible();
+ setPasswordInvisible();
+ setIdentityInvisible();
+ break;
}
}
+ private void setIdentityInvisible() {
+ mView.findViewById(R.id.l_identity).setVisibility(View.GONE);
+ mPhase2Spinner.setSelection(Phase2.NONE);
+ }
+
private void setPhase2Invisible() {
mView.findViewById(R.id.l_phase2).setVisibility(View.GONE);
mPhase2Spinner.setSelection(Phase2.NONE);
diff --git a/wrap_alpha.py b/wrap_alpha.py
new file mode 100755
index 0000000..53db4eb
--- /dev/null
+++ b/wrap_alpha.py
@@ -0,0 +1,43 @@
+#!/usr/bin/python
+
+import os
+
+# assume everything needs alpha suffixes
+for root, dirs, files in os.walk('.'):
+ if "res/drawable-" not in root: continue
+
+ for before in files:
+ if "_alpha.png" in before: continue
+ if not before.startswith("ic_settings_"): continue
+
+ after = before.replace(".png", "_alpha.png")
+ os.rename(os.path.join(root, before), os.path.join(root, after))
+
+# build xml redirection
+for root, dirs, files in os.walk('.'):
+ if "res/drawable-" not in root: continue
+
+ for src in files:
+ if not src.endswith(".png"): continue
+ src = src[0:-4]
+
+ src_clause = '\n android:src="@drawable/%s"' % (src)
+
+ alpha = src.endswith("_alpha")
+ if alpha:
+ src = src[0:-6]
+ alpha_clause = '\n android:tint="?android:attr/colorAccent"'
+ else:
+ alpha_clause = ''
+
+ am = src.endswith("_am")
+ if am:
+ src = src[0:-3]
+ am_clause = '\n android:autoMirrored="true"'
+ else:
+ am_clause = ''
+
+ with open("res/drawable/%s.xml" % (src), 'w') as xml:
+ xml.write("""<?xml version="1.0" encoding="utf-8"?>
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"%s%s%s />
+""" % (src_clause, alpha_clause, am_clause))