mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-25 08:05:55 +01:00
fix crash on some devices when creating a test notification in debug menu
This commit is contained in:
parent
a36885bcd5
commit
74f2b8c1c2
@ -209,7 +209,13 @@ public class BluetoothCommunicationService extends Service {
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
|
||||
if (intent == null) {
|
||||
Log.i(TAG, "no intent");
|
||||
return START_NOT_STICKY;
|
||||
}
|
||||
|
||||
String action = intent.getAction();
|
||||
|
||||
if (action == null) {
|
||||
Log.i(TAG, "no action");
|
||||
return START_NOT_STICKY;
|
||||
@ -260,8 +266,7 @@ public class BluetoothCommunicationService extends Service {
|
||||
deviceType = GBDevice.Type.MIBAND;
|
||||
mGBDeviceProtocol = new MibandProtocol();
|
||||
mGBDeviceIoThread = new MibandIoThread(btDeviceAddress);
|
||||
}
|
||||
else if (btDevice.getName().indexOf("Pebble") == 0) {
|
||||
} else if (btDevice.getName().indexOf("Pebble") == 0) {
|
||||
deviceType = GBDevice.Type.PEBBLE;
|
||||
mGBDeviceProtocol = new PebbleProtocol();
|
||||
mGBDeviceIoThread = new PebbleIoThread(btDeviceAddress);
|
||||
|
@ -151,7 +151,7 @@ public class DebugActivity extends Activity {
|
||||
ncomp.setContentTitle("Test Notification");
|
||||
ncomp.setContentText("This is a Test Notification from Gadgetbridge");
|
||||
ncomp.setTicker("This is a Test Notification from Gadgetbridge");
|
||||
ncomp.setSmallIcon(R.drawable.ic_launcher);
|
||||
ncomp.setSmallIcon(R.drawable.ic_notification);
|
||||
ncomp.setAutoCancel(true);
|
||||
nManager.notify((int) System.currentTimeMillis(), ncomp.build());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user