1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-09 03:31:46 +00:00

Show Android Open File Limit (fixes #346) (#350)

* Show Android Open File Limit (fixes #346)

* Imported de translation
This commit is contained in:
Catfriend1 2019-03-06 00:12:37 +01:00 committed by GitHub
parent 226b84a5d9
commit f679ca2cc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 0 deletions

View file

@ -150,6 +150,7 @@ public class SettingsActivity extends SyncthingActivity {
// Settings/About
private static final String KEY_SYNCTHING_API_KEY = "syncthing_api_key";
private static final String KEY_SYNCTHING_DATABASE_SIZE = "syncthing_database_size";
private static final String KEY_OS_OPEN_FILE_LIMIT = "os_open_file_limit";
private static final String BIND_ALL = "0.0.0.0";
private static final String BIND_LOCALHOST = "127.0.0.1";
@ -394,6 +395,7 @@ public class SettingsActivity extends SyncthingActivity {
Log.d(TAG, "Failed to get app version name");
}
screen.findPreference(KEY_SYNCTHING_DATABASE_SIZE).setSummary(getDatabaseSize());
screen.findPreference(KEY_OS_OPEN_FILE_LIMIT).setSummary(getOpenFileLimit());
// Check if we should directly show a sub preference screen.
Bundle bundle = getArguments();
@ -1081,5 +1083,16 @@ public class SettingsActivity extends SyncthingActivity {
}
return resultParts[0];
}
/**
* Get current open file limit enforced by the Android OS.
*/
private String getOpenFileLimit() {
String result = Util.runShellCommandGetOutput("/system/bin/ulimit -n", false);
if (TextUtils.isEmpty(result)) {
return "N/A";
}
return result;
}
}
}

View file

@ -651,6 +651,9 @@ Bitte melden Sie auftretende Probleme via GitHub.</string>
<!-- Title of the preference showing database size -->
<string name="syncthing_database_size">Syncthing Datenbankgröße</string>
<!-- Title of the preference showing the OS open file limit -->
<string name="os_open_file_limit">Android Offene Dateien Limit</string>
<!-- FolderPickerAcitivity -->

View file

@ -672,6 +672,9 @@ Please report any problems you encounter via Github.</string>
<!-- Title of the preference showing database size -->
<string name="syncthing_database_size">Syncthing Database Size</string>
<!-- Title of the preference showing the OS open file limit -->
<string name="os_open_file_limit">Android Open File Limit</string>
<!-- FolderPickerAcitivity -->

View file

@ -344,6 +344,12 @@
android:key="syncthing_database_size"
android:title="@string/syncthing_database_size" />
<Preference
android:persistent="false"
android:selectable="false"
android:key="os_open_file_limit"
android:title="@string/os_open_file_limit" />
</PreferenceScreen>
</PreferenceScreen>