Commit Graph

278 Commits

Author SHA1 Message Date
João Victor Mendes Freire
8b14ffb876 Fix user avatar not being set on rotation
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
2022-12-05 20:05:05 +00:00
João Victor Mendes Freire
b59b276b3a Fix user not being redirect to user details page
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
2022-12-02 14:45:43 +00:00
João Victor Mendes Freire
98c58a00fd Fix settings crash on users page on config change
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
2022-12-02 12:46:33 +00:00
Jackson Michael Moreira Miranda
2122313bb5 Merge "Changing the process to create a new user" 2022-11-30 12:05:30 +00:00
Jackson Michael
e55a53b067 Changing the process to create a new user
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
2022-11-25 20:19:30 +00:00
TreeHugger Robot
2c45688a13 Merge "Introduce concept of DockUser" 2022-11-14 15:00:56 +00:00
Adam Bookatz
81e5f3730c Introduce concept of DockUser
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
2022-11-10 16:14:22 -08:00
Tetiana Meronyk
19fcb87e39 Hide "Add user" button for secondary user
Bug: 258447375
Test: croot && make RunSettingsRoboTests -j40 ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest" && make RunSettingsRoboTests -j40 ROBOTEST_FILTER="com.android.settings.users.MultiUserSwitchBarControllerTest"

Change-Id: I5f0fd25fb9f710f7311275b2a840663f2bf3eeab
2022-11-09 19:35:32 +00:00
Tetiana Meronyk
61d661feb9 Merge "Disable toggle on managed device with "Disallow add user" or "Disallow switch user"" 2022-11-07 09:27:30 +00:00
TreeHugger Robot
1f41a637a2 Merge "Crop avatar to circle when syncing from Contacts." into tm-qpr-dev am: 057d24bb97 am: 56f9461b45
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20347031

Change-Id: I9fd63455801f7dcd3da74f036aceb0e1f99765af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-04 18:17:14 +00:00
Oli Lan
e402603084 Crop avatar to circle when syncing from Contacts.
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
2022-11-02 16:26:58 +00:00
Tetiana Meronyk
3ade4a3ad7 Disable toggle on managed device with "Disallow add user" or "Disallow switch user"
Bug: 244279615
Test: croot && make RunSettingsRoboTests -j40 ROBOTEST_FILTER="com.android.settings.users.MultiUserSwitchBarControllerTest"
Change-Id: I3e89c8fac1828b4c9bb1c7df08687684981bda11
2022-10-24 22:06:57 +00:00
Jackson Michael
898421bd0c Adding the sections "Allow multiple users" and "Delete guest activity" on the search result
Also added new keywords strings for the both items.

Bug: 245261104
Test: Manual test and unit test
Change-Id: I3ddc1204c6dbdcd6a82ffaa55f4ca7f4bcb3783d
2022-10-13 12:31:03 +00:00
Nikhil Kumar
0661a7640f Enable Name and Avatar change without turning on multi-user
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
2022-09-21 14:07:42 +01:00
Tetiana Meronyk
bfb90d17dc Merge "Update icons in multiuser settings" into tm-qpr-dev am: a666d80973 am: 8b7a6d5349
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19745315

Change-Id: Ic435088eeef5d07507868925b869550760364386
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-01 20:44:50 +00:00
Tetiana Meronyk
86aee84483 Update icons in multiuser settings
Bug: 243631790
Test: manual visual
Change-Id: I2885d12ef3762e233a852978a0435a60e034f2c2
2022-08-30 16:14:32 +00:00
Tetiana Meronyk
4b3a489ad3 Merge "Remove overflow from guest user settings" 2022-08-26 12:17:18 +00:00
Tetiana Meronyk
53a45bea3d Remove overflow from guest user settings
- Removed overflow for guest users
- Code cleanup

Bug: 191509236
Test: atest UserSettingsTest
Change-Id: I1ccf9924a471f148bf6413a040ccc769f9293c97
2022-08-23 14:25:59 +00:00
Kedar Chitnis
f4c320ae2f Remove feature flag SETTINGS_GUEST_MODE_UX_CHANGES
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
2022-08-22 02:39:05 +00:00
Kedar Chitnis
3ff8586db8 Remove feature flag SETTINGS_GUEST_MODE_UX_CHANGES
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
2022-08-22 02:35:14 +00:00
Anna Bauza
ab64c52f7d Merge "Fix "Turn on phone calls" for guest user" 2022-06-09 08:46:38 +00:00
Ronish Kalia
8d224da75c Merge "Add support for launching user edit dialog" 2022-06-07 16:13:16 +00:00
Avinash Vadlamudi
5bf8cd7a09 Rename method for better readability
- Rename encircle to encircleUserIcon for proper readability

Bug: 231592331
Test: build, manual check
Change-Id: If9e829372834d8a5f43e4cce358e8c0975fa30eb
(cherry picked from commit 1b7e411315)
2022-06-06 10:03:05 +00:00
Avinash Vadlamudi
d23aba7042 Fix the Ephemeral guest mode UI bugs
- Update the user-icon size to 40dp to align with add-icon size
- Remove the guestInfo preference and add the infoText as the summary for the guestExit preference and fix UserSettingsTest

Bug: 231592331
Test: Manual test, atest SettingsRoboTests
Change-Id: I2591bc19a7b2381d1842f0b28ab8fa19c15c19b8
(cherry picked from commit 9cf1d188a2)
2022-06-03 10:58:54 +00:00
Avinash Vadlamudi
1b7e411315 Rename method for better readability
- Rename encircle to encircleUserIcon for proper readability

Bug: 231592331
Test: build, manual check
Change-Id: If9e829372834d8a5f43e4cce358e8c0975fa30eb
2022-06-03 10:22:31 +00:00
Avinash Vadlamudi
9cf1d188a2 Fix the Ephemeral guest mode UI bugs
- Update the user-icon size to 40dp to align with add-icon size
- Remove the guestInfo preference and add the infoText as the summary for the guestExit preference and fix UserSettingsTest

Bug: 231592331
Test: Manual test, atest SettingsRoboTests
Change-Id: I2591bc19a7b2381d1842f0b28ab8fa19c15c19b8
2022-06-02 15:38:46 +00:00
ronish
ca7f6bf933 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
2022-05-30 14:39:17 +00:00
Anna Bauza
935b735fb4 Fix "Turn on phone calls" for guest user
Move "Turn on phone calls" from guest detail user screen to user screen.
Optimisation: Applying restrictions to default guest user has been moved
to UserManagerService -> setDefaultGuestRestrictions.

Following UX there is no need for confirmation dialog.

Bug: 191483069
Test: make RunSettingsRoboTests -j128 ROBOTEST_FILTER="com.android.settings.users.GuestTelephonyPreferenceControllerTest"
       make RunSettingsRoboTests -j128 ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest"
Change-Id: Id7391d3f85954ea7f9c94791f24174105ec8073e
2022-05-28 07:18:40 +00:00
Yasin Kilicdere
cdc0f7213d Merge "Revert "Revert "Remove the fallback AddSupervisedUserActivity.""" 2022-04-19 15:37:34 +00:00
Kedar Chitnis
a1fbad7dd8 Guest mode UX flow updates to user settings
- Add option in user settings to enable/disable ephemeral
  mode for guest user
- Update user settings to show exit guest and reset guest preferences
- Update user settings to show guest related preferences grouped together

Bug: 214031645, 175795666
Screenshots: go/ephemeral-guest-b-214031645-ux
Test: Manual test on sunfish, atest SystemUITests, atest SettingsRoboTests

Relands ag/16544951 after fixing post submit issues

Revert "Revert "Guest mode UX flow updates to user settings""

This reverts commit ed45e8c56a.

Change-Id: I54583f9021171ae523ff40d4f63835f1cb486e35
Merged-In: I54583f9021171ae523ff40d4f63835f1cb486e35
2022-04-14 09:37:57 +00:00
Kedar Chitnis
fa49a4f111 Guest mode UX flow updates to user settings
- Add option in user settings to enable/disable ephemeral
  mode for guest user
- Update user settings to show exit guest and reset guest preferences
- Update user settings to show guest related preferences grouped together

Bug: 214031645, 175795666
Screenshots: go/ephemeral-guest-b-214031645-ux
Test: Manual test on sunfish, atest SystemUITests, atest SettingsRoboTests

Relands ag/16544951 after fixing post submit issues

Revert "Revert "Guest mode UX flow updates to user settings""

This reverts commit ed45e8c56a.

Change-Id: I54583f9021171ae523ff40d4f63835f1cb486e35
2022-04-04 05:28:21 +00:00
Anna Bauza
ee23152051 Fix "Remove Guest" option shows "Reset Guest" dialog
If the guest user was not auto created, removing the user from settings message was wrongly worded. Small refactor to reuse the same wording in different modules has been done.

Bug: 225314166
Test: manual
Change-Id: Ia1871efc6aeeb2d3604c2fc4fd98a2a3a500953b
2022-03-30 08:20:04 +00:00
Yasin Kilicdere
b724929454 Merge "Singularization of duplicated multi user strings." into tm-dev 2022-03-24 12:03:29 +00:00
Yasin Kilicdere
4564bce03c Singularization of duplicated multi user strings.
Many multi-user strings were duplicated between SettingsLib, Settings,
System UI and Car projects. This CL removes those duplicates.

List of singularized strings: "Guest", "Remove guest", "Add user",
"Remove guest?", "Too many incorrect attempts...."

Bug: 191386817
Test: NA
Change-Id: I8d9629a1a9628cab9f049df84f706bd04ee75cc2
2022-03-23 19:20:34 +00:00
Matt Pietal
296b904bf1 Update multiple users strings
To match latest guidance

Bug: 219078700
Test: manual
Change-Id: Ieef884e046e1e1798cc98a553bcd902c1374d069
2022-03-23 13:39:42 -04:00
Oli Lan
5f56a273c4 Reduce gap above user list in multiuser settings.
This fixes a large gap above the user list, which occurred because
a PreferenceCategory was used for this with a blank title.

Bug: 224659273
Test: Install and inspect
Change-Id: I82c4491cc6a5111c6517b2845b44632e0859e1b6
2022-03-16 14:57:00 +00:00
Yasin Kilicdere
ba6ee82d59 Revert "Revert "Remove the fallback AddSupervisedUserActivity.""
This reverts commit a30b27657b.

Reason for revert: Now we can remove the fallback activity since the real flow is ready

Change-Id: Iecedbf588412547feecc6de36c89236097f8c236
2022-03-10 11:34:40 +00:00
Yasin Kilicdere
161697beef Merge "Update UI to show feedback while creating Guest from Settings." into tm-dev 2022-03-08 17:41:16 +00:00
Matt Pietal
b8c30c7c5d Add user button UX update
Visually align all add user/guest icons between settings and
systemui. Both areas may tint and size the icons slightly differently.

Fixes: 219078700
Test: visual, use the multiple users settings page
Change-Id: Ic88d5b2197f402f130d6cfeb94bdb2bb1b6aa58c
2022-03-07 13:37:20 -05:00
Yasin Kilicdere
4e31442a72 Update UI to show feedback while creating Guest from Settings.
Make UM.createGuest call async and show "Creating new guest" dialog during.

Bug: 219741250
Test: Manual
Change-Id: I7e3497fef283a4c13719a12b962866f88e9e5a50
2022-03-04 18:24:56 +00:00
Yasin Kilicdere
a30b27657b Revert "Remove the fallback AddSupervisedUserActivity."
This reverts commit 86f3500439.

Reason for revert: Real flow is not ready yet, so we still need the fallback activity.

Change-Id: I34dc5386ff8c18a62b4b11e25fd355a62602329f
2022-03-04 15:44:42 +00:00
Yasin Kilicdere
3fc4642ab4 Fix Guest string was not translated in UMS.userWithName()
This CL reverts the changes made in ag/14282598 since the issue is
solved from the source and removes 'String name' parameter from
UM.createGuest() calls.

Bug: 185309160
Test: atest UserDetailsSettingsTest
Change-Id: I92acad938d79e21b45af99cc76ff411022b61f1b
Merged-In: I92acad938d79e21b45af99cc76ff411022b61f1b
(cherry picked from commit ae871ba823)
2022-03-03 18:32:48 +00:00
Yasin Kilicdere
86f3500439 Remove the fallback AddSupervisedUserActivity.
Rollback the changes done in ag/16388725 and ag/16709333

Bug: 209659998
Test: croot && make RunSettingsRoboTests -j40 ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest"

Change-Id: I75b85df50a3caff55375ad261a97225377644a38
2022-03-01 21:59:23 +00:00
Oli Lan
43412bcccd Increase default user icon size.
This increases the size of the default user icon to the size specified
by the system (190dp), using the new method added in ag/16847427.

Bug: 218838295
Test: visual inspection
Test: make RunSettingsRoboTests -j40 ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest"
Change-Id: I3d88fbd1e148f0f63c796a272cd5771f4447812d
2022-02-16 11:44:50 +00:00
Darrell Shi
547416749e Settings for timeout to user 0 when docked.
Test: atest SettingsRoboTests:TimeoutToUserZeroSettingsTest
Test: atest SettingsRoboTests:TimeoutToUserZeroPreferenceControllerTest
Test: manually on device, video: http://shortn/_elZS1CdDtE
Bug: 213906356
Change-Id: I519345cdf44eaf452e092adee78ccf9d79130d33
2022-02-02 06:31:51 +00:00
Yasin Kilicdere
031104f18e Merge "Make sure activity for adding a supervised user is opened full screen." 2022-01-21 18:16:48 +00:00
Mayank Garg
d228248738 Replaced removeUserOrSetEphemeral by removeUserWhenPossible
Bug: 199446770
Test: m Settings
Change-Id: I1c8cfdbf395a7be59946cf0dad510ec1aee320d9
2022-01-14 16:03:56 -08:00
Yasin Kilicdere
d9281c887a Make sure activity for adding a supervised user is opened full screen.
Add supervised user activity only covers the right hand side of the
screen in large screen devices. This CL makes sure it is always
started from Settings with correct flags to be shown full-screen.

Bug: 214401383
Bug: 205101183
Bug: 199868785
Test: croot && make RunSettingsRoboTests -j40 ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest"
Change-Id: If81e0cce91a5295eb2b93b12f68b70fd1240c953
2022-01-13 18:46:19 +00:00
Yasin Kilicdere
3a0ebebac4 Add logging for settings entrypoint to add supervised user.
Bug: 213442701
Test: croot && make RunSettingsRoboTests -j40 ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest"
Change-Id: Ie6110b0ef5c16c9f83e3d939f78f21f003e55e35
2022-01-06 23:21:59 +00:00
Michael Groover
d1f76eea72 Merge "Add unaudited exported flag to exposed runtime receivers" 2022-01-03 17:35:02 +00:00