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

Commit 1ca191d0 authored by d34d's avatar d34d Committed by Steve Kondik
Browse files

Themes: Check common resource paths at java layer

This solves two problems:
1. It won't try to attach common resources that do not exist
2. Avoids call down to the native layer if they don't exist

Change-Id: I7b58b3f8a2540b6f62bd54feb21a3e33320c8e47
parent c18b93c0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.util.Log;
import android.util.SparseArray;
import android.util.TypedValue;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
@@ -666,8 +667,12 @@ 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,