mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Implement a hook allowing enterprise modules to perform actions on startup
Add an interface `io.element.android.features.enterprise.api.AppStartupHook`, which can be implemented in the enterprise build to perform certain actions on startup. It's a bit of a kludge for now since it doesn't block the rest of the app from proceeding, but it will serve our purposes for now.
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) 2026 Element Creations Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.features.enterprise.api
|
||||
|
||||
import android.app.Activity
|
||||
|
||||
/**
|
||||
* A hook that is called during app startup, from the `MainActivity`.
|
||||
*
|
||||
* Note that the hook is run in the background: it will not block startup of the app.
|
||||
*/
|
||||
fun interface AppStartupHook {
|
||||
/** @param activity The activity which is active while the app starts (i.e. the `MainActivity`). */
|
||||
suspend fun onAppStartup(activity: Activity)
|
||||
}
|
||||
Reference in New Issue
Block a user