Moved root to experimental settings, removed confirm dialog.
This commit is contained in:
parent
273d24bc15
commit
9636c2ae91
|
@ -343,20 +343,9 @@ public class SettingsFragment extends PreferenceFragment
|
||||||
switch (preference.getKey()) {
|
switch (preference.getKey()) {
|
||||||
case SyncthingService.PREF_USE_ROOT:
|
case SyncthingService.PREF_USE_ROOT:
|
||||||
if (mUseRoot.isChecked()) {
|
if (mUseRoot.isChecked()) {
|
||||||
// Only check preference after dialog was confirmed and root was granted.
|
// Only check preference after root was granted.
|
||||||
mUseRoot.setChecked(false);
|
mUseRoot.setChecked(false);
|
||||||
new AlertDialog.Builder(getActivity())
|
new TestRootTask().execute();
|
||||||
.setTitle(R.string.root_dialog_title)
|
|
||||||
.setMessage(R.string.root_dialog_message)
|
|
||||||
.setPositiveButton(android.R.string.yes,
|
|
||||||
new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
|
||||||
new TestRootTask().execute();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.setNegativeButton(android.R.string.no, null)
|
|
||||||
.show();
|
|
||||||
} else {
|
} else {
|
||||||
new Thread(new ChownFilesRunnable()).start();
|
new Thread(new ChownFilesRunnable()).start();
|
||||||
mSyncthingService.getApi().requireRestart(getActivity());
|
mSyncthingService.getApi().requireRestart(getActivity());
|
||||||
|
|
|
@ -246,13 +246,9 @@ Please report any problems you encounter via Github.</string>
|
||||||
|
|
||||||
<string name="advanced_folder_picker_summary">Select any folder on the device for syncing</string>
|
<string name="advanced_folder_picker_summary">Select any folder on the device for syncing</string>
|
||||||
|
|
||||||
<string name="use_root_title">Sync as Root</string>
|
<string name="use_root_title">Run Syncthing as Superuser</string>
|
||||||
|
|
||||||
<string name="use_root_summary">Run Syncthing as Superuser</string>
|
<string name="use_root_summary">This may cause various problems with Syncthing and with your device. Use at your own risk.</string>
|
||||||
|
|
||||||
<string name="root_dialog_title">Are you sure you want to enable root?</string>
|
|
||||||
|
|
||||||
<string name="root_dialog_message">This may cause various problems with Syncthing and with your device. Use at your own risk.</string>
|
|
||||||
|
|
||||||
<string name="notification_type_title">Notification</string>
|
<string name="notification_type_title">Notification</string>
|
||||||
|
|
||||||
|
|
|
@ -29,12 +29,6 @@
|
||||||
android:summary="@string/advanced_folder_picker_summary"
|
android:summary="@string/advanced_folder_picker_summary"
|
||||||
android:defaultValue="false" />
|
android:defaultValue="false" />
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:key="use_root"
|
|
||||||
android:title="@string/use_root_title"
|
|
||||||
android:summary="@string/use_root_summary"
|
|
||||||
android:defaultValue="false" />
|
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:key="notification_type"
|
android:key="notification_type"
|
||||||
android:title="@string/notification_type_title"
|
android:title="@string/notification_type_title"
|
||||||
|
@ -151,6 +145,12 @@
|
||||||
android:key="syncthing_experimental"
|
android:key="syncthing_experimental"
|
||||||
android:title="@string/experimental_settings">
|
android:title="@string/experimental_settings">
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="use_root"
|
||||||
|
android:title="@string/use_root_title"
|
||||||
|
android:summary="@string/use_root_summary"
|
||||||
|
android:defaultValue="false" />
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="wakelock_while_binary_running"
|
android:key="wakelock_while_binary_running"
|
||||||
android:title="@string/keep_wakelock_while_binary_running"
|
android:title="@string/keep_wakelock_while_binary_running"
|
||||||
|
|
Loading…
Reference in New Issue