E AndroidRuntime: java.lang.RuntimeException: Unable to create service com.android.systemui.keyguard.KeyguardService

Oh boy! I finally got AOKP to boot up in an Engineering build for the XA2 Ultra (discovery). However, once you get through the setup pages, it crashes at the home screen. Here’s the logcat output:

——— beginning of crash
08-21 04:12:30.094 3050 3050 E AndroidRuntime: FATAL EXCEPTION: main
08-21 04:12:30.094 3050 3050 E AndroidRuntime: Process: com.android.systemui, PID: 3050
08-21 04:12:30.094 3050 3050 E AndroidRuntime: java.lang.RuntimeException: Unable to create service com.android.systemui.keyguard.KeyguardService: java.lang.NullPointerException: Attempt to invoke interface method ‘android.service.gesture.IEdgeGestureHostCallback android.service.gesture.IEdgeGestureService.registerEdgeGestureActivationListener(android.service.gesture.IEdgeGestureActivationListener)’ on a null object reference
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at android.app.ActivityThread.handleCreateService(ActivityThread.java:3582)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at android.app.ActivityThread.access$1300(ActivityThread.java:200)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6718)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke interface method ‘android.service.gesture.IEdgeGestureHostCallback android.service.gesture.IEdgeGestureService.registerEdgeGestureActivationListener(android.service.gesture.IEdgeGestureActivationListener)’ on a null object reference
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at android.service.gesture.EdgeGestureManager.setEdgeGestureActivationListener(EdgeGestureManager.java:178)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at com.android.systemui.statusbar.pie.PieController.init(PieController.java:126)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at com.android.systemui.statusbar.phone.StatusBar.updatePieControls(StatusBar.java:6201)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at com.android.systemui.statusbar.phone.StatusBar$19.onChange(StatusBar.java:5464)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at com.android.systemui.statusbar.phone.StatusBar.start(StatusBar.java:886)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at com.android.systemui.SystemBars.createStatusBarFromConfig(SystemBars.java:71)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at com.android.systemui.SystemBars.start(SystemBars.java:42)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at com.android.systemui.SystemUIApplication.startServicesIfNeeded(SystemUIApplication.java:185)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at com.android.systemui.SystemUIApplication.startServicesIfNeeded(SystemUIApplication.java:129)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at com.android.systemui.keyguard.KeyguardService.onCreate(KeyguardService.java:48)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: at android.app.ActivityThread.handleCreateService(ActivityThread.java:3570)
08-21 04:12:30.094 3050 3050 E AndroidRuntime: … 8 more
08-21 04:12:30.100 1445 1478 V RescueParty: Disabled because of eng build

There is a lot in there, but here is the important part:

Caused by: java.lang.NullPointerException: Attempt to invoke interface method ‘android.service.gesture.IEdgeGestureHostCallback android.service.gesture.IEdgeGestureService.registerEdgeGestureActivationListener(android.service.gesture.IEdgeGestureActivationListener)’ on a null object reference

08-21 04:12:30.094 3050 3050 E AndroidRuntime: at android.service.gesture.EdgeGestureManager.setEdgeGestureActivationListener(EdgeGestureManager.java:178)

So, I took a look at EdgeGestureManager.java, around line 178, which is reportedly the problem:

public boolean setEdgeGestureActivationListener(EdgeGestureActivationListener listener) {
if (DEBUG) {
Slog.d(TAG, “Set edge gesture activation listener”);
}
try {
IEdgeGestureHostCallback callback = mPs.registerEdgeGestureActivationListener(listener.mDelegator);
listener.setHostCallback(callback);
return true;
} catch (RemoteException e) {
Slog.e(TAG, “Failed to set edge gesture activation listener: ” + e.getMessage());
return false;
}
}

I took a look at Lineage and RR, and ended up adding new code to my files to fix it. Here’s what I put in, based on what I saw in the other working ROMs:

public void updateEdgeGestureActivationListener(EdgeGestureActivationListener listener, int positions) {
if (DEBUG) {
Slog.d(TAG, “Update edge gesture activation listener: 0x” + Integer.toHexString(positions));
}
if (mPs == null) {
Slog.e(TAG, “Failed to update edge gesture activation listener: Service not present”);
return;
}
try {
mPs.updateEdgeGestureActivationListener(listener.mDelegator.asBinder(), positions);
} catch (RemoteException e) {
Slog.e(TAG, “Failed to update edge gesture activation listener: ” + e.getMessage());
}
}

So now it will check if it is “null” or empty before trying to use it. If it is empty, it exits rather than crashing because it is empty. If it’s not empty, it will use it instead. Praise God! This even worked! After fixing this last piece of the puzzle, AOKP Pie finally booted and worked on my XA2 Ultra!

Linux – keep it simple.

Advertisements

system/bt/stack/btu/btu_hcif.cc:729:22: error: no member named ‘BLUETOOTH_CLASSIC_PAIRING_EVENT_REPORTED’ in namespace ‘android::util’

Several Bluetooth issues were really giving me the run around while trying to compile AOKP for the Xperia XA2 Ultra. Let’s take a look:

system/bt/stack/btu/btu_hcif.cc:729:22: error: no member named ‘BLUETOOTH_CLASSIC_PAIRING_EVENT_REPORTED’ in namespace ‘android::util’
android::util::BLUETOOTH_CLASSIC_PAIRING_EVENT_REPORTED, “”, handle,
~~~~~~~~~~~~~~~^
system/bt/stack/btu/btu_hcif.cc:1698:22: error: no member named ‘BLUETOOTH_CLASSIC_PAIRING_EVENT_REPORTED’ in namespace ‘android::util’
android::util::BLUETOOTH_CLASSIC_PAIRING_EVENT_REPORTED, “”, handle,
~~~~~~~~~~~~~~~^
2 errors generated.

I made several changes to the system/bt/stack/btu/btu_hcif.cc file:

Changed: Line 729
static void read_encryption_key_size_complete_after_encryption_change(
uint8_t status, uint16_t handle, uint8_t key_size) {
int ret = 0;
//WJH int ret = android::util::stats_write(
//WJH android::util::BLUETOOTH_CLASSIC_PAIRING_EVENT_REPORTED, “”, handle,
//WJH HCI_READ_ENCR_KEY_SIZE, HCI_COMMAND_COMPLETE_EVT, status, 0, key_size);
if (ret < 0) {
LOG(WARNING) << __func__ << “: failed to log encryption key size ”
<< std::to_string(key_size);
}

changed line 1698
static void read_encryption_key_size_complete_after_key_refresh(
uint8_t status, uint16_t handle, uint8_t key_size) {
int ret = 0;
//WJH int ret = android::util::stats_write(
//WJH android::util::BLUETOOTH_CLASSIC_PAIRING_EVENT_REPORTED, “”, handle,
//WJH HCI_READ_ENCR_KEY_SIZE, HCI_COMMAND_COMPLETE_EVT, status, 0, key_size);
if (ret < 0) {
LOG(WARNING) << __func__ << “: failed to log encryption key size ”
<< std::to_string(key_size);
}

At first I was really worried about the outcome of these changes, but the Bluetooth still seems to work properly in all my tests. So I’m not sure what it is that I “removed”. Hopefully it’s nothing important, but it does beg the question: when are we cutting something out that we actually need? How do we know when we get there?

This did “fix” the issue during compile, and since the Bluetooth works, I’m going to go with it is okay…..

Linux – keep it simple.

error: vendor/qcom/opensource/cryptfs_hw/Android.bp:27:37: unrecognized property “product_variables.lineage.uses_metadata_as_fde_key”

Another random error while compiling AOKP pie for the XA2 Ultra. These calls work properly when compiling Lineage, but don’t work in the AOKP source tree, so I did some digging.

error: vendor/qcom/opensource/cryptfs_hw/Android.bp:27:37: unrecognized property “product_variables.lineage.uses_metadata_as_fde_key”

In the end, I found that the only way around it was to remove the unrecognized property, since this isn’t LineageOS, it isn’t declared anywhere in AOKP. So, I edited vendor/qcom/opensource/cryptfs_hw/Android.bp at line 27, like so:

//WJH uses_metadata_as_fde_key: {
//WJH cflags: [“-DUSE_METADATA_FOR_KEY”],
//WJH },

By commenting them out, they are basically deleted. This seemed to work well, and so far, hasn’t hampered any of the rom functions.

Linux – keep it simple.

system.com/vold/Ext4Crypt.cpp:204:12: error: use of undeclared identifier ‘fs_mgr_is_wrapped_key_supported’

Another strange set of errors while compiling AOKP. It seems like they are in the middle of merging some Lineage commits, but didn’t finish them. Either way, I ran into this problem with Ext3Crypt:

compile system.com/vold/Ext4Crypt.cpp:204:12: error: use of undeclared identifier ‘fs_mgr_is_wrapped_key_supported’

So, I took a look at line 204 from system.com/vold/Ext4Crypt.cpp, and this is what I saw:

bool is_wrapped_key_supported() {
return fs_mgr_is_wrapped_key_supported(
fs_mgr_get_entry_for_mount_point(fstab_default, DATA_MNT_POINT));
}

This didn’t make sense to me, since the call is for a bool, the answer must be true or false, zero or one. Instead it is trying to grab some information and determine if it is true or false based on that. I spent hours trying to crack down on it, but I couldn’t find how this all washed out. In the end, I made this edit to get through this error:

bool is_wrapped_key_supported() {
//return fs_mgr_is_wrapped_key_supported(
// fs_mgr_get_entry_for_mount_point(fstab_default, DATA_MNT_POINT)); //WJH
return false; //WJH
}

Essentially, I returned false. I debated about what to return, but I don’t want it to use it, since I can’t correctly fix it, so I decided false was my best bet. Sure enough, that worked.

Linux – keep it simple.

AudioPolicyManager.cpp:2240:65: error: member reference type ‘android::AudioMix *’ is a pointer

Well, that was a new one to me! I had just build LineageOS and Resurrection Remix for the XA2 Ultra, and now I got this error in the first minute of trying to build AOKP. Here’s the full error:

vendor/qcom/opensource/audio/policy_hal/AudioPolicyManager.cpp:2240:65: error: member reference type ‘android::AudioMix *’ is a pointer; did you mean to use ‘->’?
sp<AudioPolicyMix> policyMix = inputDesc->mPolicyMix.promote();
~~~~~~~~~~~~~~~~~~~~~^
->
vendor/qcom/opensource/audio/policy_hal/AudioPolicyManager.cpp:2240:66: error: no member named ‘promote’ in ‘android::AudioMix’
sp<AudioPolicyMix> policyMix = inputDesc->mPolicyMix.promote();
~~~~~~~~~~~~~~~~~~~~~ ^
vendor/qcom/opensource/audio/policy_hal/AudioPolicyManager.cpp:2243:37: error: no member named ‘mCbFlags’ in ‘android::AudioPolicyMix’
&& ((policyMix->mCbFlags & AudioMix::kCbFlagNotifyActivity) != 0)) {
~~~~~~~~~ ^
vendor/qcom/opensource/audio/policy_hal/AudioPolicyManager.cpp:2244:77: error: no member named ‘mDeviceAddress’ in ‘android::AudioPolicyMix’
mpClientInterface->onDynamicPolicyMixStateUpdate(policyMix->mDeviceAddress,
~~~~~~~~~ ^
vendor/qcom/opensource/audio/policy_hal/AudioPolicyManager.cpp:2265:39: error: no member named ‘mMixType’ in ‘android::AudioPolicyMix’
} else if (policyMix->mMixType == MIX_TYPE_PLAYERS) {
~~~~~~~~~ ^
vendor/qcom/opensource/audio/policy_hal/AudioPolicyManager.cpp:2266:42: error: no member named ‘mDeviceAddress’ in ‘android::AudioPolicyMix’
address = policyMix->mDeviceAddress;
~~~~~~~~~ ^
6 errors generated.

Ironically, the vendor/qcom/opensource/audio/policy_hal/AudioPolicyManager.cpp file is common to all three ROMs, Lineage, RR, and AOKP. So how is it that it fails on AOKP, but gives me no errors on Lineage or RR? As it turns out, there was a commit to /frameworks/av in Lineage and RR that was not performed on AOKP. You can take a look at the commit yourself if you’d like.

Essentially, you have a situation where the target ROM (AOKP) has dependencies mixed from the source ROM (LineageOS). Some of these dependencies were updated with the new code, and some were not, making a half done product that didn’t build. This is one of the problems when you are working on the latest versions of custom ROMs, is that there may be a few errors that are due to dependencies being changed.

So, there were two options for fixing this:

  1. Update /frameworks/av to match LineageOS.
  2. Rollback the changes in qcom’s audio policy.

The first is the most progressive, as the changes will probably come to that anyways, but it may require making other changes to more and more files. Just perusing the files looked like changing 10 files on about 80 different lines, but these may affect other files or lines as well.

That said, the simpler answer was to go with the second option and roll back the changes in the qcom audio policy. This only required changing about 6 or 7 lines in one file, which was much easier to accomplish.

If you look at the commit that made the changes, you can see the few lines that are edited to make this work properly. Fortunately the quick rollback fixed the issue and allows the build to continue.

audio

Linux – keep it simple.

Video Tutorial on How to Compile Android and Modify Kernels

video

For those interested, I have just posted a video tutorial series on XDA for building Android Oreo, Nougat, Marshmallow, and Lollipop on 5 different phones, the emulator, and 5 different ROMs. Also included are custom kernel editing, adding apps, changing source code, backgrounds, and more. Here’s what I posted:

From XDA: https://forum.xda-developers.com/android/general/guide-how-to-build-custom-roms-kernel-t3814251

===========================================================================

Praise God! Finally a video tutorial of how to build Android and modify kernels!

I have created a video tutorial and guide for how to compile Android, from Lollipop through Marshmallow, Nougat, and Oreo. The video series covers several different phones, the emulator, kernel and rom editing, app source code editing, and much more!

Who is this video series for?
Well, this video tutorial is a step by step guide built primarily for the beginner. This is written for those who already know how to flash TWRP, CWM, or the like, and who have installed a custom rom before. This is designed to help those who are ready to move up from flashing and installing other peoples custom rom to actually start making their own custom roms. I recommend that a beginner watch the entire series in numerical/alphabetical order (the videos are marked).

That said, I believe that an intermediate developer may find a useful trick here and there, and they should just skip ahead to videos of interest. Perhaps kernel development, or something along those lines.

An advanced rom/kernel developer will probably far exceed my feeble abilities, and will not likely find much useful information here. Perhaps if you are an advanced developer, you would consider continuing the tutorial or making an advanced video series! (See further posts for recommendations on contributing videos.)

Why did you put this together?
Well, after building roms for several different devices, I started receiving requests from users who wanted to start building their own roms, but didn’t know how. I didn’t have enough time to answer everyones questions, so I wrote a few guides, pointed others to guides that were available, but there are some things that you just need to see to understand. Hence, the video tutorial. I just hope that someone finds it useful.

This course was written in order! While Lollipop and Marshmallow are old by today’s standards, there is still good learning value in building them, and there are topics covered there that really make them worth watching.

What’s in the videos?
During the series, we will be building for the emulator, as well as 5 different phones of various brands, and 5 different roms. I hope that this will give the viewer a good idea of how to build for their own specific phone as they see the differences and similarities across the phones and custom roms.

[CODE]
+ Ubuntu installation
+ Java installations
+ Using Git, GitHub, GitKraken, and the command line
+ Fastboot and ADB
+ Heimdall/Odin
+ QFIL, QPST, SALT, and other tools
+ AOSP, SlimRoms, PACrom, AOKP, AOSCP
+ Lollipop, Marshmallow, Nougat, Oreo
+ Errors
+ Overclocking CPU/GPU
+ Adding Governors and I/O Schedulers
+ Sound modifications
+ Changing app colors, text, and icons
+ Adding prebuilt apps
+ Adding source code
+ Converting device from one rom to another
+ AND MORE!
[/CODE]

**** This is an UNOFFICIAL TUTORIAL. Use at your own risk! ****
Download links:
Ogg Vorbis Video GitLab:
[url]https://gitlab.com/alaskalinuxuser/course_android_developer_guide[/url]
Clicking on a video in GitLab will allow you to watch it online.

Ogg Vorbis Video Downloads:
[url]https://gitlab.com/alaskalinuxuser/course_android_developer_guide/-/archive/master/course_android_developer_guide-master.zip[/url]
This download is rather large due to the multiple videos.

MP4 Video GitLab:
[url]https://gitlab.com/alaskalinuxuser/course_android_developer_guide_mp4[/url]
Clicking on a video in GitLab will allow you to watch it online.

MP4 Video Downloads:
[url]https://gitlab.com/alaskalinuxuser/course_android_developer_guide_mp4/-/archive/master/course_android_developer_guide_mp4-master.zip[/url]
This download is rather large due to the multiple videos.

I also have several written guides available on XDA, here are a few:

Building ROMs for the Galaxy Note Edge: [url]https://forum.xda-developers.com/note-edge/general/guide-build-aosp-roms-kernels-note-edge-t3488840[/url]
Building ROMs for the Galaxy S4: [url]https://forum.xda-developers.com/galaxy-s4-tmobile/general/guide-step-step-instructions-building-t3402637[/url]

===========================================================================

Be sure to check out the videos or the XDA thread! I hope that these will help some of the aspiring Android developers out there!

Linux – keep it simple.

error: use of undeclared identifier ‘LED_ADJUSTMENT_G’

After synching my source with AOKP for Nougat 7.1.2, I ran into this error when trying to build for the JFLTETMO:

[CODE]
target thumb C: lights.MSM8960 <= hardware/samsung/liblights/lights.c
hardware/samsung/liblights/lights.c:215:40: error: use of undeclared identifier ‘LED_ADJUSTMENT_R’
int red = ((color >> 16) & 0xFF) * LED_ADJUSTMENT_R;
^
hardware/samsung/liblights/lights.c:216:41: error: use of undeclared identifier ‘LED_ADJUSTMENT_G’
int green = ((color >> 8) & 0xFF) * LED_ADJUSTMENT_G;
^
hardware/samsung/liblights/lights.c:217:33: error: use of undeclared identifier ‘LED_ADJUSTMENT_B’
int blue = (color & 0xFF) * LED_ADJUSTMENT_B;
^
hardware/samsung/liblights/lights.c:258:31: error: use of undeclared identifier ‘LED_BRIGHTNESS_BATTERY’
adjusted_brightness = LED_BRIGHTNESS_BATTERY;
^
hardware/samsung/liblights/lights.c:261:31: error: use of undeclared identifier ‘LED_BRIGHTNESS_NOTIFICATION’
adjusted_brightness = LED_BRIGHTNESS_NOTIFICATION;
^
hardware/samsung/liblights/lights.c:264:31: error: use of undeclared identifier ‘LED_BRIGHTNESS_ATTENTION’
adjusted_brightness = LED_BRIGHTNESS_ATTENTION;
^
6 errors generated.
[/CODE]

Pretty simple, as we have talked about this before. In the past, I actually removed these lines from the light.c file, but this time I decided I would leave them in, and declare them instead. Essentially, the outcome is the same though for this build.

What these lines do is allow for custom liblight configurations. Perhaps a particular phone or tablet has a built in LED notification light where the green is brighter than the red or blue. In that case, every mixed color made from those LEDs will look strange. This gives the rom maker the option to “dim” down one or all three of the lights. The same applies for the brightness of the battery, notification, or attention lights.

As you can see below, I just declared them with the default values:

[CODE]
return err;
}

// WJH declaring these undeclared lights.
int LED_ADJUSTMENT_R = 1;
int LED_ADJUSTMENT_G = 1;
int LED_ADJUSTMENT_B = 1;
// WJH declaring these undeclared lights.

static int calibrate_color(int color, int brightness)
{
int red = ((color >> 16) & 0xFF) * LED_ADJUSTMENT_R;
int green = ((color >> 8) & 0xFF) * LED_ADJUSTMENT_G;
int blue = (color & 0xFF) * LED_ADJUSTMENT_B;

return (((red * brightness) / 255) << 16) + (((green * brightness) / 255) << 8) + ((blue * brightness) / 255);
}

…………EDITED FOR SPACE………………

led->delay_off = state->flashOffMS;
break;
default:
return -EINVAL;
}

// WJH declaring these brightness adjustments.
int LED_BRIGHTNESS_BATTERY = 255;
int LED_BRIGHTNESS_NOTIFICATION = 255;
int LED_BRIGHTNESS_ATTENTION = 255;
// WJH declaring these brightness adjustments.

switch (type) {
case TYPE_BATTERY:
adjusted_brightness = LED_BRIGHTNESS_BATTERY;
break;
case TYPE_NOTIFICATION:
adjusted_brightness = LED_BRIGHTNESS_NOTIFICATION;
break;
case TYPE_ATTENTION:
adjusted_brightness = LED_BRIGHTNESS_ATTENTION;
break;
default:
adjusted_brightness = 255;
}
[/CODE]

 

For the LED_ADJUSTMENT_R/G/B, I gave a value of 1. If you look at the math, it is used in the next formulae as (a & b) * LED_ADJUSTMENT_R/G/B. So if I set a value of 0, then the mathmatical outcome will be 0. If I set it at 1, then it will always be (a & b).

For the LED_BRIGHTNESS_BATTERY and so forth, I used the adjusted_brightness of 255, which is the default.

For both of these sets, I could have just removed them all together. But I build for several phones using the same source. By leaving them in, I should have an error if the device tree declared what is already declared in the lights.c file. Or at least that is my hope. In that case, then I could remove my handy work to make room for the actual values.

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.

POWER_HINT_LAUNCH_BOOST is not declared in this scope!

While building AOKP 7.1.2 for the kltevwz (the Verizon Samsung Galaxy S5), I ran into this error:

[CODE]

device/qcom/common/power/power-8974.c:143:17: error: ‘POWER_HINT_LAUNCH_BOOST’ was not declared in this scope …….Edited for space…….. make: *** Waiting for unfinished jobs….

[/CODE]

So, I headed over to device/qcom/common/power/power-8974.c, and this is what I saw:

[CODE]

if (hint == POWER_HINT_LAUNCH_BOOST) {
int duration = 2000;
int resources[] = { CPUS_ONLINE_MIN_3,
CPU0_MIN_FREQ_TURBO_MAX, CPU1_MIN_FREQ_TURBO_MAX,
CPU2_MIN_FREQ_TURBO_MAX, CPU3_MIN_FREQ_TURBO_MAX };

interaction(duration, ARRAY_SIZE(resources), resources);

return HINT_HANDLED;
}

[/CODE]

Looked pretty normal to me. However, when comparing to LineageOS’s 14.1 files, I saw that they dropped the “boost” from the name of the hint. So I edited mine to match, like so:

[CODE]

if (hint == POWER_HINT_LAUNCH) {
int duration = 2000;
int resources[] = { CPUS_ONLINE_MIN_3,
CPU0_MIN_FREQ_TURBO_MAX, CPU1_MIN_FREQ_TURBO_MAX,
CPU2_MIN_FREQ_TURBO_MAX, CPU3_MIN_FREQ_TURBO_MAX };

interaction(duration, ARRAY_SIZE(resources), resources);

return HINT_HANDLED;
}

[/CODE]

And, it built that part successfully! I like the easy problems!

Linux – keep it simple.