diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandDateConverter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandDateConverter.java
index b1b7828d4..e46275d39 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandDateConverter.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandDateConverter.java
@@ -58,8 +58,8 @@ public class MiBandDateConverter {
value[offset + 5]);
int offsetInHours = MiBandCoordinator.getDeviceTimeOffsetHours(deviceAddress);
- if(offsetInHours != 0)
- timestamp.add(Calendar.HOUR_OF_DAY,-offsetInHours);
+ if (offsetInHours != 0)
+ timestamp.add(Calendar.HOUR_OF_DAY, -offsetInHours);
return timestamp;
}
@@ -83,8 +83,8 @@ public class MiBandDateConverter {
// shift to -8, so at 6am the device thinks it's still 10pm
// of the day before.
int offsetInHours = MiBandCoordinator.getDeviceTimeOffsetHours(deviceAddress);
- if(offsetInHours != 0)
- timestamp.add(Calendar.HOUR_OF_DAY,offsetInHours);
+ if (offsetInHours != 0)
+ timestamp.add(Calendar.HOUR_OF_DAY, offsetInHours);
return new byte[]{
(byte) (timestamp.get(Calendar.YEAR) - 2000),
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/GB.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/GB.java
index 820a93f66..f711c58a9 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/GB.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/GB.java
@@ -19,6 +19,9 @@
along with this program. If not, see . */
package nodomain.freeyourgadget.gadgetbridge.util;
+import static nodomain.freeyourgadget.gadgetbridge.GBApplication.isRunningOreoOrLater;
+import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_RECORDED_DATA_TYPES;
+
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationChannel;
@@ -28,12 +31,10 @@ import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
-import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.text.Html;
import android.text.SpannableString;
-import android.util.Log;
import android.widget.Toast;
import androidx.annotation.NonNull;
@@ -48,8 +49,6 @@ import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
import java.util.Collections;
import java.util.List;
@@ -63,10 +62,6 @@ import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceService;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService;
-import nodomain.freeyourgadget.gadgetbridge.util.GBPrefs;
-
-import static nodomain.freeyourgadget.gadgetbridge.GBApplication.isRunningOreoOrLater;
-import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_RECORDED_DATA_TYPES;
public class GB {
@@ -305,7 +300,11 @@ public class GB {
public static void notify(int id, @NonNull Notification notification, Context context) {
createNotificationChannels(context);
- NotificationManagerCompat.from(context).notify(id, notification);
+ try {
+ NotificationManagerCompat.from(context).notify(id, notification);
+ } catch (SecurityException e) {
+ toast(context.getString(R.string.warning_missing_notification_permission), Toast.LENGTH_SHORT, WARN);
+ }
}
public static void removeNotification(int id, Context context) {
diff --git a/app/src/main/res/drawable/ic_bluetooth_searching.xml b/app/src/main/res/drawable/ic_bluetooth_searching.xml
index 3550ab438..78b9d0861 100644
--- a/app/src/main/res/drawable/ic_bluetooth_searching.xml
+++ b/app/src/main/res/drawable/ic_bluetooth_searching.xml
@@ -3,7 +3,7 @@
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
- android:tint="#7E7E7E">
+ android:tint="#7E7E7E"
android:autoMirrored="true">
Beep twice
Vibrate and beep once
- Clap hands to turn up screen"
- Clapping again will turn off the screen"
+ Clap hands to turn up screen
+ Clapping again will turn off the screen
The screen will turn off after the microphone has detected silence for a while
Device specific settings
@@ -2677,4 +2677,5 @@
BLE
BT_CLASSIC
Activity info
+ Could not post ongoing notification due to missing permission