Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca7f6bf9 authored by ronish's avatar ronish
Browse files

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
parent 0a6ea7f8
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -173,6 +173,9 @@ public class UserSettings extends SettingsPreferenceFragment
    private static final String KEY_TITLE = "title";
    private static final String KEY_SUMMARY = "summary";

    private static final String EXTRA_OPEN_DIALOG_USER_PROFILE_EDITOR =
            "EXTRA_OPEN_DIALOG_USER_PROFILE_EDITOR";

    static {
        USER_REMOVED_INTENT_FILTER = new IntentFilter(Intent.ACTION_USER_REMOVED);
        USER_REMOVED_INTENT_FILTER.addAction(Intent.ACTION_USER_INFO_CHANGED);
@@ -286,6 +289,12 @@ public class UserSettings extends SettingsPreferenceFragment
        mSwitchBarController = new MultiUserSwitchBarController(activity,
                new MainSwitchBarController(switchBar), this /* listener */);
        getSettingsLifecycle().addObserver(mSwitchBarController);

        boolean openUserEditDialog = getIntent().getBooleanExtra(
                EXTRA_OPEN_DIALOG_USER_PROFILE_EDITOR, false);
        if (switchBar.isChecked() && openUserEditDialog) {
            showDialog(DIALOG_USER_PROFILE_EDITOR);
        }
    }

    @Override