Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 351760a4 authored by George Chan's avatar George Chan
Browse files

Addressed and handled guest mode, screen off vs keyguard race condition, and...

Addressed and handled guest mode, screen off vs keyguard race condition, and screen off before lock condition

- Added a 2 fallback checks to mitigate keyguard and screen off race condition and lock after screen timeout setting
- Added a check to only reenable USB if user is not a guest
- Added an extra check to make sure that the USB port state is disabled, since in some HIDL implementation disabledForce can represent for framework's intent. Also added a request boolean to make sure DISABLED_FORCE is actuated by (if not partly by) APM so that it does not take action if itself did not expect USB to be disabled (ie. Enterprise policy)
- Added a lock to the critical section to avoid race condition between the multiple calls to setUsbDataSignalIfPossible()
- Removed data role check for determining if any existing connection should block disabling USB

Bug: 433991065, 433323500, 435244379
Test: manual testing, atest FrameworksMockingServicesTests
Flag: android.security.aapm_feature_usb_data_protection
Change-Id: Ie329879281e00d106f8099a67e9f9e42c3f5004d
parent e6020b6c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment