[Windows] Remove redundant DirectSound error codes
[xbmc.git] / xbmc / platform / android / PlatformAndroid.cpp
blobd35896cd149aaa6fe31894b61a07a8834b33d9ee
1 /*
2 * Copyright (C) 2016-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #include "PlatformAndroid.h"
11 #include "ServiceBroker.h"
12 #include "filesystem/SpecialProtocol.h"
13 #include "settings/AdvancedSettings.h"
14 #include "settings/SettingsComponent.h"
15 #include "utils/log.h"
16 #include "windowing/android/WinSystemAndroidGLESContext.h"
18 #include "platform/android/activity/XBMCApp.h"
19 #include "platform/android/powermanagement/AndroidPowerSyscall.h"
20 #include "platform/android/storage/AndroidStorageProvider.h"
22 #include <stdlib.h>
24 #include <androidjni/Build.h>
25 #include <androidjni/PackageManager.h>
27 CPlatform* CPlatform::CreateInstance()
29 return new CPlatformAndroid();
32 bool CPlatformAndroid::InitStageOne()
34 if (!CPlatformPosix::InitStageOne())
35 return false;
36 setenv("SSL_CERT_FILE", CSpecialProtocol::TranslatePath("special://xbmc/system/certs/cacert.pem").c_str(), 1);
38 setenv("OS", "Linux", true); // for python scripts that check the OS
40 CWinSystemAndroidGLESContext::Register();
42 CAndroidPowerSyscall::Register();
44 return true;
47 bool CPlatformAndroid::InitStageThree()
49 if (!CPlatformPosix::InitStageThree())
50 return false;
52 if (CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_guiVideoLayoutTransparent)
54 CLog::Log(LOGINFO, "XBMCApp: VideoLayout view was set to transparent.");
55 CXBMCApp::Get().SetVideoLayoutBackgroundColor(0);
58 return true;
61 void CPlatformAndroid::PlatformSyslog()
63 CLog::Log(
64 LOGINFO,
65 "Product: {}, Device: {}, Board: {} - Manufacturer: {}, Brand: {}, Model: {}, Hardware: {}",
66 CJNIBuild::PRODUCT, CJNIBuild::DEVICE, CJNIBuild::BOARD, CJNIBuild::MANUFACTURER,
67 CJNIBuild::BRAND, CJNIBuild::MODEL, CJNIBuild::HARDWARE);
69 std::string extstorage;
70 const bool extready = CAndroidStorageProvider::GetExternalStorage(extstorage);
71 CLog::Log(
72 LOGINFO, "External storage path = {}; status = {}; Permissions = {}{}", extstorage,
73 extready ? "ok" : "nok",
74 CJNIContext::checkCallingOrSelfPermission("android.permission.MANAGE_EXTERNAL_STORAGE") ==
75 CJNIPackageManager::PERMISSION_GRANTED
76 ? "MANAGE_EXTERNAL_STORAGE "
77 : "",
78 CJNIContext::checkCallingOrSelfPermission("android.permission.WRITE_EXTERNAL_STORAGE") ==
79 CJNIPackageManager::PERMISSION_GRANTED
80 ? "WRITE_EXTERNAL_STORAGE"
81 : "");