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

Commit f32f6b06 authored by Shaquille Johnson's avatar Shaquille Johnson Committed by Gerrit Code Review
Browse files

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

parents 0160a443 49b45a95
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];