mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-19 13:18:32 +00:00
aux/android: Create an interface for handling foreground service notification
This commit is contained in:
parent
a2a61cb5cf
commit
94d747cac9
|
@ -0,0 +1,33 @@
|
|||
// Copyright 2020, Collabora, Ltd.
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
/*!
|
||||
* @file
|
||||
* @brief Interface used by the IPC service to create a notification to keep it in the foreground..
|
||||
* @author Ryan Pavlik <ryan.pavlik@collabora.com>
|
||||
* @ingroup aux_android
|
||||
*/
|
||||
|
||||
package org.freedesktop.monado.auxiliary
|
||||
|
||||
import android.app.Notification
|
||||
import android.app.PendingIntent
|
||||
import android.content.Context
|
||||
|
||||
/**
|
||||
* Interface for handling a foreground service notification.
|
||||
*
|
||||
* Exists so that the service itself doesn't have to deal with UI details.
|
||||
*/
|
||||
interface IServiceNotification {
|
||||
|
||||
/**
|
||||
* Create and return a notification (creating the channel if applicable) that can be used in
|
||||
* {@code Service#startForeground()}
|
||||
*/
|
||||
fun buildNotification(context: Context, pendingShutdownIntent: PendingIntent): Notification
|
||||
|
||||
/**
|
||||
* Return the notification ID to use
|
||||
*/
|
||||
fun getNotificationId(): Int
|
||||
}
|
Loading…
Reference in a new issue