summaryrefslogtreecommitdiff
path: root/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java
AgeCommit message (Collapse)Author
2018-08-30Factor some RestrictedLockUtils out of SettingLibPhilip P. Moltmann
Also make the new lib only use system-apis. This allows mainline module to use the new RestrictedLockUtilsSettingLib. Unfortunately the whole RestrictedLockUtils would have caused to much new system-api. Hence it was split into RestrictedLockUtils and RestrictedLockUtilsInternal. This caused a lot of trivial code changes. Bug: 110953302 Test: Built Change-Id: I693b3bf56f3be71f0790776e3aad5694717786ef
2018-08-28Sort importsFan Zhang
Having consistent import order will reduce chance of merge conflict between internal and external master Test: rebuild Change-Id: I9acb311ec05f72f0a37f08b0d26785841fe91de5
2018-04-26Merge "Pipe the user restriction to the admin dialog" into pi-dev am: c76929eb92Tony Mak
am: 45f3997297 Change-Id: I9aefd00b88469de40b81ec18493db10050ae7990
2018-04-25Pipe the user restriction to the admin dialogTony Mak
This change allows us to show different strings for different user restriction. Instead of setting DevicePolicyManager.EXTRA_RESTRICTION everywhere in Settings, EnforcedAdmin object now stores the restriction. So when we are starting the admin dialog with the EnforcedAdmin object, we can set the EXTRA_RESTRICTION bit. Test: make RunSettingsLibRoboTests Bug: 78443458 Change-Id: Iabc1629b9ed18f881cdc8c15ec5e49a4b50f76a4
2018-04-20Migrated SystemUI & SettingsLib to androidxAurimas Liutikas
Test: make SystemUI SettingsLib Bug:76692459 Change-Id: I248fdf4042a0a97bc6349091da21c936c2d37c95
2018-03-14Change MeteredDataDisabled function names for clarityMichael Wachenschwanz
Add the word Packages to several functions to clarify Metered Data is disabled on a per Package basis. setMeteredDataDisabled to setMeteredDataDisabledPackages getMeteredDataDisabled to getMeteredDataDisabledPackages isMeteredDataDisabledForUser to isMeteredDataDisabledForUserPackage Change-Id: Ied755b4422f8689e34bdb68d733d60fbfc47c692 Fixes: 73803958 Test: cts-tradefed run singleCommand cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSetMeteredDataDisabledPackages Test: cts-tradefed run singleCommand cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedProfileOwnerTest#testSetMeteredDataDisabledPackages Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest#testSetGetMeteredDataDisabledPackages
2018-01-29Add a DPM api to check if a pkg is restricted to use metered data.Sudheer Shanka
We need this so that Settings can check if an app is restricted by admin from using metered data. Bug: 63700027 Test: manual Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest Change-Id: I9a2ea9c458b0f10a3c3c6edcbe82da9eccaa51c3
2017-12-06Profile lock timeout.Pavel Grafov
When a managed profile has separate lock (a.k.a work challenge) and maximum screen off timeout set by admin, this timeout will only cause the profile to get locked, not the whole device. PowerManagerService now tracks some per-profile state for profiles that have lock timeout set by admin and have separate lock: 1. timeout set by admin. 2. wake lock summary 3. last activity time 4. whether the profile is considered active 5. whether the profile got locked last time it went inactive. Wake lock summaries and last activity times are updated at the same time as global wake lock summary/user activity is updated. Test: cts-tradefed run commandAndExit cts-dev -a armeabi-v7a -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.ManagedProfileTest Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services Bug: 63908311 Change-Id: Ief7be4e0bf12bdbedef94a129a13d07a9f98e75c
2017-11-01Fix possible NPE crash when adding new accounts in Settings.Lu Chen
Test: make RunSettingsLibRoboTests -j40 Bug: 68005130
2017-04-27Support profile global restrictions in disclosure messages.Pavel Grafov
Starting from Android O ENSURE_VERIFY_APPS can be enforced globally by profile owners. To take this into account, this CL uses newer UserManager API for getting a list of enforcing admins with their userIds instead of just a mask. Bug: 37158436 Test: manually Change-Id: Id18b365668373b5aa28d59fcc4d662a2f5d133d8
2017-02-22Fix broken RestrictedLockUtils KeyGuard APIsRobin Lee
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
2016-12-13Extract checking profiles for restrictions into a shared method.Andrew Scull
Test: m RunSettingsLibRoboTests Change-Id: Ie8fd3121771a7a2213ee441aef5a0746ad09a6c9
2016-06-03Merge "Avoid triggering support dialog in non-current user." into nyc-devTreeHugger Robot
2016-06-03Avoid triggering support dialog in non-current user.Sudheer Shanka
Bug: 28953755 Change-Id: I3e23a003ec7c8c3d275fa09d6d58f59cc272f617
2016-06-01Fix call to equals that could never succeed.Ian Rogers
Caught by Error Prone. Bug: 29045331 Change-Id: I5901a3ca06e0cc85620f596cfa4178f5ad61d1a7 (cherry picked from commit edf2f5747b9adc3399b59eb478c94641b1021222)
2016-05-17Update RestrictedLockUtils to use UM.getUserRestrictionSource.Sudheer Shanka
Bug: 28269827 Change-Id: Ib4a1441b71986ca6637a9236136b60e18dbc1643
2016-05-04New settings key and policy transparency for managed profile settingsTony Mak
Bug: 28281560 Change-Id: I38d0c202088df410a28e78800de4e74377ec3216
2016-04-07Fix work profile screen timeout policyRicky Wai
Settings screen should apply both primary and managed maximum timeout policy, even separate profile challenge is enabled. Bug: 27493348 Change-Id: Ia1ec1cafc7665c54816833af64e0f446a77a55b2
2016-03-31Merge "AfW - suspend apps - API polish" into nyc-devAndrei Stingaceanu
2016-03-30Return null value if getActiveAdminUncheckedLocked returns null.Sudheer Shanka
- 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-29AfW - suspend apps - API polishAndrei Stingaceanu
* 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-09Use compound drawable instead of image span.Sudheer Shanka
Bug: 27263531 Change-Id: Id35342c6656cd4b0f4b1756c903e9cf071293a14
2016-03-02Update restricted icon.Sudheer Shanka
Bug: 25603665 Bug: 27263775 Change-Id: Ib66866cf536f15130f936d03d9328ee5b0b508c7
2016-02-19Part1 - Don't add padlock if the restriction is not set by admin.Sudheer Shanka
Bug: 26687435 Change-Id: I2fd740b1fa0d76eceedc4dde73e41d779820bbcf
2016-02-16Suspend packages - new API for retrieving the suspended statusAndrei Stingaceanu
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-04Merge "Made changes to fix some policy transparency options."Sudheer Shanka
2016-02-04Made changes to fix some policy transparency options.Sudheer Shanka
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-03Add an utility method to get device owner.Sudheer Shanka
Change-Id: I0856d220aa8e4b8d17b83c04b9530dc2d085d94d
2016-02-01Make Notification Redaction independent for work profilesClara Bayarri
Bug: 26709332 Change-Id: Ifc13c3c5a62110a3dfc44c2a02df9db11d92b431
2016-01-28Merge "RestrictedLockUtils - introduce check for suspended apps"Andrei Stingaceanu
2016-01-28RestrictedLockUtils - introduce check for suspended appsAndrei Stingaceanu
Used in Settings for restricting preferences. Bug: 22776761 Change-Id: I6aad4400981cee00c734060ea3d6cf2641a721d9
2016-01-28Add a DPM method to allow system to query parent profile instance.Sudheer Shanka
Bug: 26830384 Change-Id: Ib12b171b1032bd86488f32f8d22eb0a9efb75e8f
2016-01-26Made checkIfkeyguardNotificationFeaturesDisabled more generic.Sudheer Shanka
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-26Merge "Add util method to get the admin who set maximum time to lock."Sudheer Shanka
2016-01-26Check for null condition in case there is no DPM support.Sudheer Shanka
Change-Id: Ie7c70737d0c36ae9efd1920498d9f07b8a7016b1
2016-01-25Add util method to get the admin who set maximum time to lock.Sudheer Shanka
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-21Add a guard against NullPointerException in RestrictedLockUtils.Sudheer Shanka
Change-Id: I1eb7852cf58a4435a2c7627a569ade5f44855bf7
2016-01-21Fix admin check in Settings.Ruben Brunk
- This check is broken when there are no Admins on the device. - Blocks enabling NotificationListenerServices in Settings. Change-Id: I2c30daf2fc4632d55e84f0e499e3ceedbe162b98
2016-01-18Merge "Add an util method and update setMenuItemAsDisabledByAdmin."Sudheer Shanka
2016-01-18Merge "Add extra utility method to RestrictedLockUtils."Sudheer Shanka
2016-01-18Merge "Remove spacing when removing padlock and add more util methods."Sudheer Shanka
2016-01-18Remove spacing when removing padlock and add more util methods.Sudheer Shanka
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-18Check for null values when copying enforcedAdmin in QSTile.State.Sudheer Shanka
Bug: 26612685 Change-Id: I8228d1dffc3623d3589b51c6c33f07cc53605ef2
2016-01-15Add an util method and update setMenuItemAsDisabledByAdmin.Sudheer Shanka
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-13Add restricted padlocks to tiles in quick settings.Sudheer Shanka
Change-Id: Ib11a38f8512b811e5713a33055a04a72f1b825f1
2016-01-12Add extra utility method to RestrictedLockUtils.Sudheer Shanka
Change-Id: I558c975e5b35622cc7a4c1e8a8b16e6492ce983f
2016-01-12Move restricted padlock support to SettingsLibSudheer Shanka
Change-Id: Ib0b1c58d1f45e017b6b17ce0a55ca839b900cba4