Skip to content
This repository
Browse code

jni: consmetic refactor to consistent appearance

  • Loading branch information...
commit f8b366e8c491d83b0dc42200186976f59e1bcc7d 1 parent 66e86e6
authored June 30, 2013

Showing 68 changed files with 814 additions and 403 deletions. Show diff stats Hide diff stats

  1. 13  xbmc/android/jni/ApplicationInfo.cpp
  2. 8  xbmc/android/jni/ApplicationInfo.h
  3. 11  xbmc/android/jni/AudioManager.cpp
  4. 9  xbmc/android/jni/AudioManager.h
  5. 3  xbmc/android/jni/BaseColumns.cpp
  6. 6  xbmc/android/jni/BaseColumns.h
  7. 91  xbmc/android/jni/BitSet.cpp
  8. 17  xbmc/android/jni/BitSet.h
  9. 6  xbmc/android/jni/Bitmap.h
  10. 4  xbmc/android/jni/BitmapDrawable.cpp
  11. 10  xbmc/android/jni/BitmapDrawable.h
  12. 9  xbmc/android/jni/BroadcastReceiver.h
  13. 5  xbmc/android/jni/CharSequence.cpp
  14. 7  xbmc/android/jni/CharSequence.h
  15. 6  xbmc/android/jni/ClassLoader.cpp
  16. 7  xbmc/android/jni/ClassLoader.h
  17. 62  xbmc/android/jni/ConnectivityManager.cpp
  18. 14  xbmc/android/jni/ConnectivityManager.h
  19. 20  xbmc/android/jni/ContentResolver.cpp
  20. 10  xbmc/android/jni/ContentResolver.h
  21. 72  xbmc/android/jni/Context.cpp
  22. 8  xbmc/android/jni/Context.h
  23. 106  xbmc/android/jni/Cursor.cpp
  24. 21  xbmc/android/jni/Cursor.h
  25. 21  xbmc/android/jni/DhcpInfo.cpp
  26. 10  xbmc/android/jni/DhcpInfo.h
  27. 3  xbmc/android/jni/Drawable.h
  28. 10  xbmc/android/jni/Enum.cpp
  29. 7  xbmc/android/jni/Enum.h
  30. 11  xbmc/android/jni/Environment.cpp
  31. 9  xbmc/android/jni/Environment.h
  32. 5  xbmc/android/jni/File.cpp
  33. 3  xbmc/android/jni/File.h
  34. 68  xbmc/android/jni/Intent.cpp
  35. 7  xbmc/android/jni/Intent.h
  36. 13  xbmc/android/jni/IntentFilter.cpp
  37. 7  xbmc/android/jni/IntentFilter.h
  38. 3  xbmc/android/jni/JNIBase.cpp
  39. 1  xbmc/android/jni/JNIBase.h
  40. 8  xbmc/android/jni/List.cpp
  41. 7  xbmc/android/jni/List.h
  42. 14  xbmc/android/jni/MediaStore.cpp
  43. 10  xbmc/android/jni/MediaStore.h
  44. 46  xbmc/android/jni/NetworkInfo.cpp
  45. 35  xbmc/android/jni/NetworkInfo.h
  46. 19  xbmc/android/jni/PackageManager.cpp
  47. 15  xbmc/android/jni/PackageManager.h
  48. 18  xbmc/android/jni/PowerManager.cpp
  49. 16  xbmc/android/jni/PowerManager.h
  50. 15  xbmc/android/jni/ScanResult.cpp
  51. 11  xbmc/android/jni/ScanResult.h
  52. 21  xbmc/android/jni/StatFs.cpp
  53. 16  xbmc/android/jni/StatFs.h
  54. 17  xbmc/android/jni/System.cpp
  55. 11  xbmc/android/jni/System.h
  56. 4  xbmc/android/jni/SystemClock.cpp
  57. 9  xbmc/android/jni/SystemClock.h
  58. 17  xbmc/android/jni/URI.cpp
  59. 13  xbmc/android/jni/URI.h
  60. 7  xbmc/android/jni/WakeLock.cpp
  61. 7  xbmc/android/jni/WakeLock.h
  62. 29  xbmc/android/jni/WifiConfiguration.cpp
  63. 26  xbmc/android/jni/WifiConfiguration.h
  64. 38  xbmc/android/jni/WifiInfo.cpp
  65. 20  xbmc/android/jni/WifiInfo.h
  66. 55  xbmc/android/jni/WifiManager.cpp
  67. 7  xbmc/android/jni/WifiManager.h
  68. 3  xbmc/android/jni/jutils.cpp
13  xbmc/android/jni/ApplicationInfo.cpp
@@ -17,19 +17,20 @@
17 17
  *  <http://www.gnu.org/licenses/>.
18 18
  *
19 19
  */
  20
+
20 21
 #include "ApplicationInfo.h"
21 22
 #include "jutils/jutils-details.hpp"
22 23
 
23 24
 using namespace jni;
24 25
 
25 26
 CJNIApplicationInfo::CJNIApplicationInfo(const jhobject &object) : CJNIBase(object)
26  
-  ,sourceDir(jcast<std::string>(get_field<jhstring>(m_object, "sourceDir")))
27  
-  ,publicSourceDir(jcast<std::string>(get_field<jhstring>(m_object, "publicSourceDir")))
28  
-  ,dataDir(jcast<std::string>(get_field<jhstring>(m_object, "dataDir")))
  27
+  ,sourceDir(       jcast<std::string>(get_field<jhstring>(m_object, "sourceDir")))
  28
+  ,publicSourceDir( jcast<std::string>(get_field<jhstring>(m_object, "publicSourceDir")))
  29
+  ,dataDir(         jcast<std::string>(get_field<jhstring>(m_object, "dataDir")))
29 30
   ,nativeLibraryDir(jcast<std::string>(get_field<jhstring>(m_object, "nativeLibraryDir")))
30  
-  ,packageName(jcast<std::string>(get_field<jhstring>(m_object, "packageName")))
31  
-  ,uid(get_field<int>(m_object, "uid"))
  31
+  ,packageName(     jcast<std::string>(get_field<jhstring>(m_object, "packageName")))
  32
+  ,uid(             get_field<int>(m_object, "uid"))
32 33
   ,targetSdkVersion(get_field<int>(m_object, "targetSdkVersion"))
33  
-  ,enabled(get_field<jboolean>(m_object, "enabled"))
  34
+  ,enabled(         get_field<jboolean>(m_object, "enabled"))
34 35
 {
35 36
 }
8  xbmc/android/jni/ApplicationInfo.h
@@ -18,6 +18,7 @@
18 18
  *  <http://www.gnu.org/licenses/>.
19 19
  *
20 20
  */
  21
+
21 22
 #include "JNIBase.h"
22 23
 
23 24
 class CJNIApplicationInfo : public CJNIBase
@@ -31,11 +32,12 @@ class CJNIApplicationInfo : public CJNIBase
31 32
   std::string dataDir;
32 33
   std::string nativeLibraryDir;
33 34
   std::string packageName;
34  
-  int uid; 
35  
-  int targetSdkVersion;
36  
-  bool enabled;
  35
+  int         uid; 
  36
+  int         targetSdkVersion;
  37
+  bool        enabled;
37 38
 
38 39
 private:
39 40
   CJNIApplicationInfo();
40 41
 };
  42
+
41 43
 typedef std::vector<CJNIApplicationInfo> CJNIApplicationInfos;
11  xbmc/android/jni/AudioManager.cpp
@@ -17,6 +17,7 @@
17 17
  *  <http://www.gnu.org/licenses/>.
18 18
  *
19 19
  */
  20
+
20 21
 #include "AudioManager.h"
21 22
 #include "jutils/jutils-details.hpp"
22 23
 
@@ -27,15 +28,19 @@ int CJNIAudioManager::STREAM_MUSIC(0);
27 28
 void CJNIAudioManager::PopulateStaticFields()
28 29
 {
29 30
   jhclass clazz = find_class("android/media/AudioManager");
30  
-  STREAM_MUSIC = (get_static_field<int>(clazz, "STREAM_MUSIC"));
  31
+  STREAM_MUSIC  = (get_static_field<int>(clazz, "STREAM_MUSIC"));
31 32
 }
32 33
 
33 34
 int CJNIAudioManager::getStreamMaxVolume()
34 35
 {
35  
-  return call_method<jint>(m_object, "getStreamMaxVolume", "(I)I", STREAM_MUSIC);
  36
+  return call_method<jint>(m_object,
  37
+    "getStreamMaxVolume", "(I)I",
  38
+    STREAM_MUSIC);
36 39
 }
37 40
 
38 41
 void CJNIAudioManager::setStreamVolume(int index /* 0 */, int flags /* NONE */)
39 42
 {
40  
-  call_method<void>(m_object, "setStreamVolume", "(III)V", STREAM_MUSIC, index, flags);
  43
+  call_method<void>(m_object,
  44
+    "setStreamVolume", "(III)V",
  45
+    STREAM_MUSIC, index, flags);
41 46
 }
9  xbmc/android/jni/AudioManager.h
@@ -18,20 +18,23 @@
18 18
  *  <http://www.gnu.org/licenses/>.
19 19
  *
20 20
  */
  21
+
21 22
 #include "JNIBase.h"
22 23
 
23 24
 class CJNIAudioManager : public CJNIBase
24 25
 {
25 26
 public:
  27
+  CJNIAudioManager(const jni::jhobject &object) : CJNIBase(object) {};
  28
+  ~CJNIAudioManager() {};
  29
+
26 30
   // Note removal of streamType param.
27  
-  int getStreamMaxVolume();
  31
+  int  getStreamMaxVolume();
28 32
   void setStreamVolume(int index = 0, int flags = 0);
29 33
 
30 34
   static void PopulateStaticFields();
31  
-  ~CJNIAudioManager(){};
32  
-  CJNIAudioManager(const jni::jhobject &object) : CJNIBase(object){};
33 35
 
34 36
 private:
35 37
   CJNIAudioManager();
  38
+
36 39
   static int STREAM_MUSIC;
37 40
 };
3  xbmc/android/jni/BaseColumns.cpp
@@ -17,6 +17,7 @@
17 17
  *  <http://www.gnu.org/licenses/>.
18 18
  *
19 19
  */
  20
+
20 21
 #include "BaseColumns.h"
21 22
 #include "jutils/jutils-details.hpp"
22 23
 
@@ -28,6 +29,6 @@ std::string CJNIBaseColumns::_COUNT;
28 29
 void CJNIBaseColumns::PopulateStaticFields()
29 30
 {
30 31
   jhclass clazz = find_class("android/provider/BaseColumns");
31  
-  _ID = (jcast<std::string>(get_static_field<jhstring>(clazz, "_ID")));
  32
+  _ID    = (jcast<std::string>(get_static_field<jhstring>(clazz, "_ID")));
32 33
   _COUNT = (jcast<std::string>(get_static_field<jhstring>(clazz, "_COUNT")));
33 34
 }
6  xbmc/android/jni/BaseColumns.h
@@ -18,13 +18,17 @@
18 18
  *  <http://www.gnu.org/licenses/>.
19 19
  *
20 20
  */
  21
+
21 22
 #include <string>
  23
+
22 24
 class CJNIBaseColumns
23 25
 {
24 26
 public:
  27
+  static void PopulateStaticFields();
  28
+
25 29
   static std::string _ID;
26 30
   static std::string _COUNT;
27  
-  static void PopulateStaticFields();
  31
+
28 32
 private:
29 33
   CJNIBaseColumns();
30 34
 };
91  xbmc/android/jni/BitSet.cpp
@@ -17,6 +17,7 @@
17 17
  *  <http://www.gnu.org/licenses/>.
18 18
  *
19 19
  */
  20
+
20 21
 #include "BitSet.h"
21 22
 #include "jutils/jutils-details.hpp"
22 23
 
@@ -29,17 +30,23 @@ CJNIBitSet::CJNIBitSet() : CJNIBase("java.util.BitSet")
29 30
 
30 31
 CJNIBitSet::CJNIBitSet(int bitCount) : CJNIBase("java.util.BitSet")
31 32
 {
32  
-  m_object = new_object(GetClassName(), "<init>", "(I)V", (jint)bitCount);
  33
+  m_object = new_object(GetClassName(),
  34
+    "<init>", "(I)V",
  35
+    (jint)bitCount);
33 36
 }
34 37
 
35 38
 void CJNIBitSet::flip(int index)
36 39
 {
37  
-  call_method<void>(m_object, "flip", "(I)V", index);
  40
+  call_method<void>(m_object,
  41
+    "flip", "(I)V",
  42
+    index);
38 43
 }
39 44
 
40 45
 void CJNIBitSet::flip(int fromIndex, int toIndex)
41 46
 {
42  
-  call_method<void>(m_object, "flip", "(II)V", fromIndex, toIndex);
  47
+  call_method<void>(m_object,
  48
+    "flip", "(II)V",
  49
+    fromIndex, toIndex);
43 50
 }
44 51
 
45 52
 void CJNIBitSet::set(int index)
@@ -49,106 +56,140 @@ void CJNIBitSet::set(int index)
49 56
 
50 57
 void CJNIBitSet::set(int fromIndex, bool state)
51 58
 {
52  
-  call_method<void>(m_object, "fromIndex", "(IZ)V", fromIndex, state);
  59
+  call_method<void>(m_object,
  60
+    "fromIndex", "(IZ)V",
  61
+    fromIndex, state);
53 62
 }
54 63
 
55 64
 void CJNIBitSet::set(int fromIndex, int toIndex)
56 65
 {
57  
-  call_method<void>(m_object, "set", "(II)V", fromIndex, toIndex);
  66
+  call_method<void>(m_object,
  67
+    "set", "(II)V",
  68
+    fromIndex, toIndex);
58 69
 }
59 70
 
60 71
 void CJNIBitSet::set(int fromIndex, int toIndex, bool state)
61 72
 {
62  
-  call_method<void>(m_object, "set", "(IIZ)V", fromIndex, toIndex, state);
  73
+  call_method<void>(m_object,
  74
+    "set", "(IIZ)V",
  75
+    fromIndex, toIndex, state);
63 76
 }
64 77
 
65 78
 void CJNIBitSet::clear(int index)
66 79
 {
67  
-  call_method<void>(m_object, "clear", "(I)V", index);
  80
+  call_method<void>(m_object,
  81
+    "clear", "(I)V",
  82
+    index);
68 83
 }
69 84
 
70 85
 void CJNIBitSet::clear(int fromIndex, int toIndex)
71 86
 {
72  
-  call_method<void>(m_object, "clear", "(II)V", fromIndex, toIndex);
  87
+  call_method<void>(m_object,
  88
+    "clear", "(II)V",
  89
+    fromIndex, toIndex);
73 90
 }
74 91
 
75 92
 void CJNIBitSet::clear()
76 93
 {
77  
-  call_method<void>(m_object, "clear", "()V");
  94
+  call_method<void>(m_object,
  95
+    "clear", "()V");
78 96
 }
79 97
 
80 98
 bool CJNIBitSet::get(int index)
81 99
 {
82  
-  return call_method<jboolean>(m_object, "get", "(I)V", index);
  100
+  return call_method<jboolean>(m_object,
  101
+    "get", "(I)V",
  102
+    index);
83 103
 }
84 104
 
85 105
 CJNIBitSet CJNIBitSet::get(int fromIndex, int toIndex)
86 106
 {
87  
-  return call_method<jhobject>(m_object, "get", "(II)V", fromIndex, toIndex);
  107
+  return call_method<jhobject>(m_object,
  108
+    "get", "(II)V",
  109
+    fromIndex, toIndex);
88 110
 }
89 111
 
90 112
 int CJNIBitSet::nextSetBit(int index)
91 113
 {
92  
-  return call_method<jint>(m_object, "nextSetBit", "(I)I", index);
  114
+  return call_method<jint>(m_object,
  115
+    "nextSetBit", "(I)I",
  116
+    index);
93 117
 }
94 118
 
95 119
 int CJNIBitSet::nextClearBit(int index)
96 120
 {
97  
-  return call_method<jint>(m_object, "nextClearBit", "(I)I", index);
  121
+  return call_method<jint>(m_object,
  122
+    "nextClearBit", "(I)I",
  123
+    index);
98 124
 }
99 125
 
100 126
 int CJNIBitSet::length()
101 127
 {
102  
-  return call_method<jint>(m_object, "length", "()I");
  128
+  return call_method<jint>(m_object,
  129
+    "length", "()I");
103 130
 }
104 131
 
105 132
 bool CJNIBitSet::isEmpty()
106 133
 {
107  
-  return call_method<jboolean>(m_object, "isEmpty", "()Z");
  134
+  return call_method<jboolean>(m_object,
  135
+    "isEmpty", "()Z");
108 136
 }
109 137
 
110 138
 bool CJNIBitSet::intersects(const CJNIBitSet &bs)
111 139
 {
112  
-  return call_method<jboolean>(m_object, "intersects", "(Ljava/util/BitSet;)Z", bs.get_raw());
  140
+  return call_method<jboolean>(m_object,
  141
+    "intersects", "(Ljava/util/BitSet;)Z",
  142
+    bs.get_raw());
113 143
 }
114 144
 
115 145
 int CJNIBitSet::cardinality()
116 146
 {
117  
-  return call_method<jint>(m_object, "cardinality", "()I");
  147
+  return call_method<jint>(m_object,
  148
+    "cardinality", "()I");
118 149
 }
119 150
 
120 151
 void CJNIBitSet::jand(const CJNIBitSet &bs)
121 152
 {
122  
-  call_method<void>(m_object, "jand", "(Ljava/util/BitSet;)V", bs.get_raw());
  153
+  call_method<void>(m_object,
  154
+    "jand", "(Ljava/util/BitSet;)V",
  155
+    bs.get_raw());
123 156
 }
124 157
 
125 158
 void CJNIBitSet::jor(const CJNIBitSet &bs)
126 159
 {
127  
-  call_method<void>(m_object, "jor", "(Ljava/util/BitSet;)V", bs.get_raw());
  160
+  call_method<void>(m_object,
  161
+    "jor", "(Ljava/util/BitSet;)V",
  162
+    bs.get_raw());
128 163
 }
129 164
 
130 165
 void CJNIBitSet::jxor(const CJNIBitSet &bs)
131 166
 {
132  
-  call_method<void>(m_object, "jxor", "(Ljava/util/BitSet;)V", bs.get_raw());
  167
+  call_method<void>(m_object,
  168
+    "jxor", "(Ljava/util/BitSet;)V",
  169
+    bs.get_raw());
133 170
 }
134 171
 
135 172
 void CJNIBitSet::jandNot(const CJNIBitSet &bs)
136 173
 {
137  
-  call_method<void>(m_object, "jandNot", "(Ljava/util/BitSet;)V", bs.get_raw());
  174
+  call_method<void>(m_object,
  175
+    "jandNot", "(Ljava/util/BitSet;)V",
  176
+    bs.get_raw());
138 177
 }
139 178
 
140 179
 int CJNIBitSet::hashCode()
141 180
 {
142  
-  return call_method<jint>(m_object, "hashCode", "()I");
  181
+  return call_method<jint>(m_object,
  182
+    "hashCode", "()I");
143 183
 }
144 184
 
145 185
 int CJNIBitSet::size()
146 186
 {
147  
-  return call_method<jint>(m_object, "size", "()I");
  187
+  return call_method<jint>(m_object,
  188
+    "size", "()I");
148 189
 }
149 190
 
150 191
 std::string CJNIBitSet::toString()
151 192
 {
152  
-  return jcast<std::string>(call_method<jhstring>(m_object, "toString", "()Ljava/lang/String;"));
  193
+  return jcast<std::string>(call_method<jhstring>(m_object,
  194
+    "toString", "()Ljava/lang/String;"));
153 195
 }
154  
-
17  xbmc/android/jni/BitSet.h
@@ -18,15 +18,16 @@
18 18
  *  <http://www.gnu.org/licenses/>.
19 19
  *
20 20
  */
  21
+
21 22
 #include "JNIBase.h"
22 23
 
23 24
 class CJNIBitSet : public CJNIBase
24 25
 {
25 26
 public:
26  
-  ~CJNIBitSet(){};
27  
-  CJNIBitSet(const jni::jhobject &object) : CJNIBase(object){};
28 27
   CJNIBitSet();
29 28
   CJNIBitSet(int);
  29
+  CJNIBitSet(const jni::jhobject &object) : CJNIBase(object) {};
  30
+  ~CJNIBitSet() {};
30 31
 
31 32
   void flip(int);
32 33
   void flip(int, int);
@@ -39,17 +40,17 @@ class CJNIBitSet : public CJNIBase
39 40
   void clear();
40 41
   bool get(int);
41 42
   CJNIBitSet get(int, int);
42  
-  int nextSetBit(int);
43  
-  int nextClearBit(int);
44  
-  int length();
  43
+  int  nextSetBit(int);
  44
+  int  nextClearBit(int);
  45
+  int  length();
45 46
   bool isEmpty();
46 47
   bool intersects(const CJNIBitSet &);
47  
-  int cardinality();
  48
+  int  cardinality();
48 49
   void jand(const CJNIBitSet &);
49 50
   void jor(const CJNIBitSet &);
50 51
   void jxor(const CJNIBitSet &);
51 52
   void jandNot(const CJNIBitSet &);
52  
-  int hashCode();
53  
-  int size();
  53
+  int  hashCode();
  54
+  int  size();
54 55
   std::string toString();
55 56
 };
6  xbmc/android/jni/Bitmap.h
@@ -18,13 +18,13 @@
18 18
  *  <http://www.gnu.org/licenses/>.
19 19
  *
20 20
  */
  21
+
21 22
 #include "JNIBase.h"
22 23
 
23 24
 class CJNIBitmap : public CJNIBase
24 25
 {
25 26
 public:
26 27
   CJNIBitmap();
27  
-  ~CJNIBitmap(){};
28  
-  CJNIBitmap(const jni::jhobject &object) : CJNIBase(object){};
29  
-
  28
+  CJNIBitmap(const jni::jhobject &object) : CJNIBase(object) {};
  29
+  ~CJNIBitmap() {};
30 30
 };
4  xbmc/android/jni/BitmapDrawable.cpp
@@ -17,6 +17,7 @@
17 17
  *  <http://www.gnu.org/licenses/>.
18 18
  *
19 19
  */
  20
+
20 21
 #include "BitmapDrawable.h"
21 22
 #include "Bitmap.h"
22 23
 #include "jutils/jutils-details.hpp"
@@ -31,5 +32,6 @@ CJNIBitmapDrawable::CJNIBitmapDrawable() : CJNIDrawable("android/graphics/drawab
31 32
 
32 33
 CJNIBitmap CJNIBitmapDrawable::getBitmap()
33 34
 {
34  
-   return (CJNIBitmap)call_method<jhobject>(m_object, "getBitmap", "()Landroid/graphics/Bitmap;");
  35
+   return call_method<jhobject>(m_object,
  36
+    "getBitmap", "()Landroid/graphics/Bitmap;");
35 37
 }
10  xbmc/android/jni/BitmapDrawable.h
@@ -18,14 +18,18 @@
18 18
  *  <http://www.gnu.org/licenses/>.
19 19
  *
20 20
  */
  21
+
21 22
 #include "Drawable.h"
  23
+
22 24
 class CJNIBitmap;
  25
+
23 26
 class CJNIBitmapDrawable : public CJNIDrawable
24 27
 {
25 28
 public:
26 29
   CJNIBitmapDrawable();
27  
-  CJNIBitmapDrawable(const jni::jhobject &object) : CJNIDrawable(object){};
28  
-  CJNIBitmapDrawable(const CJNIDrawable &drawable) : CJNIDrawable(drawable.get_raw()){};
  30
+  CJNIBitmapDrawable(const jni::jhobject &object)  : CJNIDrawable(object) {};
  31
+  CJNIBitmapDrawable(const CJNIDrawable &drawable) : CJNIDrawable(drawable.get_raw()) {};
  32
+  ~CJNIBitmapDrawable() {};
  33
+
29 34
   CJNIBitmap getBitmap();
30  
-  ~CJNIBitmapDrawable(){};
31 35
 };
9  xbmc/android/jni/BroadcastReceiver.h
@@ -18,18 +18,21 @@
18 18
  *  <http://www.gnu.org/licenses/>.
19 19
  *
20 20
  */
  21
+
21 22
 #include "JNIBase.h"
22 23
 class CJNIIntent;
  24
+
23 25
 class CJNIBroadcastReceiver : public CJNIBase
24 26
 {
25 27
 public:
26 28
   static void _onReceive(JNIEnv *env, jobject context, jobject intent);
27 29
 
28 30
 protected:
29  
-  virtual void onReceive(CJNIIntent intent)=0;
30  
-  ~CJNIBroadcastReceiver(){};
31 31
   CJNIBroadcastReceiver(const std::string &className);
  32
+  ~CJNIBroadcastReceiver(){};
  33
+
  34
+  virtual void onReceive(CJNIIntent intent)=0;
32 35
 
33 36
 private:
34  
-  static CJNIBroadcastReceiver* m_receiverInstance;
  37
+  static CJNIBroadcastReceiver *m_receiverInstance;
35 38
 };
5  xbmc/android/jni/CharSequence.cpp
@@ -17,11 +17,14 @@
17 17
  *  <http://www.gnu.org/licenses/>.
18 18
  *
19 19
  */
  20
+
20 21
 #include "CharSequence.h"
21 22
 #include "jutils/jutils-details.hpp"
  23
+
22 24
 using namespace jni;
23 25
 
24 26
 std::string CJNICharSequence::toString()
25 27
 {
26  
-  return jcast<std::string>(call_method<jhstring>(m_object, "toString", "()Ljava/lang/String;"));
  28
+  return jcast<std::string>(call_method<jhstring>(m_object,
  29
+    "toString", "()Ljava/lang/String;"));
27 30
 }
7  xbmc/android/jni/CharSequence.h
@@ -18,14 +18,17 @@
18 18
  *  <http://www.gnu.org/licenses/>.
19 19
  *
20 20
  */
  21
+
21 22
 #include "JNIBase.h"
22 23
 
23 24
 class CJNICharSequence : public CJNIBase
24 25
 {
25 26
 public:
26  
-  ~CJNICharSequence(){};
27  
-  CJNICharSequence(const jni::jhobject &object) : CJNIBase(object){};
  27
+  CJNICharSequence(const jni::jhobject &object) : CJNIBase(object) {};
  28
+  ~CJNICharSequence() {};
  29
+
28 30
   std::string toString();
  31
+
29 32
 private:
30 33
   CJNICharSequence();
31 34
 };
6  xbmc/android/jni/ClassLoader.cpp
@@ -17,11 +17,15 @@
17 17
  *  <http://www.gnu.org/licenses/>.
18 18
  *
19 19
  */
  20
+
20 21
 #include "ClassLoader.h"
21 22
 #include "jutils/jutils-details.hpp"
  23
+
22 24
 using namespace jni;
23 25
 
24 26
 jhclass CJNIClassLoader::loadClass(std::string className)
25 27
 {
26  
-  return (jhclass)call_method<jhclass>(m_object, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;", jcast<jhstring>(className)); 
  28
+  return call_method<jhclass>(m_object,
  29
+    "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;",
  30
+    jcast<jhstring>(className)); 
27 31
 }
7  xbmc/android/jni/ClassLoader.h
@@ -18,14 +18,17 @@
18 18
  *  <http://www.gnu.org/licenses/>.
19 19
  *
20 20
  */
  21
+
21 22
 #include "JNIBase.h"
22 23
 
23 24
 class CJNIClassLoader : public CJNIBase
24 25
 {
25 26
 public:
26  
-  ~CJNIClassLoader(){};
  27
+  CJNIClassLoader(const jni::jhobject &object) : CJNIBase(object) {};
  28
+  ~CJNIClassLoader() {};
  29
+
27 30
   jni::jhclass loadClass(std::string className);
28  
-  CJNIClassLoader(const jni::jhobject &object) : CJNIBase(object){};
  31
+
29 32
 private:
30 33
   CJNIClassLoader();
31 34
 };
62  xbmc/android/jni/ConnectivityManager.cpp
@@ -17,10 +17,13 @@
17 17
  *  <http://www.gnu.org/licenses/>.
18 18
  *
19 19
  */
  20
+
20 21
 #include "ConnectivityManager.h"
21 22
 #include "NetworkInfo.h"
22 23
 #include "jutils/jutils-details.hpp"
23 24
 
  25
+using namespace jni;
  26
+
24 27
 int CJNIConnectivityManager::TYPE_MOBILE(0);
25 28
 int CJNIConnectivityManager::TYPE_WIFI(0);
26 29
 int CJNIConnectivityManager::TYPE_MOBILE_MMS(0);
@@ -32,81 +35,96 @@ int CJNIConnectivityManager::TYPE_BLUETOOTH(0);
32 35
 int CJNIConnectivityManager::TYPE_DUMMY(0);
33 36
 int CJNIConnectivityManager::TYPE_ETHERNET(0);
34 37
 int CJNIConnectivityManager::DEFAULT_NETWORK_PREFERENCE(0);
35  
-using namespace jni;
36 38
 
37 39
 void CJNIConnectivityManager::PopulateStaticFields()
38 40
 {
39 41
   jhclass clazz = find_class("android.net.ConnectivityManager");
40  
-  TYPE_MOBILE = (get_static_field<int>(clazz, "TYPE_MOBILE"));
41  
-  TYPE_WIFI = (get_static_field<int>(clazz, "TYPE_WIFI"));
42  
-  TYPE_MOBILE_MMS = (get_static_field<int>(clazz, "TYPE_MOBILE_MMS"));
43  
-  TYPE_MOBILE_SUPL = (get_static_field<int>(clazz, "TYPE_MOBILE_SUPL"));
44  
-  TYPE_MOBILE_DUN = (get_static_field<int>(clazz, "TYPE_MOBILE_DUN"));
  42
+  TYPE_MOBILE       = (get_static_field<int>(clazz, "TYPE_MOBILE"));
  43
+  TYPE_WIFI         = (get_static_field<int>(clazz, "TYPE_WIFI"));
  44
+  TYPE_MOBILE_MMS   = (get_static_field<int>(clazz, "TYPE_MOBILE_MMS"));
  45
+  TYPE_MOBILE_SUPL  = (get_static_field<int>(clazz, "TYPE_MOBILE_SUPL"));
  46
+  TYPE_MOBILE_DUN   = (get_static_field<int>(clazz, "TYPE_MOBILE_DUN"));
45 47
   TYPE_MOBILE_HIPRI = (get_static_field<int>(clazz, "TYPE_MOBILE_HIPRI"));
46  
-  TYPE_WIMAX = (get_static_field<int>(clazz, "TYPE_WIMAX"));
47  
-  TYPE_BLUETOOTH = (get_static_field<int>(clazz, "TYPE_BLUETOOTH"));
48  
-  TYPE_DUMMY = (get_static_field<int>(clazz, "TYPE_DUMMY"));
49  
-  TYPE_ETHERNET = (get_static_field<int>(clazz, "TYPE_ETHERNET"));
  48
+  TYPE_WIMAX        = (get_static_field<int>(clazz, "TYPE_WIMAX"));
  49
+  TYPE_BLUETOOTH    = (get_static_field<int>(clazz, "TYPE_BLUETOOTH"));
  50
+  TYPE_DUMMY        = (get_static_field<int>(clazz, "TYPE_DUMMY"));
  51
+  TYPE_ETHERNET     = (get_static_field<int>(clazz, "TYPE_ETHERNET"));
50 52
   DEFAULT_NETWORK_PREFERENCE = (get_static_field<int>(clazz, "DEFAULT_NETWORK_PREFERENCE"));
51 53
 }
52 54
 
53 55
 bool CJNIConnectivityManager::isNetworkTypeValid(int networkType)
54 56
 {
55  
-  return call_method<jboolean>(m_object, "isNetworkTypeValid", "(I)Z", networkType);
  57
+  return call_method<jboolean>(m_object,
  58
+    "isNetworkTypeValid", "(I)Z",
  59
+    networkType);
56 60
 }
57 61
 
58 62
 void CJNIConnectivityManager::setNetworkPreference(int preference)
59 63
 {
60  
-  return call_method<void>(m_object, "setNetworkPreference", "(I)V", preference);
  64
+  return call_method<void>(m_object,
  65
+    "setNetworkPreference", "(I)V",
  66
+    preference);
61 67
 }
62 68
 
63 69
 int CJNIConnectivityManager::getNetworkPreference()
64 70
 {
65  
-  return call_method<jint>(m_object, "getNetworkPreference", "()I");
  71
+  return call_method<jint>(m_object,
  72
+    "getNetworkPreference", "()I");
66 73
 }
67 74
 
68 75
 CJNINetworkInfo CJNIConnectivityManager::getActiveNetworkInfo()
69 76
 {
70  
-  return (CJNINetworkInfo)call_method<jhobject>(m_object, "getActiveNetworkInfo", "()Landroid/net/NetworkInfo;");
  77
+  return call_method<jhobject>(m_object,
  78
+    "getActiveNetworkInfo", "()Landroid/net/NetworkInfo;");
71 79
 }
72 80
 
73 81
 CJNINetworkInfo CJNIConnectivityManager::getNetworkInfo(int networkType)
74 82
 {
75  
-  return (CJNINetworkInfo)call_method<jhobject>(m_object, "getNetworkInfo", "(I)Landroid/net/NetworkInfo;", networkType);
  83
+  return call_method<jhobject>(m_object,
  84
+    "getNetworkInfo", "(I)Landroid/net/NetworkInfo;",
  85
+    networkType);
76 86
 }
77 87
 
78 88
 std::vector<CJNINetworkInfo> CJNIConnectivityManager::getAllNetworkInfo()
79 89
 {
80 90
   JNIEnv *env = xbmc_jnienv();
81  
-  jhobjectArray oNetworks = call_method<jhobjectArray>(m_object, "getAllNetworkInfo", "()[Landroid/net/NetworkInfo;");
  91
+
  92
+  jhobjectArray oNetworks = call_method<jhobjectArray>(m_object,
  93
+    "getAllNetworkInfo", "()[Landroid/net/NetworkInfo;");
82 94
   jsize size = env->GetArrayLength(oNetworks.get());
83 95
   std::vector<CJNINetworkInfo> networks;
84 96
   networks.reserve(size);
85 97
   for(int i = 0; i < size; i++)
86  
-  {
87 98
     networks.push_back(CJNINetworkInfo(jhobject(env->GetObjectArrayElement(oNetworks.get(), i))));
88  
-  }
  99
+
89 100
   return networks;
90 101
 }
91 102
 
92 103
 int CJNIConnectivityManager::startUsingNetworkFeature(int networkType, std::string feature)
93 104
 {
94  
-  return call_method<jint>(m_object, "startUsingNetworkFeature", "(ILjava/lang/String;)I", networkType, jcast<jhstring>(feature));
  105
+  return call_method<jint>(m_object,
  106
+    "startUsingNetworkFeature", "(ILjava/lang/String;)I",
  107
+    networkType, jcast<jhstring>(feature));
95 108
 }
96 109
 
97 110
 int CJNIConnectivityManager::stopUsingNetworkFeature(int networkType, std::string feature)
98 111
 {
99  
-  return call_method<jint>(m_object, "stopUsingNetworkFeature", "(ILjava/lang/String;)I", networkType, jcast<jhstring>(feature));
  112
+  return call_method<jint>(m_object,
  113
+    "stopUsingNetworkFeature", "(ILjava/lang/String;)I",
  114
+    networkType, jcast<jhstring>(feature));
100 115
 }
101 116
 
102 117
 bool CJNIConnectivityManager::requestRouteToHost(int networkType, int hostAddress)
103 118
 {
104  
-  return call_method<jboolean>(m_object, "requestRouteToHost", "(II)Z", networkType, hostAddress);
  119
+  return call_method<jboolean>(m_object,
  120
+    "requestRouteToHost", "(II)Z",
  121
+    networkType, hostAddress);
105 122
 }
106 123
 
107 124
 bool CJNIConnectivityManager::getBackgroundDataSetting()
108 125
 {
109  
-  return call_method<jboolean>(m_object, "getBackgroundDataSetting", "()Z");
  126
+  return call_method<jboolean>(m_object,
  127
+    "getBackgroundDataSetting", "()Z");
110 128
 }
111 129
 
112 130
 
14  xbmc/android/jni/ConnectivityManager.h
@@ -18,24 +18,28 @@
18 18
  *  <http://www.gnu.org/licenses/>.
19 19
  *
20 20
  */
  21
+
21 22
 #include "JNIBase.h"
22 23
 
23 24
 class CJNINetworkInfo;
  25
+
24 26
 class CJNIConnectivityManager : public CJNIBase
25 27
 {
26 28
 public:
27  
-  CJNIConnectivityManager(const jni::jhobject &object) : CJNIBase(object){};
  29
+  CJNIConnectivityManager(const jni::jhobject &object) : CJNIBase(object) {};
  30
+
28 31
   bool isNetworkTypeValid(int);
29 32
   void setNetworkPreference(int);
30  
-  int getNetworkPreference();
  33
+  int  getNetworkPreference();
31 34
   CJNINetworkInfo getActiveNetworkInfo();
32 35
   CJNINetworkInfo getNetworkInfo(int);
33 36
   std::vector<CJNINetworkInfo> getAllNetworkInfo();
34  
-  int startUsingNetworkFeature(int, std::string);
35  
-  int stopUsingNetworkFeature(int, std::string);
  37
+  int  startUsingNetworkFeature(int, std::string);
  38
+  int  stopUsingNetworkFeature(int, std::string);
36 39
   bool requestRouteToHost(int, int);
37 40
   bool getBackgroundDataSetting();
38 41
 
  42
+  static void PopulateStaticFields();
39 43
   static int TYPE_MOBILE;
40 44
   static int TYPE_WIFI;
41 45
   static int TYPE_MOBILE_MMS;
@@ -48,7 +52,7 @@ class CJNIConnectivityManager : public CJNIBase
48 52
   static int TYPE_ETHERNET;
49 53
   static int DEFAULT_NETWORK_PREFERENCE;
50 54
 
51  
-  static void PopulateStaticFields();
  55
+
52 56
 private:
53 57
   CJNIConnectivityManager();
54 58
 };
20  xbmc/android/jni/ContentResolver.cpp
@@ -17,31 +17,33 @@
17 17
  *  <http://www.gnu.org/licenses/>.
18 18
  *
19 19
  */
  20
+
20 21
 #include "ContentResolver.h"
21 22
 #include "Cursor.h"
22 23
 #include "jutils/jutils-details.hpp"
23 24
 #include "URI.h"
  25
+
  26
+using namespace jni;
  27
+
24 28
 std::string CJNIContentResolver::SCHEME_CONTENT;
25 29
 std::string CJNIContentResolver::SCHEME_ANDROID_RESOURCE;
26 30
 std::string CJNIContentResolver::SCHEME_FILE;
27 31
 std::string CJNIContentResolver::CURSOR_ITEM_BASE_TYPE;
28 32
 std::string CJNIContentResolver::CURSOR_DIR_BASE_TYPE;
29 33
 
30  
-using namespace jni;
31 34
 void CJNIContentResolver::PopulateStaticFields()
32 35
 {
33 36
   jhclass clazz = find_class("android/content/ContentResolver");
34  
-  SCHEME_CONTENT = jcast<std::string>(get_static_field<jhstring>(clazz,"SCHEME_CONTENT"));
  37
+  SCHEME_CONTENT          = jcast<std::string>(get_static_field<jhstring>(clazz,"SCHEME_CONTENT"));
35 38
   SCHEME_ANDROID_RESOURCE = jcast<std::string>(get_static_field<jhstring>(clazz,"SCHEME_ANDROID_RESOURCE"));
36  
-  SCHEME_FILE = jcast<std::string>(get_static_field<jhstring>(clazz,"SCHEME_FILE"));
37  
-  CURSOR_ITEM_BASE_TYPE = jcast<std::string>(get_static_field<jhstring>(clazz,"CURSOR_ITEM_BASE_TYPE"));
38  
-  CURSOR_DIR_BASE_TYPE = jcast<std::string>(get_static_field<jhstring>(clazz,"CURSOR_DIR_BASE_TYPE"));
  39
+  SCHEME_FILE             = jcast<std::string>(get_static_field<jhstring>(clazz,"SCHEME_FILE"));
  40
+  CURSOR_ITEM_BASE_TYPE   = jcast<std::string>(get_static_field<jhstring>(clazz,"CURSOR_ITEM_BASE_TYPE"));
  41
+  CURSOR_DIR_BASE_TYPE    = jcast<std::string>(get_static_field<jhstring>(clazz,"CURSOR_DIR_BASE_TYPE"));
39 42
 }
40 43
 
41 44
 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)
42 45
 {
43  
-
44  
-  return (CJNICursor)(call_method<jhobject>(m_object, \
45  
-         "query","(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;", \
46  
-         uri.get_raw(), jcast<jhobjectArray>(projection), jcast<jhstring>(selection), jcast<jhobjectArray>(selectionArgs), jcast<jhstring>(sortOrder)));
  46
+  return (CJNICursor)(call_method<jhobject>(m_object,
  47
+    "query","(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;",
  48
+    uri.get_raw(), jcast<jhobjectArray>(projection), jcast<jhstring>(selection), jcast<jhobjectArray>(selectionArgs), jcast<jhstring>(sortOrder)));
47 49
 }
10  xbmc/android/jni/ContentResolver.h
@@ -18,24 +18,26 @@
18 18
  *  <http://www.gnu.org/licenses/>.
19 19
  *
20 20
  */
  21
+
21 22
 #include "JNIBase.h"
22 23
 
23 24
 class CJNICursor;
24 25
 class CJNIURI;
  26
+
25 27
 class CJNIContentResolver : public CJNIBase
26 28
 {
27 29
 public:
28  
-  CJNIContentResolver(const jni::jhobject &object) : CJNIBase(object){};
  30
+  CJNIContentResolver(const jni::jhobject &object) : CJNIBase(object) {};
  31
+
  32
+  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);
29 33
 
  34
+  static void PopulateStaticFields();
30 35
   static std::string SCHEME_CONTENT;
31 36
   static std::string SCHEME_ANDROID_RESOURCE;
32 37
   static std::string SCHEME_FILE;
33 38
   static std::string CURSOR_ITEM_BASE_TYPE;
34 39
   static std::string CURSOR_DIR_BASE_TYPE;
35 40
 
36  
-  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);
37  
-
38  
-  static void PopulateStaticFields();
39 41
 private:
40 42
   CJNIContentResolver();
41 43
 };
72  xbmc/android/jni/Context.cpp
@@ -17,6 +17,7 @@
17 17
  *  <http://www.gnu.org/licenses/>.
18 18
  *
19 19
  */
  20
+
20 21
 #include "Context.h"
21 22
 #include "PackageManager.h"
22 23
 #include <android/log.h>
@@ -35,12 +36,18 @@
35 36
 #include "Cursor.h"
36 37
 #include "ConnectivityManager.h"
37 38
 #include "AudioManager.h"
  39
+#include "Surface.h"
  40
+#include "MediaCodec.h"
  41
+#include "MediaCodecInfo.h"
  42
+#include "MediaFormat.h"
  43
+
38 44
 #include <android/native_activity.h>
39 45
 
40 46
 using namespace jni;
41 47
 
42 48
 jhobject CJNIContext::m_context(0);
43 49
 CJNIContext* CJNIContext::m_appInstance(NULL);
  50
+
44 51
 CJNIContext::CJNIContext(const ANativeActivity *nativeActivity)
45 52
 {
46 53
   m_context.reset(nativeActivity->clazz);
@@ -67,89 +74,116 @@ void CJNIContext::PopulateStaticFields()
67 74
   CJNIContentResolver::PopulateStaticFields();
68 75
   CJNIConnectivityManager::PopulateStaticFields();
69 76
   CJNIAudioManager::PopulateStaticFields();
70  
-
  77
+  CJNISurface::PopulateStaticFields();
  78
+  CJNIMediaCodec::PopulateStaticFields();
  79
+  CJNIMediaCodecInfoCodecProfileLevel::PopulateStaticFields();
  80
+  CJNIMediaCodecInfoCodecCapabilities::PopulateStaticFields();
  81
+  CJNIMediaFormat::PopulateStaticFields();
71 82
 }
72 83
 
73 84
 CJNIPackageManager CJNIContext::GetPackageManager()
74 85
 {
75  
-  return (CJNIPackageManager)call_method<jhobject>(m_context, "getPackageManager", "()Landroid/content/pm/PackageManager;");
  86
+  return call_method<jhobject>(m_context,
  87
+    "getPackageManager", "()Landroid/content/pm/PackageManager;");
76 88
 }
77 89
 
78 90
 void CJNIContext::startActivity(const CJNIIntent &intent)
79 91
 {
80  
-  call_method<void>(jhobject(m_context), "startActivity", "(Landroid/content/Intent;)V", intent.get_raw());
  92
+  call_method<void>(jhobject(m_context),
  93
+    "startActivity", "(Landroid/content/Intent;)V",
  94
+    intent.get_raw());
81 95
 }
82 96
 
83 97
 int CJNIContext::checkCallingOrSelfPermission(const std::string &permission)
84 98
 {
85  
-  return call_method<int>(m_context, "checkCallingOrSelfPermission", "(Ljava/lang/String;)I", jcast<jhstring>(permission));
  99
+  return call_method<int>(m_context,
  100
+    "checkCallingOrSelfPermission", "(Ljava/lang/String;)I",
  101
+    jcast<jhstring>(permission));
86 102
 }
87 103
 
88 104
 jhobject CJNIContext::getSystemService(const std::string &service)
89 105
 {
90  
-  return call_method<jhobject>(m_context, "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;", jcast<jhstring>(service));
  106
+  return call_method<jhobject>(m_context,
  107
+    "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;",
  108
+    jcast<jhstring>(service));
91 109
 }
92 110
 
93 111
 CJNIIntent CJNIContext::registerReceiver(const CJNIBroadcastReceiver &receiver, const CJNIIntentFilter &filter)
94 112
 {
95  
-  return (CJNIIntent)call_method<jhobject>(m_context, "registerReceiver", \
96  
-                             "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;", receiver.get_raw(), filter.get_raw());
  113
+  return call_method<jhobject>(m_context,
  114
+    "registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;",
  115
+    receiver.get_raw(), filter.get_raw());
97 116
 }
98 117
 
99 118
 CJNIIntent CJNIContext::registerReceiver(const CJNIIntentFilter &filter)
100 119
 {
101  
-  return (CJNIIntent)call_method<jhobject>(m_context, "registerReceiver", \
102  
-                             "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;", (jobject)NULL, filter.get_raw());
  120
+  return call_method<jhobject>(m_context,
  121
+    "registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;",
  122
+    (jobject)NULL, filter.get_raw());
103 123
 }
104 124
 
105 125
 void CJNIContext::unregisterReceiver(const CJNIBroadcastReceiver &receiver)
106 126
 {
107  
-  call_method<void>(m_context, "unregisterReceiver", "(Landroid/content/BroadcastReceiver;)V", receiver.get_raw());
  127
+  call_method<void>(m_context,
  128
+    "unregisterReceiver", "(Landroid/content/BroadcastReceiver;)V",
  129
+    receiver.get_raw());
108 130
 }
109 131
 
110 132
 CJNIIntent CJNIContext::sendBroadcast(const CJNIIntent &intent)
111 133
 {
112  
-  return (CJNIIntent)call_method<jhobject>(m_context, "sendBroadcast", "(Landroid/content/Intent;)V", intent.get_raw());
  134
+  return call_method<jhobject>(m_context,
  135
+    "sendBroadcast", "(Landroid/content/Intent;)V",
  136
+    intent.get_raw());
113 137
 }
114 138
 
115 139
 CJNIIntent CJNIContext::getIntent()
116 140
 {
117  
-  return (CJNIIntent)call_method<jhobject>(m_context, "getIntent", "()Landroid/content/Intent;");
  141
+  return call_method<jhobject>(m_context,
  142
+    "getIntent", "()Landroid/content/Intent;");
118 143
 }
119 144
 
120 145
 CJNIClassLoader CJNIContext::getClassLoader()
121 146
 {
122  
-  return (CJNIClassLoader)call_method<jhobject>(m_context, "getClassLoader", "()Ljava/lang/ClassLoader;");
  147
+  return call_method<jhobject>(m_context,
  148
+    "getClassLoader", "()Ljava/lang/ClassLoader;");
123 149
 }
124 150
 
125 151
 CJNIApplicationInfo CJNIContext::getApplicationInfo()
126 152
 {
127  
-  return (CJNIApplicationInfo)call_method<jhobject>(m_context, "getApplicationInfo", "()Landroid/content/pm/ApplicationInfo;");
  153
+  return call_method<jhobject>(m_context,
  154
+    "getApplicationInfo", "()Landroid/content/pm/ApplicationInfo;");
128 155
 }
129 156
 
130 157
 std::string CJNIContext::getPackageResourcePath()
131 158
 {
132  
-  return jcast<std::string>(call_method<jhstring>(m_context, "getPackageResourcePath", "()Ljava/lang/String;"));
  159
+  return jcast<std::string>(call_method<jhstring>(m_context,
  160
+    "getPackageResourcePath", "()Ljava/lang/String;"));
133 161
 }
134 162
 
135 163
 CJNIFile CJNIContext::getCacheDir()
136 164
 {
137  
-  return (CJNIFile)call_method<jhobject>(m_context, "getCacheDir", "()Ljava/io/File;");
  165
+  return call_method<jhobject>(m_context,
  166
+    "getCacheDir", "()Ljava/io/File;");
138 167
 }
139 168
 
140 169
 CJNIFile CJNIContext::getDir(const std::string &path, int mode)
141 170
 {
142  
-  return (CJNIFile)call_method<jhobject>(m_context, "getDir", "(Ljava/lang/String;I)Ljava/io/File;", jcast<jhstring>(path), mode);
  171
+  return call_method<jhobject>(m_context,
  172
+    "getDir", "(Ljava/lang/String;I)Ljava/io/File;",
  173
+    jcast<jhstring>(path), mode);
143 174
 }
144 175
 
145 176
 CJNIFile CJNIContext::getExternalFilesDir(const std::string &path)
146 177
 {
147  
-  return (CJNIFile)call_method<jhobject>(m_context, "getExternalFilesDir", "(Ljava/lang/String;)Ljava/io/File;", jcast<jhstring>(path));
  178
+  return call_method<jhobject>(m_context,
  179
+    "getExternalFilesDir", "(Ljava/lang/String;)Ljava/io/File;",
  180
+    jcast<jhstring>(path));
148 181
 }
149 182
 
150 183
 CJNIContentResolver CJNIContext::getContentResolver()
151 184
 {
152  
-  return (CJNIContentResolver)call_method<jhobject>(m_context, "getContentResolver", "()Landroid/content/ContentResolver;");
  185
+  return call_method<jhobject>(m_context,
  186
+    "getContentResolver", "()Landroid/content/ContentResolver;");
153 187
 }
154 188
 
155 189
 void CJNIContext::_onNewIntent(JNIEnv *env, jobject context, jobject intent)
8  xbmc/android/jni/Context.h
@@ -18,8 +18,10 @@
18 18
  *  <http://www.gnu.org/licenses/>.
19 19
  *
20 20
  */
  21
+
21 22
 #include "JNIBase.h"
22 23
 #include "BroadcastReceiver.h"
  24
+
23 25
 class ANativeActivity;
24 26
 class CJNIIntent;
25 27
 class CJNIPackageManager;
@@ -29,6 +31,7 @@ class CJNIClassLoader;
29 31
 class CJNIApplicationInfo;
30 32
 class CJNIFile;
31 33
 class CJNIContentResolver;
  34
+
32 35
 class CJNIContext
33 36
 {
34 37
 public:
@@ -50,13 +53,16 @@ class CJNIContext
50 53
   static CJNIContentResolver getContentResolver();
51 54
   static CJNIContext* GetAppInstance() { return m_appInstance; };
52 55
   static void _onNewIntent(JNIEnv *env, jobject context, jobject intent);
  56
+
53 57
 protected:
54  
-  virtual void onNewIntent(CJNIIntent intent)=0;
55 58
   CJNIContext(const ANativeActivity *nativeActivity);
56 59
   ~CJNIContext();
57 60
 
  61
+  virtual void onNewIntent(CJNIIntent intent)=0;
  62
+
58 63
 private:
59 64
   CJNIContext();
  65
+
60 66
   void PopulateStaticFields();
61 67
   void operator=(CJNIContext const&){};
62 68
   static jni::jhobject m_context;
106  xbmc/android/jni/Cursor.cpp
@@ -17,6 +17,7 @@
17 17
  *  <http://www.gnu.org/licenses/>.
18 18
  *
19 19
  */
  20
+
20 21
 #include "Cursor.h"
21 22
 #include "jutils/jutils-details.hpp"
22 23
 #include "URI.h"
@@ -32,150 +33,189 @@ int CJNICursor::FIELD_TYPE_BLOB(0);
32 33
 void CJNICursor::PopulateStaticFields()
33 34
 {
34 35
   jhclass clazz = find_class("android/database/Cursor");
35  
-  FIELD_TYPE_NULL = (get_static_field<int>(clazz, "FIELD_TYPE_NULL"));
36  
-  FIELD_TYPE_INTEGER = (get_static_field<int>(clazz, "FIELD_TYPE_INTEGER"));
37  
-  FIELD_TYPE_FLOAT = (get_static_field<int>(clazz, "FIELD_TYPE_FLOAT"));
38  
-  FIELD_TYPE_STRING = (get_static_field<int>(clazz, "FIELD_TYPE_STRING"));
39  
-  FIELD_TYPE_BLOB = (get_static_field<int>(clazz, "FIELD_TYPE_BLOB"));
  36
+  FIELD_TYPE_NULL     = (get_static_field<int>(clazz, "FIELD_TYPE_NULL"));
  37
+  FIELD_TYPE_INTEGER  = (get_static_field<int>(clazz, "FIELD_TYPE_INTEGER"));
  38
+  FIELD_TYPE_FLOAT    = (get_static_field<int>(clazz, "FIELD_TYPE_FLOAT"));
  39
+  FIELD_TYPE_STRING   = (get_static_field<int>(clazz, "FIELD_TYPE_STRING"));
  40
+  FIELD_TYPE_BLOB     = (get_static_field<int>(clazz, "FIELD_TYPE_BLOB"));
40 41
 }
41 42