SlimRoms 7.1.2 on the H811 LG G4!

Praise God! My SlimRoms Nougat ROM for the LG G4 H811 is finally working!

It’s always fun to try building for a new device, but this one was particularly interesting, as it was my first non-Samsung build! Not to mention the 64 bit arch, which just makes the learning process all that much more fun! Be sure to give it a try, you can find it on XDA, or here on my site under “Homemade Roms” from the title bar menu.

Linux – keep it simple.

Fixing the blank developer settings on SlimRoms Nougat

After building SlimRoms Nougat for the H811 (LG G4 T-Mobile), I ran into an odd artifact: when you enabled and opened the developer settings, it would be blank, or crash. I had absolutely no idea why that would be, nor where to begin looking into a fix.

So, I hopped over to SlimRoms’ gerrit:¬†https://review.slimroms.org/#/q/status:merged

Once there, I looked at merged (accepted or fixed) labels, and typed “developer” in the search box. A lot of things came up, but there was a noticeable trend among the contenders, a crash or ANR report when opening the developer settings.

In every case they used the same fix, so I decided to give it a try. It looks like the common factor in every case was the FRP, or factory reset protection in the system.prop files for the devices. I took a look at mine:

# Factory Reset Protection
PRODUCT_PROPERTY_OVERRIDES += \
ro.frp.pst=/dev/block/bootdevice/by-name/persistent

and edited them as such (just commented out) :

# Factory Reset Protection
# PRODUCT_PROPERTY_OVERRIDES += \
# ro.frp.pst=/dev/block/bootdevice/by-name/persistent
# WJH commented out as this prevents the developer options from opening.

And it was fixed! It’s great when the fix is so easy!

Linux – keep it simple!

undeclared identifier ‘POWER_HINT_LAUNCH_BOOST’

So, a new one for me. I’m building a rom for the H811, the T-Mobile variant of the LG G4. Currently building the tried and true AOKP 7.1.2 that I have used for my other phones, and I ran into an error:

[CODE]
target thumb C: power.msm8992_32 <= device/qcom/common/power/power-8992.c
device/qcom/common/power/power-8992.c:211:17: error: use of undeclared identifier 'POWER_HINT_LAUNCH_BOOST'; did you mean 'POWER_HINT_CPU_BOOST'?
if (hint == POWER_HINT_LAUNCH_BOOST) {
^~~~~~~~~~~~~~~~~~~~~~~
POWER_HINT_CPU_BOOST
hardware/libhardware/include/hardware/power.h:71:5: note: 'POWER_HINT_CPU_BOOST' declared here
POWER_HINT_CPU_BOOST = 0x00000110,
^
1 error generated.
[/CODE]

The suggested option was to change POWER_HINT_LAUNCH_BOOST to POWER_HINT_CPU_BOOST, but I didn't like that, since just a dozen lines later in the code, there was already an if/then statement for POWER_HINT_CPU_BOOST. Esentially, we need to either declare POWER_HINT_LAUNCH_BOOST, or get rid of it in our code. In this case, I decided to scrap it because if it was needed, then it would have existed already. Strange logic perhaps, but what we see is that if it is not called, it will not return anything anyways. If it is called, it just supplies some information that I think we can live without.

[/CODE]
// WJH was POWER_HINT_LAUNCH_BOOST
// WJH if (hint == POWER_HINT_LAUNCH_BOOST) {
// WJH launch_boost_info_t *info = (launch_boost_info_t *)data;
// WJH if (info == NULL) {
// WJH ALOGE("Invalid argument for launch boost");
// WJH return HINT_HANDLED;
// WJH }

// WJH ALOGV("LAUNCH_BOOST: %s (pid=%d)", info->packageName, info->pid);

// WJH int duration = 2000;
// WJH int resources[] = { SCHED_BOOST_ON, 0x20C };

// WJH start_prefetch(info->pid, info->packageName);
// WJH interaction(duration, ARRAY_SIZE(resources), resources);

// WJH return HINT_HANDLED;
// WJH }

if (hint == POWER_HINT_CPU_BOOST) {
int duration = *(int32_t *)data / 1000;
int resources[] = { SCHED_BOOST_ON };
………….EDITED FOR SPACE…………….
[/CODE]

That will cut it out of the loop, which means the loss of a feature, but I think it is one we can live without.

Linux – keep it simple.