• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*****************************************************************************
2  * Copyright ©2017-2019 Gemalto – a Thales Company. All rights Reserved.
3  *
4  * This copy is 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  *     http://www.apache.org/licenses/LICENSE-2.0 or https://www.apache.org/licenses/LICENSE-2.0.html
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10  * See the License for the specific language governing permissions and limitations under the License.
11 
12  ****************************************************************************/
13 #include <android/hardware/secure_element/1.1/ISecureElement.h>
14 #include <hidl/LegacySupport.h>
15 #include <log/log.h>
16 
17 #include "SecureElement.h"
18 
19 // Generated HIDL files
20 using android::hardware::secure_element::V1_1::ISecureElement;
21 using android::hardware::secure_element::V1_1::implementation::SecureElement;
22 using android::hardware::configureRpcThreadpool;
23 using android::hardware::joinRpcThreadpool;
24 using android::OK;
25 using android::sp;
26 using android::status_t;
27 
main()28 int main() {
29   ALOGD("android::hardware::secure_element::V1_1 is starting.");
30   ALOGD("Thales Secure Element HAL for eSE2 Service 1.6.0 is starting. libse-gto v1.13");
31   sp<ISecureElement> se_service = new SecureElement("eSE1");
32   configureRpcThreadpool(1, true);
33   status_t status = se_service->registerAsService("eSE1");
34   if (status != OK) {
35     LOG_ALWAYS_FATAL(
36         "registerAsService (%d).",
37         status);
38     return -1;
39   }
40 
41   ALOGD("Thales Secure Element Service is ready");
42   joinRpcThreadpool();
43   return 1;
44 }
45