mirror of
https://github.com/pppscn/SmsForwarder
synced 2024-11-04 06:00:11 +00:00
优化:兼容OV系手机短信广播
This commit is contained in:
parent
d438096264
commit
a1fa816e89
@ -19,6 +19,7 @@
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
tools:ignore="ScopedStorage" />
|
||||
|
||||
<uses-permission android:name="android.permission.RECEIVE_SMS" />
|
||||
<uses-permission android:name="android.permission.READ_SMS" />
|
||||
<uses-permission android:name="android.permission.SEND_SMS" />
|
||||
@ -133,6 +134,9 @@
|
||||
android:permission="android.permission.BROADCAST_SMS"
|
||||
tools:ignore="IntentFilterExportedReceiver">
|
||||
<intent-filter android:priority="2147483647">
|
||||
<!--兼容OV系手机短信广播-->
|
||||
<action android:name="android.provider.OppoSpeechAssist.SMS_RECEIVED" />
|
||||
<action android:name="android.provider.Telephony.SMS_DELIVER" />
|
||||
<!--短信广播-->
|
||||
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
|
||||
</intent-filter>
|
||||
|
@ -33,7 +33,11 @@ public class SmsBroadcastReceiver extends BroadcastReceiver {
|
||||
String receiveAction = intent.getAction();
|
||||
String TAG = "SmsBroadcastReceiver";
|
||||
Log.d(TAG, "onReceive intent " + receiveAction);
|
||||
if ("android.provider.Telephony.SMS_RECEIVED".equals(receiveAction)) {
|
||||
|
||||
String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_RECEIVED";
|
||||
String SMS_DELIVER_ACTION = "android.provider.Telephony.SMS_DELIVER";
|
||||
|
||||
if (SMS_RECEIVED_ACTION.equals(receiveAction) || SMS_DELIVER_ACTION.equals(receiveAction)) {
|
||||
try {
|
||||
if (!SettingUtil.getSwitchEnableSms()) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user