Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a4c0632 authored by Shaquille Johnson's avatar Shaquille Johnson Committed by Automerger Merge Worker
Browse files

Merge "Raise an error when unable to get Attestation Application ID" into main...

Merge "Raise an error when unable to get Attestation Application ID" into main am: f32f6b06 am: 527f826a

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2863125



Change-Id: If0907aa0df855afba12e6619a546c3cfe57307dd
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 86a90565 527f826a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -20,8 +20,14 @@ import android.security.keystore.KeyAttestationApplicationId;

/** @hide */
interface IKeyAttestationApplicationIdProvider {
    const int ERROR_GET_ATTESTATION_APPLICATION_ID_FAILED = 1;

    /**
     * Provides information describing the possible applications identified by a UID.
     *
     * In case of not getting package ids from uid return
     * {@link #ERROR_GET_ATTESTATION_APPLICATION_ID_FAILED} to the caller.
     *
     * @hide
     */
    KeyAttestationApplicationId getKeyAttestationApplicationId(int uid);
+5 −2
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
 * limitations under the License.
 */


package com.android.server.security;

import android.content.Context;
@@ -23,6 +22,7 @@ import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Binder;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
import android.os.UserHandle;
import android.security.keystore.IKeyAttestationApplicationIdProvider;
import android.security.keystore.KeyAttestationApplicationId;
@@ -57,7 +57,10 @@ public class KeyAttestationApplicationIdProviderService
        try {
            String[] packageNames = mPackageManager.getPackagesForUid(uid);
            if (packageNames == null) {
                throw new RemoteException("No packages for uid");
                throw new ServiceSpecificException(
                        IKeyAttestationApplicationIdProvider
                                .ERROR_GET_ATTESTATION_APPLICATION_ID_FAILED,
                        "No package for uid: " + uid);
            }
            int userId = UserHandle.getUserId(uid);
            keyAttestationPackageInfos = new KeyAttestationPackageInfo[packageNames.length];