2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-09-04 16:15:09 +00:00

Load plugins which are registered to listen to unpaired devices

Plugins which are registered to receive packages from unpaired devices
should be loaded even if device is not paired, otherwise they won't be
able to listen to NetworkPackages from the unpaired devices.

REVIEW: 124906
This commit is contained in:
Ashish Bansal
2015-08-27 13:06:24 +05:30
parent b34e7c8a78
commit 0eb3c6e9f5
3 changed files with 23 additions and 18 deletions

View File

@@ -44,13 +44,21 @@ public abstract class Plugin {
}
/**
* To receive the network package from the unpaired device, Register your plugin
* using Device::registerUnpairedPackageListener and override this method.
* To receive the network package from the unpaired device, override
* listensToUnpairedDevices to return true and this method.
*/
public boolean onUnpairedDevicePackageReceived(NetworkPackage np) {
return false;
}
/**
* Returns whether this plugin should be loaded or not, to listen to NetworkPackages
* from the unpaired devices. By default, returns false.
*/
public boolean listensToUnpairedDevices() {
return false;
}
/**
* Return the internal plugin name, that will be used as a
* unique key to distinguish it. Use the class name as key.