Handle received EventNewBg depending on args.
(cherry picked from commit 79b7a7b)
This commit is contained in:
parent
7f45316a24
commit
ad3bf19e4c
5 changed files with 10 additions and 3 deletions
|
@ -531,6 +531,8 @@ public class IobCobCalculatorPlugin implements PluginBase {
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onEventNewBG(EventNewBG ev) {
|
public void onEventNewBG(EventNewBG ev) {
|
||||||
|
if (!ev.isActiveBgSource)
|
||||||
|
return;
|
||||||
if (this != getPlugin()) {
|
if (this != getPlugin()) {
|
||||||
log.debug("Ignoring event for non default instance");
|
log.debug("Ignoring event for non default instance");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -142,6 +142,8 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onStatusEvent(final EventNewBG e) {
|
public void onStatusEvent(final EventNewBG e) {
|
||||||
|
if (!e.isActiveBgSource || !e.isNew)
|
||||||
|
return;
|
||||||
Activity activity = getActivity();
|
Activity activity = getActivity();
|
||||||
if (activity != null)
|
if (activity != null)
|
||||||
activity.runOnUiThread(new Runnable() {
|
activity.runOnUiThread(new Runnable() {
|
||||||
|
|
|
@ -255,7 +255,8 @@ public class PersistentNotificationPlugin implements PluginBase {
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onStatusEvent(final EventNewBG ev) {
|
public void onStatusEvent(final EventNewBG ev) {
|
||||||
updateNotification();
|
if (ev.isActiveBgSource && ev.isNew)
|
||||||
|
updateNotification();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
|
|
@ -182,7 +182,8 @@ public class WearPlugin implements PluginBase {
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onStatusEvent(final EventNewBG ev) {
|
public void onStatusEvent(final EventNewBG ev) {
|
||||||
sendDataToWatch(true, true, true);
|
if (ev.isActiveBgSource)
|
||||||
|
sendDataToWatch(true, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
|
|
@ -235,7 +235,8 @@ public class StatuslinePlugin implements PluginBase {
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onStatusEvent(final EventNewBG ev) {
|
public void onStatusEvent(final EventNewBG ev) {
|
||||||
sendStatus();
|
if (ev.isActiveBgSource && ev.isNew)
|
||||||
|
sendStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
|
Loading…
Reference in a new issue