Merge branch 'dev' of https://github.com/MilosKozak/AndroidAPS into dev
This commit is contained in:
commit
aebaa76864
|
@ -15,10 +15,11 @@ apply plugin: "jacoco-android"
|
|||
apply plugin: 'com.jakewharton.butterknife'
|
||||
|
||||
ext {
|
||||
supportLibraryVersion = "27.0.2"
|
||||
supportLibraryVersion = "27.1.0"
|
||||
ormLiteVersion = "4.46"
|
||||
powermockVersion = "1.7.3"
|
||||
dexmakerVersion = "1.2"
|
||||
butterknifeVersion = "8.8.1"
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,12 +56,11 @@ tasks.matching {it instanceof Test}.all {
|
|||
|
||||
android {
|
||||
compileSdkVersion 27
|
||||
buildToolsVersion "${supportLibraryVersion}"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "info.nightscout.androidaps"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 27
|
||||
targetSdkVersion 25
|
||||
multiDexEnabled true
|
||||
versionCode 1500
|
||||
version "1.60c-dev"
|
||||
|
@ -76,7 +76,7 @@ android {
|
|||
// TODO remove once wear dependency com.google.android.gms:play-services-wearable:7.3.0
|
||||
// has been upgraded (requiring significant code changes), which currently fails release
|
||||
// build with a deprecation warning
|
||||
// abortOnError false
|
||||
abortOnError false
|
||||
// (disabled entirely to avoid reports on the error, which would still be displayed
|
||||
// and it's easy to overlook that it's ignored)
|
||||
checkReleaseBuilds false
|
||||
|
@ -181,7 +181,7 @@ dependencies {
|
|||
implementation("com.crashlytics.sdk.android:answers:1.3.12@aar") {
|
||||
transitive = true;
|
||||
}
|
||||
libs 'MilosKozak:danars-support-lib:master@zip'
|
||||
libs "MilosKozak:danars-support-lib:master@zip"
|
||||
|
||||
implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
|
||||
implementation "com.android.support:support-v4:${supportLibraryVersion}"
|
||||
|
@ -221,8 +221,8 @@ dependencies {
|
|||
|
||||
implementation 'org.mozilla:rhino:1.7.7.2'
|
||||
|
||||
api "com.jakewharton:butterknife:8.8.1"
|
||||
annotationProcessor "com.jakewharton:butterknife-compiler:8.8.1"
|
||||
implementation "com.jakewharton:butterknife:${butterknifeVersion}"
|
||||
annotationProcessor "com.jakewharton:butterknife-compiler:${butterknifeVersion}"
|
||||
|
||||
testImplementation "junit:junit:4.12"
|
||||
testImplementation "org.json:json:20140107"
|
||||
|
|
|
@ -32,7 +32,6 @@ public class Config {
|
|||
public static final boolean logPumpComm = true;
|
||||
public static final boolean logPrefsChange = true;
|
||||
public static final boolean logConfigBuilder = true;
|
||||
public static final boolean logConstraintsChanges = true;
|
||||
public static final boolean logNSUpload = true;
|
||||
public static final boolean logPumpActions = true;
|
||||
public static final boolean logCongigBuilderActions = true;
|
||||
|
|
|
@ -405,7 +405,8 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
else
|
||||
builder.setIcon(R.mipmap.blueowl);
|
||||
String message = "Build: " + BuildConfig.BUILDVERSION + "\n";
|
||||
message += MainApp.sResources.getString(R.string.configbuilder_nightscoutversion_label) + " " + ConfigBuilderPlugin.nightscoutVersionName;
|
||||
message += "Flavor: " + BuildConfig.FLAVOR + BuildConfig.BUILD_TYPE + "\n";
|
||||
message += getString(R.string.configbuilder_nightscoutversion_label) + " " + ConfigBuilderPlugin.nightscoutVersionName;
|
||||
if (MainApp.engineeringMode)
|
||||
message += "\n" + MainApp.gs(R.string.engineering_mode_enabled);
|
||||
message += getString(R.string.about_link_urls);
|
||||
|
|
|
@ -155,7 +155,8 @@ public class IobCobThread extends Thread {
|
|||
AutosensData hourAgoData = iobCobCalculatorPlugin.getAutosensData(hourago);
|
||||
if (hourAgoData != null) {
|
||||
int initialIndex = autosensDataTable.indexOfKey(hourAgoData.time);
|
||||
log.debug(">>>>> bucketed_data.size()=" + bucketed_data.size() + " i=" + i + "hourAgoData=" + hourAgoData.toString());
|
||||
if (Config.logAutosensData)
|
||||
log.debug(">>>>> bucketed_data.size()=" + bucketed_data.size() + " i=" + i + "hourAgoData=" + hourAgoData.toString());
|
||||
int past = 1;
|
||||
try {
|
||||
for (; past < 12; past++) {
|
||||
|
@ -242,7 +243,8 @@ public class IobCobThread extends Thread {
|
|||
|
||||
previous = autosensData;
|
||||
autosensDataTable.put(bgTime, autosensData);
|
||||
log.debug("Running detectSensitivity from: " + DateUtil.dateAndTimeString(oldestTimeWithData) + " to: " + DateUtil.dateAndTimeString(bgTime));
|
||||
if (Config.logAutosensData)
|
||||
log.debug("Running detectSensitivity from: " + DateUtil.dateAndTimeString(oldestTimeWithData) + " to: " + DateUtil.dateAndTimeString(bgTime));
|
||||
autosensData.autosensRatio = iobCobCalculatorPlugin.detectSensitivity(oldestTimeWithData, bgTime).ratio;
|
||||
if (Config.logAutosensData)
|
||||
log.debug(autosensData.toString());
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
package info.nightscout.androidaps.plugins.Loop;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.TaskStackBuilder;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
|
||||
import com.crashlytics.android.answers.CustomEvent;
|
||||
|
@ -48,6 +51,9 @@ import info.nightscout.utils.SP;
|
|||
public class LoopPlugin extends PluginBase {
|
||||
private static Logger log = LoggerFactory.getLogger(LoopPlugin.class);
|
||||
|
||||
public static final String CHANNEL_ID = "AndroidAPS-Openloop";
|
||||
|
||||
|
||||
protected static LoopPlugin loopPlugin;
|
||||
|
||||
public static LoopPlugin getPlugin() {
|
||||
|
@ -90,9 +96,22 @@ public class LoopPlugin extends PluginBase {
|
|||
@Override
|
||||
protected void onStart() {
|
||||
MainApp.bus().register(this);
|
||||
createNotificationChannel();
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
private void createNotificationChannel() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
|
||||
NotificationManager mNotificationManager =
|
||||
(NotificationManager) MainApp.instance().getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
@SuppressLint("WrongConstant") NotificationChannel channel = new NotificationChannel(CHANNEL_ID,
|
||||
CHANNEL_ID,
|
||||
NotificationManager.IMPORTANCE_HIGH);
|
||||
mNotificationManager.createNotificationChannel(channel);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
|
@ -322,7 +341,7 @@ public class LoopPlugin extends PluginBase {
|
|||
} else {
|
||||
if (result.isChangeRequested() && allowNotification) {
|
||||
NotificationCompat.Builder builder =
|
||||
new NotificationCompat.Builder(MainApp.instance().getApplicationContext());
|
||||
new NotificationCompat.Builder(MainApp.instance().getApplicationContext(), CHANNEL_ID);
|
||||
builder.setSmallIcon(R.drawable.notif_icon)
|
||||
.setContentTitle(MainApp.sResources.getString(R.string.openloop_newsuggestion))
|
||||
.setContentText(resultAfterConstraints.toString())
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.Overview.notifications;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
@ -8,6 +10,7 @@ import android.graphics.BitmapFactory;
|
|||
import android.media.AudioAttributes;
|
||||
import android.media.RingtoneManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
@ -28,11 +31,15 @@ import info.nightscout.utils.SP;
|
|||
*/
|
||||
|
||||
public class NotificationStore {
|
||||
|
||||
public static final String CHANNEL_ID = "AndroidAPS-Overview";
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(NotificationStore.class);
|
||||
public List<Notification> store = new ArrayList<Notification>();
|
||||
public long snoozedUntil = 0L;
|
||||
|
||||
public NotificationStore() {
|
||||
createNotificationChannel();
|
||||
}
|
||||
|
||||
public class NotificationComparator implements Comparator<Notification> {
|
||||
|
@ -110,7 +117,7 @@ public class NotificationStore {
|
|||
Bitmap largeIcon = BitmapFactory.decodeResource(context.getResources(), R.mipmap.blueowl);
|
||||
Uri sound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
|
||||
NotificationCompat.Builder notificationBuilder =
|
||||
new NotificationCompat.Builder(context)
|
||||
new NotificationCompat.Builder(context, CHANNEL_ID)
|
||||
.setSmallIcon(R.drawable.ic_notification)
|
||||
.setLargeIcon(largeIcon)
|
||||
.setContentText(n.text)
|
||||
|
@ -127,4 +134,17 @@ public class NotificationStore {
|
|||
}
|
||||
mgr.notify(n.id, notificationBuilder.build());
|
||||
}
|
||||
|
||||
private void createNotificationChannel() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
|
||||
NotificationManager mNotificationManager =
|
||||
(NotificationManager) MainApp.instance().getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
@SuppressLint("WrongConstant") NotificationChannel channel = new NotificationChannel(CHANNEL_ID,
|
||||
CHANNEL_ID,
|
||||
NotificationManager.IMPORTANCE_HIGH);
|
||||
mNotificationManager.createNotificationChannel(channel);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
package info.nightscout.androidaps.plugins.Persistentnotification;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Build;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.support.v4.app.TaskStackBuilder;
|
||||
|
||||
|
@ -41,6 +44,8 @@ import info.nightscout.utils.DecimalFormatter;
|
|||
|
||||
public class PersistentNotificationPlugin extends PluginBase {
|
||||
|
||||
public static final String CHANNEL_ID = "AndroidAPS-Ongoing";
|
||||
|
||||
private static final int ONGOING_NOTIFICATION_ID = 4711;
|
||||
private final Context ctx;
|
||||
|
||||
|
@ -57,10 +62,23 @@ public class PersistentNotificationPlugin extends PluginBase {
|
|||
@Override
|
||||
protected void onStart() {
|
||||
MainApp.bus().register(this);
|
||||
createNotificationChannel();
|
||||
updateNotification();
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
private void createNotificationChannel() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
|
||||
NotificationManager mNotificationManager =
|
||||
(NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
@SuppressLint("WrongConstant") NotificationChannel channel = new NotificationChannel(CHANNEL_ID,
|
||||
CHANNEL_ID,
|
||||
NotificationManager.IMPORTANCE_HIGH);
|
||||
mNotificationManager.createNotificationChannel(channel);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
MainApp.bus().unregister(this);
|
||||
|
@ -118,7 +136,7 @@ public class PersistentNotificationPlugin extends PluginBase {
|
|||
line3 += " - " + MainApp.getConfigBuilder().getProfileName();
|
||||
|
||||
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx);
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx, CHANNEL_ID);
|
||||
builder.setOngoing(true);
|
||||
builder.setCategory(NotificationCompat.CATEGORY_STATUS);
|
||||
builder.setSmallIcon(R.drawable.ic_notification);
|
||||
|
|
|
@ -30,7 +30,7 @@ import info.nightscout.utils.SafeParse;
|
|||
* Created by mike on 24.06.2017.
|
||||
*/
|
||||
|
||||
public class SensitivityAAPSPlugin extends PluginBase implements SensitivityInterface{
|
||||
public class SensitivityAAPSPlugin extends PluginBase implements SensitivityInterface {
|
||||
private static Logger log = LoggerFactory.getLogger(SensitivityAAPSPlugin.class);
|
||||
|
||||
static SensitivityAAPSPlugin plugin = null;
|
||||
|
@ -118,7 +118,9 @@ public class SensitivityAAPSPlugin extends PluginBase implements SensitivityInte
|
|||
String ratioLimit = "";
|
||||
String sensResult = "";
|
||||
|
||||
log.debug("Records: " + index + " " + pastSensitivity);
|
||||
if (Config.logAutosensData)
|
||||
log.debug("Records: " + index + " " + pastSensitivity);
|
||||
|
||||
Arrays.sort(deviations);
|
||||
|
||||
double percentile = IobCobCalculatorPlugin.percentile(deviations, 0.50);
|
||||
|
@ -133,7 +135,8 @@ public class SensitivityAAPSPlugin extends PluginBase implements SensitivityInte
|
|||
sensResult = "Sensitivity normal";
|
||||
}
|
||||
|
||||
log.debug(sensResult);
|
||||
if (Config.logAutosensData)
|
||||
log.debug(sensResult);
|
||||
|
||||
double rawRatio = ratio;
|
||||
ratio = Math.max(ratio, SafeParse.stringToDouble(SP.getString("openapsama_autosens_min", "0.7")));
|
||||
|
|
|
@ -118,7 +118,9 @@ public class SensitivityOref0Plugin extends PluginBase implements SensitivityInt
|
|||
String ratioLimit = "";
|
||||
String sensResult = "";
|
||||
|
||||
log.debug("Records: " + index + " " + pastSensitivity);
|
||||
if (Config.logAutosensData)
|
||||
log.debug("Records: " + index + " " + pastSensitivity);
|
||||
|
||||
Arrays.sort(deviations);
|
||||
|
||||
for (double i = 0.9; i > 0.1; i = i - 0.02) {
|
||||
|
@ -140,7 +142,10 @@ public class SensitivityOref0Plugin extends PluginBase implements SensitivityInt
|
|||
} else {
|
||||
sensResult = "Sensitivity normal";
|
||||
}
|
||||
log.debug(sensResult);
|
||||
|
||||
if (Config.logAutosensData)
|
||||
log.debug(sensResult);
|
||||
|
||||
ratio = 1 + (basalOff / profile.getMaxDailyBasal());
|
||||
|
||||
double rawRatio = ratio;
|
||||
|
|
|
@ -4,21 +4,22 @@ buildscript {
|
|||
repositories {
|
||||
jcenter()
|
||||
google()
|
||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.0.1'
|
||||
classpath 'com.android.tools.build:gradle:3.1.0'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
||||
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
|
||||
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
jcenter()
|
||||
google()
|
||||
jcenter()
|
||||
|
||||
maven {
|
||||
url "https://maven.google.com"
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
apply plugin: 'com.android.application'
|
||||
|
||||
ext {
|
||||
supportLibraryVersion = "23.0.1"
|
||||
wearableVersion = "2.0.1"
|
||||
wearableVersion = "2.0.1"
|
||||
}
|
||||
|
||||
def generateGitBuild = { ->
|
||||
|
@ -27,13 +26,12 @@ def generateGitBuild = { ->
|
|||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "26.0.2"
|
||||
compileSdkVersion 27
|
||||
|
||||
defaultConfig {
|
||||
applicationId "info.nightscout.androidaps"
|
||||
minSdkVersion 20
|
||||
targetSdkVersion 23
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 25
|
||||
versionCode 1
|
||||
versionName "1.0.2"
|
||||
buildConfigField "String", "BUILDVERSION", generateGitBuild()
|
||||
|
|
Loading…
Reference in a new issue