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
This commit is contained in:
Becca Hughes
2024-04-02 17:53:30 +00:00
parent 1bf1b02c31
commit 13c6b07868

View File

@@ -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);
}