4package org.qtproject.qt.android;
6import android.content.Context;
7import android.app.Activity;
8import android.app.Service;
10import java.util.HashMap;
12class QtEmbeddedViewInterfaceFactory {
13 private static final HashMap<Context, QtEmbeddedViewInterface> m_interfaces =
new HashMap<>();
14 private static final Object m_interfaceLock =
new Object();
17 synchronized (m_interfaceLock) {
18 if (!m_interfaces.containsKey(
context)) {
19 if (
context instanceof Activity)
20 m_interfaces.put(
context,
new QtEmbeddedDelegate((Activity)
context));
21 else if (
context instanceof Service)
22 m_interfaces.put(
context,
new QtServiceEmbeddedDelegate((Service)
context));
25 return m_interfaces.get(
context);
30 synchronized (m_interfaceLock) {
static const QString context()