Search in sources :

Example 1 with BaseLinkProvider

use of org.kde.kdeconnect.Backends.BaseLinkProvider in project kdeconnect-android by KDE.

the class BackgroundService method onDestroy.

@Override
public void onDestroy() {
    stopForeground(true);
    for (BaseLinkProvider a : linkProviders) {
        a.onStop();
    }
    super.onDestroy();
}
Also used : BaseLinkProvider(org.kde.kdeconnect.Backends.BaseLinkProvider)

Example 2 with BaseLinkProvider

use of org.kde.kdeconnect.Backends.BaseLinkProvider in project kdeconnect-android by KDE.

the class BackgroundService method onCreate.

// This will called only once, even if we launch the service intent several times
@Override
public void onCreate() {
    super.onCreate();
    instance = this;
    // Register screen on listener
    IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);
    // See: https://developer.android.com/reference/android/net/ConnectivityManager.html#CONNECTIVITY_ACTION
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
        filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
    }
    registerReceiver(new KdeConnectBroadcastReceiver(), filter);
    Log.i("KDE/BackgroundService", "Service not started yet, initializing...");
    PluginFactory.initPluginInfo(getBaseContext());
    initializeSecurityParameters();
    NotificationHelper.initializeChannels(this);
    loadRememberedDevicesFromSettings();
    migratePluginSettings();
    registerLinkProviders();
    // Link Providers need to be already registered
    addConnectionListener(deviceListener);
    for (BaseLinkProvider a : linkProviders) {
        a.onStart();
    }
}
Also used : IntentFilter(android.content.IntentFilter) BaseLinkProvider(org.kde.kdeconnect.Backends.BaseLinkProvider)

Aggregations

BaseLinkProvider (org.kde.kdeconnect.Backends.BaseLinkProvider)2 IntentFilter (android.content.IntentFilter)1