From 580b7af1a46a74770ba9efbb6fc2f5d6a244d667 Mon Sep 17 00:00:00 2001 From: Alex Johnston Date: Thu, 26 Nov 2020 12:40:38 +0000 Subject: [PATCH] Add request manage credentials to Settings Background * This is part of the work to support a credential management app on unmanaged devices. Changes * Add new activity to Settings to display a screen to the user requesting whether the calling app can manage their KeyChain credentials. * Display the authentication policy Manual Testing * Verify screen is not displayed if intent action is not android.security.MANAGE_CREDENTIALS * Verify screen is not displayed if authentication policy is not valid * Verify button panel is visible if all items in the authentication policy are displayed * Verify button panel is not visible if not all items in the authentication policy are displayed. Verify that scrolling to the bottom of the item list, the button panel becomes visible. Bug: 165641221 Test: Manual testing make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.security.RequestManageCredentialsTest Change-Id: Ie23b226f1a285b3de6ec3e91b8880d9144bb24a3 --- AndroidManifest.xml | 9 + res/layout/app_authentication_item.xml | 50 ++++ res/layout/app_authentication_uri_item.xml | 29 +++ res/layout/request_manage_credentials.xml | 62 +++++ .../request_manage_credentials_header.xml | 42 ++++ res/values/strings.xml | 11 + res/values/styles.xml | 65 ++++++ res/values/themes.xml | 15 ++ .../CredentialManagementAppAdapter.java | 219 ++++++++++++++++++ .../security/RequestManageCredentials.java | 172 ++++++++++++++ .../UriAuthenticationPolicyAdapter.java | 84 +++++++ .../RequestManageCredentialsTest.java | 106 +++++++++ 12 files changed, 864 insertions(+) create mode 100644 res/layout/app_authentication_item.xml create mode 100644 res/layout/app_authentication_uri_item.xml create mode 100644 res/layout/request_manage_credentials.xml create mode 100644 res/layout/request_manage_credentials_header.xml create mode 100644 src/com/android/settings/security/CredentialManagementAppAdapter.java create mode 100644 src/com/android/settings/security/RequestManageCredentials.java create mode 100644 src/com/android/settings/security/UriAuthenticationPolicyAdapter.java create mode 100644 tests/robotests/src/com/android/settings/security/RequestManageCredentialsTest.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index c9f4643ee97..e917b5cb9c2 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1431,6 +1431,15 @@ android:exported="false"> + + + + + + + + + + + + + + + + + + + + + diff --git a/res/layout/app_authentication_uri_item.xml b/res/layout/app_authentication_uri_item.xml new file mode 100644 index 00000000000..202fb5414f9 --- /dev/null +++ b/res/layout/app_authentication_uri_item.xml @@ -0,0 +1,29 @@ + + + + + + + diff --git a/res/layout/request_manage_credentials.xml b/res/layout/request_manage_credentials.xml new file mode 100644 index 00000000000..eb4c9e8fdb1 --- /dev/null +++ b/res/layout/request_manage_credentials.xml @@ -0,0 +1,62 @@ + + + + + + + + + + +