Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QtServiceLoader.java
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// Copyright (c) 2016, BogDan Vatra <bogdan@kde.org>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5package org.qtproject.qt.android;
6
7import android.app.Service;
8import android.content.ContextWrapper;
9import android.util.Log;
10
11class QtServiceLoader extends QtLoader {
12 private final Service m_service;
13
14 public QtServiceLoader(Service service) {
15 super(new ContextWrapper(service));
16 m_service = service;
17
18 extractContextMetaData();
19 }
20
21 @Override
22 protected void finish() {
23 if (m_service != null)
24 m_service.stopSelf();
25 else
26 Log.w(QtTAG, "finish() called when service object is null");
27 }
28}
Q_CORE_EXPORT QtJniTypes::Service service()