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

Commit dbe60357 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Use correct pid when running under test harness" into jb-mr2-dev

parents 2c157e0f 949a926c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ AudioFlinger::AudioFlinger()
      mMode(AUDIO_MODE_INVALID),
      mBtNrecIsOff(false)
{
    getpid_cached = getpid();
    char value[PROPERTY_VALUE_MAX];
    bool doLog = (property_get("ro.test_harness", value, "0") > 0) && (atoi(value) == 1);
    if (doLog) {
+3 −2
Original line number Diff line number Diff line
@@ -21,8 +21,9 @@

namespace android {

// This optimization assumes mediaserver process doesn't fork, which it doesn't
const pid_t getpid_cached = getpid();
// Not valid until initialized by AudioFlinger constructor.  It would have to be
// re-initialized if the process containing AudioFlinger service forks (which it doesn't).
pid_t getpid_cached;

bool recordingAllowed() {
    if (getpid_cached == IPCThreadState::self()->getCallingPid()) return true;
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@

namespace android {

extern const pid_t getpid_cached;
extern pid_t getpid_cached;

bool recordingAllowed();
bool settingsAllowed();