refresh treatments over SMS

This commit is contained in:
Milos Kozak 2016-07-18 22:17:40 +02:00
parent 6147a71dd7
commit b361d99f03

View file

@ -186,10 +186,18 @@ public class SmsCommunicatorFragment extends Fragment implements PluginBase {
if (splited.length > 0) { if (splited.length > 0) {
switch (splited[0].toUpperCase()) { switch (splited[0].toUpperCase()) {
case "RNSC": case "RT":
Intent restartNSClient = new Intent(Intents.ACTION_RESTART); Intent restartNSClient = new Intent(Intents.ACTION_RESTART);
MainApp.getDbHelper().resetTreatments();
MainApp.instance().getApplicationContext().sendBroadcast(restartNSClient); MainApp.instance().getApplicationContext().sendBroadcast(restartNSClient);
List<ResolveInfo> q = MainApp.instance().getApplicationContext().getPackageManager().queryBroadcastReceivers(restartNSClient, 0); List<ResolveInfo> q = MainApp.instance().getApplicationContext().getPackageManager().queryBroadcastReceivers(restartNSClient, 0);
reply = "RT " + q.size() + " receivers";
receivedSms.processed = true;
break;
case "RNSC":
restartNSClient = new Intent(Intents.ACTION_RESTART);
MainApp.instance().getApplicationContext().sendBroadcast(restartNSClient);
q = MainApp.instance().getApplicationContext().getPackageManager().queryBroadcastReceivers(restartNSClient, 0);
reply = "RNSC " + q.size() + " receivers"; reply = "RNSC " + q.size() + " receivers";
receivedSms.processed = true; receivedSms.processed = true;
break; break;