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

Commit 9e32702d authored by Tetiana Meronyk's avatar Tetiana Meronyk
Browse files

Add separate summary "Owner" for main user on the device

Bug: 298008926
Test: visual
Change-Id: I78ece410ab939a4727e44e371ae43779e96950e0
parent a0ad1b6f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -6942,6 +6942,8 @@
    <!-- User summary to indicate that a work profile is currently not set up [CHAR LIMIT=100] -->
    <string name="user_summary_managed_profile_not_set_up">Not set up - Work profile</string>
    <!-- User information string to represent the owner of the device [CHAR LIMIT=25] -->
    <string name="user_owner">Owner</string>
    <!-- User information string to represent the admin of the device [CHAR LIMIT=25] -->
    <string name="user_admin">Admin</string>
    <!-- User settings title for current user entry "You" user. [CHAR LIMIT=30] -->
    <string name="user_you">You (<xliff:g id="name" example="Name">%s</xliff:g>)</string>
+5 −6
Original line number Diff line number Diff line
@@ -368,9 +368,6 @@ public class UserSettings extends SettingsPreferenceFragment
        mMePreference = new UserPreference(getPrefContext(), null /* attrs */, myUserId);
        mMePreference.setKey(KEY_USER_ME);
        mMePreference.setOnPreferenceClickListener(this);
        if (isCurrentUserAdmin()) {
            mMePreference.setSummary(R.string.user_admin);
        }

        mGuestCategory = findPreference(KEY_GUEST_CATEGORY);

@@ -1241,13 +1238,15 @@ public class UserSettings extends SettingsPreferenceFragment
                pref.setEnabled(canOpenUserDetails);
                pref.setSelectable(true);
                pref.setKey("id=" + user.id);
                if (user.isAdmin()) {
                    pref.setSummary(R.string.user_admin);
                }
            }
            if (pref == null) {
                continue;
            }
            if (user.isMain()) {
                pref.setSummary(R.string.user_owner);
            } else if (user.isAdmin()) {
                pref.setSummary(R.string.user_admin);
            }
            if (user.id != UserHandle.myUserId() && !user.isGuest() && !user.isInitialized()) {
                // sometimes after creating a guest the initialized flag isn't immediately set
                // and we don't want to show "Not set up" summary for them