Excessive jdwp control socket failures in catlog, triggered by all sorts of apps on clean stock ROM install
Expected Behavior
The preinstalled Android system and user apps should not continously attempt to establish jdwp debug connections at all times. It should not be necessary to satisfy the endless queries by enabling USB debugging, as that is a workaround and does not address the underlying issue.
Current Behavior
There is an endless stream of jdwp error messages from all sorts of user and system apps (see log for an excerpt). This happens already immediately on a fresh installation. The queries do never end, unless the user specifically toggles on "ADB USB debugging" in the developer options. The constant jwrp queries do slightly harm the system's battery runtime when actively using the device. Additional installed user apps make this behavior worse, as certain apps exhibit the need to query for jdwp as well.
The behavior does temporarily pause when the device enters deep sleep and doze modes. However during doze maintenance modes, the behavior continues again and shows in minimal, equally spread battery drain, exposed thanks to an energy monitoring app (Gsam Battery Monitor, see screenshot). Important detail: The endless jdwp control socket errors stop and affected (system) apps connect to whatever they wanted to establish after enabling USB debugging in the developer options. The catlog log activity is then back to normal levels, and the energy drain caused by the constant queries vanishes.
Possible Solution
You are in the better position to think of a proper solution for this. But it looks like to me that some debugging flag or "something" unintended is shipped with LineageOS that shouldn't be active and make apps constantly query for a debugging server. A change that fixes the underlying issues and avoids for users having to enable USB debugging to get rid of this error would be great.
Steps to Reproduce
- Install LineageOS on your phone. No modifications are made, this is completely stock (yes, no Magisk, just nothing). In my case, I installed LineageOS 18.1 on Whyred (official)
- Restart into LineageOS after flashing completed.
- Do the "welcome screen" setup (you can skip through there, it is not related there)
- Unlock developer settings
- Now prepare adb on your computer. You want to be able to quickly check the logs in order to catch it.
- Enable USB debugging on the Android phone.
- On your computer, in the adb terminal window, type in "adb connect device"
- On your Android phone, confirm the debug authorization.
- Now on your computer's adb terminal, type in "adb logcat"
- Capture the output and text-search for the occurences of "jdwp control socket" and "jdwp".
- Be strangely intrigued how the error magically stopped in the log as soon as you enabled adb on your phone. And how difficult it is to find such an issue when no way of accessing logs on the phone itself is available. Additionally, make sure to take the issue more seriously than last time: #4342 (closed) Thank you!
/device whyred /version lineage-18.1 /date 2022-02-14 /kernel 4.4.296-lineageos-g82e44f01405d #1 Mon Feb 7 03:55:40 UTC 2022 /baseband 660_GEN_PACK-1.336736.1.337834.1 /mods Pure stock system, no mods. Various mods such as Magisk and OpenGapps have zero impact on the observed behavior, I tested both scenarios.
I have read the directions. logcat_2022-02-20_.txt