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

Commit c21ae325 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

themes: Fix strictmode warnings

 * Use access() in the native layer instead of constructing a File
   object, as this will open the file and trigger a strictmode
   warning any time we hit this code path.

Change-Id: I0ee93e84c4b6d4937fc1ab08975e1a4c10a80295
(cherry picked from commit 4a9b471e)
Ticket: CYNGNOS-751
parent 4aae7797
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -667,12 +667,8 @@ public final class AssetManager implements AutoCloseable {
    public final int addCommonOverlayPath(String themeApkPath,
            String resApkPath, String prefixPath) {
        synchronized (this) {
            if ((new File(themeApkPath).exists()) && (new File(resApkPath).exists())) {
            return addCommonOverlayPathNative(themeApkPath, resApkPath, prefixPath);
        }

            return 0;
        }
    }

    private native final int addCommonOverlayPathNative(String themeApkPath,
+5 −0
Original line number Diff line number Diff line
@@ -585,6 +585,11 @@ static jint android_content_AssetManager_addCommonOverlayPath(JNIEnv* env, jobje
        return 0;
    }

    if (!access(packagePath8.c_str(), R_OK) == 0 ||
        !access(resApkPath8.c_str(), R_OK) == 0) {
        return 0;
    }

    AssetManager* am = assetManagerForJavaObject(env, clazz);
    if (am == NULL) {
        return 0;