From 5bff5f38683ec06b897bf156e1a39be1014cbf3b Mon Sep 17 00:00:00 2001 From: Ankit Agrawal Date: Tue, 13 Dec 2022 21:24:11 +0530 Subject: [PATCH] Adb is disconnecting during Monkey Test Run. When running the monkey test, its going in tethering page inside Settings app and enabling ethernet tethering. Due to get adb connection is getting lost. Guarding ethernet tethering option when monkey test is running, it will not display ethernet tethering option during monkey test. Bug: Test: start monkey test run using below command adb shell monkey -v 1000000 Change-Id: I4040cb088404e663b032179ff52b1bc564ecf76b Signed-off-by: Ankit Agrawal --- .../settings/network/EthernetTetherPreferenceController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/network/EthernetTetherPreferenceController.java b/src/com/android/settings/network/EthernetTetherPreferenceController.java index 17b4b021315..fd695994137 100644 --- a/src/com/android/settings/network/EthernetTetherPreferenceController.java +++ b/src/com/android/settings/network/EthernetTetherPreferenceController.java @@ -26,6 +26,7 @@ import androidx.lifecycle.Lifecycle; import androidx.lifecycle.OnLifecycleEvent; import com.android.internal.annotations.VisibleForTesting; +import com.android.settings.Utils; import com.android.settingslib.utils.ThreadUtils; import java.util.HashSet; @@ -87,7 +88,7 @@ public final class EthernetTetherPreferenceController extends TetherBasePreferen @Override public boolean shouldShow() { - return mEthernetManager != null; + return mEthernetManager != null && !Utils.isMonkeyRunning(); } @Override