aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac1
-rw-r--r--xbmc/interfaces/builtins/AndroidBuiltins.cpp44
-rw-r--r--xbmc/interfaces/builtins/AndroidBuiltins.h30
-rw-r--r--xbmc/interfaces/builtins/Builtins.cpp11
-rw-r--r--xbmc/interfaces/builtins/Makefile.in (renamed from xbmc/interfaces/builtins/Makefile)4
5 files changed, 87 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 9aa736677d..a861ce9378 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2380,6 +2380,7 @@ OUTPUT_FILES="Makefile \
xbmc/guilib/Makefile \
xbmc/input/linux/Makefile \
xbmc/interfaces/Makefile \
+ xbmc/interfaces/builtins/Makefile \
xbmc/network/Makefile \
xbmc/network/upnp/Makefile \
lib/libexif/Makefile \
diff --git a/xbmc/interfaces/builtins/AndroidBuiltins.cpp b/xbmc/interfaces/builtins/AndroidBuiltins.cpp
new file mode 100644
index 0000000000..007d60ce65
--- /dev/null
+++ b/xbmc/interfaces/builtins/AndroidBuiltins.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2005-2015 Team XBMC
+ * http://xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "AndroidBuiltins.h"
+
+#include "ApplicationMessenger.h"
+
+/*! \brief Launch an android system activity.
+ * \param params The parameters.
+ * \details params[0] = package
+ * params[1] = intent (optional)
+ * params[2] = datatype (optional)
+ * params[2] = dataURI (optional)
+ */
+static int LaunchAndroidActivity(const std::vector<std::string>& params)
+{
+ CApplicationMessenger::Get().StartAndroidActivity(params);
+
+ return 0;
+}
+
+CBuiltins::CommandMap CAndroidBuiltins::GetOperations() const
+{
+ return {
+ {"startandroidactivity", {"Launch an Android native app with the given package name. Optional parms (in order): intent, dataType, dataURI.", 1, LaunchAndroidActivity}}
+ };
+}
diff --git a/xbmc/interfaces/builtins/AndroidBuiltins.h b/xbmc/interfaces/builtins/AndroidBuiltins.h
new file mode 100644
index 0000000000..166e561df3
--- /dev/null
+++ b/xbmc/interfaces/builtins/AndroidBuiltins.h
@@ -0,0 +1,30 @@
+#pragma once
+/*
+ * Copyright (C) 2005-2015 Team XBMC
+ * http://xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "Builtins.h"
+
+//! \brief Class providing CEC related built-in commands.
+class CAndroidBuiltins
+{
+public:
+ //! \brief Returns the map of operations.
+ CBuiltins::CommandMap GetOperations() const;
+};
diff --git a/xbmc/interfaces/builtins/Builtins.cpp b/xbmc/interfaces/builtins/Builtins.cpp
index 2657c0c4dd..feac617ee6 100644
--- a/xbmc/interfaces/builtins/Builtins.cpp
+++ b/xbmc/interfaces/builtins/Builtins.cpp
@@ -125,6 +125,10 @@
#include "SystemBuiltins.h"
#include "WeatherBuiltins.h"
+#if defined(TARGET_ANDROID)
+#include "AndroidBuiltins.h"
+#endif
+
using namespace XFILE;
using namespace ADDON;
using namespace KODI::MESSAGING;
@@ -144,9 +148,6 @@ typedef struct
const BUILT_IN commands[] = {
{ "Help", false, "This help message" },
-#if defined(TARGET_ANDROID)
- { "StartAndroidActivity", true, "Launch an Android native app with the given package name. Optional parms (in order): intent, dataType, dataURI." },
-#endif
};
CBuiltins::CBuiltins()
@@ -165,6 +166,10 @@ CBuiltins::CBuiltins()
RegisterCommands<CSkinBuiltins>();
RegisterCommands<CSystemBuiltins>();
RegisterCommands<CWeatherBuiltins>();
+
+#if defined(TARGET_ANDROID)
+ RegisterCommands<CAndroidBuiltins>();
+#endif
}
CBuiltins::~CBuiltins()
diff --git a/xbmc/interfaces/builtins/Makefile b/xbmc/interfaces/builtins/Makefile.in
index bb1366b590..ae0b40c3af 100644
--- a/xbmc/interfaces/builtins/Makefile
+++ b/xbmc/interfaces/builtins/Makefile.in
@@ -15,6 +15,10 @@ SRCS += SkinBuiltins.cpp
SRCS += SystemBuiltins.cpp
SRCS += WeatherBuiltins.cpp
+ifeq (@USE_ANDROID@,1)
+SRCS += AndroidBuiltins.cpp
+endif
+
LIB=builtins.a
include ../../../Makefile.include