1 /* 2 * Copyright (C) 2018 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.car.trust; 18 19 import android.bluetooth.BluetoothDevice; 20 import android.car.trust.ICarTrustAgentBleCallback; 21 import android.car.trust.ICarTrustAgentEnrolmentCallback; 22 import android.car.trust.ICarTrustAgentTokenRequestDelegate; 23 import android.car.trust.ICarTrustAgentTokenResponseCallback; 24 import android.car.trust.ICarTrustAgentUnlockCallback; 25 26 /** 27 * Binder interface for CarTrustAgentBleService. 28 * 29 * @hide 30 */ 31 interface ICarTrustAgentBleService { 32 /** General BLE */ 33 void registerBleCallback(in ICarTrustAgentBleCallback callback); 34 void unregisterBleCallback(in ICarTrustAgentBleCallback callback); 35 36 /** Enrolment */ 37 void startEnrolmentAdvertising(); 38 void stopEnrolmentAdvertising(); 39 void sendEnrolmentHandle(in BluetoothDevice device, long handle); 40 void registerEnrolmentCallback(in ICarTrustAgentEnrolmentCallback callback); 41 void unregisterEnrolmentCallback(in ICarTrustAgentEnrolmentCallback callback); 42 43 /** Unlock */ 44 void startUnlockAdvertising(); 45 void stopUnlockAdvertising(); 46 void registerUnlockCallback(in ICarTrustAgentUnlockCallback callback); 47 void unregisterUnlockCallback(in ICarTrustAgentUnlockCallback callback); 48 49 /** Token request */ 50 void setTokenRequestDelegate(in ICarTrustAgentTokenRequestDelegate delegate); 51 void revokeTrust(); 52 void addEscrowToken(in byte[] token, int uid); 53 void removeEscrowToken(long handle, int uid); 54 void isEscrowTokenActive(long handle, int uid); 55 56 /** Token response */ 57 void setTokenResponseCallback(in ICarTrustAgentTokenResponseCallback callback); 58 void onEscrowTokenAdded(in byte[] token, long handle, int uid); 59 void onEscrowTokenRemoved(long handle, boolean successful); 60 void onEscrowTokenActiveStateChanged(long handle, boolean active); 61 } 62