Device: Fix AirPods Max 2 wear detection#572
Merged
Merged
Conversation
Bit 5 of pubStatus is always set on A3454 and no longer carries the wear flag (unlike Max gen 1). Read bits 1 and 3 instead — the per-earcup sensors. OR rather than AND so phones that only see one bit reliably still report worn correctly. Closes #548
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.
What changed
Fixes wear detection on AirPods Max 2. The app used to show "in-ear" all the time — even when the headphones were sitting on a desk — so auto play/pause never triggered. Now the dashboard reflects whether the headphones are actually being worn, and auto play/pause works as expected when both earcups come off.
Technical Context
true.0x23for "both worn" and0x21for "neither" — bit 1 only). AND would falsely report "not worn" during normal use on those phones.0x2Bsample where old and new logic both return worn; cannot determine its layout without an unworn sample, so left unchanged pending a follow-up.Review checklist
In earflag toggles between worn/unworn states on a real Max 2pubStatustoggling0x21 ↔ 0x23)Closes #548