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

Commit 29050e9b authored by Kalesh Singh's avatar Kalesh Singh Committed by Automerger Merge Worker
Browse files

Merge "NativeLibraryHelper: Remove use of hardcoded PAGE_SIZE 4096" into main...

Merge "NativeLibraryHelper: Remove use of hardcoded PAGE_SIZE 4096" into main am: f3d43d21 am: 50fe2437

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2701794



Change-Id: I0f50f5035bbee42f9592f0cb4fe4f71b1f919bb4
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents bb25444a 50fe2437
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@ sumFiles(JNIEnv*, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntry, const char
static install_status_t
copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntry, const char* fileName)
{
    static const size_t kPageSize = getpagesize();
    void** args = reinterpret_cast<void**>(arg);
    jstring* javaNativeLibPath = (jstring*) args[0];
    jboolean extractNativeLibs = *(jboolean*) args[1];
@@ -156,9 +157,9 @@ copyFileIfChanged(JNIEnv *env, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntr
            return INSTALL_FAILED_INVALID_APK;
        }

        if (offset % PAGE_SIZE != 0) {
            ALOGE("Library '%s' is not page-aligned - will not be able to open it directly from"
                " apk.\n", fileName);
        if (offset % kPageSize != 0) {
            ALOGE("Library '%s' is not PAGE(%zu)-aligned - will not be able to open it directly "
                  "from apk.\n", fileName, kPageSize);
            return INSTALL_FAILED_INVALID_APK;
        }