Add support for launching user edit dialog

This is required for tiffin usecase wherein a tap on user
details should redirect the user to this edit page, wherein
a user can edit their profile pic and name

Bug: 216835089
Test: Tested manually

Change-Id: I1d214e7436fbf027fcac4a8bb2e0d7a26b923d85
This commit is contained in:
ronish
2022-05-30 14:30:28 +00:00
parent 0a6ea7f85f
commit ca7f6bf933

View File

@@ -173,6 +173,9 @@ public class UserSettings extends SettingsPreferenceFragment
private static final String KEY_TITLE = "title"; private static final String KEY_TITLE = "title";
private static final String KEY_SUMMARY = "summary"; private static final String KEY_SUMMARY = "summary";
private static final String EXTRA_OPEN_DIALOG_USER_PROFILE_EDITOR =
"EXTRA_OPEN_DIALOG_USER_PROFILE_EDITOR";
static { static {
USER_REMOVED_INTENT_FILTER = new IntentFilter(Intent.ACTION_USER_REMOVED); USER_REMOVED_INTENT_FILTER = new IntentFilter(Intent.ACTION_USER_REMOVED);
USER_REMOVED_INTENT_FILTER.addAction(Intent.ACTION_USER_INFO_CHANGED); USER_REMOVED_INTENT_FILTER.addAction(Intent.ACTION_USER_INFO_CHANGED);
@@ -286,6 +289,12 @@ public class UserSettings extends SettingsPreferenceFragment
mSwitchBarController = new MultiUserSwitchBarController(activity, mSwitchBarController = new MultiUserSwitchBarController(activity,
new MainSwitchBarController(switchBar), this /* listener */); new MainSwitchBarController(switchBar), this /* listener */);
getSettingsLifecycle().addObserver(mSwitchBarController); getSettingsLifecycle().addObserver(mSwitchBarController);
boolean openUserEditDialog = getIntent().getBooleanExtra(
EXTRA_OPEN_DIALOG_USER_PROFILE_EDITOR, false);
if (switchBar.isChecked() && openUserEditDialog) {
showDialog(DIALOG_USER_PROFILE_EDITOR);
}
} }
@Override @Override