WifiChipAidlImpl: cache unsupported usable channel query - #4
Conversation
The AIDL Wi-Fi HAL may report ERROR_NOT_SUPPORTED for getUsableChannels. Cache that permanent result for the lifetime of the WifiChipAidlImpl instance to avoid repeated unsupported Binder calls and error logging. Other service-specific and transient errors continue using the existing handling.
Verify that ERROR_NOT_SUPPORTED is cached after the first getUsableChannels call. Also verify that transient service errors such as ERROR_BUSY are not cached and the HAL is queried again.
Remove trailing whitespace from the usable channel tests.
Remove the remaining whitespace from the blank line between tests.
Restore the original indentation around the existing unit tests.
Restore the expected indentation in the transient error test.
|
Ready for maintainer review. The affected vendor/framework incompatibility was reproduced on the official Validation completed for the current pull request head: targeted FrameworksWifiTests: 2 passed / 0 failed; Runtime validation of a ROM containing the source change remains pending. The locally built ROM cannot be installed as an update because it is signed |
Summary
Cache an explicit
ERROR_NOT_SUPPORTEDresponse from the AIDL Wi-Fi HAL forgetUsableChannels().After the HAL reports that the operation is unsupported, subsequent calls on
the same
WifiChipAidlImplinstance returnnullwithout repeating theunsupported Binder transaction.
Problem
The AIDL contract allows
getUsableChannels()to returnWifiStatusCode.ERROR_NOT_SUPPORTED.The current implementation handles that result as a generic
ServiceSpecificException, so later framework queries can repeatedly invokean operation which the HAL has already declared unsupported.
This affects compatibility with older vendor Wi-Fi implementations such as
the one used by Xiaomi Mi 9T Pro / Redmi K20 Pro (
raphael).Change
ERROR_NOT_SUPPORTEDresponse.WifiChipAidlImplinstance.service-specific errors.
ERROR_BUSY.This source change is intentionally narrower than the exact-build binary
workaround currently installed on the affected device.
The installed workaround bypasses the usable-channel query more broadly,
while this pull request first calls the HAL and disables later calls only
after receiving an explicit
ERROR_NOT_SUPPORTEDresult.Tests
Added unit coverage verifying that:
ERROR_NOT_SUPPORTEDreaches the HAL once and is then cached.ERROR_BUSYis not cached and the HAL is queried again.Local validation was completed with the
lineage_raphael userdebugtarget anda physical Xiaomi Mi 9T Pro / Redmi K20 Pro (
raphael) running Android 16 /crDroid 12.11.
Executed tests:
Result:
FrameworksWifiTestscompilation: passed.ERROR_NOT_SUPPORTEDcaching: passed.ERROR_BUSYretry: passed.The tests use a mocked AIDL HAL. They validate the framework-side behavior but
do not replace runtime validation with the affected vendor HAL.
Validated pull request head:
Device context
Device:
Installed build:
An exact-build
service-wifi.jarcompatibility module is currently installedand operational on the affected device.
The module remains enabled because the installed official ROM predates this
source change.
Validation status
lineage_raphael userdebugbuild containing this change: completed.pending.
The complete local ROM build passed compilation, packaging, VINTF and ZIP
integrity checks.
The local ROM package was not installed because it is signed with the AOSP
test key, while the installed official crDroid ROM trusts the crDroid release
key.
The installed exact-build compatibility module remains enabled until an
official ROM build containing this source change is available for controlled
validation.
This pull request is ready for maintainer review.
Runtime validation with an official crDroid build remains pending because the
locally built package is signed with the AOSP test key and cannot be installed
as an update over the installed official release-key build.