Add back developer option for freeform window support.
Bug: 64144308 Test: manual Change-Id: I9eb28b03ebed17528d469d0c1fcdf3a6d0094a37
This commit is contained in:
@@ -467,6 +467,11 @@
|
|||||||
android:title="@string/force_resizable_activities"
|
android:title="@string/force_resizable_activities"
|
||||||
android:summary="@string/force_resizable_activities_summary"/>
|
android:summary="@string/force_resizable_activities_summary"/>
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="enable_freeform_support"
|
||||||
|
android:title="@string/enable_freeform_support"
|
||||||
|
android:summary="@string/enable_freeform_support_summary"/>
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="reset_shortcut_manager_throttling"
|
android:key="reset_shortcut_manager_throttling"
|
||||||
android:title="@string/reset_shortcut_manager_throttling" />
|
android:title="@string/reset_shortcut_manager_throttling" />
|
||||||
|
@@ -167,6 +167,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
private static final String TETHERING_HARDWARE_OFFLOAD = "tethering_hardware_offload";
|
private static final String TETHERING_HARDWARE_OFFLOAD = "tethering_hardware_offload";
|
||||||
private static final String KEY_COLOR_MODE = "picture_color_mode";
|
private static final String KEY_COLOR_MODE = "picture_color_mode";
|
||||||
private static final String FORCE_RESIZABLE_KEY = "force_resizable_activities";
|
private static final String FORCE_RESIZABLE_KEY = "force_resizable_activities";
|
||||||
|
private static final String ENABLE_FREEFORM_SUPPORT_KEY = "enable_freeform_support";
|
||||||
private static final String COLOR_TEMPERATURE_KEY = "color_temperature";
|
private static final String COLOR_TEMPERATURE_KEY = "color_temperature";
|
||||||
|
|
||||||
private static final String BLUETOOTH_SHOW_DEVICES_WITHOUT_NAMES_KEY =
|
private static final String BLUETOOTH_SHOW_DEVICES_WITHOUT_NAMES_KEY =
|
||||||
@@ -312,6 +313,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
|
|
||||||
private SwitchPreference mForceResizable;
|
private SwitchPreference mForceResizable;
|
||||||
|
|
||||||
|
private SwitchPreference mEnableFreeformSupport;
|
||||||
|
|
||||||
private SwitchPreference mColorTemperaturePreference;
|
private SwitchPreference mColorTemperaturePreference;
|
||||||
|
|
||||||
private final ArrayList<Preference> mAllPrefs = new ArrayList<>();
|
private final ArrayList<Preference> mAllPrefs = new ArrayList<>();
|
||||||
@@ -495,6 +498,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
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);
|
mForceResizable = findAndInitSwitchPref(FORCE_RESIZABLE_KEY);
|
||||||
|
mEnableFreeformSupport = findAndInitSwitchPref(ENABLE_FREEFORM_SUPPORT_KEY);
|
||||||
|
removePreferenceForProduction(mEnableFreeformSupport);
|
||||||
|
|
||||||
mImmediatelyDestroyActivities = (SwitchPreference) findPreference(
|
mImmediatelyDestroyActivities = (SwitchPreference) findPreference(
|
||||||
IMMEDIATELY_DESTROY_ACTIVITIES_KEY);
|
IMMEDIATELY_DESTROY_ACTIVITIES_KEY);
|
||||||
@@ -612,7 +617,16 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void removePreference(Preference preference) {
|
private void removePreference(Preference preference) {
|
||||||
getPreferenceScreen().removePreference(preference);
|
if (preference == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final PreferenceGroup parent = preference.getParent();
|
||||||
|
|
||||||
|
if (parent != null) {
|
||||||
|
parent.removePreference(preference);
|
||||||
|
}
|
||||||
|
|
||||||
mAllPrefs.remove(preference);
|
mAllPrefs.remove(preference);
|
||||||
mResetSwitchPrefs.remove(preference);
|
mResetSwitchPrefs.remove(preference);
|
||||||
}
|
}
|
||||||
@@ -823,6 +837,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
updateSimulateColorSpace();
|
updateSimulateColorSpace();
|
||||||
updateUSBAudioOptions();
|
updateUSBAudioOptions();
|
||||||
updateForceResizableOptions();
|
updateForceResizableOptions();
|
||||||
|
updateEnableFreeformWindowsSupportOptions();
|
||||||
Preference webViewAppPref = findPreference(mWebViewAppPrefController.getPreferenceKey());
|
Preference webViewAppPref = findPreference(mWebViewAppPrefController.getPreferenceKey());
|
||||||
mWebViewAppPrefController.updateState(webViewAppPref);
|
mWebViewAppPrefController.updateState(webViewAppPref);
|
||||||
updateOemUnlockOptions();
|
updateOemUnlockOptions();
|
||||||
@@ -1421,6 +1436,17 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
mForceResizable.isChecked() ? 1 : 0);
|
mForceResizable.isChecked() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateEnableFreeformWindowsSupportOptions() {
|
||||||
|
updateSwitchPreference(mEnableFreeformSupport, Settings.Global.getInt(getContentResolver(),
|
||||||
|
Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT, 0) != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void writeEnableFreeformWindowsSupportOptions() {
|
||||||
|
Settings.Global.putInt(getContentResolver(),
|
||||||
|
Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT,
|
||||||
|
mEnableFreeformSupport.isChecked() ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
private void updateForceRtlOptions() {
|
private void updateForceRtlOptions() {
|
||||||
updateSwitchPreference(mForceRtlLayout,
|
updateSwitchPreference(mForceRtlLayout,
|
||||||
Settings.Global.getInt(getActivity().getContentResolver(),
|
Settings.Global.getInt(getActivity().getContentResolver(),
|
||||||
@@ -2329,6 +2355,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
writeUSBAudioOptions();
|
writeUSBAudioOptions();
|
||||||
} else if (preference == mForceResizable) {
|
} else if (preference == mForceResizable) {
|
||||||
writeForceResizableOptions();
|
writeForceResizableOptions();
|
||||||
|
} else if (preference == mEnableFreeformSupport){
|
||||||
|
writeEnableFreeformWindowsSupportOptions();
|
||||||
} else if (preference == mBluetoothShowDevicesWithoutNames) {
|
} else if (preference == mBluetoothShowDevicesWithoutNames) {
|
||||||
writeBluetoothShowDevicesWithoutUserFriendlyNameOptions();
|
writeBluetoothShowDevicesWithoutUserFriendlyNameOptions();
|
||||||
} else if (preference == mBluetoothDisableAbsVolume) {
|
} else if (preference == mBluetoothDisableAbsVolume) {
|
||||||
|
Reference in New Issue
Block a user