blob: 149edf3de43fb3d40a94913cd0458a63a26b7be3 [file] [log] [blame]
Jan Altensen1a843362019-01-20 01:40:51 +01001/*
2 * Copyright (C) 2019 The LineageOS 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 VENDOR_LINEAGE_LIVEDISPLAY_V2_0_DISPLAYMODES_H
18#define VENDOR_LINEAGE_LIVEDISPLAY_V2_0_DISPLAYMODES_H
19
Jan Altensen1a843362019-01-20 01:40:51 +010020#include <hidl/MQDescriptor.h>
21#include <hidl/Status.h>
Jan Altensen0003f592019-07-20 01:01:03 +020022#include <vendor/lineage/livedisplay/2.0/IDisplayModes.h>
Jan Altensen1a843362019-01-20 01:40:51 +010023
24namespace vendor {
25namespace lineage {
26namespace livedisplay {
27namespace V2_0 {
Jan Altensen4e47a0b2019-01-20 02:40:07 +010028namespace samsung {
Jan Altensen1a843362019-01-20 01:40:51 +010029
30using ::android::hardware::hidl_array;
31using ::android::hardware::hidl_memory;
32using ::android::hardware::hidl_string;
33using ::android::hardware::hidl_vec;
34using ::android::hardware::Return;
35using ::android::hardware::Void;
36using ::android::sp;
37
Jan Altensen4e47a0b2019-01-20 02:40:07 +010038class DisplayModes : public IDisplayModes {
39 public:
40 DisplayModes();
41 bool isSupported();
42
Jan Altensen1a843362019-01-20 01:40:51 +010043 // Methods from ::vendor::lineage::livedisplay::V2_0::IDisplayModes follow.
Jan Altensen4e47a0b2019-01-20 02:40:07 +010044 Return<void> getDisplayModes(getDisplayModes_cb resultCb) override;
45 Return<void> getCurrentDisplayMode(getCurrentDisplayMode_cb resultCb) override;
46 Return<void> getDefaultDisplayMode(getDefaultDisplayMode_cb resultCb) override;
Jan Altensen1a843362019-01-20 01:40:51 +010047 Return<bool> setDisplayMode(int32_t modeID, bool makeDefault) override;
48
49 // Methods from ::android::hidl::base::V1_0::IBase follow.
Jan Altensen4e47a0b2019-01-20 02:40:07 +010050 private:
51 static const std::map<int32_t, std::string> kModeMap;
52 int32_t mDefaultModeId;
Jan Altensen1a843362019-01-20 01:40:51 +010053};
54
Jan Altensen4e47a0b2019-01-20 02:40:07 +010055} // namespace samsung
Jan Altensen1a843362019-01-20 01:40:51 +010056} // namespace V2_0
57} // namespace livedisplay
58} // namespace lineage
59} // namespace vendor
60
61#endif // VENDOR_LINEAGE_LIVEDISPLAY_V2_0_DISPLAYMODES_H