mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-03-03 21:26:36 +00:00
ipc/android: Initial port of parts to Kotlin.
This commit is contained in:
parent
b2f751ae99
commit
fa840e1cd8
src/xrt/ipc/android
|
@ -1,7 +1,10 @@
|
|||
// Copyright 2020, Collabora, Ltd.
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'kotlin-android'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion project.sharedTargetSdk
|
||||
|
@ -41,4 +44,6 @@ android {
|
|||
dependencies {
|
||||
implementation project(':src:xrt:auxiliary:android')
|
||||
implementation "androidx.annotation:annotation:$androidxAnnotationVersion"
|
||||
implementation "androidx.core:core-ktx:$androidxCoreVersion"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
|
||||
}
|
||||
|
|
|
@ -6,27 +6,21 @@
|
|||
* @author Ryan Pavlik <ryan.pavlik@collabora.com>
|
||||
* @ingroup ipc_android
|
||||
*/
|
||||
package org.freedesktop.monado.ipc
|
||||
|
||||
|
||||
package org.freedesktop.monado.ipc;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import android.app.Service
|
||||
import android.content.Intent
|
||||
import android.os.IBinder
|
||||
|
||||
/**
|
||||
* Minimal implementation of a Service.
|
||||
* <p>
|
||||
*
|
||||
* This is needed so that the APK can expose the binder service implemented in MonadoImpl.
|
||||
*/
|
||||
public class MonadoService extends Service {
|
||||
class MonadoService : Service() {
|
||||
val monado: MonadoImpl = MonadoImpl()
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return new MonadoImpl();
|
||||
override fun onBind(intent: Intent): IBinder? {
|
||||
return monado;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue