Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03b2d4c4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Disable DevelopmentSettingsActivity by default"

parents e2e0ee33 831f6302
Loading
Loading
Loading
Loading
+2 −19
Original line number Diff line number Diff line
@@ -1920,7 +1920,8 @@
                  android:label="@string/development_settings_title"
                  android:icon="@drawable/ic_settings_development"
                  android:taskAffinity="com.android.settings"
                  android:parentActivityName="Settings">
                  android:parentActivityName="Settings"
                  android:enabled="false">
            <intent-filter android:priority="1">
                <action android:name="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" />
        </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"
                  android:label="@string/select_application"
                  android:theme="@android:style/Theme.DeviceDefault.Light.Dialog" />
@@ -2006,15 +1998,6 @@
                  android:label="@string/select_webview_provider_dialog_title">
        </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 -->

        <activity android:name=".bluetooth.BluetoothPairingDialog"
+2 −1
Original line number Diff line number Diff line
@@ -835,7 +835,8 @@ public class SettingsActivity extends SettingsDrawerActivity
                || somethingChanged;

        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,
                        Settings.DevelopmentSettingsDashboardActivity.class.getName()),
+11 −2
Original line number Diff line number Diff line
@@ -298,12 +298,15 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra

    @Override
    protected int getPreferenceScreenResId() {
        Log.d(TAG, "Creating pref screen");
        return R.xml.development_settings;
        return Utils.isMonkeyRunning()? R.xml.placeholder_prefs : R.xml.development_settings;
    }

    @Override
    protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
        if (Utils.isMonkeyRunning()) {
            mPreferenceControllers = new ArrayList<>();
            return null;
        }
        mPreferenceControllers = buildPreferenceControllers(context, getActivity(), getLifecycle(),
                this /* devOptionsDashboardFragment */,
                new BluetoothA2dpConfigStore());
@@ -326,6 +329,9 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
    }

    private void enableDeveloperOptions() {
        if (Utils.isMonkeyRunning()) {
            return;
        }
        DevelopmentSettingsEnabler.setDevelopmentSettingsEnabled(getContext(), true);
        for (AbstractPreferenceController controller : mPreferenceControllers) {
            if (controller instanceof DeveloperOptionsPreferenceController) {
@@ -335,6 +341,9 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
    }

    private void disableDeveloperOptions() {
        if (Utils.isMonkeyRunning()) {
            return;
        }
        DevelopmentSettingsEnabler.setDevelopmentSettingsEnabled(getContext(), false);
        final SystemPropPoker poker = SystemPropPoker.getInstance();
        poker.blockPokes();
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;

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

    @Mock
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;

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

    private Context mContext;
Loading