Merge "Fix minor issues." into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
756143de48
@@ -8684,6 +8684,7 @@ public class DevicePolicyManager {
|
|||||||
*/
|
*/
|
||||||
@RequiresPermission(anyOf = {SET_TIME, QUERY_ADMIN_POLICY}, conditional = true)
|
@RequiresPermission(anyOf = {SET_TIME, QUERY_ADMIN_POLICY}, conditional = true)
|
||||||
public boolean getAutoTimeEnabled(@Nullable ComponentName admin) {
|
public boolean getAutoTimeEnabled(@Nullable ComponentName admin) {
|
||||||
|
throwIfParentInstance("getAutoTimeEnabled");
|
||||||
if (mService != null) {
|
if (mService != null) {
|
||||||
try {
|
try {
|
||||||
return mService.getAutoTimeEnabled(admin, mContext.getPackageName());
|
return mService.getAutoTimeEnabled(admin, mContext.getPackageName());
|
||||||
|
|||||||
@@ -447,6 +447,7 @@ import android.util.AtomicFile;
|
|||||||
import android.util.DebugUtils;
|
import android.util.DebugUtils;
|
||||||
import android.util.IndentingPrintWriter;
|
import android.util.IndentingPrintWriter;
|
||||||
import android.util.IntArray;
|
import android.util.IntArray;
|
||||||
|
import android.util.Log;
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
@@ -12080,7 +12081,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
|||||||
Objects.requireNonNull(who, "ComponentName is null");
|
Objects.requireNonNull(who, "ComponentName is null");
|
||||||
final CallerIdentity caller = getCallerIdentity(who);
|
final CallerIdentity caller = getCallerIdentity(who);
|
||||||
Preconditions.checkCallAuthorization(
|
Preconditions.checkCallAuthorization(
|
||||||
isDeviceOwner(caller) || isProfileOwner(caller));
|
isDefaultDeviceOwner(caller) || isProfileOwner(caller));
|
||||||
|
|
||||||
if (packageList != null) {
|
if (packageList != null) {
|
||||||
for (String pkg : packageList) {
|
for (String pkg : packageList) {
|
||||||
@@ -13365,8 +13366,14 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
|||||||
PolicyDefinition<Boolean> policyDefinition =
|
PolicyDefinition<Boolean> policyDefinition =
|
||||||
PolicyDefinition.getPolicyDefinitionForUserRestriction(key);
|
PolicyDefinition.getPolicyDefinitionForUserRestriction(key);
|
||||||
if (enabledFromThisOwner) {
|
if (enabledFromThisOwner) {
|
||||||
setLocalUserRestrictionInternal(
|
// TODO: Remove this special case - replace with breaking change to require
|
||||||
admin, key, /* enabled= */ true, affectedUserId);
|
// setGlobally to disable ADB
|
||||||
|
if (key.equals(UserManager.DISALLOW_DEBUGGING_FEATURES) && parent) {
|
||||||
|
setGlobalUserRestrictionInternal(admin, key, /* enabled= */ true);
|
||||||
|
} else {
|
||||||
|
setLocalUserRestrictionInternal(
|
||||||
|
admin, key, /* enabled= */ true, affectedUserId);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Remove any local and global policy that was set by the admin
|
// Remove any local and global policy that was set by the admin
|
||||||
if (!policyDefinition.isLocalOnlyPolicy()) {
|
if (!policyDefinition.isLocalOnlyPolicy()) {
|
||||||
@@ -15155,7 +15162,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
|||||||
}
|
}
|
||||||
DevicePolicyEventLogger
|
DevicePolicyEventLogger
|
||||||
.createEvent(DevicePolicyEnums.SET_LOCKTASK_MODE_ENABLED)
|
.createEvent(DevicePolicyEnums.SET_LOCKTASK_MODE_ENABLED)
|
||||||
.setAdmin(admin.info.getPackageName())
|
.setAdmin(admin.info == null ? null : admin.info.getPackageName())
|
||||||
.setBoolean(isEnabled)
|
.setBoolean(isEnabled)
|
||||||
.setStrings(pkg)
|
.setStrings(pkg)
|
||||||
.write();
|
.write();
|
||||||
@@ -22721,7 +22728,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleFinancedDeviceKioskRoleChange() {
|
private void handleFinancedDeviceKioskRoleChange() {
|
||||||
if (!isPermissionCheckFlagEnabled()) {
|
if (!isPolicyEngineForFinanceFlagEnabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Slog.i(LOG_TAG, "Handling action " + ACTION_DEVICE_FINANCING_STATE_CHANGED);
|
Slog.i(LOG_TAG, "Handling action " + ACTION_DEVICE_FINANCING_STATE_CHANGED);
|
||||||
|
|||||||
Reference in New Issue
Block a user