Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QtAndroidServiceConnection.java
Go to the documentation of this file.
1// Copyright (C) 2017 BogDan Vatra <bogdan@kde.org>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4package org.qtproject.qt.android.extras;
5
6import android.content.ComponentName;
7import android.content.ServiceConnection;
8import android.os.IBinder;
9
10public class QtAndroidServiceConnection implements ServiceConnection
11{
13 {
14 m_id = id;
15 }
16
17 public void setId(long id)
18 {
19 synchronized(this)
20 {
21 m_id = id;
22 }
23 }
24
25 @Override
26 public void onServiceConnected(ComponentName name, IBinder service)
27 {
28 synchronized(this) {
29 QtNative.onServiceConnected(m_id, name.flattenToString(), service);
30 }
31 }
32
33 @Override
34 public void onServiceDisconnected(ComponentName name)
35 {
36 synchronized(this) {
37 QtNative.onServiceDisconnected(m_id, name.flattenToString());
38 }
39 }
40
41 private long m_id;
42}
static native void onServiceDisconnected(long id, String name)
static native void onServiceConnected(long id, String name, IBinder service)
GLenum GLuint id
[7]
GLuint name