commit
b6cd214006
10 changed files with 23 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
|||
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).
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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() + '"'
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<uses-permission android:name="android.permission.RECEIVE_SMS" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_MMS" />
|
||||
<uses-permission android:name="android.permission.SEND_SMS" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.SEND_MMS" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -611,6 +611,7 @@
|
|||
<string name="danar_bluetooth_status">Bluetooth status</string>
|
||||
<string name="nav_about">About</string>
|
||||
<string name="smscommunicator_missingsmspermission">Missing SMS permission</string>
|
||||
<string name="smscommunicator_missingphonestatepermission">Missing phone state permission</string>
|
||||
<string name="xdripstatus_settings">xDrip Status (watch)</string>
|
||||
<string name="xdripstatus">xDrip Statusline (watch)</string>
|
||||
<string name="xdripstatus_shortname">xds</string>
|
||||
|
|
|
@ -117,6 +117,7 @@ public class MainAppTest {
|
|||
|
||||
@Test
|
||||
public void isEngineeringModeOrReleaseTest() {
|
||||
mainApp.devBranch = true;
|
||||
Assert.assertEquals(!Config.APS, mainApp.isEngineeringModeOrRelease());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue