Device management info: Refer to current user, not primary user

The device management info page should show information about the
current user's policies, not the primary user's.

Bug: 32692748
Test: m RunSettingsRoboTests

Change-Id: I5d8afa7fae1c0f3a4da78b085365882827e6721b
This commit is contained in:
Bartosz Fabianowski
2017-03-30 10:33:28 +02:00
parent 2b37b43821
commit b836da263d
20 changed files with 89 additions and 139 deletions

View File

@@ -142,7 +142,7 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe
}
@Override
public boolean isAlwaysOnVpnSetInPrimaryUser() {
public boolean isAlwaysOnVpnSetInCurrentUser() {
return VpnUtils.isAlwaysOnVpnSet(mCm, MY_USER_ID);
}
@@ -159,12 +159,12 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe
}
@Override
public int getMaximumFailedPasswordsBeforeWipeInPrimaryUser() {
final ComponentName deviceOwner = mDpm.getDeviceOwnerComponentOnAnyUser();
if (deviceOwner == null) {
public int getMaximumFailedPasswordsBeforeWipeInCurrentUser() {
final ComponentName profileOwner = mDpm.getProfileOwnerAsUser(MY_USER_ID);
if (profileOwner == null) {
return 0;
}
return mDpm.getMaximumFailedPasswordsForWipe(deviceOwner, mDpm.getDeviceOwnerUserId());
return mDpm.getMaximumFailedPasswordsForWipe(profileOwner, MY_USER_ID);
}
@Override