Monado OpenXR Runtime
Loading...
Searching...
No Matches
u_android.h
Go to the documentation of this file.
1// Copyright 2026, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Various helpers for doing Android specific things.
6 * @author Jakob Bornecrantz <jakob@collabora.com>
7 * @author Korcan Hussein <korcan.hussein@collabora.com>
8 * @ingroup aux_util
9 */
10
11#pragma once
12
13#include "xrt/xrt_compiler.h"
14#include "util/u_logging.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20
21/*!
22 * @brief Tries to set the highest possible priority on the current thread,
23 * within the constraints of the Android app sandbox.
24 *
25 * On Android, SCHED_FIFO requires CAP_SYS_NICE or a privileged SELinux domain,
26 * neither of which is available to a regular app process. This function will not
27 * give the thread real-time priority, but will attempt to set the highest priority.
28 *
29 * @param name Thread name to be used in logging.
30 * @param log_level Logging level to control chattiness.
31 *
32 * @return Returns true/false if setting real-time priority was successful
33 *
34 * @ingroup aux_util
35 */
36bool
38
39
40#ifdef __cplusplus
41}
42#endif
u_logging_level
Logging level enum.
Definition u_logging.h:45
bool u_android_try_to_set_highest_priority_on_thread(enum u_logging_level log_level, const char *name)
Tries to set the highest possible priority on the current thread, within the constraints of the Andro...
Definition u_android.c:33
Basic logging functionality.
Header holding common defines.