Consolidate point where ADB is enabled for Test Harness Mode
Test Harness Mode relies on enabling ADB upon boot. However, currently,
there appears to be a race condition when enabling ADB. Test Harness
Mode enables ADB in PHASE_BOOT_COMPLETED, and ADB sets itself up in
PHASE_ACTIVITY_MANAGER_READY, both by writing a setting. It appears that
sometimes, the setting for initializing ADB's state commits *after* the
setting to enable ADB for Test Harness Mode, which means that ADB turns
on for a brief moment, then off until the device is manually fixed.
This changes it so that the AdbService checks the Test Harness Mode
property when initializing ADB state, always enabling ADB on boot if
Test Harness Mode is enabled.
Bug: 232813060
Test: tested with user and userdebug builds, both enable adb correctly
Change-Id: I518415dda275bc3d563820ead611e5f017368c95
3 files changed