1 /* 2 * Copyright 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.credentials; 18 19 import java.util.List; 20 21 import android.credentials.CredentialProviderInfo; 22 import android.credentials.ClearCredentialStateRequest; 23 import android.credentials.CreateCredentialRequest; 24 import android.credentials.GetCandidateCredentialsRequest; 25 import android.credentials.GetCredentialRequest; 26 import android.credentials.RegisterCredentialDescriptionRequest; 27 import android.credentials.UnregisterCredentialDescriptionRequest; 28 import android.credentials.IClearCredentialStateCallback; 29 import android.credentials.ICreateCredentialCallback; 30 import android.credentials.IGetCredentialCallback; 31 import android.credentials.IGetCandidateCredentialsCallback; 32 import android.credentials.IPrepareGetCredentialCallback; 33 import android.credentials.ISetEnabledProvidersCallback; 34 import android.content.ComponentName; 35 import android.os.IBinder; 36 import android.os.ICancellationSignal; 37 38 /** 39 * System private interface for talking to the credential manager service. 40 * 41 * @hide 42 */ 43 interface ICredentialManager { 44 executeGetCredential(in GetCredentialRequest request, in IGetCredentialCallback callback, String callingPackage)45 @nullable ICancellationSignal executeGetCredential(in GetCredentialRequest request, in IGetCredentialCallback callback, String callingPackage); 46 executePrepareGetCredential(in GetCredentialRequest request, in IPrepareGetCredentialCallback prepareGetCredentialCallback, in IGetCredentialCallback getCredentialCallback, String callingPackage)47 @nullable ICancellationSignal executePrepareGetCredential(in GetCredentialRequest request, in IPrepareGetCredentialCallback prepareGetCredentialCallback, in IGetCredentialCallback getCredentialCallback, String callingPackage); 48 executeCreateCredential(in CreateCredentialRequest request, in ICreateCredentialCallback callback, String callingPackage)49 @nullable ICancellationSignal executeCreateCredential(in CreateCredentialRequest request, in ICreateCredentialCallback callback, String callingPackage); 50 getCandidateCredentials(in GetCredentialRequest request, in IGetCandidateCredentialsCallback callback, in IBinder clientCallback, String callingPackage)51 @nullable ICancellationSignal getCandidateCredentials(in GetCredentialRequest request, in IGetCandidateCredentialsCallback callback, in IBinder clientCallback, String callingPackage); 52 clearCredentialState(in ClearCredentialStateRequest request, in IClearCredentialStateCallback callback, String callingPackage)53 @nullable ICancellationSignal clearCredentialState(in ClearCredentialStateRequest request, in IClearCredentialStateCallback callback, String callingPackage); 54 setEnabledProviders(in List<String> primaryProviders, in List<String> providers, in int userId, in ISetEnabledProvidersCallback callback)55 void setEnabledProviders(in List<String> primaryProviders, in List<String> providers, in int userId, in ISetEnabledProvidersCallback callback); 56 registerCredentialDescription(in RegisterCredentialDescriptionRequest request, String callingPackage)57 void registerCredentialDescription(in RegisterCredentialDescriptionRequest request, String callingPackage); 58 unregisterCredentialDescription(in UnregisterCredentialDescriptionRequest request, String callingPackage)59 void unregisterCredentialDescription(in UnregisterCredentialDescriptionRequest request, String callingPackage); 60 isEnabledCredentialProviderService(in ComponentName componentName, String callingPackage)61 boolean isEnabledCredentialProviderService(in ComponentName componentName, String callingPackage); 62 getCredentialProviderServices(in int userId, in int providerFilter)63 List<CredentialProviderInfo> getCredentialProviderServices(in int userId, in int providerFilter); 64 getCredentialProviderServicesForTesting(in int providerFilter)65 List<CredentialProviderInfo> getCredentialProviderServicesForTesting(in int providerFilter); 66 isServiceEnabled()67 boolean isServiceEnabled(); 68 } 69 70