Revert "Add ifdefs to compile out Parcel::Blob code"
Revert submission 34231615
Reason for revert: Droidmonitor created revert due to b/428745402. Will be verifying through ABTD before submission.
Fix: 428745402
Reverted changes: /q/submissionid:34231615
Change-Id: Ie1b496659d704310e4ccc115a4bf774901e89e1a
diff --git a/libs/binder/Android.bp b/libs/binder/Android.bp
index 67b34fb..72edf0a 100644
--- a/libs/binder/Android.bp
+++ b/libs/binder/Android.bp
@@ -732,7 +732,7 @@
}
cc_library {
- name: "libbinder_rpc_no_legacy",
+ name: "libbinder_rpc_no_blob",
vendor_available: true,
defaults: [
"libbinder_common_defaults",
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index f9ae94f..870940f 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -24,9 +24,9 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
-#ifndef BINDER_DISABLE_BLOB
#include <sys/mman.h>
-#endif // BINDER_DISABLE_BLOB
+#include <sys/resource.h>
+#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <algorithm>
@@ -3500,7 +3500,6 @@
// --- Parcel::Blob ---
-#ifndef BINDER_DISABLE_BLOB
Parcel::Blob::Blob() :
mFd(-1), mData(nullptr), mSize(0), mMutable(false) {
}
@@ -3531,6 +3530,5 @@
mSize = 0;
mMutable = false;
}
-#endif // BINDER_DISABLE_BLOB
} // namespace android
diff --git a/libs/binder/TEST_MAPPING b/libs/binder/TEST_MAPPING
index 954c9af..32ad8dc 100644
--- a/libs/binder/TEST_MAPPING
+++ b/libs/binder/TEST_MAPPING
@@ -98,9 +98,6 @@
},
{
"name": "binderStatsPusherUnitTest"
- },
- {
- "name": "binderRpcTestNoLegacy"
}
],
"presubmit-large": [
diff --git a/libs/binder/include/binder/Parcel.h b/libs/binder/include/binder/Parcel.h
index 450c6ae..6c4c6fe 100644
--- a/libs/binder/include/binder/Parcel.h
+++ b/libs/binder/include/binder/Parcel.h
@@ -1399,7 +1399,6 @@
size_t mReserved;
-#ifndef BINDER_DISABLE_BLOB
class Blob {
public:
LIBBINDER_EXPORTED Blob();
@@ -1419,12 +1418,11 @@
size_t mSize;
bool mMutable;
};
-#endif // BINDER_DISABLE_BLOB
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wweak-vtables"
-#endif
+ #if defined(__clang__)
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wweak-vtables"
+ #endif
// FlattenableHelperInterface and FlattenableHelper avoid generating a vtable entry in objects
// following Flattenable template/protocol.
@@ -1471,7 +1469,6 @@
LIBBINDER_EXPORTED status_t read(FlattenableHelperInterface& val) const;
public:
-#ifndef BINDER_DISABLE_BLOB
class ReadableBlob : public Blob {
friend class Parcel;
public:
@@ -1484,7 +1481,6 @@
public:
LIBBINDER_EXPORTED inline void* data() { return mData; }
};
-#endif // BINDER_DISABLE_BLOB
/**
* Returns the total amount of ashmem memory owned by this object.
diff --git a/libs/binder/tests/Android.bp b/libs/binder/tests/Android.bp
index 72ea822..6a98a4a 100644
--- a/libs/binder/tests/Android.bp
+++ b/libs/binder/tests/Android.bp
@@ -548,17 +548,6 @@
}
cc_test {
- name: "binderRpcTestNoLegacy",
- defaults: [
- "binderRpcTest_defaults",
- "binderRpcTest_static_defaults",
- ],
- static_libs: [
- "libbinder_rpc_no_legacy",
- ],
-}
-
-cc_test {
name: "binderRpcTestNoKernelAtAll",
defaults: [
"binderRpcTest_defaults",