diff options
| author | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
| commit | be933ef2241d79558f91796cc5b3a161f72ebf9c (patch) | |
| tree | fe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android/System.h | |
| parent | 5f8335c1e49ce108ef3481863833c98efa00411b (diff) | |
| download | kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2 kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip | |
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android/System.h')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android/System.h | 114 |
1 files changed, 0 insertions, 114 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 deleted file mode 100644 index ef2d728..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/platform/android/System.h +++ /dev/null | |||
| @@ -1,114 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include "../../AddonBase.h" | ||
| 12 | |||
| 13 | /* | ||
| 14 | * For interface between add-on and kodi. | ||
| 15 | * | ||
| 16 | * This structure defines the addresses of functions stored inside Kodi which | ||
| 17 | * are then available for the add-on to call | ||
| 18 | * | ||
| 19 | * All function pointers there are used by the C++ interface functions below. | ||
| 20 | * You find the set of them on xbmc/addons/interfaces/General.cpp | ||
| 21 | * | ||
| 22 | * Note: For add-on development itself this is not needed | ||
| 23 | */ | ||
| 24 | |||
| 25 | static const char* INTERFACE_ANDROID_SYSTEM_NAME = "ANDROID_SYSTEM"; | ||
| 26 | static const char* INTERFACE_ANDROID_SYSTEM_VERSION = "1.0.1"; | ||
| 27 | static const char* INTERFACE_ANDROID_SYSTEM_VERSION_MIN = "1.0.1"; | ||
| 28 | |||
| 29 | struct AddonToKodiFuncTable_android_system | ||
| 30 | { | ||
| 31 | void* (*get_jni_env)(); | ||
| 32 | int (*get_sdk_version)(); | ||
| 33 | const char *(*get_class_name)(); | ||
| 34 | }; | ||
| 35 | |||
| 36 | //============================================================================== | ||
| 37 | /// | ||
| 38 | /// \defgroup cpp_kodi_platform Interface - kodi::platform | ||
| 39 | /// \ingroup cpp | ||
| 40 | /// @brief **Android platform specific functions** | ||
| 41 | /// | ||
| 42 | /// #include <kodi/platform/android/System.h>" | ||
| 43 | /// | ||
| 44 | //------------------------------------------------------------------------------ | ||
| 45 | |||
| 46 | namespace kodi | ||
| 47 | { | ||
| 48 | namespace platform | ||
| 49 | { | ||
| 50 | class ATTRIBUTE_HIDDEN CInterfaceAndroidSystem | ||
| 51 | { | ||
| 52 | public: | ||
| 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() | ||
| 68 | { | ||
| 69 | if (m_interface) | ||
| 70 | return m_interface->get_jni_env(); | ||
| 71 | |||
| 72 | return nullptr; | ||
| 73 | } | ||
| 74 | //---------------------------------------------------------------------------- | ||
| 75 | |||
| 76 | //============================================================================ | ||
| 77 | /// | ||
| 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 | |||
| 89 | return 0; | ||
| 90 | } | ||
| 91 | |||
| 92 | //============================================================================ | ||
| 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(); | ||
| 104 | |||
| 105 | return std::string(); | ||
| 106 | } | ||
| 107 | |||
| 108 | private: | ||
| 109 | AddonToKodiFuncTable_android_system* m_interface; | ||
| 110 | }; | ||
| 111 | //---------------------------------------------------------------------------- | ||
| 112 | |||
| 113 | } /* namespace platform */ | ||
| 114 | } /* namespace kodi */ | ||
