diff --git a/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java b/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java index 3d539e44..d29a5b87 100644 --- a/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/activities/FolderPickerActivity.java @@ -234,12 +234,8 @@ public class FolderPickerActivity extends SyncthingActivity } } - @SuppressLint("NewApi") private void invalidateOptions() { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) - invalidateOptionsMenu(); - else - supportInvalidateOptionsMenu(); + invalidateOptionsMenu(); } private class FileAdapter extends ArrayAdapter { diff --git a/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java b/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java index 826ca373..d725b289 100644 --- a/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java @@ -148,7 +148,7 @@ public class MainActivity extends SyncthingActivity .setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { - sp.edit().putBoolean("first_start", false).commit(); + sp.edit().putBoolean("first_start", false).apply(); } }) .show(); diff --git a/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingService.java b/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingService.java index 9dee2fa9..310dfb2c 100644 --- a/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingService.java +++ b/src/main/java/com/nutomic/syncthingandroid/syncthing/SyncthingService.java @@ -282,7 +282,7 @@ public class SyncthingService extends Service implements // Make sure this is also done for existing installs. We can replace this check with // {@link #isFirstStart()} after a while. if (!sp.getBoolean("default_user_pw_set", false)) { - sp.edit().putBoolean("default_user_pw_set", true).commit(); + sp.edit().putBoolean("default_user_pw_set", true).apply(); char[] chars = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".toCharArray(); StringBuilder sb = new StringBuilder(); @@ -293,7 +293,7 @@ public class SyncthingService extends Service implements String user = Build.MODEL.replaceAll("[^a-zA-Z0-9 ]", ""); Log.i(TAG, "Generated GUI username and password (username is " + user + ")"); sp.edit().putString("gui_user", user) - .putString("gui_password", sb.toString()).commit(); + .putString("gui_password", sb.toString()).apply(); } mDeviceStateHolder = new DeviceStateHolder(SyncthingService.this); diff --git a/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java b/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java index 8c684fd3..44430cb0 100644 --- a/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java +++ b/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java @@ -19,6 +19,7 @@ import org.xml.sax.SAXException; import java.io.File; import java.io.IOException; +import java.util.Locale; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -219,7 +220,7 @@ public class ConfigXml { .getElementsByTagName("folder").item(0); String model = Build.MODEL .replace(" ", "_") - .toLowerCase() + .toLowerCase(Locale.US) .replaceAll("[^a-z0-9_-]", ""); folder.setAttribute("id", mContext.getString(R.string.default_folder_id, model)); folder.setAttribute("path", Environment