• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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 #include <log/log.h>
18 #include "Readback.h"
19 #include "hwc_tester.h"
20 
21 /*
22  * A simple binary that takes over the HWC through its AIDL Client Wrappers and
23  * display a simple red color on the screen.
24  */
25 
26 static volatile bool keep_running = true;
signal_handler(int)27 void signal_handler(int) { keep_running = false; }
28 
main()29 int main() {
30   hcct::HwcTester tester;
31 
32   // Get all available displays
33   auto display_ids = tester.GetAllDisplayIds();
34   if (display_ids.empty()) {
35     ALOGE("No displays available");
36     return 1;
37   }
38 
39   tester.DrawSolidColorToScreen(display_ids[0], libhwc_aidl_test::RED);
40 
41   // Stay on, allowing the host tests to take screenshots and process.
42   signal(SIGTERM, signal_handler);
43   while (keep_running) {
44     sleep(1);
45   }
46 
47   return 0;
48 }
49