Revert "Prevent monkey from changing usb settings"

This reverts commit 7b17780134.

Change-Id: I5990c1ee09f387b03a8a0836776053484ece7569
This commit is contained in:
Jeffrey Huang
2017-11-13 19:34:00 +00:00
parent 7b17780134
commit da3f0d9e56
4 changed files with 3 additions and 52 deletions

View File

@@ -38,7 +38,6 @@ import android.support.v7.preference.PreferenceScreen;
import com.android.settings.TestConfig;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.testutils.shadow.SettingsShadowSystemProperties;
import com.android.settings.testutils.shadow.ShadowUtils;
import org.junit.After;
import org.junit.Before;
@@ -55,7 +54,7 @@ import org.robolectric.util.ReflectionHelpers;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH,
sdk = TestConfig.SDK_VERSION,
shadows = {SettingsShadowSystemProperties.class, ShadowUtils.class})
shadows = {SettingsShadowSystemProperties.class})
public class ClearAdbKeysPreferenceControllerTest {
@Mock
@@ -84,7 +83,6 @@ public class ClearAdbKeysPreferenceControllerTest {
public void tearDown() {
ShadowClearAdbKeysWarningDialog.resetDialog();
SettingsShadowSystemProperties.clear();
ShadowUtils.reset();
}
@Test
@@ -138,20 +136,6 @@ public class ClearAdbKeysPreferenceControllerTest {
assertThat(isHandled).isFalse();
}
@Test
public void handlePreferenceTreeClick_monkeyUser_shouldReturnFalse() {
SystemProperties.set(RO_ADB_SECURE_PROPERTY_KEY, Boolean.toString(true));
doReturn(true).when(mController).isAdminUser();
ShadowUtils.setIsUserAMonkey(true);
mController.displayPreference(mScreen);
final String preferenceKey = mController.getPreferenceKey();
when(mPreference.getKey()).thenReturn(preferenceKey);
final boolean isHandled = mController.handlePreferenceTreeClick(mPreference);
assertThat(isHandled).isFalse();
}
@Test
public void onDeveloperOptionsSwitchEnabled_isAdminUser_shouldEnablePreference() {
SystemProperties.set(RO_ADB_SECURE_PROPERTY_KEY, Boolean.toString(true));