Fix default logo is wrong for some apps.

1. Use the new api setComponentNameForConfirmDeviceCredentialActivity()
   to set component name for ConfirmDeviceCredentialActivity to the
   calling activity's info.
   This solves the issue that when
   KeyguardManager.createConfirmDeviceCredentialIntent() is used, the
   top activity will be ConfirmDeviceCredentialActivity, and logo will
   be settings logo.

2. Update getting logo logic. Current order is:
   a. Check componentNameForConfirmDeviceCredentialActivity, if it's not
   null, use componentNameForConfirmDeviceCredentialActivity.
   b. Check top activity is the same as opPackageName, if so, use top
   activity.
   c. Check allowBackgroundAuthentication or isSystem, if so, use
   opPackageName.

   d. Check whether it's one of
   biometric_dialog_package_names_for_logo_with_overrides, if so, use
   IconProvider.getIcon() to get the logo with overrides; Otherwise use
   packageManager.getApplicationIcon() to get default logo.

3. Rename contains*Configurations() to requires*Permission() and add
   tests.

Test: atest PromptViewModelTest
Test: atest PromptSelectorInteractorImplTest
Test: atest AuthServiceTest
Flag: ACONFIG android.hardware.biometrics.custom_biometric_prompt NEXTFOOD
Bug: 337082634
Bug: 336403662

Change-Id: I87b9760cf55552c388902443f47ddcdd8786e010
13 files changed