Commit Graph

225 Commits

Author SHA1 Message Date
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
Edgar Wang
fff8c56de2 Revert "Improve multi user settings screen"
This reverts commit d19dc306dd.

Reason for revert: this CL made Settings the test cases called shadowUserManager.hasUserRestriction()
https://sponge.corp.google.com/target?show=FAILED&sortBy=STATUS&id=07150153-ccb7-4215-a9f8-eed31e44c66f&target=RunSettingsRoboTests1-test-output

Bug: 142798722

Change-Id: I3937a07ee35a472cadd6db8cd0177e08e63516a4
2020-05-07 09:24:47 +00:00
Andras Kloczl
d19dc306dd 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: Id51c12c5470e30e2dffe93f3bd8c22380d8bdc1f
2020-05-05 13:45:01 +01:00
Ben Murdoch
7803f907c7 Move strings related to user creation to SettingsLib.
Test: Build, manually check device.
Bug: 147653252
Bug: 152038380
Change-Id: I921d7907eca5c6bd6585f89e5dd5b6b6222bc745
2020-03-23 14:23:23 +00:00
Ben Murdoch
c20d548ad9 Fix NPE in AddUserWhenLockedPreferenceController.
Set LockPatternUtils in constructor, but allow it to be
overridden for tests.

Bug: 149511500
Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.users.AddUserWhenLockedPreferenceControllerTest"
Change-Id: I4148fec8eea9c76afebe45cc29c2c87775fd3b1e
2020-02-17 18:02:28 +00:00
Ben Murdoch
fa92269759 Revert "Revert "Show "Add users from lock screen" dependent on secure lock screen.""
And fix the failing test that caused the revert.

Bug: 148015798
Bug: 149209670
Test: make -j64 RunSettingsRoboTests

This reverts commit 666dacc32a.

Change-Id: I34bb82e621e009ec26c28835f309e7a5b996e9b3
2020-02-11 13:35:45 +00:00
Jon Spivack
666dacc32a Revert "Show "Add users from lock screen" dependent on secure lock screen."
This reverts commit 0149363a39.

Reason for revert: Droidcop: Potential culprit for Bug 149209670- verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: Ia1f1ce35ef5d93664cf665bea86a472376b84aab
2020-02-10 22:11:57 +00:00
Ben Murdoch
0149363a39 Show "Add users from lock screen" dependent on secure lock screen.
SysUI only enforces this setting while a secure lock screen is set,
so it doesn't make sense to show it configurable while an insecure
lock screen is set.

Bug: 148015798
Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.users.AddUserWhenLockedPreferenceControllerTest"
Change-Id: I186b2339e9575e20b55e2e5c1dab3de624848fc5
2020-01-24 12:34:15 +00:00
Ben Murdoch
34462c0cb0 Refactor Add new user / restricted profile UX flow.
Incorporate the choose user name / avatar into the
user creation flow so that we don't end up with many
"New User"s.

Bug: 147653252
Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.users.EditUserInfoControllerTest"
Change-Id: Ie19230791d8b50c8ab04df89909606179364ebab
2020-01-23 11:11:02 +00:00
Raff Tsai
c898775914 Hide search box if it is called in initial setup wizard
- Search box is hidden if user set intent extra isSetupFlow true

Fixes: 135717823
Test: search box is hidden in the following command
adb shell am start -a android.settings.SETTINGS --ez isSetupFlow true

Change-Id: Ia3d955c9390d6b0eef9391b9b35b6a483eb63d26
2019-10-18 02:08:38 +00:00
Raff Tsai
6db277ebb7 Remove summary provider
- use SummaryProvider to provide the summary of UserSettings
- use WifiDisplayPreferenceController to replace the summary loader
in WifiDisplaySettings
- use ConfigureNotificationPreferernceController to replace the
sumary load in ConfigureNotificationSettings

Fixes: 141653158
Test: robolectric
Change-Id: Id5f5ed645707caa0b25ecae5252174cbf017651c
2019-10-03 15:04:36 +08:00
Raff Tsai
966fa01423 Use SettingsLib Indexable
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId

Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
2019-09-25 18:24:56 +08:00
Raff Tsai
ac3e0d0988 Directly use BaseIndexableProvider
- Add function getXmlResourceId, Fragments don't need to write
xml resource id twice.
- Remove getPreferenceControllers from Indexable.java. Because it will
move to SettingsLib later for other apps which don't need this function

Bug: 135053028
Test: robolectric
Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
2019-09-24 00:35:52 +08:00
Raff Tsai
1f30b1cd67 Merge similar BaseSearchIndexProvider code together
Bug: 135053028
Test: robolectric, check search_index.db contains the same items
Change-Id: If3c18a170b0e671690df1fdf26e59a421d2c48cd
2019-09-12 11:09:09 +08:00
Sunny Shao
7687e0b17d Use FooterPreference in xml explicitly
Removed the FooterPreferenceMixin from the UserSettings page.

Fixes: 140008560
Test: manual test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.users
Change-Id: If6da2bd2f6a72d8e61b8c8bca9e3179cfdee05e6
2019-08-26 17:08:31 +08:00
Bookatz
6a3f2bfe2a Merge "If cannot add restricted profile, don't suggest it" into qt-dev
am: a5018be48a

Change-Id: Ic94e5f918a0db96dd21d8f719231bb65f31bd613
2019-06-17 18:43:04 -07:00
Bookatz
673bc9d01c If cannot add restricted profile, don't suggest it
Previously, on devices that cannot add a restricted profile (e.g. most
phones), the Multiple users menu had an option to "Add user", whereas
for devices that can, the option read "Add user or profile". Now it only
says the latter, due to ag/6412347. We add back the original wording
here.

Fixes: 135294519
Test: manual confirmation on a phone that text says "Add user"
Test: m -j ROBOTEST_FILTER=UserSettingsTest RunSettingsRoboTests
Change-Id: Ia166b6ff9c69c0042e8a781be1146a5622177121
2019-06-17 18:33:16 +00:00
Colin Cross
807e861105 Use if instead of switch for resources
Converting to Soong will move some code from directly compiled
into the app to compiled into an Android library and then
shared between the app and the tests.  This will cause resource
IDs in the library to become non-final, which means they can
no longer be used in case statements.  Convert affect case
statements to if blocks.

Test: m RunSettingsRoboTests
Change-Id: I25742a374f06d3fa4decbfc0d223a350acc50881
2019-05-13 13:42:01 -07:00
Raff Tsai
b508184d60 Remove "Add users from lock screen" from secondary users
Fixes: 124885010
Test: Robolectric, manual
Change-Id: I1c940fda2fa5f3da39c19bd119ac483024f5a83b
2019-03-07 13:20:02 +08:00
Pavel Grafov
19cf0b4580 Don't hide "Add user" when disallowed by admin
Bug: 125226170
Test: atest tests/robotests/src/com/android/settings/users/UserSettingsTest.java
Test: manual, with TestDPC
Change-Id: I347fae04030e04325a5ee5c634f782e554ece263
2019-02-21 13:38:53 +00:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Jonathan Scott
ba3b68686d Add policy transparency to disallow remove user.
On the Settings > System -> Multiple users screen, ensures that the"Delete from this device" menu is always available, but is disabled and includes policy information when DISABLE_REMOVE_USER is set.

Change-Id: Ia6c6cfb360f35a6e447bf9d85d2472ac11dde1ac
Fix: 113807450
Test: m ROBOTEST_FILTER=UserSettingsTest -j40 RunSettingsRoboTests; CTS Verifier Device Owner Tests/Policy transparency test/Disallow remove user.
2018-09-19 09:32:35 +01:00
Doris Ling
73d7773eb2 Fix visibility of AddUser when toggling multiuser.
- when enabling multi user, also need to update the visibility of the
Add user preference, but need to check the add user capability as well.

Change-Id: Ia243901c7537bdb39ca3a39aed559b003f803e4d
Fixes: 115397726
Test: make RunSettingsRoboTests
2018-09-12 12:33:46 -07:00
Doris Ling
e845b40f35 Do not show AddUser if adding user is not allowed.
- when multi user is enabled, we should keep the current visibility for
AddUser preference, since earlier check has been done to update its
visibility according to the add user capability. We should only set the
visibility to false if multi user is disabled.

Change-Id: I246e9242f255dbd57c5309b2d16c95d202607531
Fixes: 114241868
Test: make RunSettingsRoboTests
2018-09-07 14:08:49 -07:00
Philip P. Moltmann
e3f721132a RestrictedLockUtils was split into ...Internal
This means that in some cases RestrictedLockUtils has to be used and in
some RestrictedLockUtilsInternal.

This causes a lot of trivial code changes.

I also updated the ordering of the imports in all affected files.

Bug: 110953302
Test: Built
      make -j RunSettingsRoboTests
Change-Id: I9bdf8b89134f853bae4f38c81af436715c73e924
2018-08-30 08:11:39 -07:00
Fan Zhang
a79c377fbc Declare "searchable" attribute for preferences.
Now we can easily mark a preference nonIndexable in xml instead of
adding key into searchIndexProvider.

Bug: 112608186
Test: robotests
Change-Id: I0ff16d44bb7b6ad148d3d35f09ca0da0163f73f4
2018-08-16 09:06:39 -07:00
tmfang
41ab6b4bf8 Migrate all AlertDialogs to AndroidX version
This CL only changed AlertDialog imports.
So, reviewer can review it easily.

Change-Id: I097bc44394195b14287f4f920c570ac8653f356a
Fixes: 111413092
Test: This CL can't pass Robo test.
2018-07-20 11:32:13 +08:00