Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

jni: consmetic refactor to consistent appearance

  • Loading branch information...
commit f8b366e8c491d83b0dc42200186976f59e1bcc7d 1 parent 66e86e6
@davilla davilla authored
Showing with 814 additions and 403 deletions.
  1. +7 −6 xbmc/android/jni/ApplicationInfo.cpp
  2. +5 −3 xbmc/android/jni/ApplicationInfo.h
  3. +8 −3 xbmc/android/jni/AudioManager.cpp
  4. +6 −3 xbmc/android/jni/AudioManager.h
  5. +2 −1  xbmc/android/jni/BaseColumns.cpp
  6. +5 −1 xbmc/android/jni/BaseColumns.h
  7. +66 −25 xbmc/android/jni/BitSet.cpp
  8. +9 −8 xbmc/android/jni/BitSet.h
  9. +3 −3 xbmc/android/jni/Bitmap.h
  10. +3 −1 xbmc/android/jni/BitmapDrawable.cpp
  11. +7 −3 xbmc/android/jni/BitmapDrawable.h
  12. +6 −3 xbmc/android/jni/BroadcastReceiver.h
  13. +4 −1 xbmc/android/jni/CharSequence.cpp
  14. +5 −2 xbmc/android/jni/CharSequence.h
  15. +5 −1 xbmc/android/jni/ClassLoader.cpp
  16. +5 −2 xbmc/android/jni/ClassLoader.h
  17. +40 −22 xbmc/android/jni/ConnectivityManager.cpp
  18. +9 −5 xbmc/android/jni/ConnectivityManager.h
  19. +11 −9 xbmc/android/jni/ContentResolver.cpp
  20. +6 −4 xbmc/android/jni/ContentResolver.h
  21. +53 −19 xbmc/android/jni/Context.cpp
  22. +7 −1 xbmc/android/jni/Context.h
  23. +73 −33 xbmc/android/jni/Cursor.cpp
  24. +13 −8 xbmc/android/jni/Cursor.h
  25. +12 −9 xbmc/android/jni/DhcpInfo.cpp
  26. +5 −5 xbmc/android/jni/DhcpInfo.h
  27. +2 −1  xbmc/android/jni/Drawable.h
  28. +7 −3 xbmc/android/jni/Enum.cpp
  29. +5 −2 xbmc/android/jni/Enum.h
  30. +8 −3 xbmc/android/jni/Environment.cpp
  31. +6 −3 xbmc/android/jni/Environment.h
  32. +4 −1 xbmc/android/jni/File.cpp
  33. +2 −1  xbmc/android/jni/File.h
  34. +50 −18 xbmc/android/jni/Intent.cpp
  35. +4 −3 xbmc/android/jni/Intent.h
  36. +10 −3 xbmc/android/jni/IntentFilter.cpp
  37. +4 −3 xbmc/android/jni/IntentFilter.h
  38. +3 −0  xbmc/android/jni/JNIBase.cpp
  39. +1 −0  xbmc/android/jni/JNIBase.h
  40. +6 −2 xbmc/android/jni/List.cpp
  41. +5 −2 xbmc/android/jni/List.h
  42. +8 −6 xbmc/android/jni/MediaStore.cpp
  43. +7 −3 xbmc/android/jni/MediaStore.h
  44. +31 −15 xbmc/android/jni/NetworkInfo.cpp
  45. +19 −16 xbmc/android/jni/NetworkInfo.h
  46. +14 −5 xbmc/android/jni/PackageManager.cpp
  47. +9 −6 xbmc/android/jni/PackageManager.h
  48. +12 −6 xbmc/android/jni/PowerManager.cpp
  49. +10 −6 xbmc/android/jni/PowerManager.h
  50. +9 −6 xbmc/android/jni/ScanResult.cpp
  51. +7 −4 xbmc/android/jni/ScanResult.h
  52. +15 −6 xbmc/android/jni/StatFs.cpp
  53. +9 −7 xbmc/android/jni/StatFs.h
  54. +13 −4 xbmc/android/jni/System.cpp
  55. +6 −5 xbmc/android/jni/System.h
  56. +3 −1 xbmc/android/jni/SystemClock.cpp
  57. +6 −3 xbmc/android/jni/SystemClock.h
  58. +12 −5 xbmc/android/jni/URI.cpp
  59. +8 −5 xbmc/android/jni/URI.h
  60. +5 −2 xbmc/android/jni/WakeLock.cpp
  61. +5 −2 xbmc/android/jni/WakeLock.h
  62. +16 −13 xbmc/android/jni/WifiConfiguration.cpp
  63. +14 −12 xbmc/android/jni/WifiConfiguration.h
  64. +26 −12 xbmc/android/jni/WifiInfo.cpp
  65. +12 −8 xbmc/android/jni/WifiInfo.h
  66. +37 −18 xbmc/android/jni/WifiManager.cpp
  67. +6 −1 xbmc/android/jni/WifiManager.h
  68. +3 −0  xbmc/android/jni/jutils.cpp
View
13 xbmc/android/jni/ApplicationInfo.cpp
@@ -17,19 +17,20 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "ApplicationInfo.h"
#include "jutils/jutils-details.hpp"
using namespace jni;
CJNIApplicationInfo::CJNIApplicationInfo(const jhobject &object) : CJNIBase(object)
- ,sourceDir(jcast<std::string>(get_field<jhstring>(m_object, "sourceDir")))
- ,publicSourceDir(jcast<std::string>(get_field<jhstring>(m_object, "publicSourceDir")))
- ,dataDir(jcast<std::string>(get_field<jhstring>(m_object, "dataDir")))
+ ,sourceDir( jcast<std::string>(get_field<jhstring>(m_object, "sourceDir")))
+ ,publicSourceDir( jcast<std::string>(get_field<jhstring>(m_object, "publicSourceDir")))
+ ,dataDir( jcast<std::string>(get_field<jhstring>(m_object, "dataDir")))
,nativeLibraryDir(jcast<std::string>(get_field<jhstring>(m_object, "nativeLibraryDir")))
- ,packageName(jcast<std::string>(get_field<jhstring>(m_object, "packageName")))
- ,uid(get_field<int>(m_object, "uid"))
+ ,packageName( jcast<std::string>(get_field<jhstring>(m_object, "packageName")))
+ ,uid( get_field<int>(m_object, "uid"))
,targetSdkVersion(get_field<int>(m_object, "targetSdkVersion"))
- ,enabled(get_field<jboolean>(m_object, "enabled"))
+ ,enabled( get_field<jboolean>(m_object, "enabled"))
{
}
View
8 xbmc/android/jni/ApplicationInfo.h
@@ -18,6 +18,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNIApplicationInfo : public CJNIBase
@@ -31,11 +32,12 @@ class CJNIApplicationInfo : public CJNIBase
std::string dataDir;
std::string nativeLibraryDir;
std::string packageName;
- int uid;
- int targetSdkVersion;
- bool enabled;
+ int uid;
+ int targetSdkVersion;
+ bool enabled;
private:
CJNIApplicationInfo();
};
+
typedef std::vector<CJNIApplicationInfo> CJNIApplicationInfos;
View
11 xbmc/android/jni/AudioManager.cpp
@@ -17,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "AudioManager.h"
#include "jutils/jutils-details.hpp"
@@ -27,15 +28,19 @@ int CJNIAudioManager::STREAM_MUSIC(0);
void CJNIAudioManager::PopulateStaticFields()
{
jhclass clazz = find_class("android/media/AudioManager");
- STREAM_MUSIC = (get_static_field<int>(clazz, "STREAM_MUSIC"));
+ STREAM_MUSIC = (get_static_field<int>(clazz, "STREAM_MUSIC"));
}
int CJNIAudioManager::getStreamMaxVolume()
{
- return call_method<jint>(m_object, "getStreamMaxVolume", "(I)I", STREAM_MUSIC);
+ return call_method<jint>(m_object,
+ "getStreamMaxVolume", "(I)I",
+ STREAM_MUSIC);
}
void CJNIAudioManager::setStreamVolume(int index /* 0 */, int flags /* NONE */)
{
- call_method<void>(m_object, "setStreamVolume", "(III)V", STREAM_MUSIC, index, flags);
+ call_method<void>(m_object,
+ "setStreamVolume", "(III)V",
+ STREAM_MUSIC, index, flags);
}
View
9 xbmc/android/jni/AudioManager.h
@@ -18,20 +18,23 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNIAudioManager : public CJNIBase
{
public:
+ CJNIAudioManager(const jni::jhobject &object) : CJNIBase(object) {};
+ ~CJNIAudioManager() {};
+
// Note removal of streamType param.
- int getStreamMaxVolume();
+ int getStreamMaxVolume();
void setStreamVolume(int index = 0, int flags = 0);
static void PopulateStaticFields();
- ~CJNIAudioManager(){};
- CJNIAudioManager(const jni::jhobject &object) : CJNIBase(object){};
private:
CJNIAudioManager();
+
static int STREAM_MUSIC;
};
View
3  xbmc/android/jni/BaseColumns.cpp
@@ -17,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "BaseColumns.h"
#include "jutils/jutils-details.hpp"
@@ -28,6 +29,6 @@ std::string CJNIBaseColumns::_COUNT;
void CJNIBaseColumns::PopulateStaticFields()
{
jhclass clazz = find_class("android/provider/BaseColumns");
- _ID = (jcast<std::string>(get_static_field<jhstring>(clazz, "_ID")));
+ _ID = (jcast<std::string>(get_static_field<jhstring>(clazz, "_ID")));
_COUNT = (jcast<std::string>(get_static_field<jhstring>(clazz, "_COUNT")));
}
View
6 xbmc/android/jni/BaseColumns.h
@@ -18,13 +18,17 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include <string>
+
class CJNIBaseColumns
{
public:
+ static void PopulateStaticFields();
+
static std::string _ID;
static std::string _COUNT;
- static void PopulateStaticFields();
+
private:
CJNIBaseColumns();
};
View
91 xbmc/android/jni/BitSet.cpp
@@ -17,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "BitSet.h"
#include "jutils/jutils-details.hpp"
@@ -29,17 +30,23 @@ CJNIBitSet::CJNIBitSet() : CJNIBase("java.util.BitSet")
CJNIBitSet::CJNIBitSet(int bitCount) : CJNIBase("java.util.BitSet")
{
- m_object = new_object(GetClassName(), "<init>", "(I)V", (jint)bitCount);
+ m_object = new_object(GetClassName(),
+ "<init>", "(I)V",
+ (jint)bitCount);
}
void CJNIBitSet::flip(int index)
{
- call_method<void>(m_object, "flip", "(I)V", index);
+ call_method<void>(m_object,
+ "flip", "(I)V",
+ index);
}
void CJNIBitSet::flip(int fromIndex, int toIndex)
{
- call_method<void>(m_object, "flip", "(II)V", fromIndex, toIndex);
+ call_method<void>(m_object,
+ "flip", "(II)V",
+ fromIndex, toIndex);
}
void CJNIBitSet::set(int index)
@@ -49,106 +56,140 @@ void CJNIBitSet::set(int index)
void CJNIBitSet::set(int fromIndex, bool state)
{
- call_method<void>(m_object, "fromIndex", "(IZ)V", fromIndex, state);
+ call_method<void>(m_object,
+ "fromIndex", "(IZ)V",
+ fromIndex, state);
}
void CJNIBitSet::set(int fromIndex, int toIndex)
{
- call_method<void>(m_object, "set", "(II)V", fromIndex, toIndex);
+ call_method<void>(m_object,
+ "set", "(II)V",
+ fromIndex, toIndex);
}
void CJNIBitSet::set(int fromIndex, int toIndex, bool state)
{
- call_method<void>(m_object, "set", "(IIZ)V", fromIndex, toIndex, state);
+ call_method<void>(m_object,
+ "set", "(IIZ)V",
+ fromIndex, toIndex, state);
}
void CJNIBitSet::clear(int index)
{
- call_method<void>(m_object, "clear", "(I)V", index);
+ call_method<void>(m_object,
+ "clear", "(I)V",
+ index);
}
void CJNIBitSet::clear(int fromIndex, int toIndex)
{
- call_method<void>(m_object, "clear", "(II)V", fromIndex, toIndex);
+ call_method<void>(m_object,
+ "clear", "(II)V",
+ fromIndex, toIndex);
}
void CJNIBitSet::clear()
{
- call_method<void>(m_object, "clear", "()V");
+ call_method<void>(m_object,
+ "clear", "()V");
}
bool CJNIBitSet::get(int index)
{
- return call_method<jboolean>(m_object, "get", "(I)V", index);
+ return call_method<jboolean>(m_object,
+ "get", "(I)V",
+ index);
}
CJNIBitSet CJNIBitSet::get(int fromIndex, int toIndex)
{
- return call_method<jhobject>(m_object, "get", "(II)V", fromIndex, toIndex);
+ return call_method<jhobject>(m_object,
+ "get", "(II)V",
+ fromIndex, toIndex);
}
int CJNIBitSet::nextSetBit(int index)
{
- return call_method<jint>(m_object, "nextSetBit", "(I)I", index);
+ return call_method<jint>(m_object,
+ "nextSetBit", "(I)I",
+ index);
}
int CJNIBitSet::nextClearBit(int index)
{
- return call_method<jint>(m_object, "nextClearBit", "(I)I", index);
+ return call_method<jint>(m_object,
+ "nextClearBit", "(I)I",
+ index);
}
int CJNIBitSet::length()
{
- return call_method<jint>(m_object, "length", "()I");
+ return call_method<jint>(m_object,
+ "length", "()I");
}
bool CJNIBitSet::isEmpty()
{
- return call_method<jboolean>(m_object, "isEmpty", "()Z");
+ return call_method<jboolean>(m_object,
+ "isEmpty", "()Z");
}
bool CJNIBitSet::intersects(const CJNIBitSet &bs)
{
- return call_method<jboolean>(m_object, "intersects", "(Ljava/util/BitSet;)Z", bs.get_raw());
+ return call_method<jboolean>(m_object,
+ "intersects", "(Ljava/util/BitSet;)Z",
+ bs.get_raw());
}
int CJNIBitSet::cardinality()
{
- return call_method<jint>(m_object, "cardinality", "()I");
+ return call_method<jint>(m_object,
+ "cardinality", "()I");
}
void CJNIBitSet::jand(const CJNIBitSet &bs)
{
- call_method<void>(m_object, "jand", "(Ljava/util/BitSet;)V", bs.get_raw());
+ call_method<void>(m_object,
+ "jand", "(Ljava/util/BitSet;)V",
+ bs.get_raw());
}
void CJNIBitSet::jor(const CJNIBitSet &bs)
{
- call_method<void>(m_object, "jor", "(Ljava/util/BitSet;)V", bs.get_raw());
+ call_method<void>(m_object,
+ "jor", "(Ljava/util/BitSet;)V",
+ bs.get_raw());
}
void CJNIBitSet::jxor(const CJNIBitSet &bs)
{
- call_method<void>(m_object, "jxor", "(Ljava/util/BitSet;)V", bs.get_raw());
+ call_method<void>(m_object,
+ "jxor", "(Ljava/util/BitSet;)V",
+ bs.get_raw());
}
void CJNIBitSet::jandNot(const CJNIBitSet &bs)
{
- call_method<void>(m_object, "jandNot", "(Ljava/util/BitSet;)V", bs.get_raw());
+ call_method<void>(m_object,
+ "jandNot", "(Ljava/util/BitSet;)V",
+ bs.get_raw());
}
int CJNIBitSet::hashCode()
{
- return call_method<jint>(m_object, "hashCode", "()I");
+ return call_method<jint>(m_object,
+ "hashCode", "()I");
}
int CJNIBitSet::size()
{
- return call_method<jint>(m_object, "size", "()I");
+ return call_method<jint>(m_object,
+ "size", "()I");
}
std::string CJNIBitSet::toString()
{
- return jcast<std::string>(call_method<jhstring>(m_object, "toString", "()Ljava/lang/String;"));
+ return jcast<std::string>(call_method<jhstring>(m_object,
+ "toString", "()Ljava/lang/String;"));
}
-
View
17 xbmc/android/jni/BitSet.h
@@ -18,15 +18,16 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNIBitSet : public CJNIBase
{
public:
- ~CJNIBitSet(){};
- CJNIBitSet(const jni::jhobject &object) : CJNIBase(object){};
CJNIBitSet();
CJNIBitSet(int);
+ CJNIBitSet(const jni::jhobject &object) : CJNIBase(object) {};
+ ~CJNIBitSet() {};
void flip(int);
void flip(int, int);
@@ -39,17 +40,17 @@ class CJNIBitSet : public CJNIBase
void clear();
bool get(int);
CJNIBitSet get(int, int);
- int nextSetBit(int);
- int nextClearBit(int);
- int length();
+ int nextSetBit(int);
+ int nextClearBit(int);
+ int length();
bool isEmpty();
bool intersects(const CJNIBitSet &);
- int cardinality();
+ int cardinality();
void jand(const CJNIBitSet &);
void jor(const CJNIBitSet &);
void jxor(const CJNIBitSet &);
void jandNot(const CJNIBitSet &);
- int hashCode();
- int size();
+ int hashCode();
+ int size();
std::string toString();
};
View
6 xbmc/android/jni/Bitmap.h
@@ -18,13 +18,13 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNIBitmap : public CJNIBase
{
public:
CJNIBitmap();
- ~CJNIBitmap(){};
- CJNIBitmap(const jni::jhobject &object) : CJNIBase(object){};
-
+ CJNIBitmap(const jni::jhobject &object) : CJNIBase(object) {};
+ ~CJNIBitmap() {};
};
View
4 xbmc/android/jni/BitmapDrawable.cpp
@@ -17,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "BitmapDrawable.h"
#include "Bitmap.h"
#include "jutils/jutils-details.hpp"
@@ -31,5 +32,6 @@ CJNIBitmapDrawable::CJNIBitmapDrawable() : CJNIDrawable("android/graphics/drawab
CJNIBitmap CJNIBitmapDrawable::getBitmap()
{
- return (CJNIBitmap)call_method<jhobject>(m_object, "getBitmap", "()Landroid/graphics/Bitmap;");
+ return call_method<jhobject>(m_object,
+ "getBitmap", "()Landroid/graphics/Bitmap;");
}
View
10 xbmc/android/jni/BitmapDrawable.h
@@ -18,14 +18,18 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "Drawable.h"
+
class CJNIBitmap;
+
class CJNIBitmapDrawable : public CJNIDrawable
{
public:
CJNIBitmapDrawable();
- CJNIBitmapDrawable(const jni::jhobject &object) : CJNIDrawable(object){};
- CJNIBitmapDrawable(const CJNIDrawable &drawable) : CJNIDrawable(drawable.get_raw()){};
+ CJNIBitmapDrawable(const jni::jhobject &object) : CJNIDrawable(object) {};
+ CJNIBitmapDrawable(const CJNIDrawable &drawable) : CJNIDrawable(drawable.get_raw()) {};
+ ~CJNIBitmapDrawable() {};
+
CJNIBitmap getBitmap();
- ~CJNIBitmapDrawable(){};
};
View
9 xbmc/android/jni/BroadcastReceiver.h
@@ -18,18 +18,21 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNIIntent;
+
class CJNIBroadcastReceiver : public CJNIBase
{
public:
static void _onReceive(JNIEnv *env, jobject context, jobject intent);
protected:
- virtual void onReceive(CJNIIntent intent)=0;
- ~CJNIBroadcastReceiver(){};
CJNIBroadcastReceiver(const std::string &className);
+ ~CJNIBroadcastReceiver(){};
+
+ virtual void onReceive(CJNIIntent intent)=0;
private:
- static CJNIBroadcastReceiver* m_receiverInstance;
+ static CJNIBroadcastReceiver *m_receiverInstance;
};
View
5 xbmc/android/jni/CharSequence.cpp
@@ -17,11 +17,14 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "CharSequence.h"
#include "jutils/jutils-details.hpp"
+
using namespace jni;
std::string CJNICharSequence::toString()
{
- return jcast<std::string>(call_method<jhstring>(m_object, "toString", "()Ljava/lang/String;"));
+ return jcast<std::string>(call_method<jhstring>(m_object,
+ "toString", "()Ljava/lang/String;"));
}
View
7 xbmc/android/jni/CharSequence.h
@@ -18,14 +18,17 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNICharSequence : public CJNIBase
{
public:
- ~CJNICharSequence(){};
- CJNICharSequence(const jni::jhobject &object) : CJNIBase(object){};
+ CJNICharSequence(const jni::jhobject &object) : CJNIBase(object) {};
+ ~CJNICharSequence() {};
+
std::string toString();
+
private:
CJNICharSequence();
};
View
6 xbmc/android/jni/ClassLoader.cpp
@@ -17,11 +17,15 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "ClassLoader.h"
#include "jutils/jutils-details.hpp"
+
using namespace jni;
jhclass CJNIClassLoader::loadClass(std::string className)
{
- return (jhclass)call_method<jhclass>(m_object, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;", jcast<jhstring>(className));
+ return call_method<jhclass>(m_object,
+ "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;",
+ jcast<jhstring>(className));
}
View
7 xbmc/android/jni/ClassLoader.h
@@ -18,14 +18,17 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNIClassLoader : public CJNIBase
{
public:
- ~CJNIClassLoader(){};
+ CJNIClassLoader(const jni::jhobject &object) : CJNIBase(object) {};
+ ~CJNIClassLoader() {};
+
jni::jhclass loadClass(std::string className);
- CJNIClassLoader(const jni::jhobject &object) : CJNIBase(object){};
+
private:
CJNIClassLoader();
};
View
62 xbmc/android/jni/ConnectivityManager.cpp
@@ -17,10 +17,13 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "ConnectivityManager.h"
#include "NetworkInfo.h"
#include "jutils/jutils-details.hpp"
+using namespace jni;
+
int CJNIConnectivityManager::TYPE_MOBILE(0);
int CJNIConnectivityManager::TYPE_WIFI(0);
int CJNIConnectivityManager::TYPE_MOBILE_MMS(0);
@@ -32,81 +35,96 @@ int CJNIConnectivityManager::TYPE_BLUETOOTH(0);
int CJNIConnectivityManager::TYPE_DUMMY(0);
int CJNIConnectivityManager::TYPE_ETHERNET(0);
int CJNIConnectivityManager::DEFAULT_NETWORK_PREFERENCE(0);
-using namespace jni;
void CJNIConnectivityManager::PopulateStaticFields()
{
jhclass clazz = find_class("android.net.ConnectivityManager");
- TYPE_MOBILE = (get_static_field<int>(clazz, "TYPE_MOBILE"));
- TYPE_WIFI = (get_static_field<int>(clazz, "TYPE_WIFI"));
- TYPE_MOBILE_MMS = (get_static_field<int>(clazz, "TYPE_MOBILE_MMS"));
- TYPE_MOBILE_SUPL = (get_static_field<int>(clazz, "TYPE_MOBILE_SUPL"));
- TYPE_MOBILE_DUN = (get_static_field<int>(clazz, "TYPE_MOBILE_DUN"));
+ TYPE_MOBILE = (get_static_field<int>(clazz, "TYPE_MOBILE"));
+ TYPE_WIFI = (get_static_field<int>(clazz, "TYPE_WIFI"));
+ TYPE_MOBILE_MMS = (get_static_field<int>(clazz, "TYPE_MOBILE_MMS"));
+ TYPE_MOBILE_SUPL = (get_static_field<int>(clazz, "TYPE_MOBILE_SUPL"));
+ TYPE_MOBILE_DUN = (get_static_field<int>(clazz, "TYPE_MOBILE_DUN"));
TYPE_MOBILE_HIPRI = (get_static_field<int>(clazz, "TYPE_MOBILE_HIPRI"));
- TYPE_WIMAX = (get_static_field<int>(clazz, "TYPE_WIMAX"));
- TYPE_BLUETOOTH = (get_static_field<int>(clazz, "TYPE_BLUETOOTH"));
- TYPE_DUMMY = (get_static_field<int>(clazz, "TYPE_DUMMY"));
- TYPE_ETHERNET = (get_static_field<int>(clazz, "TYPE_ETHERNET"));
+ TYPE_WIMAX = (get_static_field<int>(clazz, "TYPE_WIMAX"));
+ TYPE_BLUETOOTH = (get_static_field<int>(clazz, "TYPE_BLUETOOTH"));
+ TYPE_DUMMY = (get_static_field<int>(clazz, "TYPE_DUMMY"));
+ TYPE_ETHERNET = (get_static_field<int>(clazz, "TYPE_ETHERNET"));
DEFAULT_NETWORK_PREFERENCE = (get_static_field<int>(clazz, "DEFAULT_NETWORK_PREFERENCE"));
}
bool CJNIConnectivityManager::isNetworkTypeValid(int networkType)
{
- return call_method<jboolean>(m_object, "isNetworkTypeValid", "(I)Z", networkType);
+ return call_method<jboolean>(m_object,
+ "isNetworkTypeValid", "(I)Z",
+ networkType);
}
void CJNIConnectivityManager::setNetworkPreference(int preference)
{
- return call_method<void>(m_object, "setNetworkPreference", "(I)V", preference);
+ return call_method<void>(m_object,
+ "setNetworkPreference", "(I)V",
+ preference);
}
int CJNIConnectivityManager::getNetworkPreference()
{
- return call_method<jint>(m_object, "getNetworkPreference", "()I");
+ return call_method<jint>(m_object,
+ "getNetworkPreference", "()I");
}
CJNINetworkInfo CJNIConnectivityManager::getActiveNetworkInfo()
{
- return (CJNINetworkInfo)call_method<jhobject>(m_object, "getActiveNetworkInfo", "()Landroid/net/NetworkInfo;");
+ return call_method<jhobject>(m_object,
+ "getActiveNetworkInfo", "()Landroid/net/NetworkInfo;");
}
CJNINetworkInfo CJNIConnectivityManager::getNetworkInfo(int networkType)
{
- return (CJNINetworkInfo)call_method<jhobject>(m_object, "getNetworkInfo", "(I)Landroid/net/NetworkInfo;", networkType);
+ return call_method<jhobject>(m_object,
+ "getNetworkInfo", "(I)Landroid/net/NetworkInfo;",
+ networkType);
}
std::vector<CJNINetworkInfo> CJNIConnectivityManager::getAllNetworkInfo()
{
JNIEnv *env = xbmc_jnienv();
- jhobjectArray oNetworks = call_method<jhobjectArray>(m_object, "getAllNetworkInfo", "()[Landroid/net/NetworkInfo;");
+
+ jhobjectArray oNetworks = call_method<jhobjectArray>(m_object,
+ "getAllNetworkInfo", "()[Landroid/net/NetworkInfo;");
jsize size = env->GetArrayLength(oNetworks.get());
std::vector<CJNINetworkInfo> networks;
networks.reserve(size);
for(int i = 0; i < size; i++)
- {
networks.push_back(CJNINetworkInfo(jhobject(env->GetObjectArrayElement(oNetworks.get(), i))));
- }
+
return networks;
}
int CJNIConnectivityManager::startUsingNetworkFeature(int networkType, std::string feature)
{
- return call_method<jint>(m_object, "startUsingNetworkFeature", "(ILjava/lang/String;)I", networkType, jcast<jhstring>(feature));
+ return call_method<jint>(m_object,
+ "startUsingNetworkFeature", "(ILjava/lang/String;)I",
+ networkType, jcast<jhstring>(feature));
}
int CJNIConnectivityManager::stopUsingNetworkFeature(int networkType, std::string feature)
{
- return call_method<jint>(m_object, "stopUsingNetworkFeature", "(ILjava/lang/String;)I", networkType, jcast<jhstring>(feature));
+ return call_method<jint>(m_object,
+ "stopUsingNetworkFeature", "(ILjava/lang/String;)I",
+ networkType, jcast<jhstring>(feature));
}
bool CJNIConnectivityManager::requestRouteToHost(int networkType, int hostAddress)
{
- return call_method<jboolean>(m_object, "requestRouteToHost", "(II)Z", networkType, hostAddress);
+ return call_method<jboolean>(m_object,
+ "requestRouteToHost", "(II)Z",
+ networkType, hostAddress);
}
bool CJNIConnectivityManager::getBackgroundDataSetting()
{
- return call_method<jboolean>(m_object, "getBackgroundDataSetting", "()Z");
+ return call_method<jboolean>(m_object,
+ "getBackgroundDataSetting", "()Z");
}
View
14 xbmc/android/jni/ConnectivityManager.h
@@ -18,24 +18,28 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNINetworkInfo;
+
class CJNIConnectivityManager : public CJNIBase
{
public:
- CJNIConnectivityManager(const jni::jhobject &object) : CJNIBase(object){};
+ CJNIConnectivityManager(const jni::jhobject &object) : CJNIBase(object) {};
+
bool isNetworkTypeValid(int);
void setNetworkPreference(int);
- int getNetworkPreference();
+ int getNetworkPreference();
CJNINetworkInfo getActiveNetworkInfo();
CJNINetworkInfo getNetworkInfo(int);
std::vector<CJNINetworkInfo> getAllNetworkInfo();
- int startUsingNetworkFeature(int, std::string);
- int stopUsingNetworkFeature(int, std::string);
+ int startUsingNetworkFeature(int, std::string);
+ int stopUsingNetworkFeature(int, std::string);
bool requestRouteToHost(int, int);
bool getBackgroundDataSetting();
+ static void PopulateStaticFields();
static int TYPE_MOBILE;
static int TYPE_WIFI;
static int TYPE_MOBILE_MMS;
@@ -48,7 +52,7 @@ class CJNIConnectivityManager : public CJNIBase
static int TYPE_ETHERNET;
static int DEFAULT_NETWORK_PREFERENCE;
- static void PopulateStaticFields();
+
private:
CJNIConnectivityManager();
};
View
20 xbmc/android/jni/ContentResolver.cpp
@@ -17,31 +17,33 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "ContentResolver.h"
#include "Cursor.h"
#include "jutils/jutils-details.hpp"
#include "URI.h"
+
+using namespace jni;
+
std::string CJNIContentResolver::SCHEME_CONTENT;
std::string CJNIContentResolver::SCHEME_ANDROID_RESOURCE;
std::string CJNIContentResolver::SCHEME_FILE;
std::string CJNIContentResolver::CURSOR_ITEM_BASE_TYPE;
std::string CJNIContentResolver::CURSOR_DIR_BASE_TYPE;
-using namespace jni;
void CJNIContentResolver::PopulateStaticFields()
{
jhclass clazz = find_class("android/content/ContentResolver");
- SCHEME_CONTENT = jcast<std::string>(get_static_field<jhstring>(clazz,"SCHEME_CONTENT"));
+ SCHEME_CONTENT = jcast<std::string>(get_static_field<jhstring>(clazz,"SCHEME_CONTENT"));
SCHEME_ANDROID_RESOURCE = jcast<std::string>(get_static_field<jhstring>(clazz,"SCHEME_ANDROID_RESOURCE"));
- SCHEME_FILE = jcast<std::string>(get_static_field<jhstring>(clazz,"SCHEME_FILE"));
- CURSOR_ITEM_BASE_TYPE = jcast<std::string>(get_static_field<jhstring>(clazz,"CURSOR_ITEM_BASE_TYPE"));
- CURSOR_DIR_BASE_TYPE = jcast<std::string>(get_static_field<jhstring>(clazz,"CURSOR_DIR_BASE_TYPE"));
+ SCHEME_FILE = jcast<std::string>(get_static_field<jhstring>(clazz,"SCHEME_FILE"));
+ CURSOR_ITEM_BASE_TYPE = jcast<std::string>(get_static_field<jhstring>(clazz,"CURSOR_ITEM_BASE_TYPE"));
+ CURSOR_DIR_BASE_TYPE = jcast<std::string>(get_static_field<jhstring>(clazz,"CURSOR_DIR_BASE_TYPE"));
}
CJNICursor CJNIContentResolver::query(const CJNIURI &uri, const std::vector<std::string> &projection, const std::string &selection, const std::vector<std::string> &selectionArgs, const std::string &sortOrder)
{
-
- return (CJNICursor)(call_method<jhobject>(m_object, \
- "query","(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;", \
- uri.get_raw(), jcast<jhobjectArray>(projection), jcast<jhstring>(selection), jcast<jhobjectArray>(selectionArgs), jcast<jhstring>(sortOrder)));
+ return (CJNICursor)(call_method<jhobject>(m_object,
+ "query","(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;",
+ uri.get_raw(), jcast<jhobjectArray>(projection), jcast<jhstring>(selection), jcast<jhobjectArray>(selectionArgs), jcast<jhstring>(sortOrder)));
}
View
10 xbmc/android/jni/ContentResolver.h
@@ -18,24 +18,26 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNICursor;
class CJNIURI;
+
class CJNIContentResolver : public CJNIBase
{
public:
- CJNIContentResolver(const jni::jhobject &object) : CJNIBase(object){};
+ CJNIContentResolver(const jni::jhobject &object) : CJNIBase(object) {};
+
+ CJNICursor query(const CJNIURI &uri, const std::vector<std::string> &projection, const std::string &selection, const std::vector<std::string> &selectionArgs, const std::string &sortOrder);
+ static void PopulateStaticFields();
static std::string SCHEME_CONTENT;
static std::string SCHEME_ANDROID_RESOURCE;
static std::string SCHEME_FILE;
static std::string CURSOR_ITEM_BASE_TYPE;
static std::string CURSOR_DIR_BASE_TYPE;
- CJNICursor query(const CJNIURI &uri, const std::vector<std::string> &projection, const std::string &selection, const std::vector<std::string> &selectionArgs, const std::string &sortOrder);
-
- static void PopulateStaticFields();
private:
CJNIContentResolver();
};
View
72 xbmc/android/jni/Context.cpp
@@ -17,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "Context.h"
#include "PackageManager.h"
#include <android/log.h>
@@ -35,12 +36,18 @@
#include "Cursor.h"
#include "ConnectivityManager.h"
#include "AudioManager.h"
+#include "Surface.h"
+#include "MediaCodec.h"
+#include "MediaCodecInfo.h"
+#include "MediaFormat.h"
+
#include <android/native_activity.h>
using namespace jni;
jhobject CJNIContext::m_context(0);
CJNIContext* CJNIContext::m_appInstance(NULL);
+
CJNIContext::CJNIContext(const ANativeActivity *nativeActivity)
{
m_context.reset(nativeActivity->clazz);
@@ -67,89 +74,116 @@ void CJNIContext::PopulateStaticFields()
CJNIContentResolver::PopulateStaticFields();
CJNIConnectivityManager::PopulateStaticFields();
CJNIAudioManager::PopulateStaticFields();
-
+ CJNISurface::PopulateStaticFields();
+ CJNIMediaCodec::PopulateStaticFields();
+ CJNIMediaCodecInfoCodecProfileLevel::PopulateStaticFields();
+ CJNIMediaCodecInfoCodecCapabilities::PopulateStaticFields();
+ CJNIMediaFormat::PopulateStaticFields();
}
CJNIPackageManager CJNIContext::GetPackageManager()
{
- return (CJNIPackageManager)call_method<jhobject>(m_context, "getPackageManager", "()Landroid/content/pm/PackageManager;");
+ return call_method<jhobject>(m_context,
+ "getPackageManager", "()Landroid/content/pm/PackageManager;");
}
void CJNIContext::startActivity(const CJNIIntent &intent)
{
- call_method<void>(jhobject(m_context), "startActivity", "(Landroid/content/Intent;)V", intent.get_raw());
+ call_method<void>(jhobject(m_context),
+ "startActivity", "(Landroid/content/Intent;)V",
+ intent.get_raw());
}
int CJNIContext::checkCallingOrSelfPermission(const std::string &permission)
{
- return call_method<int>(m_context, "checkCallingOrSelfPermission", "(Ljava/lang/String;)I", jcast<jhstring>(permission));
+ return call_method<int>(m_context,
+ "checkCallingOrSelfPermission", "(Ljava/lang/String;)I",
+ jcast<jhstring>(permission));
}
jhobject CJNIContext::getSystemService(const std::string &service)
{
- return call_method<jhobject>(m_context, "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;", jcast<jhstring>(service));
+ return call_method<jhobject>(m_context,
+ "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;",
+ jcast<jhstring>(service));
}
CJNIIntent CJNIContext::registerReceiver(const CJNIBroadcastReceiver &receiver, const CJNIIntentFilter &filter)
{
- return (CJNIIntent)call_method<jhobject>(m_context, "registerReceiver", \
- "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;", receiver.get_raw(), filter.get_raw());
+ return call_method<jhobject>(m_context,
+ "registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;",
+ receiver.get_raw(), filter.get_raw());
}
CJNIIntent CJNIContext::registerReceiver(const CJNIIntentFilter &filter)
{
- return (CJNIIntent)call_method<jhobject>(m_context, "registerReceiver", \
- "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;", (jobject)NULL, filter.get_raw());
+ return call_method<jhobject>(m_context,
+ "registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;",
+ (jobject)NULL, filter.get_raw());
}
void CJNIContext::unregisterReceiver(const CJNIBroadcastReceiver &receiver)
{
- call_method<void>(m_context, "unregisterReceiver", "(Landroid/content/BroadcastReceiver;)V", receiver.get_raw());
+ call_method<void>(m_context,
+ "unregisterReceiver", "(Landroid/content/BroadcastReceiver;)V",
+ receiver.get_raw());
}
CJNIIntent CJNIContext::sendBroadcast(const CJNIIntent &intent)
{
- return (CJNIIntent)call_method<jhobject>(m_context, "sendBroadcast", "(Landroid/content/Intent;)V", intent.get_raw());
+ return call_method<jhobject>(m_context,
+ "sendBroadcast", "(Landroid/content/Intent;)V",
+ intent.get_raw());
}
CJNIIntent CJNIContext::getIntent()
{
- return (CJNIIntent)call_method<jhobject>(m_context, "getIntent", "()Landroid/content/Intent;");
+ return call_method<jhobject>(m_context,
+ "getIntent", "()Landroid/content/Intent;");
}
CJNIClassLoader CJNIContext::getClassLoader()
{
- return (CJNIClassLoader)call_method<jhobject>(m_context, "getClassLoader", "()Ljava/lang/ClassLoader;");
+ return call_method<jhobject>(m_context,
+ "getClassLoader", "()Ljava/lang/ClassLoader;");
}
CJNIApplicationInfo CJNIContext::getApplicationInfo()
{
- return (CJNIApplicationInfo)call_method<jhobject>(m_context, "getApplicationInfo", "()Landroid/content/pm/ApplicationInfo;");
+ return call_method<jhobject>(m_context,
+ "getApplicationInfo", "()Landroid/content/pm/ApplicationInfo;");
}
std::string CJNIContext::getPackageResourcePath()
{
- return jcast<std::string>(call_method<jhstring>(m_context, "getPackageResourcePath", "()Ljava/lang/String;"));
+ return jcast<std::string>(call_method<jhstring>(m_context,
+ "getPackageResourcePath", "()Ljava/lang/String;"));
}
CJNIFile CJNIContext::getCacheDir()
{
- return (CJNIFile)call_method<jhobject>(m_context, "getCacheDir", "()Ljava/io/File;");
+ return call_method<jhobject>(m_context,
+ "getCacheDir", "()Ljava/io/File;");
}
CJNIFile CJNIContext::getDir(const std::string &path, int mode)
{
- return (CJNIFile)call_method<jhobject>(m_context, "getDir", "(Ljava/lang/String;I)Ljava/io/File;", jcast<jhstring>(path), mode);
+ return call_method<jhobject>(m_context,
+ "getDir", "(Ljava/lang/String;I)Ljava/io/File;",
+ jcast<jhstring>(path), mode);
}
CJNIFile CJNIContext::getExternalFilesDir(const std::string &path)
{
- return (CJNIFile)call_method<jhobject>(m_context, "getExternalFilesDir", "(Ljava/lang/String;)Ljava/io/File;", jcast<jhstring>(path));
+ return call_method<jhobject>(m_context,
+ "getExternalFilesDir", "(Ljava/lang/String;)Ljava/io/File;",
+ jcast<jhstring>(path));
}
CJNIContentResolver CJNIContext::getContentResolver()
{
- return (CJNIContentResolver)call_method<jhobject>(m_context, "getContentResolver", "()Landroid/content/ContentResolver;");
+ return call_method<jhobject>(m_context,
+ "getContentResolver", "()Landroid/content/ContentResolver;");
}
void CJNIContext::_onNewIntent(JNIEnv *env, jobject context, jobject intent)
View
8 xbmc/android/jni/Context.h
@@ -18,8 +18,10 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
#include "BroadcastReceiver.h"
+
class ANativeActivity;
class CJNIIntent;
class CJNIPackageManager;
@@ -29,6 +31,7 @@ class CJNIClassLoader;
class CJNIApplicationInfo;
class CJNIFile;
class CJNIContentResolver;
+
class CJNIContext
{
public:
@@ -50,13 +53,16 @@ class CJNIContext
static CJNIContentResolver getContentResolver();
static CJNIContext* GetAppInstance() { return m_appInstance; };
static void _onNewIntent(JNIEnv *env, jobject context, jobject intent);
+
protected:
- virtual void onNewIntent(CJNIIntent intent)=0;
CJNIContext(const ANativeActivity *nativeActivity);
~CJNIContext();
+ virtual void onNewIntent(CJNIIntent intent)=0;
+
private:
CJNIContext();
+
void PopulateStaticFields();
void operator=(CJNIContext const&){};
static jni::jhobject m_context;
View
106 xbmc/android/jni/Cursor.cpp
@@ -17,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "Cursor.h"
#include "jutils/jutils-details.hpp"
#include "URI.h"
@@ -32,150 +33,189 @@ int CJNICursor::FIELD_TYPE_BLOB(0);
void CJNICursor::PopulateStaticFields()
{
jhclass clazz = find_class("android/database/Cursor");
- FIELD_TYPE_NULL = (get_static_field<int>(clazz, "FIELD_TYPE_NULL"));
- FIELD_TYPE_INTEGER = (get_static_field<int>(clazz, "FIELD_TYPE_INTEGER"));
- FIELD_TYPE_FLOAT = (get_static_field<int>(clazz, "FIELD_TYPE_FLOAT"));
- FIELD_TYPE_STRING = (get_static_field<int>(clazz, "FIELD_TYPE_STRING"));
- FIELD_TYPE_BLOB = (get_static_field<int>(clazz, "FIELD_TYPE_BLOB"));
+ FIELD_TYPE_NULL = (get_static_field<int>(clazz, "FIELD_TYPE_NULL"));
+ FIELD_TYPE_INTEGER = (get_static_field<int>(clazz, "FIELD_TYPE_INTEGER"));
+ FIELD_TYPE_FLOAT = (get_static_field<int>(clazz, "FIELD_TYPE_FLOAT"));
+ FIELD_TYPE_STRING = (get_static_field<int>(clazz, "FIELD_TYPE_STRING"));
+ FIELD_TYPE_BLOB = (get_static_field<int>(clazz, "FIELD_TYPE_BLOB"));
}
int CJNICursor::getCount()
{
- return call_method<jint>(m_object, "getCount", "()I");
+ return call_method<jint>(m_object,
+ "getCount", "()I");
}
int CJNICursor::getPosition()
{
- return call_method<jint>(m_object, "getPosition", "()I");
+ return call_method<jint>(m_object,
+ "getPosition", "()I");
}
bool CJNICursor::move(int offset)
{
- return call_method<jboolean>(m_object, "move", "(I)Z", offset);
+ return call_method<jboolean>(m_object,
+ "move", "(I)Z",
+ offset);
}
bool CJNICursor::moveToPosition(int position)
{
- return call_method<jboolean>(m_object, "moveToPosition", "(I)Z", position);
+ return call_method<jboolean>(m_object,
+ "moveToPosition", "(I)Z", position);
}
bool CJNICursor::moveToFirst()
{
- return call_method<jboolean>(m_object, "moveToFirst", "()Z");
+ return call_method<jboolean>(m_object,
+ "moveToFirst", "()Z");
}
bool CJNICursor::moveToLast()
{
- return call_method<jboolean>(m_object, "moveToLast", "()Z");
+ return call_method<jboolean>(m_object,
+ "moveToLast", "()Z");
}
bool CJNICursor::moveToNext()
{
- return call_method<jboolean>(m_object, "moveToNext", "()Z");
+ return call_method<jboolean>(m_object,
+ "moveToNext", "()Z");
}
bool CJNICursor::moveToPrevious()
{
- return call_method<jboolean>(m_object, "moveToPrevious", "()Z");
+ return call_method<jboolean>(m_object,
+ "moveToPrevious", "()Z");
}
bool CJNICursor::isFirst()
{
- return call_method<jboolean>(m_object, "isFirst", "()Z");
+ return call_method<jboolean>(m_object,
+ "isFirst", "()Z");
}
bool CJNICursor::isLast()
{
- return call_method<jboolean>(m_object, "isLast", "()Z");
+ return call_method<jboolean>(m_object,
+ "isLast", "()Z");
}
bool CJNICursor::isBeforeFirst()
{
- return call_method<jboolean>(m_object, "isBeforeFirst", "()Z");
+ return call_method<jboolean>(m_object,
+ "isBeforeFirst", "()Z");
}
bool CJNICursor::isAfterLast()
{
- return call_method<jboolean>(m_object, "isAfterLast", "()Z");
+ return call_method<jboolean>(m_object,
+ "isAfterLast", "()Z");
}
int CJNICursor::getColumnIndex(const std::string &columnName)
{
- return call_method<jint>(m_object, "getColumnIndex", "(Ljava/lang/String;)I", jcast<jhstring>(columnName));
+ return call_method<jint>(m_object,
+ "getColumnIndex", "(Ljava/lang/String;)I",
+ jcast<jhstring>(columnName));
}
std::string CJNICursor::getColumnName(int columnIndex)
{
- return jcast<std::string>(call_method<jhstring>(m_object, "getColumnName", "(I)Ljava/lang/String;", columnIndex));
+ return jcast<std::string>(call_method<jhstring>(m_object,
+ "getColumnName", "(I)Ljava/lang/String;",
+ columnIndex));
}
std::vector<std::string> CJNICursor::getColumnNames()
{
- return jcast<std::vector<std::string>>(call_method<jhobjectArray>(m_object, "getColumnNames", "()[Ljava/lang/String;"));
+ return jcast<std::vector<std::string>>(call_method<jhobjectArray>(m_object,
+ "getColumnNames", "()[Ljava/lang/String;"));
}
int CJNICursor::getColumnCount()
{
- return call_method<jint>(m_object, "getColumnCount", "()I");
+ return call_method<jint>(m_object,
+ "getColumnCount", "()I");
}
std::string CJNICursor::getString(int columnIndex)
{
- return jcast<std::string>(call_method<jhstring>(m_object, "getString", "(I)Ljava/lang/String;", columnIndex));
+ return jcast<std::string>(call_method<jhstring>(m_object,
+ "getString", "(I)Ljava/lang/String;",
+ columnIndex));
}
short CJNICursor::getShort(int columnIndex)
{
- return call_method<jshort>(m_object, "getShort", "()S", columnIndex);
+ return call_method<jshort>(m_object,
+ "getShort", "()S",
+ columnIndex);
}
int CJNICursor::getInt(int columnIndex)
{
- return call_method<jint>(m_object, "getInt", "()I", columnIndex);
+ return call_method<jint>(m_object,
+ "getInt", "()I",
+ columnIndex);
}
long CJNICursor::getLong(int columnIndex)
{
- return call_method<jint>(m_object, "getLong", "()J", columnIndex);
+ return call_method<jint>(m_object,
+ "getLong", "()J",
+ columnIndex);
}
float CJNICursor::getFloat(int columnIndex)
{
- return call_method<jfloat>(m_object, "getFloat", "()F", columnIndex);
+ return call_method<jfloat>(m_object,
+ "getFloat", "()F",
+ columnIndex);
}
double CJNICursor::getDouble(int columnIndex)
{
- return call_method<jdouble>(m_object, "getDouble", "()D", columnIndex);
+ return call_method<jdouble>(m_object,
+ "getDouble", "()D",
+ columnIndex);
}
int CJNICursor::getType(int columnIndex)
{
- return call_method<jint>(m_object, "getType", "(I)I", columnIndex);
+ return call_method<jint>(m_object,
+ "getType", "(I)I",
+ columnIndex);
}
bool CJNICursor::isNull(int columnIndex)
{
- return call_method<jboolean>(m_object, "isNull", "(I)Z", columnIndex);
+ return call_method<jboolean>(m_object,
+ "isNull", "(I)Z",
+ columnIndex);
}
void CJNICursor::deactivate()
{
- call_method<void>(m_object, "deactivate", "()V");
+ call_method<void>(m_object,
+ "deactivate", "()V");
}
bool CJNICursor::requery()
{
- return call_method<jboolean>(m_object, "requery", "()Z");
+ return call_method<jboolean>(m_object,
+ "requery", "()Z");
}
void CJNICursor::close()
{
- call_method<void>(m_object, "close", "()V");
+ call_method<void>(m_object,
+ "close", "()V");
}
bool CJNICursor::isClosed()
{
- return call_method<jboolean>(m_object, "isClosed", "()Z");
+ return call_method<jboolean>(m_object,
+ "isClosed", "()Z");
}
View
21 xbmc/android/jni/Cursor.h
@@ -18,16 +18,20 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
#include "MediaStore.h"
+
class CJNIURI;
+
class CJNICursor : public CJNIBase
{
public:
- ~CJNICursor(){};
CJNICursor(const jni::jhobject &object) : CJNIBase(object){};
- int getCount();
- int getPosition();
+ ~CJNICursor(){};
+
+ int getCount();
+ int getPosition();
bool move(int offset);
bool moveToPosition(int position);
bool moveToFirst();
@@ -38,30 +42,31 @@ class CJNICursor : public CJNIBase
bool isLast();
bool isBeforeFirst();
bool isAfterLast();
- int getColumnIndex(const std::string &columnName);
+ int getColumnIndex(const std::string &columnName);
std::string getColumnName(int columnIndex);
std::vector<std::string> getColumnNames();
- int getColumnCount();
+ int getColumnCount();
std::string getString(int columnIndex);
short getShort(int columnIndex);
- int getInt(int columnIndex);
+ int getInt(int columnIndex);
long getLong(int columnIndex);
float getFloat(int columnIndex);
double getDouble(int columnIndex);
- int getType(int columnIndex);
+ int getType(int columnIndex);
bool isNull(int columnIndex);
void deactivate();
bool requery();
void close();
bool isClosed();
+ static void PopulateStaticFields();
static int FIELD_TYPE_NULL;
static int FIELD_TYPE_INTEGER;
static int FIELD_TYPE_FLOAT;
static int FIELD_TYPE_STRING;
static int FIELD_TYPE_BLOB;
- static void PopulateStaticFields();
+
private:
CJNICursor();
};
View
21 xbmc/android/jni/DhcpInfo.cpp
@@ -17,28 +17,31 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "DhcpInfo.h"
#include "jutils/jutils-details.hpp"
using namespace jni;
CJNIDhcpInfo::CJNIDhcpInfo(const jhobject &object) : CJNIBase(object)
- ,ipAddress(get_field<int>(m_object, "ipAddress"))
- ,gateway(get_field<int>(m_object, "gateway"))
- ,netmask(get_field<int>(m_object, "netmask"))
- ,dns1(get_field<int>(m_object, "dns1"))
- ,dns2(get_field<int>(m_object, "dns2"))
- ,serverAddress(get_field<int>(m_object, "serverAddress"))
- ,leaseDuration(get_field<int>(m_object, "leaseDuration"))
+ ,ipAddress( get_field<int>(m_object, "ipAddress"))
+ ,gateway( get_field<int>(m_object, "gateway"))
+ ,netmask( get_field<int>(m_object, "netmask"))
+ ,dns1( get_field<int>(m_object, "dns1"))
+ ,dns2( get_field<int>(m_object, "dns2"))
+ ,serverAddress( get_field<int>(m_object, "serverAddress"))
+ ,leaseDuration( get_field<int>(m_object, "leaseDuration"))
{
}
std::string CJNIDhcpInfo::toString()
{
- return jcast<std::string>(call_method<jhstring>(m_object, "toString", "()Ljava/lang/String;"));
+ return jcast<std::string>(call_method<jhstring>(m_object,
+ "toString", "()Ljava/lang/String;"));
}
int CJNIDhcpInfo::describeContents()
{
- return call_method<jint>(m_object, "describeContents", "()I");
+ return call_method<jint>(m_object,
+ "describeContents", "()I");
}
View
10 xbmc/android/jni/DhcpInfo.h
@@ -18,11 +18,16 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNIDhcpInfo : public CJNIBase
{
public:
+ CJNIDhcpInfo();
+ CJNIDhcpInfo(const jni::jhobject &object);
+ ~CJNIDhcpInfo(){};
+
std::string toString();
int ipAddress;
int gateway;
@@ -32,9 +37,4 @@ class CJNIDhcpInfo : public CJNIBase
int serverAddress;
int leaseDuration;
int describeContents();
-
- CJNIDhcpInfo();
- ~CJNIDhcpInfo(){};
- CJNIDhcpInfo(const jni::jhobject &object);
-private:
};
View
3  xbmc/android/jni/Drawable.h
@@ -18,13 +18,14 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNIDrawable : public CJNIBase
{
public:
CJNIDrawable();
- ~CJNIDrawable(){};
CJNIDrawable(const jni::jhobject &object) : CJNIBase(object){};
CJNIDrawable(std::string classname) : CJNIBase(classname){};
+ ~CJNIDrawable(){};
};
View
10 xbmc/android/jni/Enum.cpp
@@ -17,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "Enum.h"
#include "jutils/jutils-details.hpp"
@@ -24,14 +25,17 @@ using namespace jni;
std::string CJNIEnum::name()
{
- return jcast<std::string>(call_method<jhstring>(m_object, "name", "()Ljava/lang/String;"));
+ return jcast<std::string>(call_method<jhstring>(m_object,
+ "name", "()Ljava/lang/String;"));
}
std::string CJNIEnum::toString()
{
- return jcast<std::string>(call_method<jhstring>(m_object, "toString", "()Ljava/lang/String;"));
+ return jcast<std::string>(call_method<jhstring>(m_object,
+ "toString", "()Ljava/lang/String;"));
}
bool CJNIEnum::equals(const CJNIEnum &object)
{
- return call_method<jboolean>(m_object, "equals", "(Ljava/lang/Object;)Z", object.get_raw());
+ return call_method<jboolean>(m_object,
+ "equals", "(Ljava/lang/Object;)Z", object.get_raw());
}
View
7 xbmc/android/jni/Enum.h
@@ -18,13 +18,16 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
+
class CJNIEnum : public CJNIBase
{
public:
- CJNIEnum(jni::jhobject const& object) : CJNIBase(object){};
+ CJNIEnum(jni::jhobject const& object) : CJNIBase(object) {};
+ ~CJNIEnum() {};
+
virtual std::string name();
virtual std::string toString();
virtual bool equals(const CJNIEnum &object);
- ~CJNIEnum(){};
};
View
11 xbmc/android/jni/Environment.cpp
@@ -17,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "Environment.h"
#include "File.h"
#include "jutils/jutils-details.hpp"
@@ -25,15 +26,19 @@ using namespace jni;
std::string CJNIEnvironment::getExternalStorageState()
{
- return jcast<std::string>(call_static_method<jhstring>("android/os/Environment", "getExternalStorageState", "()Ljava/lang/String;"));
+ return jcast<std::string>(call_static_method<jhstring>("android/os/Environment",
+ "getExternalStorageState", "()Ljava/lang/String;"));
}
CJNIFile CJNIEnvironment::getExternalStorageDirectory()
{
- return (CJNIFile)call_static_method<jhobject>("android/os/Environment", "getExternalStorageDirectory", "()Ljava/io/File;");
+ return (CJNIFile)call_static_method<jhobject>("android/os/Environment",
+ "getExternalStorageDirectory", "()Ljava/io/File;");
}
CJNIFile CJNIEnvironment::getExternalStoragePublicDirectory(const std::string &type)
{
- return (CJNIFile)call_static_method<jhobject>("android/os/Environment", "getExternalStoragePublicDirectory", "(Ljava/lang/String;)Ljava/io/File;", jcast<jhstring>(type));
+ return (CJNIFile)call_static_method<jhobject>("android/os/Environment",
+ "getExternalStoragePublicDirectory", "(Ljava/lang/String;)Ljava/io/File;",
+ jcast<jhstring>(type));
}
View
9 xbmc/android/jni/Environment.h
@@ -18,15 +18,18 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNIFile;
+
class CJNIEnvironment : public CJNIBase
{
public:
- static std::string getExternalStorageState();
- static CJNIFile getExternalStorageDirectory();
- static CJNIFile getExternalStoragePublicDirectory(const std::string &type);
+ static std::string getExternalStorageState();
+ static CJNIFile getExternalStorageDirectory();
+ static CJNIFile getExternalStoragePublicDirectory(const std::string &type);
+
protected:
CJNIEnvironment();
~CJNIEnvironment(){};
View
5 xbmc/android/jni/File.cpp
@@ -17,11 +17,14 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "File.h"
#include "jutils/jutils-details.hpp"
using namespace jni;
+
std::string CJNIFile::getAbsolutePath()
{
- return jcast<std::string>(call_method<jhstring>(m_object, "getAbsolutePath", "()Ljava/lang/String;"));
+ return jcast<std::string>(call_method<jhstring>(m_object,
+ "getAbsolutePath", "()Ljava/lang/String;"));
}
View
3  xbmc/android/jni/File.h
@@ -18,14 +18,15 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNIFile : public CJNIBase
{
public:
CJNIFile();
- ~CJNIFile(){};
CJNIFile(const jni::jhobject &file) : CJNIBase(file){};
+ ~CJNIFile(){};
std::string getAbsolutePath();
};
View
68 xbmc/android/jni/Intent.cpp
@@ -17,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "Intent.h"
#include "jutils/jutils-details.hpp"
#include "URI.h"
@@ -28,90 +29,121 @@ CJNIIntent::CJNIIntent(const std::string &action) : CJNIBase("android/content/In
if(action.empty())
m_object = new_object(GetClassName());
else
- m_object = new_object(GetClassName(), "<init>", "(Ljava/lang/String;)V", jcast<jhstring>(action));
+ m_object = new_object(GetClassName(),
+ "<init>", "(Ljava/lang/String;)V",
+ jcast<jhstring>(action));
}
std::string CJNIIntent::getAction()
{
- return jcast<std::string>(call_method<jhstring>(m_object, "getAction", "()Ljava/lang/String;"));
+ return jcast<std::string>(call_method<jhstring>(m_object,
+ "getAction", "()Ljava/lang/String;"));
}
std::string CJNIIntent::getDataString()
{
- return jcast<std::string>(call_method<jhstring>(m_object, "getDataString", "()Ljava/lang/String;"));
+ return jcast<std::string>(call_method<jhstring>(m_object,
+ "getDataString", "()Ljava/lang/String;"));
}
std::string CJNIIntent::getPackage()
{
- return jcast<std::string>(call_method<jhstring>(m_object, "getPackage", "()Ljava/lang/String;"));
+ return jcast<std::string>(call_method<jhstring>(m_object,
+ "getPackage", "()Ljava/lang/String;"));
}
std::string CJNIIntent::getType()
{
- return jcast<std::string>(call_method<jhstring>(m_object, "getType", "()Ljava/lang/String;"));
+ return jcast<std::string>(call_method<jhstring>(m_object,
+ "getType", "()Ljava/lang/String;"));
}
int CJNIIntent::getIntExtra(const std::string &name, int defaultValue)
{
- return call_method<jint>(m_object, "getIntExtra", "(Ljava/lang/String;I)I", jcast<jhstring>(name), defaultValue);
+ return call_method<jint>(m_object,
+ "getIntExtra", "(Ljava/lang/String;I)I",
+ jcast<jhstring>(name), defaultValue);
}
bool CJNIIntent::hasExtra(const std::string &name)
{
- return call_method<jboolean>(m_object, "hasExtra", "(Ljava/lang/String;)Z", jcast<jhstring>(name));
+ return call_method<jboolean>(m_object,
+ "hasExtra", "(Ljava/lang/String;)Z",
+ jcast<jhstring>(name));
}
bool CJNIIntent::hasCategory(const std::string &category)
{
- return call_method<jboolean>(m_object, "hasCategory", "(Ljava/lang/String;)Z", jcast<jhstring>(category));
+ return call_method<jboolean>(m_object,
+ "hasCategory", "(Ljava/lang/String;)Z",
+ jcast<jhstring>(category));
}
void CJNIIntent::addFlags(int flags)
{
- call_method<jhobject>(m_object, "addFlags", "(I;)Landroid/content/Intent;", flags);
+ call_method<jhobject>(m_object,
+ "addFlags", "(I;)Landroid/content/Intent;",
+ flags);
}
void CJNIIntent::addCategory(const std::string &category)
{
- call_method<jhstring>(m_object, "addCategory", "(Ljava/lang/String;)Landroid/content/Intent;", jcast<jhstring>(category));
+ call_method<jhstring>(m_object,
+ "addCategory", "(Ljava/lang/String;)Landroid/content/Intent;",
+ jcast<jhstring>(category));
}
void CJNIIntent::setAction(const std::string &action)
{
- call_method<jhobject>(m_object, "setAction", "(Ljava/lang/String;)Landroid/content/Intent;", jcast<jhstring>(action));
+ call_method<jhobject>(m_object,
+ "setAction", "(Ljava/lang/String;)Landroid/content/Intent;",
+ jcast<jhstring>(action));
}
void CJNIIntent::setClassName(const std::string &packageName, const std::string &className)
{
- call_method<jhobject>(m_object, "setClassName", "(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;", jcast<jhstring>(packageName), jcast<jhstring>(className));
+ call_method<jhobject>(m_object,
+ "setClassName", "(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;",
+ jcast<jhstring>(packageName), jcast<jhstring>(className));
}
void CJNIIntent::setData(const std::string &uri)
{
- call_method<jhobject>(m_object, "setData", "(Landroid/net/Uri;)Landroid/content/Intent;", jcast<jhstring>(uri));
+ call_method<jhobject>(m_object,
+ "setData", "(Landroid/net/Uri;)Landroid/content/Intent;",
+ jcast<jhstring>(uri));
}
void CJNIIntent::setDataAndType(const CJNIURI &uri, const std::string &type)
{
- call_method<jhobject>(m_object, "setDataAndType", "(Landroid/net/Uri;Ljava/lang/String;)Landroid/content/Intent;", uri.get_raw(), jcast<jhstring>(type));
+ call_method<jhobject>(m_object,
+ "setDataAndType", "(Landroid/net/Uri;Ljava/lang/String;)Landroid/content/Intent;",
+ uri.get_raw(), jcast<jhstring>(type));
}
void CJNIIntent::setFlags(int flags)
{
- call_method<jhobject>(m_object, "setFlags", "(I;)Landroid/content/Intent;", flags);
+ call_method<jhobject>(m_object,
+ "setFlags", "(I;)Landroid/content/Intent;",
+ flags);
}
void CJNIIntent::setPackage(const std::string &packageName)
{
- call_method<jhobject>(m_object, "setPackage", "(Ljava/lang/String;)Landroid/content/Intent;", jcast<jhstring>(packageName));
+ call_method<jhobject>(m_object,
+ "setPackage", "(Ljava/lang/String;)Landroid/content/Intent;",
+ jcast<jhstring>(packageName));
}
void CJNIIntent::setType(const std::string &type)
{
- call_method<jhobject>(m_object, "setType", "(Ljava/lang/String;)Landroid/content/Intent;", jcast<jhstring>(type));
+ call_method<jhobject>(m_object,
+ "setType", "(Ljava/lang/String;)Landroid/content/Intent;",
+ jcast<jhstring>(type));
}
CJNIURI CJNIIntent::getData() const
{
- return (CJNIURI)call_method<jhobject>(m_object, "getData","()Landroid/net/Uri;");
+ return (CJNIURI)call_method<jhobject>(m_object,
+ "getData","()Landroid/net/Uri;");
}
View
7 xbmc/android/jni/Intent.h
@@ -18,6 +18,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNIURI;
@@ -25,15 +26,15 @@ class CJNIIntent : public CJNIBase
{
public:
CJNIIntent(const std::string &action = "");
- ~CJNIIntent(){};
- CJNIIntent(const jni::jhobject &intent) : CJNIBase(intent){};
+ CJNIIntent(const jni::jhobject &intent) : CJNIBase(intent) {};
+ ~CJNIIntent() {};
std::string getAction();
std::string getDataString();
std::string getPackage();
std::string getType();
- int getIntExtra(const std::string &name, int defaultValue);
+ int getIntExtra(const std::string &name, int defaultValue);
bool hasExtra(const std::string &name);
bool hasCategory(const std::string &category);
View
13 xbmc/android/jni/IntentFilter.cpp
@@ -17,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "IntentFilter.h"
#include "jutils/jutils-details.hpp"
@@ -29,15 +30,21 @@ CJNIIntentFilter::CJNIIntentFilter() : CJNIBase("android/content/IntentFilter")
CJNIIntentFilter::CJNIIntentFilter(const std::string &action) : CJNIBase("android/content/IntentFilter")
{
- m_object = new_object(GetClassName(), "<init>", "(Ljava/lang/String;)V", jcast<jhstring>(action));
+ m_object = new_object(GetClassName(),
+ "<init>", "(Ljava/lang/String;)V",
+ jcast<jhstring>(action));
}
void CJNIIntentFilter::addAction(std::string action)
{
- call_method<void>(m_object, "addAction", "(Ljava/lang/String;)V", jcast<jhstring>(action));
+ call_method<void>(m_object,
+ "addAction", "(Ljava/lang/String;)V",
+ jcast<jhstring>(action));
}
void CJNIIntentFilter::addDataScheme(std::string scheme)
{
- call_method<void>(m_object, "addDataScheme", "(Ljava/lang/String;)V", jcast<jhstring>(scheme));
+ call_method<void>(m_object,
+ "addDataScheme", "(Ljava/lang/String;)V",
+ jcast<jhstring>(scheme));
}
View
7 xbmc/android/jni/IntentFilter.h
@@ -18,16 +18,17 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
class CJNIIntentFilter : public CJNIBase
{
public:
CJNIIntentFilter();
+ CJNIIntentFilter(const jni::jhobject &object) : CJNIBase(object) {};
CJNIIntentFilter(const std::string &action);
+ ~CJNIIntentFilter() {};
+
void addDataScheme(std::string scheme);
void addAction(std::string action);
-
- ~CJNIIntentFilter(){};
- CJNIIntentFilter(const jni::jhobject &object) : CJNIBase(object){};
};
View
3  xbmc/android/jni/JNIBase.cpp
@@ -17,8 +17,11 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
+
using namespace jni;
+
CJNIBase::CJNIBase(std::string classname)
{
m_className = classname;
View
1  xbmc/android/jni/JNIBase.h
@@ -18,6 +18,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "jutils/jutils.hpp"
class CJNIBase
View
8 xbmc/android/jni/List.cpp
@@ -17,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "List.h"
#include "jutils/jutils-details.hpp"
#include "ScanResult.h"
@@ -28,13 +29,16 @@ using namespace jni;
template <typename T>
T CJNIList<T>::get(int index)
{
- return (T)call_method<jhobject>(m_object, "get", "(I)Ljava/lang/Object;", index);
+ return (T)call_method<jhobject>(m_object,
+ "get", "(I)Ljava/lang/Object;",
+ index);
}
template <typename T>
int CJNIList<T>::size()
{
- return m_object.get() ? call_method<jint>(m_object, "size", "()I") : 0;
+ return m_object.get() ? call_method<jint>(m_object,
+ "size", "()I") : 0;
}
template class CJNIList<CJNIScanResult>;
View
7 xbmc/android/jni/List.h
@@ -18,16 +18,19 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
template <typename T>
class CJNIList : public CJNIBase
{
public:
- ~CJNIList(){};
CJNIList(const jni::jhobject &object) : CJNIBase(object){};
- T get(int index);
+ ~CJNIList(){};
+
+ T get(int index);
int size();
+
private:
CJNIList();
};
View
14 xbmc/android/jni/MediaStore.cpp
@@ -17,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "MediaStore.h"
#include "jutils/jutils-details.hpp"
@@ -29,14 +30,15 @@ std::string CJNIMediaStoreMediaColumns::TITLE;
std::string CJNIMediaStoreMediaColumns::DATE_ADDED;
std::string CJNIMediaStoreMediaColumns::DATE_MODIFIED;
std::string CJNIMediaStoreMediaColumns::MIME_TYPE;
+
void CJNIMediaStoreMediaColumns::PopulateStaticFields()
{
jhclass clazz = find_class("android/provider/MediaStore$MediaColumns");
- DATA = (jcast<std::string>(get_static_field<jhstring>(clazz, "DATA")));
- SIZE = (jcast<std::string>(get_static_field<jhstring>(clazz, "SIZE")));
- DISPLAY_NAME = (jcast<std::string>(get_static_field<jhstring>(clazz, "DISPLAY_NAME")));
- TITLE = (jcast<std::string>(get_static_field<jhstring>(clazz, "TITLE")));
- DATE_ADDED = (jcast<std::string>(get_static_field<jhstring>(clazz, "DATE_ADDED")));
+ DATA = (jcast<std::string>(get_static_field<jhstring>(clazz, "DATA")));
+ SIZE = (jcast<std::string>(get_static_field<jhstring>(clazz, "SIZE")));
+ DISPLAY_NAME = (jcast<std::string>(get_static_field<jhstring>(clazz, "DISPLAY_NAME")));
+ TITLE = (jcast<std::string>(get_static_field<jhstring>(clazz, "TITLE")));
+ DATE_ADDED = (jcast<std::string>(get_static_field<jhstring>(clazz, "DATE_ADDED")));
DATE_MODIFIED = (jcast<std::string>(get_static_field<jhstring>(clazz, "DATE_MODIFIED")));
- MIME_TYPE = (jcast<std::string>(get_static_field<jhstring>(clazz, "MIME_TYPE")));
+ MIME_TYPE = (jcast<std::string>(get_static_field<jhstring>(clazz, "MIME_TYPE")));
}
View
10 xbmc/android/jni/MediaStore.h
@@ -18,11 +18,15 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "JNIBase.h"
#include "BaseColumns.h"
+
class CJNIMediaStoreMediaColumns : public CJNIBaseColumns
{
public:
+ static void PopulateStaticFields();
+
static std::string DATA;
static std::string SIZE;
static std::string DISPLAY_NAME;
@@ -30,7 +34,7 @@ class CJNIMediaStoreMediaColumns : public CJNIBaseColumns
static std::string DATE_ADDED;
static std::string DATE_MODIFIED;
static std::string MIME_TYPE;
- static void PopulateStaticFields();
+
private:
CJNIMediaStoreMediaColumns();
};
@@ -38,6 +42,6 @@ class CJNIMediaStoreMediaColumns : public CJNIBaseColumns
class CJNIMediaStore : public CJNIBase
{
public:
- ~CJNIMediaStore(){};
- CJNIMediaStore(const jni::jhobject &object) : CJNIBase(object){};
+ CJNIMediaStore(const jni::jhobject &object) : CJNIBase(object) {};
+ ~CJNIMediaStore() {};
};
View
46 xbmc/android/jni/NetworkInfo.cpp
@@ -17,6 +17,7 @@
* <http://www.gnu.org/licenses/>.
*
*/
+
#include "NetworkInfo.h"
#include "jutils/jutils-details.hpp"
@@ -24,76 +25,91 @@ using namespace jni;
int CJNINetworkInfo::getType() const
{
- return call_method<jint>(m_object, "getType", "()I");
+ return call_method<jint>(m_object,
+ "getType", "()I");
}
int CJNINetworkInfo::getSubtype() const
{