Restore media.log service

Bug: 26306954
Change-Id: I00319f4869f46941e4c814a29b2f69a62e572743
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index dbc6e6e..0a3a832 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -184,8 +184,7 @@
       mSystemReady(false)
 {
     getpid_cached = getpid();
-    // disable media.log until the service is reenabled, see b/26306954
-    const bool doLog = false; // property_get_bool("ro.test_harness", false);
+    const bool doLog = property_get_bool("ro.test_harness", false);
     if (doLog) {
         mLogMemoryDealer = new MemoryDealer(kLogMemorySize, "LogWriters",
                 MemoryHeapBase::READ_ONLY);
diff --git a/services/medialog/MediaLogService.cpp b/services/medialog/MediaLogService.cpp
index 41dab1f..98a71bb 100644
--- a/services/medialog/MediaLogService.cpp
+++ b/services/medialog/MediaLogService.cpp
@@ -28,7 +28,7 @@
 
 void MediaLogService::registerWriter(const sp<IMemory>& shared, size_t size, const char *name)
 {
-    if (IPCThreadState::self()->getCallingUid() != AID_MEDIA || shared == 0 ||
+    if (IPCThreadState::self()->getCallingUid() != AID_AUDIOSERVER || shared == 0 ||
             size < kMinSize || size > kMaxSize || name == NULL ||
             shared->size() < NBLog::Timeline::sharedSize(size)) {
         return;
@@ -41,7 +41,7 @@
 
 void MediaLogService::unregisterWriter(const sp<IMemory>& shared)
 {
-    if (IPCThreadState::self()->getCallingUid() != AID_MEDIA || shared == 0) {
+    if (IPCThreadState::self()->getCallingUid() != AID_AUDIOSERVER || shared == 0) {
         return;
     }
     Mutex::Autolock _l(mLock);
@@ -58,7 +58,7 @@
 {
     // FIXME merge with similar but not identical code at services/audioflinger/ServiceUtilities.cpp
     static const String16 sDump("android.permission.DUMP");
-    if (!(IPCThreadState::self()->getCallingUid() == AID_MEDIA ||
+    if (!(IPCThreadState::self()->getCallingUid() == AID_AUDIOSERVER ||
             PermissionCache::checkCallingPermission(sDump))) {
         dprintf(fd, "Permission Denial: can't dump media.log from pid=%d, uid=%d\n",
                 IPCThreadState::self()->getCallingPid(),