Add development option to force everything resizable
Bug: 24815256 Change-Id: Ic9620c3b502e92f1a628bbe696ae91896d25d5b3
This commit is contained in:
@@ -5173,6 +5173,11 @@
|
|||||||
<!-- UI debug setting: force allow on external summary [CHAR LIMIT=150] -->
|
<!-- UI debug setting: force allow on external summary [CHAR LIMIT=150] -->
|
||||||
<string name="force_allow_on_external_summary">Makes any app elligible to be written to external storage, regardless of manifest values</string>
|
<string name="force_allow_on_external_summary">Makes any app elligible to be written to external storage, regardless of manifest values</string>
|
||||||
|
|
||||||
|
<!-- UI debug setting: force all activites to be resizable for multiwindow [CHAR LIMIT=50] -->
|
||||||
|
<string name="force_resizable_activities">Force activities to be resizable</string>
|
||||||
|
<!-- UI debug setting: force allow on external summary [CHAR LIMIT=150] -->
|
||||||
|
<string name="force_resizable_activities_summary">Makes all activities resizable for multi-window, regardless of manifest values.</string>
|
||||||
|
|
||||||
<!-- Activity title for network data usage summary. [CHAR LIMIT=25] -->
|
<!-- Activity title for network data usage summary. [CHAR LIMIT=25] -->
|
||||||
<string name="data_usage_summary_title">Data usage</string>
|
<string name="data_usage_summary_title">Data usage</string>
|
||||||
<!-- Activity title for Appk data usage summary. [CHAR LIMIT=25] -->
|
<!-- Activity title for Appk data usage summary. [CHAR LIMIT=25] -->
|
||||||
|
@@ -348,6 +348,10 @@
|
|||||||
android:title="@string/force_allow_on_external"
|
android:title="@string/force_allow_on_external"
|
||||||
android:summary="@string/force_allow_on_external_summary"/>
|
android:summary="@string/force_allow_on_external_summary"/>
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="force_resizable_activities"
|
||||||
|
android:title="@string/force_resizable_activities"
|
||||||
|
android:summary="@string/force_resizable_activities_summary"/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
@@ -55,6 +55,7 @@ import android.os.SystemProperties;
|
|||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
import android.provider.SearchIndexableResource;
|
import android.provider.SearchIndexableResource;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.provider.Settings.Global;
|
||||||
import android.support.v14.preference.SwitchPreference;
|
import android.support.v14.preference.SwitchPreference;
|
||||||
import android.support.v7.preference.ListPreference;
|
import android.support.v7.preference.ListPreference;
|
||||||
import android.support.v7.preference.Preference;
|
import android.support.v7.preference.Preference;
|
||||||
@@ -157,6 +158,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
private static final String WIFI_LEGACY_DHCP_CLIENT_KEY = "legacy_dhcp_client";
|
private static final String WIFI_LEGACY_DHCP_CLIENT_KEY = "legacy_dhcp_client";
|
||||||
private static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
|
private static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
|
||||||
private static final String KEY_COLOR_MODE = "color_mode";
|
private static final String KEY_COLOR_MODE = "color_mode";
|
||||||
|
private static final String FORCE_RESIZABLE_KEY = "force_resizable_activities";
|
||||||
|
|
||||||
private static final String INACTIVE_APPS_KEY = "inactive_apps";
|
private static final String INACTIVE_APPS_KEY = "inactive_apps";
|
||||||
|
|
||||||
@@ -259,6 +261,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
private ColorModePreference mColorModePreference;
|
private ColorModePreference mColorModePreference;
|
||||||
|
|
||||||
|
private SwitchPreference mForceResizable;
|
||||||
|
|
||||||
private final ArrayList<Preference> mAllPrefs = new ArrayList<Preference>();
|
private final ArrayList<Preference> mAllPrefs = new ArrayList<Preference>();
|
||||||
|
|
||||||
private final ArrayList<SwitchPreference> mResetSwitchPrefs
|
private final ArrayList<SwitchPreference> mResetSwitchPrefs
|
||||||
@@ -383,6 +387,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
mOpenGLTraces = addListPreference(OPENGL_TRACES_KEY);
|
mOpenGLTraces = addListPreference(OPENGL_TRACES_KEY);
|
||||||
mSimulateColorSpace = addListPreference(SIMULATE_COLOR_SPACE);
|
mSimulateColorSpace = addListPreference(SIMULATE_COLOR_SPACE);
|
||||||
mUSBAudio = findAndInitSwitchPref(USB_AUDIO_KEY);
|
mUSBAudio = findAndInitSwitchPref(USB_AUDIO_KEY);
|
||||||
|
mForceResizable = findAndInitSwitchPref(FORCE_RESIZABLE_KEY);
|
||||||
|
|
||||||
mImmediatelyDestroyActivities = (SwitchPreference) findPreference(
|
mImmediatelyDestroyActivities = (SwitchPreference) findPreference(
|
||||||
IMMEDIATELY_DESTROY_ACTIVITIES_KEY);
|
IMMEDIATELY_DESTROY_ACTIVITIES_KEY);
|
||||||
@@ -636,6 +641,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
updateMobileDataAlwaysOnOptions();
|
updateMobileDataAlwaysOnOptions();
|
||||||
updateSimulateColorSpace();
|
updateSimulateColorSpace();
|
||||||
updateUSBAudioOptions();
|
updateUSBAudioOptions();
|
||||||
|
updateForceResizableOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetDangerousOptions() {
|
private void resetDangerousOptions() {
|
||||||
@@ -1182,6 +1188,18 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
mUSBAudio.isChecked() ? 1 : 0);
|
mUSBAudio.isChecked() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateForceResizableOptions() {
|
||||||
|
updateSwitchPreference(mForceResizable, Settings.Global.getInt(getContentResolver(),
|
||||||
|
Settings.Global.DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES,
|
||||||
|
Build.IS_DEBUGGABLE ? 1 : 0) != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void writeForceResizableOptions() {
|
||||||
|
Settings.Global.putInt(getContentResolver(),
|
||||||
|
Settings.Global.DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES,
|
||||||
|
mForceResizable.isChecked() ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
private void updateForceRtlOptions() {
|
private void updateForceRtlOptions() {
|
||||||
updateSwitchPreference(mForceRtlLayout,
|
updateSwitchPreference(mForceRtlLayout,
|
||||||
Settings.Global.getInt(getActivity().getContentResolver(),
|
Settings.Global.getInt(getActivity().getContentResolver(),
|
||||||
@@ -1686,6 +1704,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
writeMobileDataAlwaysOnOptions();
|
writeMobileDataAlwaysOnOptions();
|
||||||
} else if (preference == mUSBAudio) {
|
} else if (preference == mUSBAudio) {
|
||||||
writeUSBAudioOptions();
|
writeUSBAudioOptions();
|
||||||
|
} else if (preference == mForceResizable) {
|
||||||
|
writeForceResizableOptions();
|
||||||
} else if (INACTIVE_APPS_KEY.equals(preference.getKey())) {
|
} else if (INACTIVE_APPS_KEY.equals(preference.getKey())) {
|
||||||
startInactiveAppsFragment();
|
startInactiveAppsFragment();
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user