Try to enable freeform mode via writing secure settings before resorting to manual user action
@@ -127,6 +127,10 @@ public class FreeformModeFragment extends SettingsFragment implements Preference
case "freeform_hack":
if(((CheckBoxPreference) p).isChecked()) {
if(!U.hasFreeformSupport(getActivity())) {
+ try {
+ Settings.Global.putInt(getActivity().getContentResolver(), "enable_freeform_support", 1);
+ U.showToastLong(getActivity(), R.string.reboot_required);
+ } catch (Exception e) {
((CheckBoxPreference) p).setChecked(false);
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
@@ -139,7 +143,7 @@ public class FreeformModeFragment extends SettingsFragment implements Preference
try {
startActivity(intent);
U.showToastLong(getActivity(), R.string.enable_force_activities_resizable);
- } catch (ActivityNotFoundException e) {
+ } catch (ActivityNotFoundException e1) {
intent = new Intent(Settings.ACTION_DEVICE_INFO_SETTINGS);
try {
startActivity(intent);
@@ -152,6 +156,7 @@ public class FreeformModeFragment extends SettingsFragment implements Preference
dialog.show();
dialog.setCancelable(false);
}
+ }
if(pref.getBoolean("taskbar_active", false)
&& getActivity().isInMultiWindowMode()
