mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-28 12:47:43 +00:00
Change hard-coded string to use library-provided constant
Does this cause problems with older SDKs? I don't think so. (If there are problems, I assume they were already there)
This commit is contained in:
parent
d03520ce70
commit
12fb67a7aa
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 Albert Vaca Cintora <albertvaka@gmail.com>
|
* Copyright 2014 Albert Vaca Cintora <albertvaka@gmail.com>
|
||||||
|
* Copyright 2019 Simon Redman <simon@ergotech.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License as
|
* 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.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.provider.Telephony;
|
||||||
import android.telephony.PhoneNumberUtils;
|
import android.telephony.PhoneNumberUtils;
|
||||||
import android.telephony.SmsManager;
|
import android.telephony.SmsManager;
|
||||||
import android.telephony.SmsMessage;
|
import android.telephony.SmsMessage;
|
||||||
@ -127,7 +129,7 @@ public class SMSPlugin extends Plugin {
|
|||||||
|
|
||||||
//Log.e("TelephonyPlugin","Telephony event: " + action);
|
//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();
|
final Bundle bundle = intent.getExtras();
|
||||||
if (bundle == null) return;
|
if (bundle == null) return;
|
||||||
@ -274,7 +276,7 @@ public class SMSPlugin extends Plugin {
|
|||||||
public boolean onCreate() {
|
public boolean onCreate() {
|
||||||
permissionExplanation = R.string.telepathy_permission_explanation;
|
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);
|
filter.setPriority(500);
|
||||||
context.registerReceiver(receiver, filter);
|
context.registerReceiver(receiver, filter);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user