diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
index db66ffec38..2465b9d9a5 100644
--- a/ISSUE_TEMPLATE.md
+++ b/ISSUE_TEMPLATE.md
@@ -1,10 +1,10 @@
Reporting bugs
--------------
-- Note the precise time the problem occurred and describe the circumstances and steps that caused
+- **Note the precise time the problem occurred** and describe the circumstances and steps that caused
the problem
- Note the Build version (found in the About dialog in the app, when pressing the three dots in the
upper-right corner).
- Obtain the app's log files, which can be found on the phone in
_/storage/emulated/0/Android/data/info.nightscout.androidaps/_
See https://github.com/MilosKozak/AndroidAPS/wiki/Accessing-logfiles
-- Open an issue at https://github.com/MilosKozak/AndroidAPS/issues/new
\ No newline at end of file
+- Open an issue at https://github.com/MilosKozak/AndroidAPS/issues/new
diff --git a/README.md b/README.md
index deeea159bc..d1e1e8a47c 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# AndroidAPS
-* Check the wiki: https://github.com/MilosKozak/AndroidAPS/wiki
+* Check the wiki: http://wiki.androidaps.org
* Everyone who’s been looping with AndroidAPS needs to fill out the form after 3 days of looping https://docs.google.com/forms/d/14KcMjlINPMJHVt28MDRupa4sz4DDIooI4SrW0P3HSN8/viewform?c=0&w=1
[![Gitter](https://badges.gitter.im/MilosKozak/AndroidAPS.svg)](https://gitter.im/MilosKozak/AndroidAPS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
diff --git a/app/build.gradle b/app/build.gradle
index 02e0c46295..bb01bf19d8 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -63,7 +63,7 @@ android {
targetSdkVersion 25
multiDexEnabled true
versionCode 1500
- version "2.0i-dev"
+ version "2.0"
buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"'
buildConfigField "String", "HEAD", '"' + generateGitBuild() + '"'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 264132de25..e6eecda51b 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -12,6 +12,7 @@
+
diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.java b/app/src/main/java/info/nightscout/androidaps/MainActivity.java
index 1595e6cb02..844f218803 100644
--- a/app/src/main/java/info/nightscout/androidaps/MainActivity.java
+++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.java
@@ -326,6 +326,7 @@ public class MainActivity extends AppCompatActivity {
case AndroidPermission.CASE_LOCATION:
case AndroidPermission.CASE_SMS:
case AndroidPermission.CASE_BATTERY:
+ case AndroidPermission.CASE_PHONESTATE:
break;
}
}
diff --git a/app/src/main/java/info/nightscout/androidaps/logging/L.java b/app/src/main/java/info/nightscout/androidaps/logging/L.java
index c44d2516c2..0fde02f4ed 100644
--- a/app/src/main/java/info/nightscout/androidaps/logging/L.java
+++ b/app/src/main/java/info/nightscout/androidaps/logging/L.java
@@ -99,13 +99,13 @@ public class L {
private static void initialize() {
logElements = new ArrayList<>();
logElements.add(new LogElement(APS, true));
- logElements.add(new LogElement(AUTOSENS, true));
+ logElements.add(new LogElement(AUTOSENS, false));
logElements.add(new LogElement(BGSOURCE, true));
- logElements.add(new LogElement(CONFIGBUILDER, true));
+ logElements.add(new LogElement(CONFIGBUILDER, false));
logElements.add(new LogElement(CONSTRAINTS, true));
logElements.add(new LogElement(CORE, true));
logElements.add(new LogElement(DATABASE, true));
- logElements.add(new LogElement(DATAFOOD, true));
+ logElements.add(new LogElement(DATAFOOD, false));
logElements.add(new LogElement(DATASERVICE, true));
logElements.add(new LogElement(DATATREATMENTS, true));
logElements.add(new LogElement(EVENTS, false, true));
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/notifications/Notification.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/notifications/Notification.java
index f6f291ddc2..0a055d7ae6 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/notifications/Notification.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/notifications/Notification.java
@@ -71,6 +71,7 @@ public class Notification {
public static final int DEVICENOTPAIRED = 43;
public static final int MEDTRONIC_PUMP_ALARM = 44;
public static final int RILEYLINK_CONNECTION = 45;
+ public static final int PERMISSION_PHONESTATE = 46;
public int id;
diff --git a/app/src/main/java/info/nightscout/utils/AndroidPermission.java b/app/src/main/java/info/nightscout/utils/AndroidPermission.java
index 6759bf5c96..c2a572ff4f 100644
--- a/app/src/main/java/info/nightscout/utils/AndroidPermission.java
+++ b/app/src/main/java/info/nightscout/utils/AndroidPermission.java
@@ -21,6 +21,7 @@ public class AndroidPermission {
public static final int CASE_SMS = 0x2;
public static final int CASE_LOCATION = 0x3;
public static final int CASE_BATTERY = 0x4;
+ public static final int CASE_PHONESTATE = 0x5;
public static void askForPermission(Activity activity, String[] permission, Integer requestCode) {
boolean test = false;
@@ -55,6 +56,16 @@ public class AndroidPermission {
} else
MainApp.bus().post(new EventDismissNotification(Notification.PERMISSION_SMS));
}
+ // Following is a bug in Android 8
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.O) {
+ if (!checkForPermission(activity, Manifest.permission.READ_PHONE_STATE)) {
+ NotificationWithAction notification = new NotificationWithAction(Notification.PERMISSION_PHONESTATE, MainApp.gs(R.string.smscommunicator_missingphonestatepermission), Notification.URGENT);
+ notification.action(MainApp.gs(R.string.request), () ->
+ AndroidPermission.askForPermission(activity, new String[]{Manifest.permission.READ_PHONE_STATE}, AndroidPermission.CASE_PHONESTATE));
+ MainApp.bus().post(new EventNewNotification(notification));
+ } else
+ MainApp.bus().post(new EventDismissNotification(Notification.PERMISSION_PHONESTATE));
+ }
}
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 969eeb3e07..802152ef53 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -611,6 +611,7 @@
Bluetooth status
About
Missing SMS permission
+ Missing phone state permission
xDrip Status (watch)
xDrip Statusline (watch)
xds
diff --git a/app/src/test/java/info/nightscout/MainAppTest.java b/app/src/test/java/info/nightscout/MainAppTest.java
index 2b9217c1a8..1bbfba3662 100644
--- a/app/src/test/java/info/nightscout/MainAppTest.java
+++ b/app/src/test/java/info/nightscout/MainAppTest.java
@@ -117,6 +117,7 @@ public class MainAppTest {
@Test
public void isEngineeringModeOrReleaseTest() {
+ mainApp.devBranch = true;
Assert.assertEquals(!Config.APS, mainApp.isEngineeringModeOrRelease());
}