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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user