[Android]: Fix exception when using Qt to create a service on Android

Fixes: QTBUG-91194
Pick-to: 5.15 6.0 6.1
Change-Id: Idd243c17bf82150fe2ea8b0100f8c432d75ef249
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Lars Schmertmann 2021-02-18 08:45:43 +01:00
parent 33ddacdd24
commit 3466fc5b76

View File

@ -39,8 +39,11 @@ package org.qtproject.qt.android.bindings;
import android.app.Service;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.IBinder;
import org.qtproject.qt.android.QtNative;
public class QtService extends Service
{
QtServiceLoader m_loader = new QtServiceLoader(this);
@ -153,4 +156,14 @@ public class QtService extends Service
return super.onUnbind(intent);
}
//---------------------------------------------------------------------------
public boolean loadApplication(Service service, ClassLoader classLoader, Bundle loaderParams)
{
return QtNative.serviceDelegate().loadApplication(service, classLoader, loaderParams);
}
public boolean startApplication()
{
return QtNative.serviceDelegate().startApplication();
}
}