summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/deviceinfo
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2011-09-27 11:33:17 -0700
committerAmith Yamasani <yamasani@google.com>2011-09-27 11:33:17 -0700
commitae69755aa874dbac77e9874d9716ab891a144193 (patch)
tree91a33f9fd43a0e9e22d38ffe48f0268954fb95e8 /src/com/android/settings/deviceinfo
parent0e5fd21beb33a39b4254d4c8dd6b60c0939dbee0 (diff)
downloadpackages_apps_settings-ae69755aa874dbac77e9874d9716ab891a144193.zip
packages_apps_settings-ae69755aa874dbac77e9874d9716ab891a144193.tar.gz
packages_apps_settings-ae69755aa874dbac77e9874d9716ab891a144193.tar.bz2
Disable USB connection type when monkeys are running.
Bug: 5375336 Also use the correct API for testing if monkeys are running. (ActivityManager.isUserAMonkey()) Bug: 5375910 Change-Id: I2bf8e061ee5977d521de197d3a92095c1a98218d
Diffstat (limited to 'src/com/android/settings/deviceinfo')
-rw-r--r--src/com/android/settings/deviceinfo/UsbSettings.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/settings/deviceinfo/UsbSettings.java b/src/com/android/settings/deviceinfo/UsbSettings.java
index 538cde7..c8671b9 100644
--- a/src/com/android/settings/deviceinfo/UsbSettings.java
+++ b/src/com/android/settings/deviceinfo/UsbSettings.java
@@ -34,6 +34,7 @@ import android.util.Log;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.Utils;
/**
* USB storage settings.
@@ -111,6 +112,11 @@ public class UsbSettings extends SettingsPreferenceFragment {
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
+ // Don't allow any changes to take effect as the USB host will be disconnected, killing
+ // the monkeys
+ if (Utils.isMonkeyRunning()) {
+ return true;
+ }
// temporary hack - using check boxes as radio buttons
// don't allow unchecking them
if (preference instanceof CheckBoxPreference) {