Merge "Disable DevelopmentSettingsActivity by default"
This commit is contained in:
committed by
Android (Google) Code Review
commit
03b2d4c44c
@@ -1920,7 +1920,8 @@
|
|||||||
android:label="@string/development_settings_title"
|
android:label="@string/development_settings_title"
|
||||||
android:icon="@drawable/ic_settings_development"
|
android:icon="@drawable/ic_settings_development"
|
||||||
android:taskAffinity="com.android.settings"
|
android:taskAffinity="com.android.settings"
|
||||||
android:parentActivityName="Settings">
|
android:parentActivityName="Settings"
|
||||||
|
android:enabled="false">
|
||||||
<intent-filter android:priority="1">
|
<intent-filter android:priority="1">
|
||||||
<action android:name="android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
|
<action android:name="android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
|
||||||
<action android:name="com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
|
<action android:name="com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
|
||||||
@@ -1989,15 +1990,6 @@
|
|||||||
android:value="com.android.settings.print.PrintJobSettingsFragment" />
|
android:value="com.android.settings.print.PrintJobSettingsFragment" />
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<!-- Keep compatibility with old shortcuts. -->
|
|
||||||
<activity-alias android:name="DevelopmentSettings"
|
|
||||||
android:exported="true"
|
|
||||||
android:label="@string/development_settings_title"
|
|
||||||
android:targetActivity="Settings$DevelopmentSettingsDashboardActivity">
|
|
||||||
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
|
|
||||||
android:value="com.android.settings.development.DevelopmentSettingsDashboardFragment" />
|
|
||||||
</activity-alias>
|
|
||||||
|
|
||||||
<activity android:name=".development.AppPicker"
|
<activity android:name=".development.AppPicker"
|
||||||
android:label="@string/select_application"
|
android:label="@string/select_application"
|
||||||
android:theme="@android:style/Theme.DeviceDefault.Light.Dialog" />
|
android:theme="@android:style/Theme.DeviceDefault.Light.Dialog" />
|
||||||
@@ -2006,15 +1998,6 @@
|
|||||||
android:label="@string/select_webview_provider_dialog_title">
|
android:label="@string/select_webview_provider_dialog_title">
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<!-- Keep compatibility with old shortcuts. -->
|
|
||||||
<activity-alias android:name="UsbSettings"
|
|
||||||
android:exported="true"
|
|
||||||
android:label="@string/storage_title_usb"
|
|
||||||
android:targetActivity="Settings$DevelopmentSettingsDashboardActivity">
|
|
||||||
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
|
|
||||||
android:value="com.android.settings.deviceinfo.UsbSettings" />
|
|
||||||
</activity-alias>
|
|
||||||
|
|
||||||
<!-- Bluetooth stuff -->
|
<!-- Bluetooth stuff -->
|
||||||
|
|
||||||
<activity android:name=".bluetooth.BluetoothPairingDialog"
|
<activity android:name=".bluetooth.BluetoothPairingDialog"
|
||||||
|
@@ -835,7 +835,8 @@ public class SettingsActivity extends SettingsDrawerActivity
|
|||||||
|| somethingChanged;
|
|| somethingChanged;
|
||||||
|
|
||||||
final boolean showDev = DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(this)
|
final boolean showDev = DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(this)
|
||||||
&& !um.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES);
|
&& !um.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES)
|
||||||
|
&& !Utils.isMonkeyRunning();
|
||||||
|
|
||||||
somethingChanged = setTileEnabled(new ComponentName(packageName,
|
somethingChanged = setTileEnabled(new ComponentName(packageName,
|
||||||
Settings.DevelopmentSettingsDashboardActivity.class.getName()),
|
Settings.DevelopmentSettingsDashboardActivity.class.getName()),
|
||||||
|
@@ -298,12 +298,15 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getPreferenceScreenResId() {
|
protected int getPreferenceScreenResId() {
|
||||||
Log.d(TAG, "Creating pref screen");
|
return Utils.isMonkeyRunning()? R.xml.placeholder_prefs : R.xml.development_settings;
|
||||||
return R.xml.development_settings;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
|
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
|
||||||
|
if (Utils.isMonkeyRunning()) {
|
||||||
|
mPreferenceControllers = new ArrayList<>();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
mPreferenceControllers = buildPreferenceControllers(context, getActivity(), getLifecycle(),
|
mPreferenceControllers = buildPreferenceControllers(context, getActivity(), getLifecycle(),
|
||||||
this /* devOptionsDashboardFragment */,
|
this /* devOptionsDashboardFragment */,
|
||||||
new BluetoothA2dpConfigStore());
|
new BluetoothA2dpConfigStore());
|
||||||
@@ -326,6 +329,9 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void enableDeveloperOptions() {
|
private void enableDeveloperOptions() {
|
||||||
|
if (Utils.isMonkeyRunning()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
DevelopmentSettingsEnabler.setDevelopmentSettingsEnabled(getContext(), true);
|
DevelopmentSettingsEnabler.setDevelopmentSettingsEnabled(getContext(), true);
|
||||||
for (AbstractPreferenceController controller : mPreferenceControllers) {
|
for (AbstractPreferenceController controller : mPreferenceControllers) {
|
||||||
if (controller instanceof DeveloperOptionsPreferenceController) {
|
if (controller instanceof DeveloperOptionsPreferenceController) {
|
||||||
@@ -335,6 +341,9 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void disableDeveloperOptions() {
|
private void disableDeveloperOptions() {
|
||||||
|
if (Utils.isMonkeyRunning()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
DevelopmentSettingsEnabler.setDevelopmentSettingsEnabled(getContext(), false);
|
DevelopmentSettingsEnabler.setDevelopmentSettingsEnabled(getContext(), false);
|
||||||
final SystemPropPoker poker = SystemPropPoker.getInstance();
|
final SystemPropPoker poker = SystemPropPoker.getInstance();
|
||||||
poker.blockPokes();
|
poker.blockPokes();
|
||||||
|
@@ -45,7 +45,7 @@ import org.robolectric.RuntimeEnvironment;
|
|||||||
import org.robolectric.annotation.Config;
|
import org.robolectric.annotation.Config;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class ActionBarShadowControllerTest {
|
public class ActionBarShadowControllerTest {
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
|
@@ -40,7 +40,7 @@ import org.robolectric.RuntimeEnvironment;
|
|||||||
import org.robolectric.annotation.Config;
|
import org.robolectric.annotation.Config;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class ActionButtonPreferenceTest {
|
public class ActionButtonPreferenceTest {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
@@ -33,7 +33,7 @@ import org.robolectric.RuntimeEnvironment;
|
|||||||
import org.robolectric.annotation.Config;
|
import org.robolectric.annotation.Config;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class AppPreferenceTest {
|
public class AppPreferenceTest {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
@@ -33,7 +33,7 @@ import org.robolectric.RuntimeEnvironment;
|
|||||||
import org.robolectric.annotation.Config;
|
import org.robolectric.annotation.Config;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class AppSwitchPreferenceTest {
|
public class AppSwitchPreferenceTest {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
@@ -32,7 +32,7 @@ import org.robolectric.annotation.Config;
|
|||||||
import org.robolectric.util.ReflectionHelpers;
|
import org.robolectric.util.ReflectionHelpers;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class AspectRatioFrameLayoutTest {
|
public class AspectRatioFrameLayoutTest {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
@@ -29,7 +29,7 @@ import org.robolectric.annotation.Config;
|
|||||||
import static junit.framework.Assert.assertEquals;
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class DefaultIndicatorSeekBarTest {
|
public class DefaultIndicatorSeekBarTest {
|
||||||
|
|
||||||
private DefaultIndicatorSeekBar mDefaultIndicatorSeekBar;
|
private DefaultIndicatorSeekBar mDefaultIndicatorSeekBar;
|
||||||
|
@@ -58,7 +58,7 @@ import static org.mockito.Mockito.verify;
|
|||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class EntityHeaderControllerTest {
|
public class EntityHeaderControllerTest {
|
||||||
|
|
||||||
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
|
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
|
||||||
|
@@ -38,7 +38,7 @@ import static org.mockito.Mockito.verify;
|
|||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class FixedLineSummaryPreferenceTest {
|
public class FixedLineSummaryPreferenceTest {
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
|
@@ -37,7 +37,7 @@ import static org.mockito.Mockito.mock;
|
|||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class LoadingViewControllerTest {
|
public class LoadingViewControllerTest {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
@@ -40,7 +40,7 @@ import static org.mockito.Mockito.mock;
|
|||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class MasterSwitchPreferenceTest {
|
public class MasterSwitchPreferenceTest {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
@@ -36,7 +36,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class PreferenceCategoryControllerTest {
|
public class PreferenceCategoryControllerTest {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
@@ -45,7 +45,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class RadioButtonPickerFragmentTest {
|
public class RadioButtonPickerFragmentTest {
|
||||||
|
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@ import org.robolectric.annotation.Config;
|
|||||||
import static junit.framework.Assert.assertEquals;
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class RingProgressBarTest {
|
public class RingProgressBarTest {
|
||||||
|
|
||||||
private Context mContext = RuntimeEnvironment.application;
|
private Context mContext = RuntimeEnvironment.application;
|
||||||
|
@@ -36,7 +36,7 @@ import static com.google.common.truth.Truth.assertThat;
|
|||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(
|
@Config(
|
||||||
manifest = TestConfig.MANIFEST_PATH,
|
manifest = TestConfig.MANIFEST_PATH,
|
||||||
sdk = TestConfig.SDK_VERSION,
|
sdk = TestConfig.SDK_VERSION_O,
|
||||||
shadows = {ShadowTextUtils.class}
|
shadows = {ShadowTextUtils.class}
|
||||||
)
|
)
|
||||||
public class RtlCompatibleViewPagerTest {
|
public class RtlCompatibleViewPagerTest {
|
||||||
|
@@ -41,7 +41,7 @@ import org.robolectric.annotation.Config;
|
|||||||
import org.robolectric.shadows.ShadowView;
|
import org.robolectric.shadows.ShadowView;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class ScrollToParentEditTextTest {
|
public class ScrollToParentEditTextTest {
|
||||||
|
|
||||||
private static final int EDIT_TEXT_SIZE = 20;
|
private static final int EDIT_TEXT_SIZE = 20;
|
||||||
|
@@ -34,7 +34,7 @@ import static org.mockito.Mockito.times;
|
|||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class SummaryUpdaterTest {
|
public class SummaryUpdaterTest {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
@@ -42,7 +42,7 @@ import org.robolectric.RuntimeEnvironment;
|
|||||||
import org.robolectric.annotation.Config;
|
import org.robolectric.annotation.Config;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
|
||||||
public class ValidatedEditTextPreferenceTest {
|
public class ValidatedEditTextPreferenceTest {
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
|
Reference in New Issue
Block a user