Update Action Not Allowed Dialog text for a financed device
Bug: 173826319 Bug: 158157476 Test: Used a test device that is registered via ZT Test: m RunSettingsRoboTests ROBOTEST_FILTER=ActionDisabledByAdminDialogHelperTest Change-Id: Iefeb0b653764952e409dfd862d9cc54c4f5e7fc9
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
package com.android.settings.testutils.shadow;
|
||||
|
||||
import static android.app.admin.DevicePolicyManager.DEVICE_OWNER_TYPE_DEFAULT;
|
||||
import static android.app.admin.DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.UserIdInt;
|
||||
import android.app.admin.DevicePolicyManager;
|
||||
import android.app.admin.DevicePolicyManager.DeviceOwnerType;
|
||||
import android.app.admin.PasswordMetrics;
|
||||
import android.app.admin.PasswordPolicy;
|
||||
import android.content.ComponentName;
|
||||
@@ -23,6 +25,7 @@ import java.util.Objects;
|
||||
public class ShadowDevicePolicyManager extends org.robolectric.shadows.ShadowDevicePolicyManager {
|
||||
|
||||
private final Map<Integer, Long> mProfileTimeouts = new HashMap<>();
|
||||
private final Map<String, Integer> mDeviceOwnerTypes = new HashMap<>();
|
||||
private Map<Integer, CharSequence> mSupportMessagesMap = new HashMap<>();
|
||||
private boolean mIsAdminActiveAsUser = false;
|
||||
private ComponentName mDeviceOwnerComponentName;
|
||||
@@ -77,6 +80,16 @@ public class ShadowDevicePolicyManager extends org.robolectric.shadows.ShadowDev
|
||||
mDeviceOwnerComponentName = admin;
|
||||
}
|
||||
|
||||
public void setDeviceOwnerType(@NonNull ComponentName admin,
|
||||
@DeviceOwnerType int deviceOwnerType) {
|
||||
mDeviceOwnerTypes.put(admin.getPackageName(), deviceOwnerType);
|
||||
}
|
||||
|
||||
@DeviceOwnerType
|
||||
public int getDeviceOwnerType(@NonNull ComponentName admin) {
|
||||
return mDeviceOwnerTypes.getOrDefault(admin.getPackageName(), DEVICE_OWNER_TYPE_DEFAULT);
|
||||
}
|
||||
|
||||
@Implementation
|
||||
public PasswordMetrics getPasswordMinimumMetrics(int userHandle) {
|
||||
PasswordPolicy policy = new PasswordPolicy();
|
||||
|
Reference in New Issue
Block a user