Find and integrate proprietary Boost Framework files - YOCAP/documentation GitHub Wiki

Before getting device specific, let's try and get the built-in msm8998-userdebug target working.

When you try the first build, the first error we get is:

FAILED: ninja: 'out/soong/missing', needed by 'out/soong/msm8998/dex_bootjars_input/QPerformance.jar', missing and no known rule to make it

Let's look through the code to see what's going on:

$ grep -r QPerformance *
device/qcom/common/base.mk:# Preloading QPerformance jar to ensure faster perflocks in Boost Framework
device/qcom/common/base.mk:PRODUCT_BOOT_JARS += QPerformance
Binary file device/qcom/common/.git/index matches
frameworks/base/core/java/android/util/BoostFramework.java:    private static final String PERFORMANCE_JAR = "/system/framework/QPerformance.jar";

So this a proprietary library part of Qualcomm's BoostFramework. We can find this QPerformance.jar in a number of places, easiest is to look on Github. Make sure you find one for your Android version.

Since this our first "customization", I create a <build_dir>/proprietary where all our own stuff can go.

Place QPerformance.jar in <build_dir>/proprietary/system/framework/ and then create an Android.bp file (See Android build reference) and put this in:

dex_import {
    name: "QPerformance",
    owner: "qti",
    jars: ["system/framework/QPerformance.jar"],
}

But when you add a library, you need to give it permission to run, whitelisting it:

prebuilt_etc {
    name: "com.qualcomm.qti.Performance.xml",
    src: "etc/permissions/com.qualcomm.qti.Performance.xml",
    sub_dir: "permissions",
}

Again search for the above file.

The boost framework also need a UxPerformance.jar. So repeat the above steps for that file.

You should end up with the jar and permission xml files for QPerformance and UxPerformance in your proprietary section of your build tree:

dex_import {
    name: "QPerformance",
    owner: "qti",
    jars: ["system/framework/QPerformance.jar"],

}

prebuilt_etc {
    name: "com.qualcomm.qti.Performance.xml",
    src: "etc/permissions/com.qualcomm.qti.Performance.xml",
    sub_dir: "permissions",
}

dex_import {
    name: "UxPerformance",
    owner: "qti",
    jars: ["system/framework/UxPerformance.jar"],

}

prebuilt_etc {
    name: "com.qualcomm.qti.UxPerformance.xml",
    src: "etc/permissions/com.qualcomm.qti.UxPerformance.xml",
    sub_dir: "permissions",
}
⚠️ **GitHub.com Fallback** ⚠️