mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-29 15:51:17 +00:00
model/Folder: Add getDeviceCount
This commit is contained in:
parent
8873111510
commit
ce213b9c9e
1 changed files with 13 additions and 0 deletions
|
@ -78,6 +78,19 @@ public class Folder {
|
||||||
return devices;
|
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) {
|
public Device getDevice(String deviceId) {
|
||||||
for (Device d : devices) {
|
for (Device d : devices) {
|
||||||
if (d.deviceID.equals(deviceId)) {
|
if (d.deviceID.equals(deviceId)) {
|
||||||
|
|
Loading…
Reference in a new issue