mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-23 11:21:29 +00:00
Fixed lint warnings related to min API change.
This commit is contained in:
parent
dffe99b900
commit
6ead7744b0
4 changed files with 6 additions and 9 deletions
|
@ -234,12 +234,8 @@ public class FolderPickerActivity extends SyncthingActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
|
||||||
private void invalidateOptions() {
|
private void invalidateOptions() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
|
invalidateOptionsMenu();
|
||||||
invalidateOptionsMenu();
|
|
||||||
else
|
|
||||||
supportInvalidateOptionsMenu();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class FileAdapter extends ArrayAdapter<File> {
|
private class FileAdapter extends ArrayAdapter<File> {
|
||||||
|
|
|
@ -148,7 +148,7 @@ public class MainActivity extends SyncthingActivity
|
||||||
.setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
.setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialogInterface, int i) {
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
sp.edit().putBoolean("first_start", false).commit();
|
sp.edit().putBoolean("first_start", false).apply();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.show();
|
.show();
|
||||||
|
|
|
@ -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
|
// Make sure this is also done for existing installs. We can replace this check with
|
||||||
// {@link #isFirstStart()} after a while.
|
// {@link #isFirstStart()} after a while.
|
||||||
if (!sp.getBoolean("default_user_pw_set", false)) {
|
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 =
|
char[] chars =
|
||||||
"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".toCharArray();
|
"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".toCharArray();
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -293,7 +293,7 @@ public class SyncthingService extends Service implements
|
||||||
String user = Build.MODEL.replaceAll("[^a-zA-Z0-9 ]", "");
|
String user = Build.MODEL.replaceAll("[^a-zA-Z0-9 ]", "");
|
||||||
Log.i(TAG, "Generated GUI username and password (username is " + user + ")");
|
Log.i(TAG, "Generated GUI username and password (username is " + user + ")");
|
||||||
sp.edit().putString("gui_user", user)
|
sp.edit().putString("gui_user", user)
|
||||||
.putString("gui_password", sb.toString()).commit();
|
.putString("gui_password", sb.toString()).apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
mDeviceStateHolder = new DeviceStateHolder(SyncthingService.this);
|
mDeviceStateHolder = new DeviceStateHolder(SyncthingService.this);
|
||||||
|
|
|
@ -19,6 +19,7 @@ import org.xml.sax.SAXException;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import javax.xml.parsers.DocumentBuilder;
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
|
@ -219,7 +220,7 @@ public class ConfigXml {
|
||||||
.getElementsByTagName("folder").item(0);
|
.getElementsByTagName("folder").item(0);
|
||||||
String model = Build.MODEL
|
String model = Build.MODEL
|
||||||
.replace(" ", "_")
|
.replace(" ", "_")
|
||||||
.toLowerCase()
|
.toLowerCase(Locale.US)
|
||||||
.replaceAll("[^a-z0-9_-]", "");
|
.replaceAll("[^a-z0-9_-]", "");
|
||||||
folder.setAttribute("id", mContext.getString(R.string.default_folder_id, model));
|
folder.setAttribute("id", mContext.getString(R.string.default_folder_id, model));
|
||||||
folder.setAttribute("path", Environment
|
folder.setAttribute("path", Environment
|
||||||
|
|
Loading…
Reference in a new issue