commit | f6a65a79a8c79147dc2f6a36e91f01f9449b6fc9 | [log] [tgz] |
---|---|---|
author | Remi NGUYEN VAN <reminv@google.com> | Mon Nov 25 06:11:32 2024 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Nov 25 06:11:32 2024 +0000 |
tree | 1b82c09ff4e3028a8f823445fca1e60186ae7941 | |
parent | 64c303a736e7a472c9eca3b5d9af5c019553e202 [diff] | |
parent | b30ac0cdb19effdbcabc65b0286e06daa2ff7818 [diff] |
Merge "Fix setup on devices without printflags" into main am: b028a6f264 am: b30ac0cdb1 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3368263 Change-Id: I7a6dfead78fbdce21aea0afdbacce79f40d73332 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/staticlibs/testutils/app/connectivitychecker/src/com/android/testutils/connectivitypreparer/CarrierConfigSetupTest.kt b/staticlibs/testutils/app/connectivitychecker/src/com/android/testutils/connectivitypreparer/CarrierConfigSetupTest.kt index 46e511e..78b34a8 100644 --- a/staticlibs/testutils/app/connectivitychecker/src/com/android/testutils/connectivitypreparer/CarrierConfigSetupTest.kt +++ b/staticlibs/testutils/app/connectivitychecker/src/com/android/testutils/connectivitypreparer/CarrierConfigSetupTest.kt
@@ -123,7 +123,13 @@ """telephony/com\.android\.internal\.telephony\.flags\.force_iwlan_mms:""" + """.*ENABLED \(system\)""") ParcelFileDescriptor.AutoCloseInputStream( - uiAutomation.executeShellCommand("printflags")).bufferedReader().use { reader -> + // If the command fails (for example if printflags is missing) this will return false + // and the IWLAN disable will be skipped, which should be fine at it only helps with + // flakiness. + // This uses "sh -c" to cover that case as if "printflags" is used directly and the + // binary is missing, the remote end will crash and the InputStream EOF is never + // reached, so the read would hang. + uiAutomation.executeShellCommand("sh -c printflags")).bufferedReader().use { reader -> return reader.lines().anyMatch { it.contains(flagEnabledRegex) }