blob: 155588d7f59e708edb7c6888a5682f03ee44690b [file] [log] [blame]
Tomasz Wasilczyk0d9dec22023-10-06 20:28:49 +00001/*
2 * Copyright (C) 2023 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 "OS.h"
18
19#include <android-base/threads.h>
Tomasz Wasilczykdaf727a2023-11-21 13:50:09 -080020#include <cutils/trace.h>
Tomasz Wasilczyk346f1042023-10-09 17:02:46 +000021#include <utils/misc.h>
Tomasz Wasilczyk0d9dec22023-10-06 20:28:49 +000022
23namespace android::binder::os {
24
25uint64_t GetThreadId() {
26#ifdef BINDER_RPC_SINGLE_THREADED
27 return 0;
28#else
29 return base::GetThreadId();
30#endif
31}
32
Tomasz Wasilczyk346f1042023-10-09 17:02:46 +000033bool report_sysprop_change() {
34 android::report_sysprop_change();
35 return true;
36}
37
Tomasz Wasilczykdaf727a2023-11-21 13:50:09 -080038void trace_begin(uint64_t tag, const char* name) {
39 atrace_begin(tag, name);
40}
41
42void trace_end(uint64_t tag) {
43 atrace_end(tag);
44}
45
Tomasz Wasilczyk0d9dec22023-10-06 20:28:49 +000046} // namespace android::binder::os