1 /* 2 * Copyright (C) 2017, 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 * Contributed by: Giesecke & Devrient GmbH. 18 */ 19 20 package android.se.omapi; 21 22 import android.se.omapi.ISecureElementSession; 23 24 /** @hide */ 25 @VintfStability 26 interface ISecureElementReader { 27 28 /** 29 * Returns true if a card is present in the specified reader. 30 * Returns false if a card is not present in the specified reader. 31 */ isSecureElementPresent()32 boolean isSecureElementPresent(); 33 34 /** 35 * Connects to a secure element in this reader. <br> 36 * This method prepares (initialises) the Secure Element for communication 37 * before the Session object is returned (e.g. powers the Secure Element by 38 * ICC ON if it is not already on). There might be multiple sessions opened at 39 * the same time on the same reader. The system ensures the interleaving of 40 * APDUs between the respective sessions. 41 * 42 * @return a Session object to be used to create Channels. 43 */ openSession()44 ISecureElementSession openSession(); 45 46 /** 47 * Close all the sessions opened on this reader. All the channels opened by 48 * all these sessions will be closed. 49 */ closeSessions()50 void closeSessions(); 51 52 /** 53 * Closes all the sessions opened on this reader and resets the reader. 54 * All the channels opened by all these sessions will be closed. 55 * @return true if the reset is successful, false otherwise. 56 */ reset()57 boolean reset(); 58 } 59