Commit Graph

251 Commits

Author SHA1 Message Date
Adam Bookatz
e5e232428d 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
Merged-In: If068aa79a770bed4abf3f7ca1859a95cd1eb4ecd
2022-11-14 19:19:21 +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
86aee84483 Update icons in multiuser settings
Bug: 243631790
Test: manual visual
Change-Id: I2885d12ef3762e233a852978a0435a60e034f2c2
2022-08-30 16:14:32 +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
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
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
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
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
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
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
Yasin Kilicdere
cc1d210fd0 Create a simple fallback activity for supervised user creation
Create a simple fallback activity to be started if no other activity could be
resolved when Add supervised user option is tapped in Multi User settings.

Bug: 207495450
Test: croot && make RunSettingsRoboTests -j40 ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest"
Change-Id: I850a2798567787c2494c75aa5fa451ddf373410d
2021-12-14 15:39:42 +00:00
Yasin Kilicdere
2a37149ec5 Add settings entrypoint to add a supervised user
Bug: 205101183
Bug: 199868785
Test: croot && make RunSettingsRoboTests -j40 ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest"
Change-Id: Ie69786c81ec938f4c4108d7fc9c0874776331865
2021-12-14 14:47:53 +00:00
Michael Groover
911f7e7aa9 Add unaudited exported flag to exposed runtime receivers
Android T allows apps to declare a runtime receiver as not exported
by invoking registerReceiver with a new RECEIVER_NOT_EXPORTED flag;
receivers registered with this flag will only receive broadcasts from
the platform and the app itself. However to ensure developers can
properly protect their receivers, all apps targeting T or later
registering a receiver for non-system broadcasts must specify either
the exported or not exported flag when invoking #registerReceiver;
if one of these flags is not provided, the platform will throw a
SecurityException. This commit updates all the exposed receivers
with a new RECEIVER_EXPORTED_UNAUDITED flag to maintain the existing
behavior of exporting the receiver while also flagging the receiver
for audit before the T release.

Bug: 161145287
Test: Build
Change-Id: Ie97372efebd8258d9a4c503771d55109a85e6ae9
2021-12-09 20:34:02 -08:00
Adam Bookatz
cd429e74db Merge "Use UM.canAddMoreUsers and UM.isUserTypeEnabled" 2021-11-29 21:00:48 +00:00
Adam Bookatz
8ca17560e5 Use UM.canAddMoreUsers and UM.isUserTypeEnabled
Settings shouldn't allow creating users if the type is diabled, and it
shouldn't allow creating more of a particular user type if no more can
be created (even if more can be created of other user types).
Previously, Settings didn't take into account the user type when
querying whether more users could be created.

Bug: 192577100
Test: com.android.settings.users.UserSettingsTest
Change-Id: I065478fd14779f528be4edce8ae215391a752ef4
2021-11-23 14:55:28 -08:00
Adam Bookatz
c2efde5fb0 Multiuser perfetto metric: Settings tracepoints
Add tracepoints in Settings for user switches and creation, for the
primary purpose of performance metrics in trace_processor.

Bug: 192001071
Test: manual
Change-Id: I1ecaccdaba3b14c42a45fefeb9b5568f7c7d6bf6
2021-11-08 18:00:48 -08:00
Rajeev Kumar
e3ec77a405 Merge "Make use of config for auto-created guest users" into sc-dev am: f11fdb3e50 am: 811cc971ce
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14988090

Change-Id: Idfb492057728e4613dc244d38baf113fff99ac9f
2021-06-25 03:46:49 +00:00
Peter Kalauskas
8d37a2bb85 Make use of config for auto-created guest users
If frameworks config config_guestUserAutoCreated=true, then Settings
will:

 - Create a new guest user any time the current guest user is removed

 - Show "Guest" instead of "Add guest"

 - Show "Reset guest" instead of "Remove guest"

Bug: 188542158
Test: With config_guestUserAutoCreated=true, delete current guest user
      using adb (`adb shell cmd user list -v --all` to find the user
      ids, then remove each guest user with `adb shell pm remove-user
      <id>`), then as owner, open multi-users settings page. Check that
      there is a item for "Guest" instead of "Add guest". Select
      "Guest", then confirm there is an item for "Reset guest" (it
      should be disabled). Select "Switch to guest", then switch back to
      owner. Open the multi-users settings page again. Check that "Reset
      guest" is now enabled. Tap "Reset guest", and press confirmation
      button, named "Reset". You should be take back to the main
      multi-user settings page and still see "Guest". Wait a few
      seconds, then use adb to confirm there is a guest user present.
Test: With config_guestUserAutoCreated=true, switch to guest user, open
      multi-users settings page, check that there is an option to "Reset
      guest". Select "Reset guest", and press confirmation button, named
      "Reset". Phone should switch back to last active user, and QS tile
      should now show "Guest" instead of "Add guest". Run `adb shell cmd
      user list -v --all` to confirm guest has a new user id.
Test: With config_guestUserAutoCreated=false, confirm that "Add guest"
      and "Remove guest" features remain unchanged
Change-Id: I7d5b81bd2e5c6b999ae18cd6b1280ae0496db94b
2021-06-24 17:40:12 -07:00
Syaoran Kuo
5c93fc758a Add testcase: Add multiple user and delete.
Add user and delete, check on UI.

Bug: 188507135
Test: atest com.android.settings.users.UserSettingsComponentTest

Change-Id: I8aaa10f38a146cd3e869b5b5b35a93b451113e07
2021-06-21 18:54:43 +08:00
Peter Kalauskas
c24234c301 Add tests for guest user events
Also, move ACTION_USER_GUEST_EXIT_CONFIRMED so it is only logged after
safety-check

Test: ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest" m RunSettingsRoboTests
Test: ROBOTEST_FILTER="com.android.settings.users.UserDetailsSettingsTest" m RunSettingsRoboTests
Bug: 184200796
Change-Id: Id18aa914bbb262984d7c7cf4b8a4ffdde278fd23
2021-05-10 20:36:48 -07:00
Rubin Xu
8e4acdbf51 Refactor ChooseLockGenericController
* Move all logics around aggregating password policies
  to the controller
* Replace HIDE_DISABLED_PREFS and MINIMUM_QUALITY_KEY
  with HIDE_INSECURE_OPTIONS as all call sites are just
  using them to hide insecure screenlock options.
* Remove password policy aggregation logic from
  ChooseLockPassword and make it use policies passed in.
* Remove padlock from disabled screen lock options,
  per UX mock.
* Increase char limit for some strings

Bug: 177638284
Bug: 177641868
Bug: 182561862
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.password
Test: 1. set profile password quality/complexity and enroll device lock
      2. set profile password quality/complexity and enroll work challenge
      3. set parent password quality/complexity and enroll device lock
      4. set parent password quality/complexity and enroll work challenge
      5. set profile and parent password complexity, then enroll work challenge
      6. set profile and parent password complexity, then unify work challenge
      7. Enroll device lock during SUW
Change-Id: Iba1d37e6f33eba7b7e8e1f805f8e37aaec108404
2021-05-06 23:09:27 +01:00
Adam Bookatz
f493bf0cdb UserDetailsSettings uses Guest string, not Guest name
The UserDetailsSettings panel, and its title, show the user's UserInfo.name.
This is correct for a regular user (and for the Owner). But for a Guest user,
this is incorrect, and the user_guest string should be used instead.

The difference occurs if the system language is changed after the guest is created;
the word 'guest' should update to the current language, not be frozen to the
language at the time of the guest's creation.

Bug: 185309160
Test: atest UserDetailsSettingsTest
Change-Id: I545aa3e6cc5d00c0bcc49960f37dddd9334b153b
2021-04-23 10:39:27 -07:00
Adam Bookatz
60a296d290 Failed guest creation doesn't crash Settings
In the new multiuser settings, there's no logic to handle
what happens when a guest user creation fails, and so Settings
crashed with a NullPointerException.
In the fix, we catch this case to avoid crashing, and display
a toast to the user so that they understand the operation was
not successful.

Bug: 175042193
Test: manually failed to create user and observe toast and no crash
Change-Id: I7dfcaa1eb6d4b792946e18d1632fd2c75e93c168
2021-03-31 18:41:57 -07:00
Peter Kalauskas
10adda880d Introduce guest user metrics
Bug: 169783558
Test: statsd_testdrive -terse 97
Change-Id: I87ce1dba20daadfba68bfff08d9b875872fd07a1
2021-03-19 19:16:23 -07:00
Peter Kalauskas
06b235e497 Revert "Update icons and text for guest user"
Revert submission 13278947-new-guest-user-strings

Reason for revert: Use same strings and text as Android R
Reverted Changes:
I8e9b7992d:Update icons and text for guest user
I42c0b46fd:Update icons and text for guest user

Bug: 169783558
Change-Id: Id038ec708e9098c856c4d24ae55a3b7e2bad391d
2021-02-11 22:29:38 +00:00
Felipe Leme
3158f45161 Merge "Refactored Settings calls to removeUserOrSetEphemeral()." 2021-01-22 16:31:09 +00:00
Stanley Wang
b87ddba6cd Use SettingsLib's MainSwitchBar to replace SwitchBar in Settings.
To log Settings metrics, the MainSwitch extends MainSwitchBar and
replace the SwitchBar in SettingsActivity.

Bug: 175181773
Test: Run robotest and apply the widget in Settings and see the ui

Change-Id: I3add3702e9058ad9192b5172c7cf0e2ccfb55a70
2021-01-14 22:48:31 +08:00
Felipe Leme
cc7f845fdd Refactored Settings calls to removeUserOrSetEphemeral().
Test: atest com.android.car.user.CarUserServiceTest \
      android.car.apitest.CarDevicePolicyManagerTest#testRemoveUser_whenDisallowed
Bug: 170887769

Change-Id: If797ace64c0fa0262116f649212bbcb1d61e2046
2021-01-06 23:41:37 -08:00
Peter Kalauskas
0fa7edbb02 Update icons and text for guest user
Test: As Guest, open Settings > System > Multiple users
Test: As Owner, open Settings > System > Multiple users
Bug: 169783558
Change-Id: I42c0b46fd895267b7556f3f308957b6dd17d92c4
2020-12-30 17:43:14 -08:00
Tsung-Mao Fang
00956fb4e1 Apply top intro preference in Settings app (1/n)
Based on content in footer, we need to convert some footers
to top info prefernce.

Test: Run robo test and see the screens
Bug: 173087905
Change-Id: Ie62a503481f9d385f5468896fba8f607cb3437d3
2020-11-16 18:44:40 +08:00
Felipe Leme
8031c0bbac Use UserManager.removeUserOrSetEphemeral() to remove current user.
Test: manual verification
Bug: 173245580
Bug: 155913815

Change-Id: I74ac8d276f3a78f6c9483a980e4a05486b0c1a8c
2020-11-13 15:15:32 -08:00
Andras Kloczl
2ac45dd49e Add user name photo dialog to user creation in SysUI
- Move user creation dialog related resources to SettingsLib
- Change dialog showing logic in UserSettings because
   EditUserInfoController contracts have changed.
- Show UserCreatingDialog when user is being created
- Fix crash when phone is rotated during user creation

Test: manual test
Doc: http://shortn/_cJE9o6pBZR
Screenrecord: http://shortn/_Jy5Q0lTAUL
Bug: 147653252
Change-Id: I15e15ad88b768a5b679de32c5429d921d850a3cb
2020-10-06 20:43:52 +01:00
Colin Cross
38fa185a27 Revert "Snap for 6793014 from 3777d883a3857b1a1589181c436d9018d7..."
Revert "Snap for 6793014 from 3157b4ee4325286f0c2ab0f26528460c8b..."

Revert "Snap for 6793014 from a43295d1825da62af038d345a7a861ed7a..."

Revert "Snap for 6793014 from 2076be4d27078d6ebc0a6b5e5ceb386109..."

Revert "Snap for 6793014 from d0e31526c62b2aeb35c293ac96feb180fc..."

Revert "Snap for 6793014 from 7a3a8c6351d5167a6ae0b33bc376efabd2..."

Revert "Snap for 6793014 from 41471cb21bb16b5c3bcc92f84293b79684..."

Revert "Snap for 6793014 from 42e5cca3cfb829690c9d8c6aca57a8e7d5..."

Revert "Snap for 6793014 from 4f81304963d19f4511b1e8e7d0aad87a67..."

Revert "Snap for 6793014 from 07602cdacf5bcc835db41f7eaa24af9964..."

Revert "Snap for 6793014 from 14cb57e107a3abce8b14937b1f92c28d18..."

Revert "Snap for 6793014 from ab1e4a81d09a540a5f927059e5bc03a606..."

Revert "Snap for 6793014 from 8c65adad0bcdfb3acc561063b4048dca24..."

Revert "Snap for 6793014 from b3061942700265e2bf04af9997775dcbbb..."

Revert "Snap for 6793014 from 551c5953fc62e339e4ee884ec2cd0ac3be..."

Revert "Snap for 6793014 from 4919273b2ac5c6347a18e17c5ec70d8da6..."

Revert "Snap for 6793014 from 988d4244914e0c749655e8cb6db18ba44f..."

Revert submission 12465146-release-request-6b259cbc-1f45-4b05-bc7e-c9b893b79d68-for-git_main-busytown-release-6793014

Reason for revert: b/166531456
Reverted Changes:
I5ff7a6c0d:Snap for 6793014 from f2989f9c65556d5155dbd57f82f0...
I77bdff943:Snap for 6793014 from a43295d1825da62af038d345a7a8...
I2ac5c520a:Snap for 6793014 from c3f124cca05579acf0a6cb589ebd...
I023b9702f:Snap for 6793014 from 98756d6d3e2bb0ba28eb125caa7a...
Ibc7893d72:Snap for 6793014 from fd1ad6750ef332d3f50f218f4d5d...
Ic27847bee:Snap for 6793014 from 8c65adad0bcdfb3acc561063b404...
If20bc9352:Snap for 6793014 from 7a3a8c6351d5167a6ae0b33bc376...
I6542d17e8:Snap for 6793014 from 3777d883a3857b1a1589181c436d...
I66e6bb8a9:Snap for 6793014 from 8b8bf0a07b0521bbe8483fbbab12...
I3cd190b6b:Snap for 6793014 from 424180bdc4aa18249e678daebfd0...
If92db7402:Snap for 6793014 from ab1e4a81d09a540a5f927059e5bc...
Iaced03c87:Snap for 6793014 from d0e31526c62b2aeb35c293ac96fe...
I5d28c6b4b:Snap for 6793014 from 4f81304963d19f4511b1e8e7d0aa...
I30d07bea3:Snap for 6793014 from 7594ec6384c4da320726def34f47...
I473205f48:Snap for 6793014 from 551c5953fc62e339e4ee884ec2cd...
I0656b41af:Snap for 6793014 from 44725f06b7f7d6407b5ee82d989b...
I0f9796067:Snap for 6793014 from 4919273b2ac5c6347a18e17c5ec7...
I9a38cda8f:Snap for 6793014 from 2076be4d27078d6ebc0a6b5e5ceb...
I876a82f51:Snap for 6793014 from 11467102abddb6026aaa164c1361...
I749d7d023:Snap for 6793014 from 41471cb21bb16b5c3bcc92f84293...
I038daea41:Snap for 6793014 from 07602cdacf5bcc835db41f7eaa24...
I47aa3131c:Snap for 6793014 from 14cb57e107a3abce8b14937b1f92...
I32dba8a95:Snap for 6793014 from 3157b4ee4325286f0c2ab0f26528...
I2ebc9f9db:Snap for 6793014 from 988d4244914e0c749655e8cb6db1...
Iae7c3370f:Snap for 6793014 from 9ffb8852294e06e2d387dc1fb868...
I6467a7f1b:Snap for 6793014 from 42e5cca3cfb829690c9d8c6aca57...
I8c6375203:Snap for 6793014 from b3061942700265e2bf04af999777...
I843b2e1f3:Snap for 6793014 from 265280bf5cb4bc14e132c3a35ae5...
Ie254f7079:Snap for 6793014 from f22ad3164937a8f2e309965c102b...
I01e0974ed:Snap for 6793014 from bbbccc3c2b7fc7c5780f6c415c42...

Change-Id: Ie8b2b332f7ebaaee7cd39c6f94d280c047426bc9
2020-08-27 04:12:26 +00:00
Andras Kloczl
57154fbac3 Fix multi user crash when Add guest was tapped multiple times
When "Add guest" got tapped multiple times then the first click starts
the guest creation process which blocks the UI thread for around 2-3
seconds, then triggers the open guest details intent, and the second
tap event starts another guest creation, but it fails (since there
can't be more than 1 guest on the device) and returns null, and in the
openUserDetails we get NullPointerException.

Test: manual test
Video: http://shortn/_i4Dce33yhl
Bug: 160267016
Change-Id: I9a4f0a91295e336d246abe5f5470682a14cb510f
2020-07-14 14:34:57 +01:00
Andras Kloczl
4e2a0717c9 Change user setup prompt dialog showing logic
- Extract user setup prompt dialog creation logic
- Move user setup prompt dialog showing to UserDetailsSettings
- Rename user click and creation related methods to improve readability
- Set "disabled by admin" for switch pref when switch is disabled
- Cleanup UserSettings and UserDetailsSettings onPreferenceClick
- After a guest is created the details page opens instead of switching

Test: Manual test and robo tests with this command:
  make -j64 RunSettingsRoboTests
Demo: http://shortn/_ACYsnbIKO9
Bug: 156867277
Change-Id: Ifa0cdefcd49d5b865e940a7cc332136ed26ecf57
2020-06-09 23:06:00 +00:00
Andras Kloczl
106431e525 Improve multi user functionality for restricted users
- Restricted users can change their name
- Improved App&Content access screen
- Remove "Turn on phone calls" from restricted user detail page

Doc: http://shortn/_Prb3SJ3xJ3
Bug: 142798722
Test: Run robo tests with this command:
  make -j64 RunSettingsRoboTests
Change-Id: I2aadf32aef52ba5ad0db7aa0cd83bac9d9941589
(cherry picked from commit f4759e00d5)
2020-05-29 12:55:18 +00:00
Andras Kloczl
4d7d4effa5 Improve multi user settings screen
- Added switch and user delete functionality to details screen.
- Added robo tests.

Screenshots: http://shortn/_S6fbIMhAYO
Bug: 142798722
Test: Run robo tests with this command:
  make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.users.*SettingsTest"
Change-Id: Ied67290e8fed87feb0a60a3f2c40eb91cc57988e
2020-05-07 22:01:33 +01:00