From 13c6b078680bbfa2bbad1fd48ce9b36cd2357254 Mon Sep 17 00:00:00 2001 From: Becca Hughes Date: Tue, 2 Apr 2024 17:53:30 +0000 Subject: [PATCH] Pass the package name from the intent to the picker fragment When an app uses the legacy autofill intent to launch the settings activity we should pass the package name of the launching app to the picker. If the app is then picked by the user we will return result_ok to the app and if it is not picked we will return result_cancel. Change-Id: I99dbfad2c69ed57ff891c189f726ecc408d9d188 Test: ondevice manual Bug: 324197609 --- .../credentials/CredentialsPickerActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/applications/credentials/CredentialsPickerActivity.java b/src/com/android/settings/applications/credentials/CredentialsPickerActivity.java index 479a184752f..44dbac0afb7 100644 --- a/src/com/android/settings/applications/credentials/CredentialsPickerActivity.java +++ b/src/com/android/settings/applications/credentials/CredentialsPickerActivity.java @@ -54,7 +54,12 @@ public class CredentialsPickerActivity extends SettingsActivity { @Override protected void onCreate(Bundle savedInstanceState) { - injectFragmentIntoIntent(this, getIntent()); + final String packageName = getCallingPackage(); + final Intent intent = getIntent(); + + intent.putExtra(DefaultCombinedPicker.EXTRA_PACKAGE_NAME, packageName); + injectFragmentIntoIntent(this, intent); + super.onCreate(savedInstanceState); }