Revert "Adds rcSetProcessMetadata"
Reason for revert: fix git_master/sdk_gphone_x86_64-userdebug build target. will resubmit with additional change
Reverted Changes:
Ib9908888a:Adds rcSetProcessMetadata
Change-Id: Ic5f6b8c24bd487450dc3048f2748e6391ab17b90
diff --git a/system/OpenglSystemCommon/HostConnection.cpp b/system/OpenglSystemCommon/HostConnection.cpp
index 13872f8..0014482 100644
--- a/system/OpenglSystemCommon/HostConnection.cpp
+++ b/system/OpenglSystemCommon/HostConnection.cpp
@@ -16,7 +16,6 @@
#include "HostConnection.h"
#include "cutils/properties.h"
-#include "renderControl_types.h"
#ifdef HOST_BUILD
#include "android/base/Tracing.h"
@@ -99,11 +98,6 @@
#endif
-#if defined(__linux__) || defined(__ANDROID__)
-#include <fstream>
-#include <string>
-#endif
-
#undef LOG_TAG
#define LOG_TAG "HostConnection"
#if PLATFORM_SDK_VERSION < 26
@@ -638,33 +632,6 @@
DPRINT("HostConnection::get() New Host Connection established %p, tid %d\n",
con.get(), getCurrentThreadId());
-
-#if defined(__linux__) || defined(__ANDROID__)
- auto rcEnc = con->rcEncoder();
- if (rcEnc != nullptr) {
-#if defined(__ANDROID__) && __ANDROID_API__ >= 21
- // The encoder does not modify the strings. The API gen does not yet
- // handle const vars.
- rcEnc->rcSetProcessMetadata(
- rcEnc, const_cast<char*>("process_name"),
- const_cast<RenderControlByte*>(getprogname()),
- strlen(getprogname()) + 1);
-#else
- std::ifstream stream("/proc/self/cmdline");
- if (stream.is_open()) {
- std::string cmdline((std::istreambuf_iterator<char>(stream)),
- std::istreambuf_iterator<char>());
- // The encoder does not modify the strings. The API gen does not yet
- // handle const vars.
- rcEnc->rcSetProcessMetadata(
- rcEnc, const_cast<char*>("process_name"),
- const_cast<RenderControlByte*>(cmdline.c_str()),
- strlen(cmdline.c_str()) + 1);
- }
-#endif
- }
-#endif
-
return con;
}
diff --git a/system/renderControl_enc/renderControl_client_context.cpp b/system/renderControl_enc/renderControl_client_context.cpp
index 1659873..27dd37e 100644
--- a/system/renderControl_enc/renderControl_client_context.cpp
+++ b/system/renderControl_enc/renderControl_client_context.cpp
@@ -78,7 +78,6 @@
rcGetFBDisplayConfigsCount = (rcGetFBDisplayConfigsCount_client_proc_t) getProc("rcGetFBDisplayConfigsCount", userData);
rcGetFBDisplayConfigsParam = (rcGetFBDisplayConfigsParam_client_proc_t) getProc("rcGetFBDisplayConfigsParam", userData);
rcGetFBDisplayActiveConfig = (rcGetFBDisplayActiveConfig_client_proc_t) getProc("rcGetFBDisplayActiveConfig", userData);
- rcSetProcessMetadata = (rcSetProcessMetadata_client_proc_t) getProc("rcSetProcessMetadata", userData);
return 0;
}
diff --git a/system/renderControl_enc/renderControl_client_context.h b/system/renderControl_enc/renderControl_client_context.h
index 3248cdf..bf79eaa 100644
--- a/system/renderControl_enc/renderControl_client_context.h
+++ b/system/renderControl_enc/renderControl_client_context.h
@@ -78,7 +78,6 @@
rcGetFBDisplayConfigsCount_client_proc_t rcGetFBDisplayConfigsCount;
rcGetFBDisplayConfigsParam_client_proc_t rcGetFBDisplayConfigsParam;
rcGetFBDisplayActiveConfig_client_proc_t rcGetFBDisplayActiveConfig;
- rcSetProcessMetadata_client_proc_t rcSetProcessMetadata;
virtual ~renderControl_client_context_t() {}
typedef renderControl_client_context_t *CONTEXT_ACCESSOR_TYPE(void);
diff --git a/system/renderControl_enc/renderControl_client_proc.h b/system/renderControl_enc/renderControl_client_proc.h
index dfe37dc..2c28127 100644
--- a/system/renderControl_enc/renderControl_client_proc.h
+++ b/system/renderControl_enc/renderControl_client_proc.h
@@ -80,7 +80,6 @@
typedef int (renderControl_APIENTRY *rcGetFBDisplayConfigsCount_client_proc_t) (void * ctx);
typedef int (renderControl_APIENTRY *rcGetFBDisplayConfigsParam_client_proc_t) (void * ctx, int, EGLint);
typedef int (renderControl_APIENTRY *rcGetFBDisplayActiveConfig_client_proc_t) (void * ctx);
-typedef void (renderControl_APIENTRY *rcSetProcessMetadata_client_proc_t) (void * ctx, char*, RenderControlByte*, uint32_t);
#endif
diff --git a/system/renderControl_enc/renderControl_enc.cpp b/system/renderControl_enc/renderControl_enc.cpp
index 4ddbdbd..017c7e4 100644
--- a/system/renderControl_enc/renderControl_enc.cpp
+++ b/system/renderControl_enc/renderControl_enc.cpp
@@ -2735,39 +2735,6 @@
return retval;
}
-void rcSetProcessMetadata_enc(void *self , char* key, RenderControlByte* valuePtr, uint32_t valueSize)
-{
- ENCODER_DEBUG_LOG("rcSetProcessMetadata(key:%s, valuePtr:%p, valueSize:0x%08x)", key, valuePtr, valueSize);
- AEMU_SCOPED_TRACE("rcSetProcessMetadata encode");
-
- renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
- IOStream *stream = ctx->m_stream;
- ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
- bool useChecksum = checksumCalculator->getVersion() > 0;
-
- const unsigned int __size_key = (strlen(key) + 1);
- const unsigned int __size_valuePtr = valueSize;
- unsigned char *ptr;
- unsigned char *buf;
- const size_t sizeWithoutChecksum = 8 + __size_key + __size_valuePtr + 4 + 2*4;
- const size_t checksumSize = checksumCalculator->checksumByteSize();
- const size_t totalSize = sizeWithoutChecksum + checksumSize;
- buf = stream->alloc(totalSize);
- ptr = buf;
- int tmp = OP_rcSetProcessMetadata;memcpy(ptr, &tmp, 4); ptr += 4;
- memcpy(ptr, &totalSize, 4); ptr += 4;
-
- memcpy(ptr, &__size_key, 4); ptr += 4;
- memcpy(ptr, key, __size_key);ptr += __size_key;
- memcpy(ptr, &__size_valuePtr, 4); ptr += 4;
- memcpy(ptr, valuePtr, __size_valuePtr);ptr += __size_valuePtr;
- memcpy(ptr, &valueSize, 4); ptr += 4;
-
- if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
- if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
-
-}
-
} // namespace
renderControl_encoder_context_t::renderControl_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator)
@@ -2843,6 +2810,5 @@
this->rcGetFBDisplayConfigsCount = &rcGetFBDisplayConfigsCount_enc;
this->rcGetFBDisplayConfigsParam = &rcGetFBDisplayConfigsParam_enc;
this->rcGetFBDisplayActiveConfig = &rcGetFBDisplayActiveConfig_enc;
- this->rcSetProcessMetadata = &rcSetProcessMetadata_enc;
}
diff --git a/system/renderControl_enc/renderControl_entry.cpp b/system/renderControl_enc/renderControl_entry.cpp
index e05e6de..e756322 100644
--- a/system/renderControl_enc/renderControl_entry.cpp
+++ b/system/renderControl_enc/renderControl_entry.cpp
@@ -73,7 +73,6 @@
int rcGetFBDisplayConfigsCount();
int rcGetFBDisplayConfigsParam(int configId, EGLint param);
int rcGetFBDisplayActiveConfig();
- void rcSetProcessMetadata(char* key, RenderControlByte* valuePtr, uint32_t valueSize);
};
#ifndef GET_CONTEXT
@@ -490,9 +489,3 @@
return ctx->rcGetFBDisplayActiveConfig(ctx);
}
-void rcSetProcessMetadata(char* key, RenderControlByte* valuePtr, uint32_t valueSize)
-{
- GET_CONTEXT;
- ctx->rcSetProcessMetadata(ctx, key, valuePtr, valueSize);
-}
-
diff --git a/system/renderControl_enc/renderControl_ftable.h b/system/renderControl_enc/renderControl_ftable.h
index b691a54..9a0f9e9 100644
--- a/system/renderControl_enc/renderControl_ftable.h
+++ b/system/renderControl_enc/renderControl_ftable.h
@@ -76,7 +76,6 @@
{"rcGetFBDisplayConfigsCount", (void*)rcGetFBDisplayConfigsCount},
{"rcGetFBDisplayConfigsParam", (void*)rcGetFBDisplayConfigsParam},
{"rcGetFBDisplayActiveConfig", (void*)rcGetFBDisplayActiveConfig},
- {"rcSetProcessMetadata", (void*)rcSetProcessMetadata},
};
static const int renderControl_num_funcs = sizeof(renderControl_funcs_by_name) / sizeof(struct _renderControl_funcs_by_name);
diff --git a/system/renderControl_enc/renderControl_opcodes.h b/system/renderControl_enc/renderControl_opcodes.h
index ddb1f73..cf4ff82 100644
--- a/system/renderControl_enc/renderControl_opcodes.h
+++ b/system/renderControl_enc/renderControl_opcodes.h
@@ -71,8 +71,7 @@
#define OP_rcGetFBDisplayConfigsCount 10065
#define OP_rcGetFBDisplayConfigsParam 10066
#define OP_rcGetFBDisplayActiveConfig 10067
-#define OP_rcSetProcessMetadata 10068
-#define OP_last 10069
+#define OP_last 10068
#endif
diff --git a/system/renderControl_enc/renderControl_types.h b/system/renderControl_enc/renderControl_types.h
index e2bb551..da215bb 100644
--- a/system/renderControl_enc/renderControl_types.h
+++ b/system/renderControl_enc/renderControl_types.h
@@ -26,5 +26,3 @@
#define FB_FPS 5
#define FB_MIN_SWAP_INTERVAL 6
#define FB_MAX_SWAP_INTERVAL 7
-
-using RenderControlByte = char;
\ No newline at end of file