Ril-daemon control app for LG G4 AOSCP Oreo!

I’m sure many of you are already using Kessaras’ great AOSCP Oreo Rom for the LG G4!

One small current issue is the ril-daemon sometimes needs to be stopped and started to make your sim card and cellular work properly. In the past, you could just reboot, or stop and start the daemon from the command line. But now you can just tap a button! That’s right, just a simple, easy to use app that stops or starts the ril-daemon when you tap the buttons.

This app requires root permission!

This app is open source, licensed under the Apache 2.0, and you can check out the source code here:
https://github.com/alaskalinuxuser/app_ril_control

You can download the app here:
https://github.com/alaskalinuxuser/app_ril_control/blob/master/app/Ril_Control.apk

Or get it on the Play Store!
https://play.google.com/store/apps/details?id=com.alaskalinuxuser.rilcontrol

Linux – keep it simple.

LG G4 on SlimRoms: delete the pin key in TWRP!

In my last post, I told the epic adventure of figuring out how to get into recovery mode so I could fix my unbooting phone. I had performed a backup of SlimRoms before trying to flash OmniRom, and since I was back into TWRP, I restored my backup. Figuring all was well, I rebooted.

Everything booted up great. However, once into the rom, it asked for my screen lock pin, as usual. But unlike the normal response, it kept saying that I was entering the wrong pin. I tried my pin, my old pin, and no pin. No luck. It wasn’t working.

There are a lot of articles on this, and this will not be much new, however, the names of my lock files were different than the article I read, so I am posting the names of the files here in case I forget when this happens to me again. (Most of this blog is simply my own scratchpad of notes to help me remember something….)

So, power off the phone, and jump back into TWRP (see the previous post if you need help with that). In TWRP, go to Advanced – > File Manager.

Scroll down to the /data folder. Open the /system folder and look at the contents.

On my phone I had to delete these files to disable the lock:

gatekeeper.password.key

gatekeeper.pattern.key

locksettings.db

locksettings.db-shm

locksettings.db-wal

After deleting these five files in the TWRP file manager, I then rebooted the phone. Sure enough, now I had no lock screen settings nor pin in the ROM. Back in action! I, of course, immediately set up a new lock screen and pin for security purposes. Hopefully that helps you too!

Linux – keep it simple.

How to get to TWRP on a LG G4 with the hardware buttons….

This is something that should be easy. Really easy. However, it took me a while to find this on the web, and since it did, I’m posting it here too. On XDA, there is a thread about this, intermingled with numerous other threads that say different or sometimes erroneous information.

Back story:

I flashed my LG G4 T-Mobile (H811) phone with a new custom rom I built – OmniRom. Only it didn’t boot. Don’t know why yet, I’m making an engineering build now so I can use ADB to figure that out. As far as I knew, the only ways to get to TWRP were to choose such from your power down menu, or use ADB to reboot into recovery. I thought all was lost, because ADB was not set to on in my custom build, and there was no way to get to TWRP, or so I thought.

I started trying every button combination I could think of.

Found the IMEI screen:

This did lead me to an interesting discovery, if you press Volume down + Volume up + Power, then, when you see the LG logo, release Power (but hold the volumes) wait a second, then press and hold the Power button with the volume buttons, you go into a special IEMI screen that displays a barcode with your IMEI on it.

But I didn’t need that. Quite frankly, you can just open the case and read the sticker to know your IMEI, so this was useless to me, but interesting enough for me to note it here.

After multiple tries, I found the “Factory Reset” screen by holding Volume down + Power, then, when you see the LG logo, release Power (but hold the volume) wait a second, then press and hold the Power button with the volume button. This will take you to the “Factory Reset” screen.  I thought that was no good. I wanted to get to the recovery mode.

However, feeling frustrated and hopeless, I chose “yes” for the factory reset. Interestingly, it then flashed the screen, and took me to TWRP!

Believe me, I was very happy!

So, if TWRP is installed properly, then you can get there by entering “Factory Reset” mode, and selecting “yes”. Simply confusing, right? I guess when you say “yes” on stock firmware, it boots stock recovery and performs a factory reset, but since there is no stock recovery, it enters TWRP with a reset flag, which TWRP doesn’t use. Makes sense, I guess. Too bad they just didn’t make it so when you push volume down and the power button during startup that it would just take you to recovery mode like every other Android phone on the market.

Linux – keep it simple.

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.

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.