The toggle state used to be set on creation and only changed onSwitchToggled(). But the state can also change when restrictions are applied from outside of settings, or when user is added with toggle being off by default.
This change updates the state during execution of onResume() in Users Settings, which also aligns with the update strategy of other Toggles on this Settings page.
Bug: 362706097
Test: atest MultiUserSwitchBarControllerTest
Flag: EXEMPT bugfix
Change-Id: I8a994b2e0ddb672362e69653374b87f85ae1548c
In the process of creating a user through the Settings app, if the current user has the DISALLOW_GRANT_ADMIN restriction, the dialogue for granting ADMIN privileges will be hidden after this implementation. This action ensures that even if child users can create SECONDARY users, they cannot create ADMIN users.
Design doc: go/unicorn-hsum
Bug: 357819541
Test: manually verified the user is not allowed to create ADMIN user when DISALLOW_GRANT_ADMIN restriction is applied.
Flag: android.multiuser.unicorn_mode_refactoring_for_hsum_read_only
Change-Id: I4b40f83b50d4de0af103d4f5ca400e42345144e0
Before this change these actions were hidden.
After this change, they are displayed but disabled which makes it more intuitive.
Bug: 336762423
Test: atest UserSettingsTest && atest UserDetailsSettingsTest
Flag: android.multiuser.new_multiuser_settings_ux
Change-Id: Ie07816b7d3817d12e78e1ec2692fcddea9328933
Before, when the restrictions were applied, the preferences that were restricted were hidden.
After this change, if admin applies a restriction, the preference is displayed as disabled and Policy Transparency Dialog is displayed
Bug: 338226475
Test: atest UserSettingsTest && atest UserDetailsSettingsTest
Flag: android.multiuser.new_multiuser_settings_ux
Change-Id: I1b5aeeeec7accde278ff3e46ea3d64c91d8400db
The name "Allow multiple users" is too ambiguous. It sounds like by toggling it off, the feature is completely disabled. In fact, it only hides user switcher. In conjunction with hiding other users from the list, it makes it appear as all the users get deleted when the toggle is off. On the contrary, users might be running in background when the toggle is off.
After this change, the new name better represents the intention behind this toggle, as well as makes the UI more intuitive. The users are not being hidden anymore. But switching preference gets disabled.
Since the toggle can only be enabled or disabled by owner (after this refactoring), it means that Owner has full control over multiuser settings and is able to perform actions on users without having to enable the toggle.
Bug: 336762423
Test: atest UserSettingsTest && atest UserDetailsSettingsTest
Flag: android.multiuser.new_multiuser_settings_ux
Change-Id: Id9d507039b58d3df66fe78710409716fd4816890
Only let main user (Owner) change state of the toggle
Bug: 336764498
Test: atest MultiUserSwitchBarControllerTest
Change-Id: Ib694d1cb4685764c64633efc090765b470a0a015
Send information to avatar sync service that user selected confirm or cancel on edit user info dialog
Bug: 320656026
Test: manual
Change-Id: I84356b844d47ea7c07f662691f1e48eaca56b7d8
When multi-user feature not supported in framework, SettingsIntelligence should not build the index of multiple users for searching.
Return empty list when multi-user feature not supported during building search index.
Change-Id: Id2fb8f2066784d63bbfd5c396da88b04306a3563
Bug: 310108420
Revert submission 24420426-multi_toggle
Reason for revert: This change needs to be done along with some other UI changes to avoid confusion
Reverted changes: /q/submissionid:24420426-multi_toggle
Change-Id: Ife2e03d0090fefcb4c1fa53dd007336759eb1bc7
It makes more sense to have the toggle as on permanently as long as there are other users on the device. Otherwise if we toggle off "Allow multiple users", other users get hidden. Also with current behaviour the any admin can switch the toggle and this can block any other user, including main, from being able to use the device.
Bug: 295183792
Test: atest MultiUserSwitchBarControllerTest && UserSettingsTest
Change-Id: I8cb0671d780f45c17a9bb7c9a9d3b108128ead9d
When dialog for creating user was dismissed with keyboard being displayed, the keyboard stayed on the screen and could not be released due to incorrect list of methods called on dialog dismissal. This CL topic fixes onDismiss() behaviour of this dialog. Videos of current behaviour and behaviour after fixed are attached to the bug.
Bug: 291865725
Test: atest UserSettingsTest
Change-Id: Ib3ade3de9228c8ba24e7ac2e235aaeec45efbe4e
In Setting, after deleting or exiting the guest user, or failure to
reset the guest user involves switching back to user0, which is not
possible with HSUM (headless system user mode). With this CL we're
now switching back to previous foreground user instead of system user.
Bug: 283106632
Test: manual
Change-Id: Id60063cca75d9fded7dfe0b7d7a4b871d67c4b0c
In a series of CLs under topic add_ui_for_hsum_admins UI and functionality for allowing multiple admins on HSUM build is added. In User settings and User switcher when creating a new user there is a new dialog prompting to choose admin status of the user to be created. In User details view there is a toggle that is visible to admin users that allows to modify admin status of existing users. This toggle is only applicable to full users that are not supervised, guests or a main device user.
Bug: 252790451
Test: croot && make RunSettingsRoboTests -j40 ROBOTEST_FILTER="com.android.settings.users.UserDetailsSettingsTest"
Change-Id: I447dc168be30aa614aeb3f8b71ad14a7223fd7c1
This commit fixes the issue where the user avatar was not being colored
(using only the gray one) when the device was rotated. Additionally, it
fixes a race condition issue of the avatar color sometimes being
different than the selected one.
Bug: 261035066
Test: manually tested && atest UserSettingsComponentTest
Change-Id: I739fa8fd5d8717b602d7ba561d9c728ce622ff10
When adding a new user and rotating the device, the settings app was not
redirecting to the user settings page, was occured with the device in
portrait.
Bug: 256013217
Test: manually tested
Change-Id: I724883ff3bc3653708d02b31d66b102ab6f7b3be
The background task loses the reference to the Activity once it is
destroyed and recreated after a config change (such as screen rotation).
This resulted in getContext() returning null and openUserDetails()
crashing.
To fix this, we simply store the context before dispatching the
background worker.
Bug: 256021119
Test: manually tested
Change-Id: I3399fa5586de0cb5fc159204166f92902dd42de0
Creating a method to run in background the process to create a new user, and making the user check and change the UI in the main thread.
Also deleted the message of created user from the handler.
Bug:246906179
Test: Manual test and unit test fixed
Change-Id: Ifb3687937987f04165fd2e099d4334c7571bb034
Dreams and docking often refers to "user zero" or "system user".
But more generally, the special user for dreams or switching-to-on-docking
need not be user 0, and in fact won't be in certain modes. So this needs updating.
Test: the files mentioned in the topic
Bug: 257333623
Change-Id: If068aa79a770bed4abf3f7ca1859a95cd1eb4ecd
This ensures that photos synced to the Android user icon from the
Me Contact, by the ProfileUpdateReceiver, are cropped to a circle.
This matches the behaviour when images are selected using the
avatar picker.
Bug: 256827004
Test: Manual, build & flash, sync photo, observe in lockscreen.
Change-Id: If1abf110b74a3892a5cfb76ee344be79c867feed
Also added new keywords strings for the both items.
Bug: 245261104
Test: Manual test and unit test
Change-Id: I3ddc1204c6dbdcd6a82ffaa55f4ca7f4bcb3783d
Primary user will be displayed in user list even when the
multi-user settings is disabled.
This will allow users to change the name and avatar of
primary user without enabling the multi-user feature.
Test: croot && make RunSettingsRoboTests -j40
ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest"
Bug: 246732754
Change-Id: I4eb5aaf97630135960410bea7cdddc52b5848a1e
Bug b/214031645 has all IC reviews approved and the feature has been
merged and tested for more than 3 months. Hence removing the feature
flag.
Bug: 214031645
Test: SettingsTest, SystemUITests
Change-Id: Iccec0a6b2325f9309c25522ad3f093c6bc1f45e6
Merged-In: Iccec0a6b2325f9309c25522ad3f093c6bc1f45e6
Bug b/214031645 has all IC reviews approved and the feature has been
merged and tested for more than 3 months. Hence removing the feature
flag.
Bug: 214031645
Test: SettingsTest, SystemUITests
Change-Id: Iccec0a6b2325f9309c25522ad3f093c6bc1f45e6