Listing settings for modify setting action should use settings list for expert mode users#2159
Merged
Merged
Conversation
… setting screen When the system bridge is connected (expert mode), the choose setting screen now queries the Settings ContentProvider directly through a new getAllSettings() AIDL method instead of falling back to the restricted ContentProvider query from the app process. The system bridge runs with shell/root privileges, giving it access to all settings rows that the app process cannot see. A queryCompat helper is added to IContentProviderUtils to handle the version-dependent IContentProvider.query() signatures across API 29–34+. When the system bridge is not connected, the existing ContentResolver query is used as a fallback.
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.
Closes #2157
Summary
getAllSettings(String namespace)method toISystemBridge.aidl(transaction ID 26) that queries the Settings ContentProvider directly from within the system bridge process.getAllSettings()inSystemBridge.ktusingActivityManagerApis.getContentProviderExternal("settings", ...)+IContentProviderUtils.queryCompat()to retrieve all settings rows with the elevated shell/root privileges the system bridge already holds.queryCompat()toIContentProviderUtilsto handle the version-dependentIContentProvider.query()signatures across API 29 (Android 10), 30 (Android 11), and 31+ (Android 12+,AttributionSource-based).ChooseSettingViewModelto injectSystemBridgeConnectionManagerand, when the system bridge is connected, callbridge.getAllSettings(namespace)instead ofsettingsAdapter.getAll(type). Falls back to the existing ContentResolver-based query when the system bridge is not connected.The system bridge runs as shell (or root), giving it unrestricted access to all Settings rows that the app process normally cannot read. No shell subprocess is spawned.
Known limitations / areas for human review
queryCompat()assumes theIContentProvider.query()transaction IDs match the expected AOSP layout for API 29/30/31+. If a device ships a heavily patched SettingsProvider that changes these signatures, the query may fail — in which case the code silently falls back tosettingsAdapter.getAll().=in the returned array (key=), whichparseKeyValuePairsdecodes back tonull. Empty-string values and null values are therefore indistinguishable; this matches the behaviour of the existing ContentResolver path.ChooseSettingViewModeldoes not re-fetch when the system bridge connects/disconnects mid-session — the user would need to navigate back and reopen the screen. This is acceptable for now as it mirrors other system-bridge-dependent UI.Test plan
secureandglobalnamespaces)Generated by Claude Code
Generated by Claude Code