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