From d61d35fa82e2d2f6e6fee8545597b9dcac805088 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 7 Jul 2017 18:37:15 +0200 Subject: [PATCH] move class to correct place --- .../broadcasts/NSClearAlarmBroadcast.java | 37 ------------------- .../plugins/Overview/OverviewFragment.java | 7 +--- 2 files changed, 2 insertions(+), 42 deletions(-) delete mode 100644 app/src/main/java/info/nightscout/androidaps/broadcasts/NSClearAlarmBroadcast.java diff --git a/app/src/main/java/info/nightscout/androidaps/broadcasts/NSClearAlarmBroadcast.java b/app/src/main/java/info/nightscout/androidaps/broadcasts/NSClearAlarmBroadcast.java deleted file mode 100644 index b624b52843..0000000000 --- a/app/src/main/java/info/nightscout/androidaps/broadcasts/NSClearAlarmBroadcast.java +++ /dev/null @@ -1,37 +0,0 @@ -package info.nightscout.androidaps.broadcasts; - -import android.content.Context; -import android.content.Intent; -import android.content.pm.ResolveInfo; -import android.os.Bundle; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; - -import info.nightscout.androidaps.Services.Intents; -import info.nightscout.androidaps.plugins.NSClientInternal.data.NSAlarm; - -/** - * Created by mike on 11.06.2017. - */ - -public class NSClearAlarmBroadcast { - private static Logger log = LoggerFactory.getLogger(NSClearAlarmBroadcast.class); - - public static void handleClearAlarm(NSAlarm originalAlarm, Context context, long silenceTimeInMsec) { - Bundle bundle = new Bundle(); - bundle.putInt("level", originalAlarm.getLevel()); - bundle.putString("group", originalAlarm.getGroup()); - bundle.putLong("silenceTime", silenceTimeInMsec); - Intent intent = new Intent(Intents.ACTION_ACK_ALARM); - intent.putExtras(bundle); - intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); - context.sendBroadcast(intent); - List x = context.getPackageManager().queryBroadcastReceivers(intent, 0); - - log.debug("ACKALARM " + x.size() + " receivers"); - } - -} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index 1f40f8574e..6d56bede52 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -31,7 +31,6 @@ import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.LinearLayout; import android.widget.TextView; -import android.widget.ToggleButton; import com.crashlytics.android.answers.Answers; import com.crashlytics.android.answers.CustomEvent; @@ -64,10 +63,9 @@ import java.util.concurrent.TimeUnit; import info.nightscout.androidaps.BuildConfig; import info.nightscout.androidaps.Config; import info.nightscout.androidaps.Constants; -import info.nightscout.androidaps.MainActivity; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; -import info.nightscout.androidaps.broadcasts.NSClearAlarmBroadcast; +import info.nightscout.androidaps.plugins.NSClientInternal.broadcasts.BroadcastAckAlarm; import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.data.GlucoseStatus; import info.nightscout.androidaps.data.IobTotal; @@ -87,7 +85,6 @@ import info.nightscout.androidaps.events.EventExtendedBolusChange; import info.nightscout.androidaps.events.EventInitializationChanged; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.events.EventPumpStatusChanged; -import info.nightscout.androidaps.events.EventRefreshGui; import info.nightscout.androidaps.events.EventRefreshOverview; import info.nightscout.androidaps.events.EventTempBasalChange; import info.nightscout.androidaps.events.EventTempTargetChange; @@ -1817,7 +1814,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, case R.id.notification_dismiss: MainApp.bus().post(new EventDismissNotification(notification.id)); if (notification.nsAlarm != null) { - NSClearAlarmBroadcast.handleClearAlarm(notification.nsAlarm, MainApp.instance().getApplicationContext(), 60 * 60 * 1000L); + BroadcastAckAlarm.handleClearAlarm(notification.nsAlarm, MainApp.instance().getApplicationContext(), 60 * 60 * 1000L); } break; }