Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6e71608 authored by Elliott Hughes's avatar Elliott Hughes Committed by Gerrit Code Review
Browse files

Merge "Use __ANDROID__ instead of HAVE_ANDROID_OS."

parents 44443bea 9b828adf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
#include <sys/types.h>
#include <stdint.h>

#ifdef HAVE_ANDROID_OS
#if defined(__ANDROID__)
#include <linux/capability.h>
#else
#include "android_filesystem_capability.h"
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ extern void androidSetCreateThreadFunc(android_create_thread_fn func);
// ------------------------------------------------------------------
// Extra functions working with raw pids.

#ifdef HAVE_ANDROID_OS
#if defined(__ANDROID__)
// Change the priority AND scheduling group of a particular thread.  The priority
// should be one of the ANDROID_PRIORITY constants.  Returns INVALID_OPERATION
// if the priority set failed, else another value if just the group set failed;
+2 −2
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public:
    // lock if possible; returns 0 on success, error otherwise
    status_t    tryLock();

#if HAVE_ANDROID_OS
#if defined(__ANDROID__)
    // lock the mutex, but don't wait longer than timeoutMilliseconds.
    // Returns 0 on success, TIMED_OUT for failure due to timeout expiration.
    //
@@ -128,7 +128,7 @@ inline void Mutex::unlock() {
inline status_t Mutex::tryLock() {
    return -pthread_mutex_trylock(&mMutex);
}
#if HAVE_ANDROID_OS
#if defined(__ANDROID__)
inline status_t Mutex::timedLock(nsecs_t timeoutNs) {
    const struct timespec ts = {
        /* .tv_sec = */ static_cast<time_t>(timeoutNs / 1000000000),
+2 −2
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ public:
    // Indicates whether this thread is running or not.
            bool        isRunning() const;

#ifdef HAVE_ANDROID_OS
#if defined(__ANDROID__)
    // Return the thread's kernel ID, same as the thread itself calling gettid(),
    // or -1 if the thread is not running.
            pid_t       getTid() const;
@@ -101,7 +101,7 @@ private:
    volatile bool           mExitPending;
    volatile bool           mRunning;
            sp<Thread>      mHoldSelf;
#ifdef HAVE_ANDROID_OS
#if defined(__ANDROID__)
    // legacy for debugging, not used by getTid() as it is set by the child thread
    // and so is not initialized until the child reaches that point
            pid_t           mTid;
+3 −3
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
#ifndef ANDROID_TRACE_H
#define ANDROID_TRACE_H

#ifdef HAVE_ANDROID_OS
#if defined(__ANDROID__)

#include <fcntl.h>
#include <stdint.h>
@@ -59,11 +59,11 @@ private:

}; // namespace android

#else // HAVE_ANDROID_OS
#else // !__ANDROID__

#define ATRACE_NAME(...)
#define ATRACE_CALL()

#endif // HAVE_ANDROID_OS
#endif // __ANDROID__

#endif // ANDROID_TRACE_H
Loading