kopia lustrzana https://github.com/ge0rg/aprsdroid
no vibration on own posits by default
rodzic
4a81377ce1
commit
ccb7b3b81e
|
|
@ -59,15 +59,15 @@ abstract class ServiceNotifier {
|
||||||
def start(ctx : Service, status : String)
|
def start(ctx : Service, status : String)
|
||||||
def stop(ctx : Service)
|
def stop(ctx : Service)
|
||||||
|
|
||||||
def setupNotification(n : Notification, ctx : Context, prefs : PrefsWrapper, prefix : String) {
|
def setupNotification(n : Notification, ctx : Context, prefs : PrefsWrapper, default: Boolean, prefix : String) {
|
||||||
// set notification LED
|
// set notification LED
|
||||||
if (prefs.getBoolean(prefix + "notify_led", true)) {
|
if (prefs.getBoolean(prefix + "notify_led", default)) {
|
||||||
n.ledARGB = Color.YELLOW
|
n.ledARGB = Color.YELLOW
|
||||||
n.ledOnMS = 300
|
n.ledOnMS = 300
|
||||||
n.ledOffMS = 1000
|
n.ledOffMS = 1000
|
||||||
n.flags |= Notification.FLAG_SHOW_LIGHTS
|
n.flags |= Notification.FLAG_SHOW_LIGHTS
|
||||||
}
|
}
|
||||||
if (prefs.getBoolean(prefix + "notify_vibr", true)) {
|
if (prefs.getBoolean(prefix + "notify_vibr", default)) {
|
||||||
ctx.getSystemService(Context.VIBRATOR_SERVICE).asInstanceOf[Vibrator]
|
ctx.getSystemService(Context.VIBRATOR_SERVICE).asInstanceOf[Vibrator]
|
||||||
.vibrate(Array[Long](0, 200, 200), -1)
|
.vibrate(Array[Long](0, 200, 200), -1)
|
||||||
}
|
}
|
||||||
|
|
@ -80,7 +80,7 @@ abstract class ServiceNotifier {
|
||||||
call : String, message : String) {
|
call : String, message : String) {
|
||||||
val n = newMessageNotification(ctx, call, message)
|
val n = newMessageNotification(ctx, call, message)
|
||||||
// set notification LED
|
// set notification LED
|
||||||
setupNotification(n, ctx, prefs, "")
|
setupNotification(n, ctx, prefs, true, "")
|
||||||
getNotificationMgr(ctx).notify(getCallNumber(call),
|
getNotificationMgr(ctx).notify(getCallNumber(call),
|
||||||
n)
|
n)
|
||||||
}
|
}
|
||||||
|
|
@ -92,7 +92,7 @@ abstract class ServiceNotifier {
|
||||||
def notifyPosition(ctx : Service, prefs : PrefsWrapper,
|
def notifyPosition(ctx : Service, prefs : PrefsWrapper,
|
||||||
status : String) {
|
status : String) {
|
||||||
val n = newNotification(ctx, status)
|
val n = newNotification(ctx, status)
|
||||||
setupNotification(n, ctx, prefs, "pos_")
|
setupNotification(n, ctx, prefs, false, "pos_")
|
||||||
getNotificationMgr(ctx).notify(SERVICE_NOTIFICATION, n)
|
getNotificationMgr(ctx).notify(SERVICE_NOTIFICATION, n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue