diff options
author | Dave Sparks <davidsparks@android.com> | 2009-11-23 19:51:33 -0800 |
---|---|---|
committer | Dave Sparks <davidsparks@android.com> | 2009-11-23 19:51:33 -0800 |
commit | 16cc72bdef471ffeee3f61eba8262783de248b04 (patch) | |
tree | e09b582e546dd12ddd271e1018ff785fde9196ca | |
parent | 8424ec323b2bc38887370c75e2c1fcd84bcdb013 (diff) | |
download | frameworks_base-16cc72bdef471ffeee3f61eba8262783de248b04.zip frameworks_base-16cc72bdef471ffeee3f61eba8262783de248b04.tar.gz frameworks_base-16cc72bdef471ffeee3f61eba8262783de248b04.tar.bz2 |
Fix simulator build.
-rw-r--r-- | media/libmedia/IMediaMetadataRetriever.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/media/libmedia/IMediaMetadataRetriever.cpp b/media/libmedia/IMediaMetadataRetriever.cpp index 68dd880..e529d25 100644 --- a/media/libmedia/IMediaMetadataRetriever.cpp +++ b/media/libmedia/IMediaMetadataRetriever.cpp @@ -41,6 +41,15 @@ pid_t gettid() { return syscall(__NR_gettid);} #undef __KERNEL__ #endif +static int myTid() { +#ifdef HAVE_GETTID + return gettid(); +#else + return getpid(); +#endif +} + +#undef LOG_TAG #define LOG_TAG "IMediaMetadataRetriever" #include <utils/Log.h> #include <cutils/sched_policy.h> @@ -50,18 +59,18 @@ namespace android { static void sendSchedPolicy(Parcel& data) { SchedPolicy policy; - get_sched_policy(gettid(), &policy); + get_sched_policy(myTid(), &policy); data.writeInt32(policy); } static void setSchedPolicy(const Parcel& data) { SchedPolicy policy = (SchedPolicy) data.readInt32(); - set_sched_policy(gettid(), policy); + set_sched_policy(myTid(), policy); } static void restoreSchedPolicy() { - set_sched_policy(gettid(), SP_FOREGROUND); + set_sched_policy(myTid(), SP_FOREGROUND); } }; // end namespace android #endif |