Skip to content
Commit 094c98e2 authored by Eran Messeri's avatar Eran Messeri
Browse files

Do not apply password quality to the parent

Prevent password quality set by the admin from applying on the primary
user, if targeting Android S and above:
* If the DPC calls setPasswordQuality on the parent profile DPM
  instance, throw.
* If the DPC calls setPasswordQuality on the regular DPM instance,
  simply ignore it on the primary profile.

This is guarded by the ChangeCompat framework.

Note about testing: As it proved difficult to mock/fake the
compatibility testing framework, the check is done via the injector,
which can be easily overridden.

Bug: 165573442
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testResetPasswordWithToken com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testGetPasswordExpiration FrameworksServicesTests:DevicePolicyManagerTest ManagedProfileTest
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Change-Id: I59354066dafb02fe1d464fd1ddabf3969a4d0f1b
parent d8e23012
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment