From 5f8335c1e49ce108ef3481863833c98efa00411b Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 2 Jul 2020 23:09:26 +0200 Subject: sync with upstream --- .../include/kodi/platform/android/System.h | 109 +++++++++++---------- 1 file changed, 55 insertions(+), 54 deletions(-) (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/platform') diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android/System.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android/System.h index aad3a28..ef2d728 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android/System.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android/System.h @@ -47,67 +47,68 @@ namespace kodi { namespace platform { - class CInterfaceAndroidSystem +class ATTRIBUTE_HIDDEN CInterfaceAndroidSystem +{ +public: + CInterfaceAndroidSystem() + : m_interface(static_cast( + GetInterface(INTERFACE_ANDROID_SYSTEM_NAME, INTERFACE_ANDROID_SYSTEM_VERSION))){}; + + //============================================================================ + /// + /// \ingroup cpp_kodi_platform + /// @brief request an JNI env pointer for the calling thread. + /// JNI env has to be controlled by kodi because of the underlying + /// threading concep. + /// + /// @param[in]: + /// @return JNI env pointer for the calling thread + /// + inline void* GetJNIEnv() { - public: - CInterfaceAndroidSystem() - : m_interface(static_cast(GetInterface(INTERFACE_ANDROID_SYSTEM_NAME, INTERFACE_ANDROID_SYSTEM_VERSION))) - {}; + if (m_interface) + return m_interface->get_jni_env(); - //============================================================================ - /// - /// \ingroup cpp_kodi_platform - /// @brief request an JNI env pointer for the calling thread. - /// JNI env has to be controlled by kodi because of the underlying - /// threading concep. - /// - /// @param[in]: - /// @return JNI env pointer for the calling thread - /// - inline void * GetJNIEnv() - { - if (m_interface) - return m_interface->get_jni_env(); + return nullptr; + } + //---------------------------------------------------------------------------- - return nullptr; - } - //---------------------------------------------------------------------------- + //============================================================================ + /// + /// \ingroup cpp_kodi_platform + /// @brief request the android sdk version to e.g. initialize JNIBase. + /// + /// @param[in]: + /// @return Android SDK version + /// + inline int GetSDKVersion() + { + if (m_interface) + return m_interface->get_sdk_version(); - //============================================================================ - /// - /// \ingroup cpp_kodi_platform - /// @brief request the android sdk version to e.g. initialize JNIBase. - /// - /// @param[in]: - /// @return Android SDK version - /// - inline int GetSDKVersion() - { - if (m_interface) - return m_interface->get_sdk_version(); + return 0; + } - return 0; - } + //============================================================================ + /// + /// \ingroup cpp_kodi_platform + /// @brief request the android main class name e.g. org.xbmc.kodi. + /// + /// @param[in]: + /// @return package class name + /// + inline std::string GetClassName() + { + if (m_interface) + return m_interface->get_class_name(); - //============================================================================ - /// - /// \ingroup cpp_kodi_platform - /// @brief request the android main class name e.g. org.xbmc.kodi. - /// - /// @param[in]: - /// @return package class name - /// - inline std::string GetClassName() - { - if (m_interface) - return m_interface->get_class_name(); + return std::string(); + } - return std::string(); - } +private: + AddonToKodiFuncTable_android_system* m_interface; +}; +//---------------------------------------------------------------------------- - private: - AddonToKodiFuncTable_android_system *m_interface; - }; - //---------------------------------------------------------------------------- } /* namespace platform */ } /* namespace kodi */ -- cgit v1.2.3