Harden 5G and carrier capability caching mechanisms - #19
Merged
Conversation
- Kept Android 11 as the minimum version for 5G capability detection. - Preserved the forward-compatible profile ID check for values 23 and higher. - Prevented empty default-network properties from being cached as 5G unsupported. - Prevented unparseable property values from producing a cached negative result. - Cached device capabilities only when at least one valid numeric profile was found. - Preserved Android 7–10 compatibility and existing legacy capability behavior.
- Preserved the maintained LTE-and-above carrier registry. - Restricted short carrier aliases to exact matching. - Added whole-phrase matching for longer carrier labels. - Normalized common separators before phrase matching. - Prevented unrelated carriers from matching short aliases by substring.
- Replaced the shell echo cache check with capability-source validation. - Required at least one relevant selected-slot CarrierConfig value before caching. - Kept maintained carrier registry matches as cacheable real-world evidence. - Prevented slot headers alone from validating default capability values. - Preserved optimistic behavior when CarrierConfig detection is unavailable.
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
This pull request introduces critical robustness improvements and security hardening to the device capability and carrier matching logic. It ensures that only verified, valid 5G capability results and carrier matches are cached, preventing false negatives, incorrect substring matches, and edge-case misconfigurations across different Android versions.
Changes & Improvements
1. 5G Capability Caching & Version Safeguards
23and higher.2. Carrier Alias Match Accuracy
3. Carrier Capability Validation & Caching
CarrierConfigvalue before allowing cache persistence.CarrierConfigdetection is unavailable.