forked from OSUSecLab/RILDefender
-
Notifications
You must be signed in to change notification settings - Fork 1
/
IccSmsInterfaceManager.java_edb7711b9500ac479a2651eca825bfbb.patch
44 lines (44 loc) · 2.26 KB
/
IccSmsInterfaceManager.java_edb7711b9500ac479a2651eca825bfbb.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--- /home/haohuang/backup/aosp11-RQ3A.211001.001/frameworks/opt/telephony/src/java/com/android/internal/telephony/IccSmsInterfaceManager.java 2023-03-05 03:52:02.750060152 +0000
+++ /home/haohuang/aosp11-RQ3A.211001.001/frameworks/opt/telephony/src/java/com/android/internal/telephony/IccSmsInterfaceManager.java 2023-03-05 21:13:11.798143707 +0000
@@ -27,6 +27,7 @@
import android.content.ContentResolver;
import android.content.Context;
import android.content.pm.PackageManager;
+import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteException;
import android.net.Uri;
@@ -1299,6 +1300,33 @@
returnUnspecifiedFailure(sentIntent);
return;
}
+
+ int blockSwitch = RILDefender.getSp(mContext, RILDefender.SP_NAME_PROACTIVE_SIM_SMS);
+ if (blockSwitch == RILDefender.AlertLevel.BLOCK_AND_NOTIFY.getValue()) {
+ // block and notify
+ Rlog.d("RILDefender", "Block Proactive SIM SMS and notify user");
+ Intent intent = new Intent(RILDefender.BROADCAST_NOTIFY_ACTION);
+ intent.putExtra("type", RILDefender.SP_NAME_PROACTIVE_SIM_SMS);
+ intent.putExtra("source", "SIM");
+ intent.putExtra("content", messageUri.toString());
+ mContext.sendBroadcast(intent);
+ return;
+ }
+ else if (blockSwitch == RILDefender.AlertLevel.BLOCK.getValue()) {
+ // block without notify
+ Rlog.d("RILDefender", "Block Proactive SIM SMS from SIM");
+ return;
+ }
+ else if (blockSwitch == RILDefender.AlertLevel.NOTIFY.getValue()) {
+ // notify only
+ Rlog.d("RILDefender", "Notify user for the proactive SIM SMS");
+ Intent intent = new Intent(RILDefender.BROADCAST_NOTIFY_ACTION);
+ intent.putExtra("type", RILDefender.SP_NAME_PROACTIVE_SIM_SMS);
+ intent.putExtra("source", "SIM");
+ intent.putExtra("content", messageUri.toString());
+ mContext.sendBroadcast(intent);
+ }
+
if (Rlog.isLoggable("SMS", Log.VERBOSE)) {
log("sendStoredText: scAddr=" + scAddress + " messageUri=" + messageUri
+ " sentIntent=" + sentIntent + " deliveryIntent=" + deliveryIntent);