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 <ankit.agarwal@intel.com>
This commit is contained in:
Ankit Agrawal
2022-12-13 21:24:11 +05:30
parent 956f288d1d
commit 5bff5f3868

View File

@@ -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