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:
Richard van der Hoff
2026-08-27 19:19:01 +01:00
parent 0cd6e70777
commit 712fe5b217
3 changed files with 32 additions and 0 deletions
@@ -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)
}