When the admin user ID is null, UserHandle.NULL which has value -1000.
Test: atest RestrictedLockUtilsTest
Fixes: 118881180
Change-Id: I4958e168c9b99e16d8640718aefe306a5fb3504b
NPE happens when "modify" is tapped on the carrier wifi network
connected using CarrierConfig information. null is passed to
sendShowAdminSupportDetailsIntent method through 2nd argument.
Bug: 128188146
Test: Manually verified the crash scenario
Test: RunSettingsLibRoboTests
Signed-off-by: Daichi Ueura <daichi.ueura@sony.com>
(Cherry-pick from pa/1302748)
Change-Id: If92c12041b91dbab0f083a1b49d263b201e87699
Rather use
context.createPackageContextAsUser(context.getPackageName(), 0, user)
.getSystemService(DevicePolicyManager.class).getProfileOwner();
Test: Looked at permission restricted by device owner in UI
Fixes: 126699845
Change-Id: I3dc16fbe360aaeb416c526cacf5f55ce2c3a1b20
This requires RestrictedLockUtils to change which then causes further
changes.
I left the old APIs available for non-system-api customers.
Test: RunSettingsLibRoboTests
Bug: 116798569
Change-Id: Id5384ee074bb245e615012b7e0d5298b8bf27ba4
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