| Jim Miller | a34dc46 | 2015-05-07 18:52:53 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2015 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 | #define LOG_TAG "fingerprintd" | 
|  | 18 |  | 
| Jim Miller | a34dc46 | 2015-05-07 18:52:53 -0700 | [diff] [blame] | 19 | #include <binder/IPCThreadState.h> | 
|  | 20 | #include <binder/IServiceManager.h> | 
|  | 21 | #include <binder/PermissionCache.h> | 
| Jim Miller | a34dc46 | 2015-05-07 18:52:53 -0700 | [diff] [blame] | 22 | #include <hardware/hardware.h> | 
|  | 23 | #include <hardware/fingerprint.h> | 
|  | 24 | #include <hardware/hw_auth_token.h> | 
| Mark Salyzyn | 66ce3e0 | 2016-09-28 10:07:20 -0700 | [diff] [blame] | 25 | #include <keystore/IKeystoreService.h> | 
|  | 26 | #include <keystore/keystore.h> // for error codes | 
| Mark Salyzyn | 30f991f | 2017-01-10 13:19:54 -0800 | [diff] [blame] | 27 | #include <log/log.h> | 
| Mark Salyzyn | 66ce3e0 | 2016-09-28 10:07:20 -0700 | [diff] [blame] | 28 | #include <utils/Log.h> | 
|  | 29 | #include <utils/String16.h> | 
| Jim Miller | a34dc46 | 2015-05-07 18:52:53 -0700 | [diff] [blame] | 30 |  | 
|  | 31 | #include "FingerprintDaemonProxy.h" | 
|  | 32 |  | 
|  | 33 | int main() { | 
|  | 34 | ALOGI("Starting " LOG_TAG); | 
|  | 35 | android::sp<android::IServiceManager> serviceManager = android::defaultServiceManager(); | 
|  | 36 | android::sp<android::FingerprintDaemonProxy> proxy = | 
|  | 37 | android::FingerprintDaemonProxy::getInstance(); | 
|  | 38 | android::status_t ret = serviceManager->addService( | 
|  | 39 | android::FingerprintDaemonProxy::descriptor, proxy); | 
|  | 40 | if (ret != android::OK) { | 
|  | 41 | ALOGE("Couldn't register " LOG_TAG " binder service!"); | 
|  | 42 | return -1; | 
|  | 43 | } | 
|  | 44 |  | 
|  | 45 | /* | 
|  | 46 | * We're the only thread in existence, so we're just going to process | 
|  | 47 | * Binder transaction as a single-threaded program. | 
|  | 48 | */ | 
|  | 49 | android::IPCThreadState::self()->joinThreadPool(); | 
|  | 50 | ALOGI("Done"); | 
|  | 51 | return 0; | 
|  | 52 | } |