| 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 "IFingerprintDaemonCallback" | 
|  | 18 | #include <stdint.h> | 
|  | 19 | #include <sys/types.h> | 
|  | 20 | #include <utils/Log.h> | 
|  | 21 | #include <binder/Parcel.h> | 
|  | 22 |  | 
|  | 23 | #include "IFingerprintDaemonCallback.h" | 
|  | 24 |  | 
|  | 25 | namespace android { | 
|  | 26 |  | 
|  | 27 | class BpFingerprintDaemonCallback : public BpInterface<IFingerprintDaemonCallback> | 
|  | 28 | { | 
|  | 29 | public: | 
| Chih-Hung Hsieh | 1c563d9 | 2016-04-29 15:44:04 -0700 | [diff] [blame] | 30 | explicit BpFingerprintDaemonCallback(const sp<IBinder>& impl) : | 
| Jim Miller | a34dc46 | 2015-05-07 18:52:53 -0700 | [diff] [blame] | 31 | BpInterface<IFingerprintDaemonCallback>(impl) { | 
|  | 32 | } | 
|  | 33 | virtual status_t onEnrollResult(int64_t devId, int32_t fpId, int32_t gpId, int32_t rem) { | 
|  | 34 | Parcel data, reply; | 
|  | 35 | data.writeInterfaceToken(IFingerprintDaemonCallback::getInterfaceDescriptor()); | 
|  | 36 | data.writeInt64(devId); | 
|  | 37 | data.writeInt32(fpId); | 
|  | 38 | data.writeInt32(gpId); | 
|  | 39 | data.writeInt32(rem); | 
|  | 40 | return remote()->transact(ON_ENROLL_RESULT, data, &reply, IBinder::FLAG_ONEWAY); | 
|  | 41 | } | 
|  | 42 |  | 
|  | 43 | virtual status_t onAcquired(int64_t devId, int32_t acquiredInfo) { | 
|  | 44 | Parcel data, reply; | 
|  | 45 | data.writeInterfaceToken(IFingerprintDaemonCallback::getInterfaceDescriptor()); | 
|  | 46 | data.writeInt64(devId); | 
|  | 47 | data.writeInt32(acquiredInfo); | 
|  | 48 | return remote()->transact(ON_ACQUIRED, data, &reply, IBinder::FLAG_ONEWAY); | 
|  | 49 | } | 
|  | 50 |  | 
|  | 51 | virtual status_t onAuthenticated(int64_t devId, int32_t fpId, int32_t gpId) { | 
|  | 52 | Parcel data, reply; | 
|  | 53 | data.writeInterfaceToken(IFingerprintDaemonCallback::getInterfaceDescriptor()); | 
|  | 54 | data.writeInt64(devId); | 
|  | 55 | data.writeInt32(fpId); | 
|  | 56 | data.writeInt32(gpId); | 
|  | 57 | return remote()->transact(ON_AUTHENTICATED, data, &reply, IBinder::FLAG_ONEWAY); | 
|  | 58 | } | 
|  | 59 |  | 
|  | 60 | virtual status_t onError(int64_t devId, int32_t error) { | 
|  | 61 | Parcel data, reply; | 
|  | 62 | data.writeInterfaceToken(IFingerprintDaemonCallback::getInterfaceDescriptor()); | 
|  | 63 | data.writeInt64(devId); | 
|  | 64 | data.writeInt32(error); | 
|  | 65 | return remote()->transact(ON_ERROR, data, &reply, IBinder::FLAG_ONEWAY); | 
|  | 66 | } | 
|  | 67 |  | 
|  | 68 | virtual status_t onRemoved(int64_t devId, int32_t fpId, int32_t gpId) { | 
|  | 69 | Parcel data, reply; | 
|  | 70 | data.writeInterfaceToken(IFingerprintDaemonCallback::getInterfaceDescriptor()); | 
|  | 71 | data.writeInt64(devId); | 
|  | 72 | data.writeInt32(fpId); | 
|  | 73 | data.writeInt32(gpId); | 
|  | 74 | return remote()->transact(ON_REMOVED, data, &reply, IBinder::FLAG_ONEWAY); | 
|  | 75 | } | 
|  | 76 |  | 
|  | 77 | virtual status_t onEnumerate(int64_t devId, const int32_t* fpIds, const int32_t* gpIds, | 
|  | 78 | int32_t sz) { | 
|  | 79 | Parcel data, reply; | 
|  | 80 | data.writeInterfaceToken(IFingerprintDaemonCallback::getInterfaceDescriptor()); | 
|  | 81 | data.writeInt64(devId); | 
|  | 82 | data.writeInt32Array(sz, fpIds); | 
|  | 83 | data.writeInt32Array(sz, gpIds); | 
|  | 84 | return remote()->transact(ON_ENUMERATE, data, &reply, IBinder::FLAG_ONEWAY); | 
|  | 85 | } | 
|  | 86 | }; | 
|  | 87 |  | 
|  | 88 | IMPLEMENT_META_INTERFACE(FingerprintDaemonCallback, | 
|  | 89 | "android.hardware.fingerprint.IFingerprintDaemonCallback"); | 
|  | 90 |  | 
|  | 91 | }; // namespace android |