The open source OpenXR runtime
1// Copyright 2022-2023, Qualcomm Innovation Center, Inc.
2// SPDX-License-Identifier: BSL-1.0
3// Author: Jarvis Huang
4// Inline implementations: do not include on its own!
5
6#pragma once
7
8#include "android.view.h"
9#include <string>
10
11namespace wrap {
12namespace android::hardware::display {
13inline std::string DisplayManager::DISPLAY_CATEGORY_PRESENTATION() {
14 auto &data = Meta::data(true);
15 auto ret = get(data.DISPLAY_CATEGORY_PRESENTATION, data.clazz());
16 data.dropClassRef();
17 return ret;
18}
19
20inline view::Display DisplayManager::getDisplay(int32_t displayId) const {
21 assert(!isNull());
22 return view::Display(
23 object().call<jni::Object>(Meta::data().getDisplay, displayId));
24}
25
26inline jni::Array<jni::Object> DisplayManager::getDisplays() const {
27 assert(!isNull());
28 return jni::Array<jni::Object>(
29 (jobjectArray)object()
30 .call<jni::Object>(Meta::data().getDisplays)
31 .getHandle(),
32 0);
33}
34
35inline jni::Array<jni::Object>
36DisplayManager::getDisplays(std::string const &category) {
37 assert(!isNull());
38 return jni::Array<jni::Object>(
39 (jobjectArray)object()
40 .call<jni::Object>(Meta::data().getDisplays1, category)
41 .getHandle(),
42 0);
43}
44
45inline std::string DeviceProductInfo::getName() const {
46 assert(!isNull());
47 return object().call<std::string>(Meta::data().getName);
48}
49
50} // namespace android::hardware::display
51} // namespace wrap