mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-24 03:37:41 +08:00
新增:转发规则新增是否启用状态
This commit is contained in:
parent
3f8f37c59b
commit
1f75928ac3
@ -68,7 +68,7 @@ public class SendUtil {
|
|||||||
LogUtil.init(context);
|
LogUtil.init(context);
|
||||||
|
|
||||||
String key = "SIM" + simId;
|
String key = "SIM" + simId;
|
||||||
List<RuleModel> ruleList = RuleUtil.getRule(null, key, type);
|
List<RuleModel> ruleList = RuleUtil.getRule(null, key, type, "1"); //只取已启用的规则
|
||||||
if (!ruleList.isEmpty()) {
|
if (!ruleList.isEmpty()) {
|
||||||
Log.d(TAG, ruleList.toString());
|
Log.d(TAG, ruleList.toString());
|
||||||
SenderUtil.init(context);
|
SenderUtil.init(context);
|
||||||
|
@ -92,6 +92,10 @@ public class RuleUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static List<RuleModel> getRule(Long id, String key, String type) {
|
public static List<RuleModel> getRule(Long id, String key, String type) {
|
||||||
|
return getRule(id, key, type, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<RuleModel> getRule(Long id, String key, String type, String status) {
|
||||||
// Define a projection that specifies which columns from the database
|
// Define a projection that specifies which columns from the database
|
||||||
// you will actually use after this query.
|
// you will actually use after this query.
|
||||||
String[] projection = {
|
String[] projection = {
|
||||||
@ -123,6 +127,11 @@ public class RuleUtil {
|
|||||||
selectionArgList.add(type);
|
selectionArgList.add(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (status != null) {
|
||||||
|
selection += " and " + RuleTable.RuleEntry.COLUMN_NAME_STATUS + " = ? ";
|
||||||
|
selectionArgList.add(status);
|
||||||
|
}
|
||||||
|
|
||||||
if (key != null) {
|
if (key != null) {
|
||||||
// Define 'where' part of query.
|
// Define 'where' part of query.
|
||||||
if (key.equals("SIM1") || key.equals("SIM2")) {
|
if (key.equals("SIM1") || key.equals("SIM2")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user