Add credential management app preference to Settings

Background
* This is part of the work to support
  a credential management app on
  unmanaged devices.
Changes
* Add a preference controller which will only
  be enabled if there is a credential management app.
* Add a fragment to display details on the credential
  management app and its policy. Add a remove button
  to remove the credential management app.
* Link CredentialManagementAppAdapter to new fragment
  and add expander.

Manual Testing
* Verify preference is disabled if there is no credential
  management app.
* Verify preference summary shows credential mangement
  app name if a credential management app exists.
* Verify fragment details page displays the
  authentication policy correctly.

Bug: 165641221
Test: Manual testing
      make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.security.CredentialManagementAppFragmentTest
      make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.security.CredentialManagementAppControllerTest
Change-Id: I06d6b88d0c89022f7a6cbf3031834defcb54bd51
This commit is contained in:
Alex Johnston
2020-11-27 21:35:50 +00:00
parent f7d2ec9e7a
commit 672c2aaaec
19 changed files with 940 additions and 12 deletions

View File

@@ -6335,6 +6335,14 @@
<string name="request_manage_credentials_allow">Allow</string>
<!-- Label for floating action button to scroll to the end of the authentication policy list [CHAR LIMIT=30] -->
<string name="request_manage_credentials_more">Show more</string>
<!-- Title of preference for the certificate management app [CHAR LIMIT=30] -->
<string name="certificate_management_app">Certificate management app</string>
<!-- Summary if there is no certificate management app [CHAR_LIMIT=NONE] -->
<string name="no_certificate_management_app">None</string>
<!-- Summary of preference if there is a certificate management app [CHAR LIMIT=NONE] -->
<string name="certificate_management_app_description">Certificates installed by this app identify you to the apps and URLs below</string>
<!-- Label for button to remove the credential management app [CHAR LIMIT=30] -->
<string name="remove_credential_management_app">Remove</string>
<!-- Sound settings screen, setting check box label -->
<string name="emergency_tone_title">Emergency dialing signal</string>

View File

@@ -816,13 +816,13 @@
<style name="RequestManageCredentialsTitle">
<item name="android:layout_marginTop">24dp</item>
<item name="android:textSize">36sp</item>
<item name="android:textColor">#202124</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
<style name="RequestManageCredentialsDescription">
<item name="android:layout_marginTop">24dp</item>
<item name="android:textSize">18sp</item>
<item name="android:textColor">#202124</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
<style name="AppAuthenticationPolicyItem">
@@ -838,12 +838,25 @@
<style name="AppAuthenticationPolicyText">
<item name="android:maxLines">1</item>
<item name="android:textSize">20sp</item>
<item name="android:textColor">#202124</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
<style name="AppAuthenticationPolicyNumberOfUrisText">
<item name="android:layout_marginTop">4dp</item>
<item name="android:textSize">16sp</item>
<item name="android:textColor">?android:attr/textColorSecondary</item>
<item name="android:alpha">0.7</item>
</style>
<style name="AppAuthenticationExpander">
<item name="android:layout_marginTop">24dp</item>
<item name="android:layout_alignParentEnd">true</item>
<item name="android:scaleType">fitEnd</item>
</style>
<style name="AppUriAuthenticationPolicyText">
<item name="android:maxLines">1</item>
<item name="android:textSize">16sp</item>
<item name="android:textColor">#5F6368</item>
<item name="android:textColor">?android:attr/textColorSecondary</item>
</style>
</resources>