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

Fixes: QTBUG-91194
Change-Id: Idd243c17bf82150fe2ea8b0100f8c432d75ef249
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3466fc5b76a97eabc815a7406f01454e4ac0db4f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Lars Schmertmann 2021-02-18 08:45:43 +01:00 committed by Qt Cherry-pick Bot
parent 18fd74c70d
commit aebbf928fa

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();
}
}