protoutil: EncodedBuffer: Remove usage of PAGE_SIZE 4096

bionic hard codes the PAGE_SIZE macro as 4096. This is going away as
Android begins to support larger page sizes. Remove the usage of this
assumption from protoutil source; use instead getpagesize() which
provides the real pagesize.

Test: atest -c libprotoutil_test
Bug: 295228590
Change-Id: I6c3212600256d61a71430dfbbf7b0c9944fe4859
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
diff --git a/libs/protoutil/tests/EncodedBuffer_test.cpp b/libs/protoutil/tests/EncodedBuffer_test.cpp
index 8a7becf..a0955854 100644
--- a/libs/protoutil/tests/EncodedBuffer_test.cpp
+++ b/libs/protoutil/tests/EncodedBuffer_test.cpp
@@ -15,13 +15,16 @@
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
+#include <unistd.h>
+
 using namespace android::util;
 using android::sp;
 
 constexpr size_t __TEST_CHUNK_SIZE = 16UL;
-constexpr size_t TEST_CHUNK_SIZE = (__TEST_CHUNK_SIZE + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
-constexpr size_t TEST_CHUNK_HALF_SIZE = TEST_CHUNK_SIZE / 2;
-constexpr size_t TEST_CHUNK_3X_SIZE = 3 * TEST_CHUNK_SIZE;
+const size_t kPageSize = getpagesize();
+const size_t TEST_CHUNK_SIZE = (__TEST_CHUNK_SIZE + (kPageSize - 1)) & ~(kPageSize - 1);
+const size_t TEST_CHUNK_HALF_SIZE = TEST_CHUNK_SIZE / 2;
+const size_t TEST_CHUNK_3X_SIZE = 3 * TEST_CHUNK_SIZE;
 
 static void expectPointer(EncodedBuffer::Pointer* p, size_t pos) {
     EXPECT_EQ(p->pos(), pos);