Loading core/api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -1366,7 +1366,7 @@ package android.credentials.selection { } @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public class IntentFactory { method @NonNull public static android.content.Intent createCancelUiIntent(@NonNull android.os.IBinder, boolean, @NonNull String); method @NonNull public static android.content.Intent createCancelUiIntent(@NonNull android.content.Context, @NonNull android.os.IBinder, boolean, @NonNull String); method @NonNull public static android.content.Intent createCredentialSelectorIntent(@NonNull android.content.Context, @NonNull android.credentials.selection.RequestInfo, @NonNull java.util.ArrayList<android.credentials.selection.ProviderData>, @NonNull java.util.ArrayList<android.credentials.selection.DisabledProviderData>, @NonNull android.os.ResultReceiver); } Loading core/java/android/credentials/selection/IntentFactory.java +52 −54 Original line number Diff line number Diff line Loading @@ -80,17 +80,7 @@ public class IntentFactory { ArrayList<DisabledProviderData> disabledProviderDataList, @NonNull ResultReceiver resultReceiver) { Intent intent = new Intent(); ComponentName componentName = ComponentName.unflattenFromString( Resources.getSystem() .getString( com.android.internal.R.string .config_credentialManagerDialogComponent)); ComponentName oemOverrideComponentName = getOemOverrideComponentName(context); if (oemOverrideComponentName != null) { componentName = oemOverrideComponentName; } intent.setComponent(componentName); setCredentialSelectorUiComponentName(context, intent); intent.putParcelableArrayListExtra( ProviderData.EXTRA_DISABLED_PROVIDER_DATA_LIST, disabledProviderDataList); intent.putExtra(RequestInfo.EXTRA_REQUEST_INFO, requestInfo); Loading @@ -100,6 +90,24 @@ public class IntentFactory { return intent; } private static void setCredentialSelectorUiComponentName(@NonNull Context context, @NonNull Intent intent) { if (configurableSelectorUiEnabled()) { ComponentName componentName = getOemOverrideComponentName(context); if (componentName == null) { componentName = ComponentName.unflattenFromString(Resources.getSystem().getString( com.android.internal.R.string .config_fallbackCredentialManagerDialogComponent)); } intent.setComponent(componentName); } else { ComponentName componentName = ComponentName.unflattenFromString(Resources.getSystem() .getString(com.android.internal.R.string .config_fallbackCredentialManagerDialogComponent)); intent.setComponent(componentName); } } /** * Returns null if there is not an enabled and valid oem override component. It means the * default platform UI component name should be used instead. Loading @@ -107,9 +115,6 @@ public class IntentFactory { @Nullable private static ComponentName getOemOverrideComponentName(@NonNull Context context) { ComponentName result = null; if (configurableSelectorUiEnabled()) { if (Resources.getSystem().getBoolean( com.android.internal.R.bool.config_enableOemCredentialManagerDialogComponent)) { String oemComponentString = Resources.getSystem() .getString( Loading Loading @@ -144,8 +149,6 @@ public class IntentFactory { } else { Slog.i(TAG, "Invalid empty OEM component name."); } } } return result; } Loading Loading @@ -186,16 +189,11 @@ public class IntentFactory { * Creates an Intent that cancels any UI matching the given request token id. */ @NonNull public static Intent createCancelUiIntent(@NonNull IBinder requestToken, boolean shouldShowCancellationUi, @NonNull String appPackageName) { public static Intent createCancelUiIntent(@NonNull Context context, @NonNull IBinder requestToken, boolean shouldShowCancellationUi, @NonNull String appPackageName) { Intent intent = new Intent(); ComponentName componentName = ComponentName.unflattenFromString( Resources.getSystem() .getString( com.android.internal.R.string .config_credentialManagerDialogComponent)); intent.setComponent(componentName); setCredentialSelectorUiComponentName(context, intent); intent.putExtra(CancelSelectionRequest.EXTRA_CANCEL_UI_REQUEST, new CancelSelectionRequest(new RequestToken(requestToken), shouldShowCancellationUi, appPackageName)); Loading core/res/res/values/config.xml +13 −16 Original line number Diff line number Diff line Loading @@ -3348,26 +3348,23 @@ <string name="config_carrierAppInstallDialogComponent" translatable="false" >com.android.simappdialog/com.android.simappdialog.InstallCarrierAppActivity</string> <!-- Name of the default framework dialog that is used to get or save an app credential. <!-- Name of the fallback CredentialManager dialog that is used to get or save an app credential. This UI should be always launch-able and is used as a fallback when an oem replacement activity (defined at config_oemCredentialManagerDialogComponent) is undefined / not found. --> <string name="config_credentialManagerDialogComponent" translatable="false" >com.android.credentialmanager/com.android.credentialmanager.CredentialSelectorActivity</string> <!-- Whether to allow the credential selector activity to be replaced by an activity at run-time (restricted to the privileged activity specified by config_credentialSelectorActivityName). If empty, no fallback will be used. IMPORTANT: In that case the OEM dialog value specified in config_oemCredentialManagerDialogComponent must always launch-able. Otherwise, the CredentialManager API contract is broken. When disabled, the fallback activity defined at config_credentialManagerDialogComponent will be used instead. --> <bool name="config_enableOemCredentialManagerDialogComponent" translatable="false">true</bool> If specified, this UI should be always launch-able. It will be used as a fallback when the OEM dialog value specified in config_oemCredentialManagerDialogComponent) is undefined / not found. --> <string name="config_fallbackCredentialManagerDialogComponent" translatable="false" >com.android.credentialmanager/com.android.credentialmanager.CredentialSelectorActivity</string> <!-- Fully qualified activity name providing the credential selector UI, that serves the CredentialManager APIs. Used only when config_enableOemCredentialManagerDialogComponent is true. CredentialManager APIs. Must be a system app component. If the activity specified cannot be found or launched, then the fallback activity defined at config_credentialManagerDialogComponent will be used instead. --> If empty, or if this activity specified cannot be found or launched, then the fallback activity defined at config_fallbackCredentialManagerDialogComponent will be used instead. --> <string name="config_oemCredentialManagerDialogComponent" translatable="false"></string> <!-- Name of the broadcast receiver that is used to receive provider change events --> Loading core/res/res/values/symbols.xml +1 −2 Original line number Diff line number Diff line Loading @@ -2297,8 +2297,7 @@ <java-symbol type="string" name="config_customVpnAlwaysOnDisconnectedDialogComponent" /> <java-symbol type="string" name="config_platformVpnConfirmDialogComponent" /> <java-symbol type="string" name="config_carrierAppInstallDialogComponent" /> <java-symbol type="string" name="config_credentialManagerDialogComponent" /> <java-symbol type="bool" name="config_enableOemCredentialManagerDialogComponent" /> <java-symbol type="string" name="config_fallbackCredentialManagerDialogComponent" /> <java-symbol type="string" name="config_oemCredentialManagerDialogComponent" /> <java-symbol type="string" name="config_credentialManagerReceiverComponent" /> <java-symbol type="string" name="config_defaultNetworkScorerPackageName" /> Loading services/credentials/java/com/android/server/credentials/CredentialManagerUi.java +2 −2 Original line number Diff line number Diff line Loading @@ -113,8 +113,8 @@ public class CredentialManagerUi { /** Creates intent that is ot be invoked to cancel an in-progress UI session. */ public Intent createCancelIntent(IBinder requestId, String packageName) { return IntentFactory.createCancelUiIntent(requestId, /*shouldShowCancellationUi=*/ true, packageName); return IntentFactory.createCancelUiIntent(mContext, requestId, /*shouldShowCancellationUi=*/ true, packageName); } /** Loading Loading
core/api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -1366,7 +1366,7 @@ package android.credentials.selection { } @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public class IntentFactory { method @NonNull public static android.content.Intent createCancelUiIntent(@NonNull android.os.IBinder, boolean, @NonNull String); method @NonNull public static android.content.Intent createCancelUiIntent(@NonNull android.content.Context, @NonNull android.os.IBinder, boolean, @NonNull String); method @NonNull public static android.content.Intent createCredentialSelectorIntent(@NonNull android.content.Context, @NonNull android.credentials.selection.RequestInfo, @NonNull java.util.ArrayList<android.credentials.selection.ProviderData>, @NonNull java.util.ArrayList<android.credentials.selection.DisabledProviderData>, @NonNull android.os.ResultReceiver); } Loading
core/java/android/credentials/selection/IntentFactory.java +52 −54 Original line number Diff line number Diff line Loading @@ -80,17 +80,7 @@ public class IntentFactory { ArrayList<DisabledProviderData> disabledProviderDataList, @NonNull ResultReceiver resultReceiver) { Intent intent = new Intent(); ComponentName componentName = ComponentName.unflattenFromString( Resources.getSystem() .getString( com.android.internal.R.string .config_credentialManagerDialogComponent)); ComponentName oemOverrideComponentName = getOemOverrideComponentName(context); if (oemOverrideComponentName != null) { componentName = oemOverrideComponentName; } intent.setComponent(componentName); setCredentialSelectorUiComponentName(context, intent); intent.putParcelableArrayListExtra( ProviderData.EXTRA_DISABLED_PROVIDER_DATA_LIST, disabledProviderDataList); intent.putExtra(RequestInfo.EXTRA_REQUEST_INFO, requestInfo); Loading @@ -100,6 +90,24 @@ public class IntentFactory { return intent; } private static void setCredentialSelectorUiComponentName(@NonNull Context context, @NonNull Intent intent) { if (configurableSelectorUiEnabled()) { ComponentName componentName = getOemOverrideComponentName(context); if (componentName == null) { componentName = ComponentName.unflattenFromString(Resources.getSystem().getString( com.android.internal.R.string .config_fallbackCredentialManagerDialogComponent)); } intent.setComponent(componentName); } else { ComponentName componentName = ComponentName.unflattenFromString(Resources.getSystem() .getString(com.android.internal.R.string .config_fallbackCredentialManagerDialogComponent)); intent.setComponent(componentName); } } /** * Returns null if there is not an enabled and valid oem override component. It means the * default platform UI component name should be used instead. Loading @@ -107,9 +115,6 @@ public class IntentFactory { @Nullable private static ComponentName getOemOverrideComponentName(@NonNull Context context) { ComponentName result = null; if (configurableSelectorUiEnabled()) { if (Resources.getSystem().getBoolean( com.android.internal.R.bool.config_enableOemCredentialManagerDialogComponent)) { String oemComponentString = Resources.getSystem() .getString( Loading Loading @@ -144,8 +149,6 @@ public class IntentFactory { } else { Slog.i(TAG, "Invalid empty OEM component name."); } } } return result; } Loading Loading @@ -186,16 +189,11 @@ public class IntentFactory { * Creates an Intent that cancels any UI matching the given request token id. */ @NonNull public static Intent createCancelUiIntent(@NonNull IBinder requestToken, boolean shouldShowCancellationUi, @NonNull String appPackageName) { public static Intent createCancelUiIntent(@NonNull Context context, @NonNull IBinder requestToken, boolean shouldShowCancellationUi, @NonNull String appPackageName) { Intent intent = new Intent(); ComponentName componentName = ComponentName.unflattenFromString( Resources.getSystem() .getString( com.android.internal.R.string .config_credentialManagerDialogComponent)); intent.setComponent(componentName); setCredentialSelectorUiComponentName(context, intent); intent.putExtra(CancelSelectionRequest.EXTRA_CANCEL_UI_REQUEST, new CancelSelectionRequest(new RequestToken(requestToken), shouldShowCancellationUi, appPackageName)); Loading
core/res/res/values/config.xml +13 −16 Original line number Diff line number Diff line Loading @@ -3348,26 +3348,23 @@ <string name="config_carrierAppInstallDialogComponent" translatable="false" >com.android.simappdialog/com.android.simappdialog.InstallCarrierAppActivity</string> <!-- Name of the default framework dialog that is used to get or save an app credential. <!-- Name of the fallback CredentialManager dialog that is used to get or save an app credential. This UI should be always launch-able and is used as a fallback when an oem replacement activity (defined at config_oemCredentialManagerDialogComponent) is undefined / not found. --> <string name="config_credentialManagerDialogComponent" translatable="false" >com.android.credentialmanager/com.android.credentialmanager.CredentialSelectorActivity</string> <!-- Whether to allow the credential selector activity to be replaced by an activity at run-time (restricted to the privileged activity specified by config_credentialSelectorActivityName). If empty, no fallback will be used. IMPORTANT: In that case the OEM dialog value specified in config_oemCredentialManagerDialogComponent must always launch-able. Otherwise, the CredentialManager API contract is broken. When disabled, the fallback activity defined at config_credentialManagerDialogComponent will be used instead. --> <bool name="config_enableOemCredentialManagerDialogComponent" translatable="false">true</bool> If specified, this UI should be always launch-able. It will be used as a fallback when the OEM dialog value specified in config_oemCredentialManagerDialogComponent) is undefined / not found. --> <string name="config_fallbackCredentialManagerDialogComponent" translatable="false" >com.android.credentialmanager/com.android.credentialmanager.CredentialSelectorActivity</string> <!-- Fully qualified activity name providing the credential selector UI, that serves the CredentialManager APIs. Used only when config_enableOemCredentialManagerDialogComponent is true. CredentialManager APIs. Must be a system app component. If the activity specified cannot be found or launched, then the fallback activity defined at config_credentialManagerDialogComponent will be used instead. --> If empty, or if this activity specified cannot be found or launched, then the fallback activity defined at config_fallbackCredentialManagerDialogComponent will be used instead. --> <string name="config_oemCredentialManagerDialogComponent" translatable="false"></string> <!-- Name of the broadcast receiver that is used to receive provider change events --> Loading
core/res/res/values/symbols.xml +1 −2 Original line number Diff line number Diff line Loading @@ -2297,8 +2297,7 @@ <java-symbol type="string" name="config_customVpnAlwaysOnDisconnectedDialogComponent" /> <java-symbol type="string" name="config_platformVpnConfirmDialogComponent" /> <java-symbol type="string" name="config_carrierAppInstallDialogComponent" /> <java-symbol type="string" name="config_credentialManagerDialogComponent" /> <java-symbol type="bool" name="config_enableOemCredentialManagerDialogComponent" /> <java-symbol type="string" name="config_fallbackCredentialManagerDialogComponent" /> <java-symbol type="string" name="config_oemCredentialManagerDialogComponent" /> <java-symbol type="string" name="config_credentialManagerReceiverComponent" /> <java-symbol type="string" name="config_defaultNetworkScorerPackageName" /> Loading
services/credentials/java/com/android/server/credentials/CredentialManagerUi.java +2 −2 Original line number Diff line number Diff line Loading @@ -113,8 +113,8 @@ public class CredentialManagerUi { /** Creates intent that is ot be invoked to cancel an in-progress UI session. */ public Intent createCancelIntent(IBinder requestId, String packageName) { return IntentFactory.createCancelUiIntent(requestId, /*shouldShowCancellationUi=*/ true, packageName); return IntentFactory.createCancelUiIntent(mContext, requestId, /*shouldShowCancellationUi=*/ true, packageName); } /** Loading