mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-29 18:08:29 +00:00
ipc/android: Allow custom service library names
Monado derivatives may choose to create and use a custom variant of service-lib for android builds with a different library name, this change replaces the hard-coded library name used for dynamic lib loading. Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2265>
This commit is contained in:
parent
b59b11101b
commit
da80ac3f71
|
@ -21,6 +21,13 @@ android {
|
|||
minSdkVersion 26
|
||||
targetSdkVersion project.sharedTargetSdk
|
||||
|
||||
def defaultServiceLibName = "monado-service"
|
||||
def serviceLibName = project.hasProperty("serviceLibName") ?
|
||||
project.serviceLibName : defaultServiceLibName
|
||||
if (serviceLibName == null || serviceLibName.length() == 0) {
|
||||
serviceLibName = defaultServiceLibName
|
||||
}
|
||||
|
||||
// Single point of truth for these names.
|
||||
def serviceAction = "org.freedesktop.monado.ipc.CONNECT"
|
||||
def shutdownAction = "org.freedesktop.monado.ipc.SHUTDOWN"
|
||||
|
@ -31,6 +38,7 @@ android {
|
|||
buildConfigField("String", "SERVICE_ACTION", "\"${serviceAction}\"")
|
||||
buildConfigField("String", "SHUTDOWN_ACTION", "\"${shutdownAction}\"")
|
||||
buildConfigField("Long", "WATCHDOG_TIMEOUT_MILLISECONDS", "1500L")
|
||||
buildConfigField("String", "SERVICE_LIB_NAME", "\"${serviceLibName}\"")
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
|
|
@ -36,7 +36,7 @@ public class MonadoImpl extends IMonado.Stub {
|
|||
static {
|
||||
// Load the shared library with the native parts of this class
|
||||
// This is the service-lib target.
|
||||
System.loadLibrary("monado-service");
|
||||
System.loadLibrary(BuildConfig.SERVICE_LIB_NAME);
|
||||
}
|
||||
|
||||
private final Context context;
|
||||
|
|
Loading…
Reference in a new issue