diff --git a/src/org/kde/kdeconnect/Plugins/SMSPlugin/SMSPlugin.java b/src/org/kde/kdeconnect/Plugins/SMSPlugin/SMSPlugin.java index bc33d199..5fcfd5a7 100644 --- a/src/org/kde/kdeconnect/Plugins/SMSPlugin/SMSPlugin.java +++ b/src/org/kde/kdeconnect/Plugins/SMSPlugin/SMSPlugin.java @@ -1,5 +1,6 @@ /* * Copyright 2014 Albert Vaca Cintora + * Copyright 2019 Simon Redman * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -32,6 +33,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.preference.PreferenceManager; +import android.provider.Telephony; import android.telephony.PhoneNumberUtils; import android.telephony.SmsManager; import android.telephony.SmsMessage; @@ -127,7 +129,7 @@ public class SMSPlugin extends Plugin { //Log.e("TelephonyPlugin","Telephony event: " + action); - if ("android.provider.Telephony.SMS_RECEIVED".equals(action)) { + if (Telephony.Sms.Intents.SMS_RECEIVED_ACTION.equals(action)) { final Bundle bundle = intent.getExtras(); if (bundle == null) return; @@ -274,7 +276,7 @@ public class SMSPlugin extends Plugin { public boolean onCreate() { permissionExplanation = R.string.telepathy_permission_explanation; - IntentFilter filter = new IntentFilter("android.provider.Telephony.SMS_RECEIVED"); + IntentFilter filter = new IntentFilter(Telephony.Sms.Intents.SMS_RECEIVED_ACTION); filter.setPriority(500); context.registerReceiver(receiver, filter);