Commit Graph

9 Commits

Author SHA1 Message Date
Jonathan Scott
e0d439472f Allow Device Management Role Holder to update Settings strings.
Test: manual
Bug: 188414370
Change-Id: I6e1a06619799a9e99382d791e72e2e4518f93cac
2022-01-25 19:03:24 +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
Mill Chen
e31fcb6dda Avoid double-badging application icon in the dialog
When creating a confirmation dialog for removing work profile, it will
fetch an icon from ApplicationInfo and badge the icon. However, the
cases of double-badging icon are happening in the some devices with
higher density, which means the icon has already had a badge after
getting it from ApplicationInfo. So this change attempts to directly use
the icon.

Bug: 148137991
Test: visual, manual
1. Install Test DPC from Play Store
2. Setup work profile
3. Settings -> Security -> Device admin apps
4. Click Test DPC item which has the badged icon -> Remove work profile
5. Observe the icon of the confirmation dialog
Change-Id: I126bb799e37e168fb5fbc76107c0c897a6be2f9a
2021-02-25 09:24:40 +00: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
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00: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
Kenny Guy
7a3555961d Add support messages to device admin pages.
Add support message to device admin settings pages.
Show policy information for device owners
and profile owners.
Allow a user to remove profile from profile owners
admin page.

Bug: 26416662
Change-Id: I95424da50067b7c0ba1618a083a31448d406188f
2016-01-06 17:21:45 +00:00
Sudheer Shanka
bc95630994 Update warning dialog on work profile deletion.
Bug: 20024761
Change-Id: I23b0eaa7742d9d23a29a2a48ab6e3d92fe310560
2015-04-28 11:32:09 +00:00
Fyodor Kupolov
dbbd4fca44 Show confirmation when turning on "Phone calls/sms"
Added confirmation dialog, when turning on "Phone calls and sms" setting for
secondary users and guests.

Bug:15761405
Change-Id: I39b2181f0b5460db9a964c6883f053a6c6336622
2015-01-08 11:21:26 -08:00