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

Commit d008d55f authored by Steve Kondik's avatar Steve Kondik Committed by Clark Scheff
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
parent 64e53307
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -671,12 +671,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
@@ -586,6 +586,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;