I want to ensure that the notification banner will be always active and non dismiss able , only when the phone is with screen active, awake, and unlocked (SECRET). No background, not at sleep mode not with screen off, not with screen locked. Of course with the less resources and battery consume. Can i do it without service schedule?
Thanks
B4X:
#Region Service Attributes
#StartAtBoot: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Service_Create
Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER
End Sub
Sub Service_Start (StartingIntent As Intent)
If Helpers.GetDetails.GetDefault("quickaccess", True) = False Then
Die
Return
End If
Service.StartForeground(Constants.NOTIFICATION_QUICK_ACCESS, Helpers.QuickAccessNotification)
StartServiceAt(Me, DateTime.Now + 30 * DateTime.TicksPerMinute, False)
End Sub
Sub Die
CancelScheduledService(Me)
StopService(Me)
End Sub
Sub Service_Destroy
End Sub
Thanks