Confirm pump plugin activation for all hardware pumps (MDT, Insight).

This commit is contained in:
Johannes Mockenhaupt 2019-07-25 22:28:17 +02:00
parent cf1bcf9943
commit d9de09d7f0
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
2 changed files with 13 additions and 0 deletions

View file

@ -2,6 +2,8 @@ package info.nightscout.androidaps.plugins.pump.common;
import java.util.Date;
import androidx.fragment.app.FragmentActivity;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderFragment;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
@ -105,6 +107,10 @@ public abstract class PumpPluginAbstract extends PluginBase implements PumpInter
*/
public abstract void onStartCustomActions();
@Override
public void switchAllowed(ConfigBuilderFragment.PluginViewHolder.PluginSwitcher pluginSwitcher, FragmentActivity activity) {
confirmPumpPluginActivation(pluginSwitcher, activity);
}
/**
* Service class (same one you did serviceConnection for)

View file

@ -8,7 +8,9 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import androidx.fragment.app.FragmentActivity;
import info.nightscout.androidaps.plugins.common.ManufacturerType;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderFragment;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.parameter_blocks.*;
@ -229,6 +231,11 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
MainApp.instance().unbindService(serviceConnection);
}
@Override
public void switchAllowed(ConfigBuilderFragment.PluginViewHolder.PluginSwitcher pluginSwitcher, FragmentActivity activity) {
confirmPumpPluginActivation(pluginSwitcher, activity);
}
@Override
public boolean isInitialized() {
return connectionService != null && alertService != null && connectionService.isPaired();