Commit Graph

28 Commits

Author SHA1 Message Date
Taran Singh
9260c67352 DO NOT MERGE: Prevent non-system IME from becoming device admin
Currently selected IME can inject KeyEvent on DeviceAdminAdd screen to
activate itself as device admin and cause various DoS attacks.

This CL ensures KeyEvent on "Activate" button can only come from system
apps.

Bug: 280793427
Test: atest DeviceAdminActivationTest
Change-Id: I6470d1684d707f4b1e86f8b456be0b4e0af5f188
(cherry picked from commit 70a501d02e)
2023-06-02 22:20:30 +00:00
Eghosa Ewansiha-Vlachavas
07695a5859 Update DPM.setProfileOwner call in DeviceAdminAdd
As DPM.setProfileOwner no longer takes ownerName as an argument, update
call in DeviceAdminAdd to reflect change.

Bug: 240562946
Test: n/a
Change-Id: I2c18e946d73e35659fb1779ca428e8680524d730
2022-09-06 13:09:03 +00:00
Jason Parks
4a9c108b28 Use API to check for the superivion component.
Bug: 219025233
Test: manual
Change-Id: Icd2593a67ae0297340991a5375b18e2f933facb1
2022-06-14 17:16:07 +00:00
kholoud mohamed
de78149c16 RESTRICT AUTOMERGE Refactor device policy resource APIs to a separate class
Bug: 217388602
Bug: 218875965
Test: atest EnterpriseResourcesTests
Test: manual
Change-Id: I4775d7741c7819fd811c3fc4eda1636b1e04b398
2022-03-17 17:37:45 +00:00
Roman Kalukiewicz
669ebc9b89 Merge "Allow users to add profile owner after setup if the supervision role is set." 2022-02-10 02:24:17 +00:00
Roman Kalukiewicz
f6a7b65a98 Allow users to add profile owner after setup if the supervision role is
set.

Bug: 185905077
Test: manual
Change-Id: Ia267c9d4fa6d438fa9449c6f44031a3831e86fa1
2022-02-09 21:13:10 +00:00
Jonathan Scott
269f97d960 Allow overriding of strings referenced in XML files.
Test: manual
Bug: 188414370
Change-Id: Ice45b1808530c14c4efff16795cac7b2cb81516e
2022-02-07 21:00:05 +00:00
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
Sunny Shao
e0c921a8fa Fix the extra speaking in Allow supervision dialog
- Extra speaking the  "double tap to activate" when focus
  "Family Link manage ...".
- Root cause: this Textview set the setMovementMethod method.
- Solution: Remove this setMovementMethod because it is usless in here.

Bug: 187968203
Test: manual test
Change-Id: Ia3f277f6814cb009f0e07f56381e3e46fbacc7a8
2021-05-26 14:53:14 +08:00
Tsung-Mao Fang
3720ae21b0 Fix the color of dot wrongly in device admin page
In this cl, we migrate origin files/method from framework into settings app.
So, we can control layout and drawble without impacting other app.

And we only remove to set a tint color in app_permission_item.xml.
Currently, it won't tint color for dot now.

Test: See the screen and dot's color is correct.
Fix: 188188444
Change-Id: I18054b47ba07e7864e7c238f2bec5fbe1d3feeea
2021-05-20 20:21:56 +08:00
Tsung-Mao Fang
0bf3c98b2f Prevent HTML Injection on the Device Admin request screen
The root issue is that CharSequence is an interface.
String implements that interface, however, Spanned class
too which is a rich text format that can store HTML code.

The solution is enforce to use String type which won't include
any HTML function.

Test: Rebuilt apk and see the string without HTML style.
Bug: 179042963
Change-Id: I53b460b12da918e022d2f2934f114d205dbaadb0
2021-04-14 15:51:37 +08:00
Tsung-Mao Fang
53bded37f2 Add collapsing toolbar to Device Admin Add page
Test: Built the apk and see new collapsing tool bar on this page
Fix: 183689071
Change-Id: I42457fc75f2b725b39e1a1187ffa6d21f5bfe164
2021-03-25 10:18:24 +00:00
Salud Lemus
2ce6dc82b3 Update Device Admin Info Settings text for a financed device
Bug: 182804474
Test: Used a test device that is registered via ZT

Change-Id: Ia48e1767038f8dc3d8965ee30bc7aa9efaec59ef
2021-03-15 21:05:38 +00:00
Edgar Wang
3cb8e75d85 Merge "Fix NPE if default supervisor is not defined" am: 9bc3b6a207 am: 4d93ad694b
Change-Id: Ibb53d7709aab6f98d61045a5745fd0d52d108346
2020-05-28 06:59:05 +00:00
Wang Han
719b573173 Fix NPE if default supervisor is not defined
* Checking for null does not work sadly. This fixes NPE at
   calling who.compareTo(supervisorComponent).

Change-Id: Ie49df625b1514b1d1e5f8063db66dce4a5050039
2020-05-15 14:06:11 +00:00
Alex Johnston
dd1747011a Add policy transparency dialog to 'Remove work profile'
* For a work profile on an organization-owned device,
  no explanation was being shown to the user as to
  why the work profile cannot be removed.
* This CL adds a policy transparency dialog when the
  'Remove work profile' option is selected in the
  'Device Admin' Settings screen.

Bug: 149391073
Test: Manual testing
      atest com.android.settings.applications.specialaccess.deviceadmin.DeviceAdminAddTest
Change-Id: I8221973ed16fcc7c79f5897c3bea063050ae00a6
2020-03-09 09:25:49 +00:00
Raff Tsai
6ff13962a3 Fix talkback issue
Fixes: 141226569
Test: manual
Change-Id: I631554ab33d6cc77f3d3f2e4625d359a802dd5b5
2019-10-04 11:59:56 +08:00
Varun Shah
3e228f5a1a Update design for Family Link supervision enrollment dialog.
Bug: 124066840
Test: manual (trigger dialog via adb shell command)
Change-Id: Iff79a2ed034bb0128ce6c573ceea58c7a9f1c985
2019-05-22 11:48:07 -07:00
Michael Wachenschwanz
35eef604a3 Simplify user flow for setting default supervisor as PO
A follow up CL will clean up and separate the DeviceAdminAdd and
ProfileOwnerAdd logic (see b/131713071)

Bug: 124066840
Test: manual (overlay config_defaultSupervisionProfileOwnerComponent and
confirm only that component can be set as profile owner after setup is
complete)
Test: manual (install CtsVerifier, adb shell am start -n "com.android.cts.verifier/.admin.tapjacking.OverlayingActivity", user should not be able to click the "Allow" button)

Change-Id: Iccd931801145719110ce75421c35db80ea651779
2019-05-02 03:42:06 +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
Fan Zhang
a6c7db1888 Update logging: switch a bunch of action() logging calls.
Use generic action(int, int, int, String, int) instead of
action(Context, int, string, Pair...) when possible.

Bug: 117860032
Test: robotests
Change-Id: I5213b52b2b10d80a3c488c37718df81b3b0a428f
2018-11-13 21:50:34 -08: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
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
jackqdyulei
f1213365fc Unrestrict SMS/PHONE app if it been set active
If an app been set default SMS/PHONE app, we need to unrestrict this
app. This CL extract a common function and invoke it when necessary.

Change-Id: Id29c5138438aa6f6f22cdd9c4ecf336de8481782
Fixes: 80305978
Test: robotests
2018-07-18 12:32:34 -07:00
tmfang
99cc23d0da Settings Fragment Migration (Change imports)
This commit *only* changes imports and optimize imports.
We don't do anything else.

This patch can't compile pass and run test case.
We will update other patches to fix these problem.

Change list.

1. import android.app.Fragment; ->
   import androidx.fragment.app.Fragment;
2. import android.app.DialogFragment; ->
   import androidx.fragment.app.DialogFragment;
3. import android.app.ListFragment; ->
   import androidx.fragment.app.ListFragment;
4. import android.app.LoaderManager; ->
   import androidx.loader.app.LoaderManager;
5. import android.content.AsyncTaskLoader; ->
   import androidx.loader.content.AsyncTaskLoader;
6. import android.content.Loader; ->
   import androidx.loader.content.Loader;
7. import android.app.FragmentTransaction; ->
   import androidx.fragment.app.FragmentTransaction;
8. import android.app.FragmentManager; ->
   import androidx.fragment.app.FragmentManager;
9. import android.app.LoaderManager.LoaderCallbacks; ->
    import androidx.loader.app.LoaderManager.LoaderCallbacks;

Bug: 110259478
Test: Can't test it.
Change-Id: I0a3f98fff34a3494a839c3c42aeabcec3df2c8b3
2018-07-11 18:23:51 -07:00
Lei Yu
154af9a750 Unrestrict app if it been set as device admin app
Fix merge conlict in imports area

Bug: 110337989
Test: RunSettingsRoboTests
Change-Id: I8229bee97d970f8b16351193cfd99ca05ff041bf
2018-07-02 17:36:27 -07:00
Fan Zhang
ca6d86c5ab Move device admin viewer/adder to specialaccess package.
Bug: 110207366
Test: robo
Change-Id: I51552dcc5ec6525040cfde17087b7f3f6b21b581
2018-06-15 08:56:14 -07:00