summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2020-07-02 23:09:26 +0200
committermanuel <manuel@mausz.at>2020-07-02 23:09:26 +0200
commit5f8335c1e49ce108ef3481863833c98efa00411b (patch)
treef02b5c1c9765bb6a14c8eb42bb4f81b9face0b55 /xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android
parente317daf081a1048904fdf0b548946fa3ba6593a7 (diff)
downloadkodi-pvr-build-master.tar.gz
kodi-pvr-build-master.tar.bz2
kodi-pvr-build-master.zip
sync with upstreamHEADmaster
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android/System.h109
1 files changed, 55 insertions, 54 deletions
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
47{ 47{
48namespace platform 48namespace platform
49{ 49{
50 class CInterfaceAndroidSystem 50class ATTRIBUTE_HIDDEN CInterfaceAndroidSystem
51{
52public:
53 CInterfaceAndroidSystem()
54 : m_interface(static_cast<AddonToKodiFuncTable_android_system*>(
55 GetInterface(INTERFACE_ANDROID_SYSTEM_NAME, INTERFACE_ANDROID_SYSTEM_VERSION))){};
56
57 //============================================================================
58 ///
59 /// \ingroup cpp_kodi_platform
60 /// @brief request an JNI env pointer for the calling thread.
61 /// JNI env has to be controlled by kodi because of the underlying
62 /// threading concep.
63 ///
64 /// @param[in]:
65 /// @return JNI env pointer for the calling thread
66 ///
67 inline void* GetJNIEnv()
51 { 68 {
52 public: 69 if (m_interface)
53 CInterfaceAndroidSystem() 70 return m_interface->get_jni_env();
54 : m_interface(static_cast<AddonToKodiFuncTable_android_system*>(GetInterface(INTERFACE_ANDROID_SYSTEM_NAME, INTERFACE_ANDROID_SYSTEM_VERSION)))
55 {};
56 71
57 //============================================================================ 72 return nullptr;
58 /// 73 }
59 /// \ingroup cpp_kodi_platform 74 //----------------------------------------------------------------------------
60 /// @brief request an JNI env pointer for the calling thread.
61 /// JNI env has to be controlled by kodi because of the underlying
62 /// threading concep.
63 ///
64 /// @param[in]:
65 /// @return JNI env pointer for the calling thread
66 ///
67 inline void * GetJNIEnv()
68 {
69 if (m_interface)
70 return m_interface->get_jni_env();
71 75
72 return nullptr; 76 //============================================================================
73 } 77 ///
74 //---------------------------------------------------------------------------- 78 /// \ingroup cpp_kodi_platform
79 /// @brief request the android sdk version to e.g. initialize JNIBase.
80 ///
81 /// @param[in]:
82 /// @return Android SDK version
83 ///
84 inline int GetSDKVersion()
85 {
86 if (m_interface)
87 return m_interface->get_sdk_version();
75 88
76 //============================================================================ 89 return 0;
77 /// 90 }
78 /// \ingroup cpp_kodi_platform
79 /// @brief request the android sdk version to e.g. initialize JNIBase.
80 ///
81 /// @param[in]:
82 /// @return Android SDK version
83 ///
84 inline int GetSDKVersion()
85 {
86 if (m_interface)
87 return m_interface->get_sdk_version();
88 91
89 return 0; 92 //============================================================================
90 } 93 ///
94 /// \ingroup cpp_kodi_platform
95 /// @brief request the android main class name e.g. org.xbmc.kodi.
96 ///
97 /// @param[in]:
98 /// @return package class name
99 ///
100 inline std::string GetClassName()
101 {
102 if (m_interface)
103 return m_interface->get_class_name();
91 104
92 //============================================================================ 105 return std::string();
93 /// 106 }
94 /// \ingroup cpp_kodi_platform
95 /// @brief request the android main class name e.g. org.xbmc.kodi.
96 ///
97 /// @param[in]:
98 /// @return package class name
99 ///
100 inline std::string GetClassName()
101 {
102 if (m_interface)
103 return m_interface->get_class_name();
104 107
105 return std::string(); 108private:
106 } 109 AddonToKodiFuncTable_android_system* m_interface;
110};
111//----------------------------------------------------------------------------
107 112
108 private:
109 AddonToKodiFuncTable_android_system *m_interface;
110 };
111 //----------------------------------------------------------------------------
112} /* namespace platform */ 113} /* namespace platform */
113} /* namespace kodi */ 114} /* namespace kodi */