Commit Graph

37 Commits

Author SHA1 Message Date
Robin Lee
acdeac6809 Fix broken RestrictedLockUtils KeyGuard APIs
They were all broken in that they returned profile admins for parent
queries even when they clearly shouldn't.

Examples:
 - disable unredacted notifications
 - disable fingerprint

This doesn't seem to have been tested beyond the bare basics of one
user with one device admin. Added some reasonable coverage. It could
still do with more.

Test: make RunSettingsLibRoboTests
Bug: 34929375
Change-Id: I1b0e986056ffa62d47091c0010977ac810ebd690
2017-02-22 17:39:34 +00:00
Andrew Scull
4e201486b5 Extract checking profiles for restrictions into a shared method.
Test: m RunSettingsLibRoboTests
Change-Id: Ie8fd3121771a7a2213ee441aef5a0746ad09a6c9
2016-12-13 10:45:37 +00:00
TreeHugger Robot
5548733eb5 Merge "Avoid triggering support dialog in non-current user." into nyc-dev 2016-06-03 17:02:53 +00:00
Sudheer Shanka
54cb63c182 Avoid triggering support dialog in non-current user.
Bug: 28953755
Change-Id: I3e23a003ec7c8c3d275fa09d6d58f59cc272f617
2016-06-03 08:26:04 -07:00
Ian Rogers
3e4885d333 Fix call to equals that could never succeed.
Caught by Error Prone.
Bug: 29045331

Change-Id: I5901a3ca06e0cc85620f596cfa4178f5ad61d1a7
(cherry picked from commit edf2f5747b)
2016-06-01 16:27:28 +00:00
Sudheer Shanka
93f8fd714a Update RestrictedLockUtils to use UM.getUserRestrictionSource.
Bug: 28269827
Change-Id: Ib4a1441b71986ca6637a9236136b60e18dbc1643
2016-05-17 13:27:27 -07:00
Tony Mak
c820cc5fb1 New settings key and policy transparency for managed profile settings
Bug: 28281560
Change-Id: I38d0c202088df410a28e78800de4e74377ec3216
2016-05-04 09:33:08 +00:00
Ricky Wai
035e924470 Fix work profile screen timeout policy
Settings screen should apply both primary and managed maximum
timeout policy, even separate profile challenge is enabled.

Bug: 27493348
Change-Id: Ia1ec1cafc7665c54816833af64e0f446a77a55b2
2016-04-07 17:16:03 +01:00
Andrei Stingaceanu
aa60469445 Merge "AfW - suspend apps - API polish" into nyc-dev 2016-03-31 10:57:58 +00:00
Sudheer Shanka
549b969280 Return null value if getActiveAdminUncheckedLocked returns null.
- Split per user version of getUserRestrictions into a separate method
  in DPMS and make the per-user version return null if the admin
  parameter is not a valid one.
- Update isAccessibilityServicePermittedByAdmin and
  isInputMethodPermittedByAdmin to return false if the admin parameter
  is not a valid one.

Bug: 27909087
Change-Id: I6f4cae6552cbfe02dc4a92b04eeeddf0314e0974
2016-03-30 17:12:07 -07:00
Andrei Stingaceanu
efc4a344a1 AfW - suspend apps - API polish
* renamed getPackageSuspended => isPackageSuspended
* does not return false for an error, instead throws
  NameNotFoundException if the package could not be
  found, or if there is an unknown RemoteException,
  wraps it in a RuntimeException and rethrows.

Bug: 27532430
Bug: 22776761
Change-Id: Iee00600089b1c0556a3312b10456826464fa8f9f
2016-03-29 14:49:21 +00:00
Sudheer Shanka
f271fd5199 Use compound drawable instead of image span.
Bug: 27263531
Change-Id: Id35342c6656cd4b0f4b1756c903e9cf071293a14
2016-03-09 14:21:07 -08:00
Sudheer Shanka
40400a648f Update restricted icon.
Bug: 25603665
Bug: 27263775
Change-Id: Ib66866cf536f15130f936d03d9328ee5b0b508c7
2016-03-02 19:08:51 -08:00
Sudheer Shanka
a8fbbb30ea Part1 - Don't add padlock if the restriction is not set by admin.
Bug: 26687435
Change-Id: I2fd740b1fa0d76eceedc4dde73e41d779820bbcf
2016-02-19 19:21:57 +00:00
Andrei Stingaceanu
355b232d79 Suspend packages - new API for retrieving the suspended status
Instead of always rebuilding the full ApplicationInfo for a
package when callers are only interested in the suspended status
add a new fast API in Packagemanager (which only checks the
suspended user setting for the requested package and returns
a boolean) and change the appropriate caller code too.

Bug: 26794775
Bug: 22776761
Change-Id: Ide8428ef734479360d5a8a75fd8e0ed8ddf2da7a
2016-02-16 14:57:29 +00:00
Sudheer Shanka
57218cbbf7 Merge "Made changes to fix some policy transparency options." 2016-02-04 19:14:14 +00:00
Sudheer Shanka
569258689a Made changes to fix some policy transparency options.
Add isInputMethodPermittedByAdmin and
isAccessibilityServicePermittedByAdmin APIs in DevicePolicyManager.
And update utility methods in RestrictedLockUtils to use the correct
userId when checking if disabled by admin.

Bug: 26897250
Bug: 26767564
Bug: 26966213
Change-Id: I0b74b3e57904a82f8ce72d856769d35b5e8403e5
2016-02-04 01:12:44 +00:00
Sudheer Shanka
1d0169bd9d Add an utility method to get device owner.
Change-Id: I0856d220aa8e4b8d17b83c04b9530dc2d085d94d
2016-02-03 00:25:50 +00:00
Clara Bayarri
6b6c5a2035 Make Notification Redaction independent for work profiles
Bug: 26709332
Change-Id: Ifc13c3c5a62110a3dfc44c2a02df9db11d92b431
2016-02-01 10:13:23 +00:00
Andrei Stingaceanu
30c33e09b6 Merge "RestrictedLockUtils - introduce check for suspended apps" 2016-01-28 21:01:53 +00:00
Andrei Stingaceanu
44af4828c3 RestrictedLockUtils - introduce check for suspended apps
Used in Settings for restricting preferences.

Bug: 22776761
Change-Id: I6aad4400981cee00c734060ea3d6cf2641a721d9
2016-01-28 20:56:04 +00:00
Sudheer Shanka
978fc0d44c Add a DPM method to allow system to query parent profile instance.
Bug: 26830384
Change-Id: Ib12b171b1032bd86488f32f8d22eb0a9efb75e8f
2016-01-28 16:36:00 +00:00
Sudheer Shanka
39cef94f1a Made checkIfkeyguardNotificationFeaturesDisabled more generic.
Currently, it can be only used for checking the status of keyguard
notification features, made it generic so that it can be used for
other keyguard features like disable_fingerprint etc.

Change-Id: Ib2adfc12d7866cce248af78cc8b159cada9a6cad
2016-01-26 22:34:41 +00:00
Sudheer Shanka
6e3e9fc359 Merge "Add util method to get the admin who set maximum time to lock." 2016-01-26 22:29:41 +00:00
Sudheer Shanka
c61087106e Check for null condition in case there is no DPM support.
Change-Id: Ie7c70737d0c36ae9efd1920498d9f07b8a7016b1
2016-01-26 14:00:16 +00:00
Sudheer Shanka
45e298f4b9 Add util method to get the admin who set maximum time to lock.
Added util method checkIfMaximumTimeToLockIsSet in RestrictedLockUtils
to get the admin who set maximum time to lock. Also, made a few updates
to the javadocs of other methods.

Change-Id: Ide3048b277f854360aa92d975963b61dff2387bb
2016-01-25 13:00:35 +00:00
Sudheer Shanka
0fa741253d Add a guard against NullPointerException in RestrictedLockUtils.
Change-Id: I1eb7852cf58a4435a2c7627a569ade5f44855bf7
2016-01-21 13:47:51 +00:00
Ruben Brunk
742721389c Fix admin check in Settings.
- This check is broken when there are no Admins on the device.
- Blocks enabling NotificationListenerServices in Settings.

Change-Id: I2c30daf2fc4632d55e84f0e499e3ceedbe162b98
2016-01-21 06:02:32 +00:00
Sudheer Shanka
e50cad066e Merge "Add an util method and update setMenuItemAsDisabledByAdmin." 2016-01-18 18:28:55 +00:00
Sudheer Shanka
a8f8fb4f8a Merge "Add extra utility method to RestrictedLockUtils." 2016-01-18 18:00:44 +00:00
Sudheer Shanka
ba4a49800e Merge "Remove spacing when removing padlock and add more util methods." 2016-01-18 17:24:19 +00:00
Sudheer Shanka
20e22960cb Remove spacing when removing padlock and add more util methods.
When adding the padlock, a space is appended to the string which needs
to removed along with the padlock. And added more utility methods in
RestrictedLockUtils.

Change-Id: I33f976db23bfdd39d76c4201be0727bfafb00fd4
2016-01-18 17:16:45 +00:00
Sudheer Shanka
1c09db211c Check for null values when copying enforcedAdmin in QSTile.State.
Bug: 26612685
Change-Id: I8228d1dffc3623d3589b51c6c33f07cc53605ef2
2016-01-18 16:05:10 +00:00
Sudheer Shanka
7664cbac35 Add an util method and update setMenuItemAsDisabledByAdmin.
Added an utility method checkIfUninstallBlocked in
RestrictedLockUtils. Also updated setMenuItemAsDisabledByAdmin
to be able to remove the added padlock and color spans.

Change-Id: I7874f7097d09bc9ab127307f2a8a03a20560347c
2016-01-15 15:47:19 +00:00
Sudheer Shanka
1c7cda8bbf Add restricted padlocks to tiles in quick settings.
Change-Id: Ib11a38f8512b811e5713a33055a04a72f1b825f1
2016-01-13 20:06:35 +00:00
Sudheer Shanka
9f77a7170a Add extra utility method to RestrictedLockUtils.
Change-Id: I558c975e5b35622cc7a4c1e8a8b16e6492ce983f
2016-01-12 19:38:53 +00:00
Sudheer Shanka
7ff866d286 Move restricted padlock support to SettingsLib
Change-Id: Ib0b1c58d1f45e017b6b17ce0a55ca839b900cba4
2016-01-12 18:14:24 +00:00