Fix single-bud NPE crashes, BluetoothSocket reflection, and add rootless Charging Case Sounds - #763
Closed
bshea-1 wants to merge 1 commit into
Closed
Conversation
…e sounds toggle - Fix KotlinNullPointerException on single-bud usage and uninitialized battery states in AirPodsService - Fix BluetoothSocket reflection constructor with valid fd (-1) and add dynamic fallback resolver - Add rootless Charging Case Sounds toggle for AirPods Pro 2 and AirPods 4 ANC via AACP - Remove per-packet notification updates in raw socket read loop - Fix default conversational awareness volume calculation in MediaController - Add NativeBridge and ProGuard hardening for JNI bindings - Update README with concise feature overview and patch documentation
Author
|
Closing PR for local modifications. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR resolves several background service crashes, improves Bluetooth socket reflection compatibility, optimizes notification resource usage, and adds rootless Charging Case Sounds toggle support.
1. Background Stability & Crash Prevention
AirPodsService, querying battery state when only one earbud is connected or before battery packets arrive caused multipleNullPointerExceptioncrashes on?.level!!. Added a safegetDisplayBatteryLevel()helper to coalesce left and right bud levels safely.intent.getParcelableExtra("device")without force unwraps (!!) and guarded device access.onBatteryInfoReceived()before indexing battery status elements.2. Bluetooth Connection Hardening
fd = 1parameter (STDOUT_FILENO) passed to reflectedBluetoothSocketconstructors (changed to-1for uninitialized socket state).bluetooth_socketearly inLibrePodsApplication.onCreate().3. Battery & Notification Optimization
updateNotificationContent()calls from the tight raw socket packet read loop (while (socket.isConnected)), preventing SystemUI notification spam and reducing CPU wakeups.4. Media Controller Typo Fix
MediaControllerconversational awareness default volume calculation from/ 0.4to* 0.4.5. New Feature: Charging Case Sounds Toggle (Rootless)
Capability.CASE_SOUNDSfor AirPods Pro 2 and AirPods 4 ANC.IN_CASE_TONE_CONFIG(0x31over AACP), allowing rootless control of case speaker chimes.