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
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
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
Add user and delete, check on UI.
Bug: 188507135
Test: atest com.android.settings.users.UserSettingsComponentTest
Change-Id: I8aaa10f38a146cd3e869b5b5b35a93b451113e07
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
* 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
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
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
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
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
Test: As Guest, open Settings > System > Multiple users
Test: As Owner, open Settings > System > Multiple users
Bug: 169783558
Change-Id: I42c0b46fd895267b7556f3f308957b6dd17d92c4
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
- 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
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
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
- 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
- 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)
- 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
- 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
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
And fix the failing test that caused the revert.
Bug: 148015798
Bug: 149209670
Test: make -j64 RunSettingsRoboTests
This reverts commit 666dacc32a.
Change-Id: I34bb82e621e009ec26c28835f309e7a5b996e9b3
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
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
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
- 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
- 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
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId
Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
- 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
Removed the FooterPreferenceMixin from the UserSettings page.
Fixes: 140008560
Test: manual test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.users
Change-Id: If6da2bd2f6a72d8e61b8c8bca9e3179cfdee05e6
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
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
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.
- 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
- 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
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
Now we can easily mark a preference nonIndexable in xml instead of
adding key into searchIndexProvider.
Bug: 112608186
Test: robotests
Change-Id: I0ff16d44bb7b6ad148d3d35f09ca0da0163f73f4
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.