diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1a8327d3..1ece5f76 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1,245 +1,248 @@
+ KDE Connect
+ Not connected to any device
+ Connected to: %sTelephony notifierSend notifications for SMS and callsBattery reportPeriodically report battery statusFilesystem exposeAllows to browse this device\'s filesystem remotelyClipboard syncShare the clipboard contentRemote inputUse your phone or tablet as a touchpad and keyboardReceive remote keypressesReceive keypress events from remote devicesMultimedia controlsProvides a remote control for your media playerRun CommandTrigger remote commands from your phone or tabletPingSend and receive pingsNotification syncAccess your notifications from other devicesReceive notificationsReceive notifications from the other device and display them on AndroidShare and receiveShare files and URLs between devicesThis feature is not available in your Android versionNo devicesOKCancelOpen settingsYou need to grant permission to access notificationsTo be able to control your media players you need to grant access to the notificationsSend pingMultimedia controlremotekeyboard_editing_onlyHandle remote keys only when editingThere is no active remote keyboard connection, establish one in kdeconnectRemote keyboard connection is activeThere is more than one remote keyboard connection, select the device to configureRemote inputMove a finger on the screen to move the mouse cursor. Tap for a click, and use two/three fingers for right and middle buttons. Use 2 fingers to scroll. Use a long press to drag\'n drop.Set two finger tap actionSet three finger tap actionSet touchpad sensitivitymousepad_double_tap_keymousepad_triple_tap_keymousepad_sensitivity_keyReverse Scrolling Directionmousepad_scroll_directionRight clickMiddle clickNothingrightmiddledefaultrightmiddlenoneSlowestAbove SlowestDefaultAbove DefaultFastestslowestaboveSlowestdefaultaboveDefaultfastestConnected devicesAvailable devicesRemembered devicesPlugins failed to load (tap for more info):Plugin settingsUnpairPaired device not reachablePair new deviceUnknown deviceDevice not reachablePairing already requestedDevice already pairedCould not send packageTimed outCanceled by userCanceled by other peerInvalid key receivedEncryption InfoThe other device doesn\'t use a recent version of KDE Connect, using the legacy encryption method.SHA1 fingerprint of your device certificate is:SHA1 fingerprint of remote device certificate is:Pair requestedPairing request from %1sReceived link from %1sTap to open \'%1s\'Incoming file from %1s%1sSending file to %1sSending files to %1sSent %1$d fileSent %1$d out of %2$d filesReceived file from %1sFailed receiving file from %1sTap to open \'%1s\'Sent file to %1s%1sFailed to send file to %1s%1sTap to answerReconnectSend Right ClickSend Middle ClickShow KeyboardDevice not pairedRequest pairingAcceptRejectDevicePair deviceRemote controlKDE Connect SettingsPlayPausePreviousRewindFast-forwardNextVolumeMultimedia SettingsForward/rewind buttonsAdjust the time to fast forward/rewind when pressed.mpris_interval_time10 seconds20 seconds30 seconds1 minute2 minutes1000000010000000200000003000000060000000120000000Show media control notificationAllows controlling your media players without opening KDE Connect.mpris_notification_enabledShare To...This device uses an old protocol versionThis device uses a newer protocol versionGeneral SettingsSettings%s settingsDevice name%sInvalid device nameReceived text, saved to clipboardCustom device listPair a new deviceUnpair %sAdd devices by IPNoisy notificationsVibrate and play a sound when receiving a fileCustomize destination directoryReceived files will appear in DownloadsFiles will be stored in the directory belowDestination directoryShareShare \"%s\"Notification filterNotifications will be synchronized for the selected apps.Internal storageAll filesSD card %dSD card(read only)Camera picturesAdd host/IPHostname or IPNo players foundUse this option only if your device is not automatically detected. Enter IP address or hostname below and touch the button to add it to the list. Touch an existing item to remove it from the list.%1$s on %2$sSend filesKDE Connect DevicesOther devices running KDE Connect in your same network should appear here.Device pairedRename deviceRenameRefreshThis paired device is not reachable. Make sure it is connected to your same network.It looks like you are on a mobile data connection. KDE Connect only works on local networks.There are no file browsers installed.Send SMSSend text messages from your desktopThis plugin is not supported by the deviceFind my phoneFind my tabletFind my TVRings this device so you can find itFoundOpenCloseYou need to grant permissions to access the storageSome Plugins need permissions to work (tap for more info):This plugin needs permissions to workYou need to grant extra permissions to enable all functionsSome plugins have features disabled because of lack of permission (tap for more info):To access your files from your PC the app needs permission to access your phone\'s storageTo share files between your phone and your desktop you need to give access to the phone\'s storageTo read and write SMS from your desktop you need to give permission to SMSTo see phone calls and SMS from the desktop you need to give permission to phone calls and SMSTo see a contact name instead of a phone number you need to give access to the phone\'s contactsSelect a ringtoneBlocked numbersDon\'t show calls and SMS from these numbers. Please specify one number per lineCover art of current mediaDevice iconSettings iconAdd a commandThere are no commands registeredYou can add new commands in the KDE Connect System SettingsYou can add commands on the desktopMedia Player ControlControl your phones media players from another deviceDark theme
diff --git a/src/org/kde/kdeconnect/BackgroundService.java b/src/org/kde/kdeconnect/BackgroundService.java
index 46686b01..53568b19 100644
--- a/src/org/kde/kdeconnect/BackgroundService.java
+++ b/src/org/kde/kdeconnect/BackgroundService.java
@@ -1,336 +1,381 @@
/*
* Copyright 2014 Albert Vaca Cintora
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package org.kde.kdeconnect;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Binder;
import android.os.Build;
import android.os.IBinder;
+import android.support.v4.app.NotificationCompat;
+import android.text.TextUtils;
import android.util.Log;
import org.kde.kdeconnect.Backends.BaseLink;
import org.kde.kdeconnect.Backends.BaseLinkProvider;
//import org.kde.kdeconnect.Backends.BluetoothBackend.BluetoothLinkProvider;
import org.kde.kdeconnect.Backends.LanBackend.LanLinkProvider;
import org.kde.kdeconnect.Helpers.SecurityHelpers.RsaHelper;
import org.kde.kdeconnect.Helpers.SecurityHelpers.SslHelper;
+import org.kde.kdeconnect.UserInterface.MaterialActivity;
+import org.kde.kdeconnect_tp.R;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class BackgroundService extends Service {
+ public static final int FOREGROUND_NOTIFICATION_ID = 1;
private static BackgroundService instance;
public interface DeviceListChangedCallback {
void onDeviceListChanged();
}
private final ConcurrentHashMap deviceListChangedCallbacks = new ConcurrentHashMap<>();
private final ArrayList linkProviders = new ArrayList<>();
private final ConcurrentHashMap devices = new ConcurrentHashMap<>();
private final HashSet