Merge changes from topic "presubmit-am-f8f92274f63941ba977d234b0bb20d91" into tm-mainline-prod

* changes:
  [automerged blank] Import translations. DO NOT MERGE ANYWHERE 2p: d2a6dd4b35 2p: 70970bfb1d
  [automerged blank] Import translations. DO NOT MERGE ANYWHERE 2p: d2a6dd4b35
  Import translations. DO NOT MERGE ANYWHERE
This commit is contained in:
Bill Yi
2022-03-24 21:26:50 +00:00
committed by Android (Google) Code Review
2 changed files with 24 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.ServiceManager;
import android.os.ServiceSpecificException;
import android.security.keystore.KeyProperties;
import android.security.maintenance.IKeystoreMaintenance;
import android.system.keystore2.Domain;
import android.system.keystore2.KeyDescriptor;
@@ -157,6 +158,11 @@ public class AndroidKeyStoreMaintenance {
* Migrates a key given by the source descriptor to the location designated by the destination
* descriptor.
*
* If Domain::APP is selected in either source or destination, nspace must be set to
* {@link KeyProperties#NAMESPACE_APPLICATION}, implying the caller's UID.
* If the caller has the MIGRATE_ANY_KEY permission, Domain::APP may be used with
* other nspace values which then indicates the UID of a different application.
*
* @param source - The key to migrate may be specified by Domain.APP, Domain.SELINUX, or
* Domain.KEY_ID. The caller needs the permissions use, delete, and grant for the
* source namespace.
@@ -183,4 +189,20 @@ public class AndroidKeyStoreMaintenance {
return SYSTEM_ERROR;
}
}
/**
* @see IKeystoreMaintenance#listEntries(int, long)
*/
@Nullable
public static KeyDescriptor[] listEntries(int domain, long nspace) {
try {
return getService().listEntries(domain, nspace);
} catch (ServiceSpecificException e) {
Log.e(TAG, "listEntries failed", e);
return null;
} catch (Exception e) {
Log.e(TAG, "Can not connect to keystore", e);
return null;
}
}
}

View File

@@ -12269,7 +12269,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
+ " only profile owner or device owner may control the preferential"
+ " network service");
synchronized (getLockObject()) {
final ActiveAdmin requiredAdmin = getDeviceOrProfileOwnerAdminLocked(
final ActiveAdmin requiredAdmin = getProfileOwnerAdminLocked(
caller.getUserId());
if (!requiredAdmin.mPreferentialNetworkServiceConfigs.equals(
preferentialNetworkServiceConfigs)) {
@@ -12299,8 +12299,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
+ " only profile owner or device owner may retrieve the preferential"
+ " network service configurations");
synchronized (getLockObject()) {
final ActiveAdmin requiredAdmin = getDeviceOrProfileOwnerAdminLocked(
caller.getUserId());
final ActiveAdmin requiredAdmin = getProfileOwnerAdminLocked(caller.getUserId());
return requiredAdmin.mPreferentialNetworkServiceConfigs;
}
}