Commit | Line | Data |
---|---|---|
cd9434cc | 1 | /* |
15e8442f JA |
2 | Copyright © Trustonic Limited 2013 |
3 | ||
4 | All rights reserved. | |
5 | ||
6 | Redistribution and use in source and binary forms, with or without modification, | |
7 | are permitted provided that the following conditions are met: | |
8 | ||
9 | 1. Redistributions of source code must retain the above copyright notice, this | |
10 | list of conditions and the following disclaimer. | |
11 | ||
12 | 2. Redistributions in binary form must reproduce the above copyright notice, | |
13 | this list of conditions and the following disclaimer in the documentation | |
14 | and/or other materials provided with the distribution. | |
15 | ||
16 | 3. Neither the name of the Trustonic Limited nor the names of its contributors | |
17 | may be used to endorse or promote products derived from this software | |
18 | without specific prior written permission. | |
19 | ||
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |
21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
23 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |
24 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
25 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |
27 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |
28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |
29 | OF THE POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | |
cd9434cc T |
31 | |
32 | /** \addtogroup ROOTPA AIDL Interfaces | |
33 | * @{ | |
34 | */ | |
35 | package com.gd.mobicore.pa.ifc; | |
36 | ||
37 | import java.util.List; | |
38 | import com.gd.mobicore.pa.ifc.CmpCommand; | |
39 | import com.gd.mobicore.pa.ifc.CmpResponse; | |
40 | import com.gd.mobicore.pa.ifc.CommandResult; | |
41 | import com.gd.mobicore.pa.ifc.BooleanResult; | |
42 | import com.gd.mobicore.pa.ifc.SPID; | |
43 | import com.gd.mobicore.pa.ifc.Version; | |
44 | import com.gd.mobicore.pa.ifc.SUID; | |
45 | import com.gd.mobicore.pa.ifc.SPContainerStructure; | |
46 | import com.gd.mobicore.pa.ifc.SPContainerStateParcel; | |
47 | ||
48 | /** | |
15e8442f JA |
49 | * RootPAServiceIfc is intended for SP.PA use at the time of installing new trustlet. It provides means |
50 | * to communicate with content management trustlet (using CMP version 3), request SE to perform provisioning | |
51 | * of root container and trustlet container and means to obtain some information on the MobiCore and its registry. | |
cd9434cc T |
52 | * |
53 | * The service is started by sending intent com.gd.mobicore.pa.service.PROVISIONING_SERVICE in binding. | |
54 | */ | |
55 | interface RootPAServiceIfc { | |
56 | ||
57 | /** | |
58 | * Checks if a root container is registered. | |
59 | * Lock must not be acquired before executing this method and it can not be | |
60 | * acquired while this method runs. | |
61 | * | |
62 | * @param result true if root container exists. | |
63 | * @return indication of successful completion | |
64 | */ | |
65 | CommandResult isRootContainerRegistered(out BooleanResult result); | |
66 | ||
67 | /** | |
68 | * Checks if a specific SP container is registered. | |
69 | * Lock must not be acquired before executing this method and it can not be | |
70 | * acquired while this method runs. | |
71 | * | |
72 | * @param spid SPID of the Service Provider | |
73 | * @param result is true if the SP container exists. | |
74 | * @return indication of successful completion | |
75 | */ | |
76 | CommandResult isSPContainerRegistered(in SPID spid, out BooleanResult result); | |
77 | ||
78 | /** | |
79 | * Returns the version of various components of the MobiCore OS and surrounding components. | |
80 | * Lock must not be acquired before executing this method and it can not be | |
81 | * acquired while this method runs. | |
82 | * | |
83 | * @param version the result code of the call is saved in this parameter. | |
84 | * @return indication of successful completion | |
85 | */ | |
86 | CommandResult getVersion(out Version version); | |
87 | ||
88 | /** | |
89 | * Returns the SUID of the device. | |
90 | * Lock must not be acquired before executing this method and it can not be | |
91 | * acquired while this method runs. | |
92 | * | |
93 | * @param suid the result of the SUID is saved in this parameter. | |
94 | * @return indication of successful completion | |
95 | */ | |
96 | CommandResult getDeviceId(out SUID suid); | |
97 | ||
98 | /** | |
99 | * Acquires an exclusive communication lock with the MobiCore CMTL and registers the UID as the owner of the lock. | |
100 | * Subsequent calls to acquire a lock by the same application with the same UID will succeed, but requests for a lock | |
101 | * by other applications with different UIDs will fail until the lock is released. A lock is released when | |
102 | * {@link #releaseLock(int)} is called or the lock times out 60 seconds after being acquired. Each subsequent | |
103 | * call to acquire a lock with the same UID will reset the lock timeout counter, so that it expires 60 seconds after | |
104 | * the most recent call. | |
105 | * @param uid a unique value for the application that wishes to acquire a lock (the user id of the process satisfies this) | |
106 | * @return indication of successful completion | |
107 | */ | |
108 | CommandResult acquireLock(int uid); | |
109 | ||
110 | /** | |
111 | * Explicitly frees a lock. | |
112 | * | |
113 | * @param uid the user id of the process which is accessing. | |
114 | * @return indication of successful completion | |
115 | */ | |
116 | CommandResult releaseLock(int uid); | |
117 | ||
118 | /** | |
119 | * Executes a list of CMP commands and returns the corresponding CMP responses. | |
120 | * If one of the commands result in an error then the following commands are | |
121 | * not executed anymore, unless the command object has "ignoreError" set true. | |
122 | * A lock is required to execute this method. | |
123 | * | |
124 | * Note that this causes only excution of the CMP command(s) and reads/stores the | |
125 | * secure objects when needed. It does not initiate any discussion with Servce Enabler | |
126 | * or any other network component with any of CMP commands. | |
127 | * | |
128 | * @param uid the user id of the process which is accessing. | |
129 | * @param commands the CMP commands to be executed | |
130 | * @param responses the CMP command responses | |
131 | * @return result code of the call | |
132 | */ | |
133 | CommandResult executeCmpCommands(int uid, in List<CmpCommand> commands, out List<CmpResponse> responses); | |
134 | ||
135 | /** | |
136 | * Starts provisioning. What actually happens after calling this depends on the state of the system and the commands SE sends. | |
137 | * In normal situation, SE sends commands to create root container and SP container (indicated by spid) if they do not already | |
138 | * exist. If given spid is 0, only root container is created (if it does not already exist). | |
139 | * Tasks are performed asynchronously. Method returns immediately. | |
140 | * Intents are broadcast to indicate the progress of the provisioning. The result is also | |
141 | * sent via broadcast. | |
142 | * | |
143 | * Cannot be executed if the acquireLock is called. Release any lock before calling this | |
144 | * method. Also, this command acquires lock internally before executing and releases lock | |
145 | * when error occurs or provisioning is finished (just before sending FINISHED_ROOT_PROVISIONING intent) or after 1 minute timeout. | |
146 | * | |
147 | * The following intents are broadcast after calling doProvisioning: | |
148 | * <ul> | |
149 | * <li>com.gd.mobicore.pa.service.PROVISIONING_PROGRESS_UPDATE: Sent when the progress is changing, status can be one of the following. | |
150 | * <ul> | |
151 | * <li>CONNECTING_SERVICE_ENABLER (id 100)</li> | |
152 | * <li>AUTHENTICATING_SOC (id 200)</li> | |
153 | * <li>CREATING_ROOT_CONTAINER (id 300)</li> | |
154 | * <li>AUTHENTICATING_ROOT (id 400)</li> | |
155 | * <li>CREATING_SP_CONTAINER (id 500)</li> | |
156 | * <li>FINISHED_PROVISIONING (id 1000)</li> | |
157 | * </ul> | |
158 | * </li> | |
159 | * <li>com.gd.mobicore.pa.service.FINISHED_ROOT_PROVISIONING: Sent when the provisioning is finished.</li> | |
160 | * <li>com.gd.mobicore.pa.service.PROVISIONING_ERROR: Sent when an error has occured, also contains an error code.</li> | |
161 | * </ul> | |
162 | * Note that depending on the nature of th errors it is possible that more than one PROVISIONING_ERROR intents are sent | |
163 | * before the excution of provisioning is fully stopped. This depends a lot on whether SE can still continue execution. | |
164 | * | |
165 | * There are constants related to the intents in @ref RootPAProvisioningIntents | |
166 | * | |
167 | * Service Enabler is contacted and asked to perform the tasks, so the device has to be connected to network | |
168 | * in order for this to succeed. | |
169 | * | |
170 | * @param uid the user id of the process which is accessing. | |
171 | * @param spid the service provider id for which a SP container should be created | |
172 | * @return indication of successful start of provisioning thread (ROOTPA_OK) or an error code | |
173 | */ | |
174 | ||
175 | CommandResult doProvisioning(int uid, in SPID spid); | |
176 | ||
177 | /** | |
178 | * Interrogates the SP container structure. | |
179 | * Lock must not be acquired before executing this method and it can not be | |
180 | * acquired while this method runs. | |
181 | * | |
182 | * @param spid provides [in] the id of the SP (SPCont) | |
15e8442f | 183 | * @param cs [out] state of the sp container and a list of installed trustlet containers for the given SP |
cd9434cc T |
184 | * @return indication of successful completion |
185 | */ | |
186 | CommandResult getSPContainerStructure(in SPID spid, out SPContainerStructure cs); | |
187 | ||
188 | /** | |
189 | * Interrogates the state of an SP container. | |
190 | * Lock must not be acquired before executing this method and it can not be | |
191 | * acquired while this method runs. | |
192 | * | |
193 | * @param spid [in] service provider id to query | |
194 | * @param state [out] the state of the SP container | |
195 | * @return indication of successful completion | |
196 | */ | |
197 | CommandResult getSPContainerState(in SPID spid, out SPContainerStateParcel state); | |
198 | ||
cd9434cc T |
199 | } |
200 | ||
201 | /**@}*/ |