blob: 3d8fc9dc2ec0b2c6167fc5c7fa13fc66812967ea [file] [log] [blame]
Will Drewrye47ba832017-04-18 17:08:09 -05001/*
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#ifndef ANDROID_ESED_OEMLOCK_H
18#define ANDROID_ESED_OEMLOCK_H
19
20#include <android/hardware/oemlock/1.0/IOemLock.h>
21#include <hidl/MQDescriptor.h>
22#include <hidl/Status.h>
23
24#include <esecpp/EseInterface.h>
25
26namespace android {
27namespace esed {
28
29using ::android::EseInterface;
30using ::android::hardware::oemlock::V1_0::IOemLock;
31using ::android::hardware::oemlock::V1_0::OemLockSecureStatus;
32using ::android::hardware::oemlock::V1_0::OemLockStatus;
33using ::android::hardware::hidl_vec;
34using ::android::hardware::Return;
35
36struct OemLock : public IOemLock {
37 OemLock(EseInterface& ese) : mEse(ese) {}
38
39 // Methods from ::android::hardware::oemlock::V1_0::IOemLock follow.
40 Return<void> getName(getName_cb _hidl_cb) override;
41
42 Return<OemLockSecureStatus> setOemUnlockAllowedByCarrier(
43 bool allowed, const hidl_vec<uint8_t>& signature) override;
44
45 Return<void> isOemUnlockAllowedByCarrier(isOemUnlockAllowedByCarrier_cb _hidl_cb) override;
46
47 Return<OemLockStatus> setOemUnlockAllowedByDevice(bool allowed) override;
48
49 Return<void> isOemUnlockAllowedByDevice(isOemUnlockAllowedByDevice_cb _hidl_cb) override;
50
51private:
52 EseInterface& mEse;
53};
54
55} // namespace esed
56} // namespace android
57
58#endif // ANDROID_ESED_OEMLOCK_H