[Windows] Remove redundant DirectSound error codes
[xbmc.git] / xbmc / platform / android / activity / JNIXBMCJsonHandler.cpp
blob1de4bc890e7b11fc77476bef1e36df076da494d5
1 /*
2 * Copyright (C) 2018 Christian Browet
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 "JNIXBMCJsonHandler.h"
11 #include "CompileInfo.h"
12 #include "interfaces/json-rpc/JSONRPC.h"
13 #include "interfaces/json-rpc/JSONServiceDescription.h"
14 #include "interfaces/json-rpc/JSONUtils.h"
16 #include <androidjni/Context.h>
17 #include <androidjni/jutils-details.hpp>
19 using namespace jni;
21 static std::string s_className = std::string(CCompileInfo::GetClass()) + "/XBMCJsonRPC";
23 void CJNIXBMCJsonHandler::RegisterNatives(JNIEnv *env)
25 jclass cClass = env->FindClass(s_className.c_str());
26 if(cClass)
28 JNINativeMethod methods[] =
30 {"_requestJSON", "(Ljava/lang/String;)Ljava/lang/String;", (void*)&CJNIXBMCJsonHandler::_requestJSON},
33 env->RegisterNatives(cClass, methods, sizeof(methods)/sizeof(methods[0]));
37 jstring CJNIXBMCJsonHandler::_requestJSON(JNIEnv *env, jobject thiz, jstring request)
39 CJNIClient client;
40 CJNITransportLayer transportLayer;
42 std::string strRequest = jcast<std::string>(jhstring::fromJNI(request));
43 std::string responseData = JSONRPC::CJSONRPC::MethodCall(strRequest, &transportLayer, &client);
45 jstring jres = env->NewStringUTF(responseData.c_str());
46 return jres;
49 /**********************************/
51 bool CJNIXBMCJsonHandler::CJNITransportLayer::PrepareDownload(const char *path, CVariant &details, std::string &protocol)
53 return false;
56 bool CJNIXBMCJsonHandler::CJNITransportLayer::Download(const char *path, CVariant &result)
58 return false;
61 int CJNIXBMCJsonHandler::CJNITransportLayer::GetCapabilities()
63 return JSONRPC::Response;
66 int CJNIXBMCJsonHandler::CJNIClient::GetPermissionFlags()
68 return JSONRPC::OPERATION_PERMISSION_ALL;
71 int CJNIXBMCJsonHandler::CJNIClient::GetAnnouncementFlags()
73 // Does not support broadcast
74 return 0;
77 bool CJNIXBMCJsonHandler::CJNIClient::SetAnnouncementFlags(int flags)
79 return false;