1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-26 06:11:19 +00:00

model/Folder: Add getDeviceCount

This commit is contained in:
Catfriend1 2019-03-06 00:47:50 +01:00
parent 8873111510
commit ce213b9c9e

View file

@ -78,6 +78,19 @@ public class Folder {
return devices;
}
/**
* Note: This is expected to return "1" if a folder is not shared with any
* other device. Syncthing's config will list ourself as the only device
* sub node which is associated with the folder. This will return >= 2
* if the folder is shared with other devices.
*/
public int getDeviceCount() {
if (devices == null) {
return 1;
}
return devices.size();
}
public Device getDevice(String deviceId) {
for (Device d : devices) {
if (d.deviceID.equals(deviceId)) {