• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 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 CPP_EVS_MANAGER_1_1_HALDISPLAY_H_
18 #define CPP_EVS_MANAGER_1_1_HALDISPLAY_H_
19 
20 #include <android/hardware/automotive/evs/1.1/IEvsDisplay.h>
21 #include <android/hardware/automotive/evs/1.1/types.h>
22 
23 #include <limits>
24 
25 namespace android::automotive::evs::V1_1::implementation {
26 
27 // TODO(129284474): This class has been defined to wrap the IEvsDisplay object the driver
28 // returns because of b/129284474 and represents an EVS display to the client
29 // application.  With a proper bug fix, we may remove this class and update the
30 // manager directly to use the IEvsDisplay object the driver provides.
31 class HalDisplay : public ::android::hardware::automotive::evs::V1_1::IEvsDisplay {
32 public:
33     explicit HalDisplay(sp<::android::hardware::automotive::evs::V1_0::IEvsDisplay> display,
34                         int32_t port = std::numeric_limits<int32_t>::min());
35     virtual ~HalDisplay();
36 
37     inline void shutdown();
38     sp<::android::hardware::automotive::evs::V1_0::IEvsDisplay> getHwDisplay();
39 
40     // Methods from ::android::hardware::automotive::evs::V1_0::IEvsDisplay follow.
41     ::android::hardware::Return<void> getDisplayInfo(getDisplayInfo_cb _hidl_cb) override;
42     ::android::hardware::Return<::android::hardware::automotive::evs::V1_0::EvsResult>
43     setDisplayState(::android::hardware::automotive::evs::V1_0::DisplayState state) override;
44     ::android::hardware::Return<::android::hardware::automotive::evs::V1_0::DisplayState>
45     getDisplayState() override;
46     ::android::hardware::Return<void> getTargetBuffer(getTargetBuffer_cb _hidl_cb) override;
47     ::android::hardware::Return<::android::hardware::automotive::evs::V1_0::EvsResult>
48     returnTargetBufferForDisplay(
49             const ::android::hardware::automotive::evs::V1_0::BufferDesc& buffer) override;
50 
51     // Methods from ::android::hardware::automotive::evs::V1_1::IEvsDisplay follow.
52     ::android::hardware::Return<void> getDisplayInfo_1_1(getDisplayInfo_1_1_cb _info_cb) override;
53 
54     // ::android::hardware::Returns a string showing the current status
55     std::string toString(const char* indent = "");
56 
57 private:
58     sp<::android::hardware::automotive::evs::V1_0::IEvsDisplay>
59             mHwDisplay;  // The low level display interface that backs this proxy
60     int32_t mId;         // Display identifier
61 };
62 
63 }  // namespace android::automotive::evs::V1_1::implementation
64 
65 #endif  // CPP_EVS_MANAGER_1_1_HALDISPLAY_H_
66