Repository navigation
Conversation
…essory permissions - Introduce UsbAutoConfirmService, an optional AccessibilityService to automatically check 'Always allow / Use by default' and confirm the system USB permission dialog on head units that forget permissions on boot. - Restrict event processing strictly to system USB activities (UsbPermissionActivity, UsbConfirmActivity under com.android.systemui and android) and verify that the dialog prompt explicitly names the app and USB access before acting. - Add an 800ms debounce window and ensure all AccessibilityNodeInfo instances are recycled cleanly. - Add an 'Auto-confirm USB permission' setting item and helper to open system Accessibility settings from CarPlayHostActivity. - Add unit tests covering system activity filters and prompt target verification.
Owner
|
这也太fifa了,并不优雅也不安全 |
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
Add an optional
UsbAutoConfirmService(Accessibility Service) to automatically grant the Android USB accessory permission prompt for CarPlay on head units that forget USB permissions across reboots.Motivation & Problem
On many automotive head units (especially customized aftermarket or OEM Android systems), the system forgets USB device/accessory permission grants every time the device cold boots. Consequently:
Key Changes
UsbAutoConfirmService.kt):com.android.systemuiandandroid).UsbPermissionActivityandUsbConfirmActivity).applicationInfo.loadLabel(packageManager)and"USB"to guarantee it never clicks permission dialogs intended for third-party apps or non-USB permissions.android:id/alwaysUseif unchecked.android:id/button1or labels matching "确定", "允许", "OK", "Allow", "Confirm").AccessibilityNodeInforeferences.usb_auto_confirm_service_config.xmldeclaring event types and view ID reporting flags.AndroidManifest.xmlwithandroid.permission.BIND_ACCESSIBILITY_SERVICE.CarPlayHostActivity.openAccessibilitySettings()to allow one-tap navigation directly into Android's Accessibility Settings page.values-zh-rCN) string resources.UsbAutoConfirmServiceTest.kt): Added comprehensive test coverage for package verification, activity class white-listing, and prompt text matching.