The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

externl: Update android-jni-wrap

authored by

Jarvis Huang and committed by
Ryan Pavlik
7c02d466 d60db292

+556 -27
-2
src/external/android-jni-wrap/wrap/android.app.cpp
··· 12 12 Activity::Meta::Meta() 13 13 : MetaBaseDroppable(Activity::getTypeName()), 14 14 getWindow(classRef().getMethod("getWindow", "()Landroid/view/Window;")), 15 - getSystemService(classRef().getMethod( 16 - "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;")), 17 15 setVrModeEnabled(classRef().getMethod( 18 16 "setVrModeEnabled", "(ZLandroid/content/ComponentName;)V")) { 19 17 MetaBaseDroppable::dropClassRef();
-12
src/external/android-jni-wrap/wrap/android.app.h
··· 65 65 jni::Object getWindow(); 66 66 67 67 /*! 68 - * Wrapper for the getSystemService method 69 - * 70 - * Java prototype: 71 - * `public java.lang.Object getSystemService(java.lang.String);` 72 - * 73 - * JNI signature: (Ljava/lang/String;)Ljava/lang/Object; 74 - * 75 - */ 76 - jni::Object getSystemService(std::string const &name); 77 - 78 - /*! 79 68 * Wrapper for the setVrModeEnabled method 80 69 * 81 70 * Java prototype: ··· 93 82 */ 94 83 struct Meta : public MetaBaseDroppable { 95 84 jni::method_t getWindow; 96 - jni::method_t getSystemService; 97 85 jni::method_t setVrModeEnabled; 98 86 99 87 /*!
-5
src/external/android-jni-wrap/wrap/android.app.impl.h
··· 16 16 return object().call<jni::Object>(Meta::data().getWindow); 17 17 } 18 18 19 - inline jni::Object Activity::getSystemService(std::string const &name) { 20 - assert(!isNull()); 21 - return object().call<jni::Object>(Meta::data().getSystemService, name); 22 - } 23 - 24 19 inline void 25 20 Activity::setVrModeEnabled(bool enabled, 26 21 content::ComponentName const &requestedComponent) {
+7 -1
src/external/android-jni-wrap/wrap/android.content.cpp
··· 24 24 "startActivity", "(Landroid/content/Intent;Landroid/os/Bundle;)V")), 25 25 createPackageContext(classRef().getMethod( 26 26 "createPackageContext", 27 - "(Ljava/lang/String;I)Landroid/content/Context;")) { 27 + "(Ljava/lang/String;I)Landroid/content/Context;")), 28 + createDisplayContext(classRef().getMethod( 29 + "createDisplayContext", "(Landroid/view/Display;)Landroid/content/Context;")), 30 + getSystemService(classRef().getMethod( 31 + "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;")), 32 + getExternalFilesDir(classRef().getMethod( 33 + "getExternalFilesDir", "(Ljava/lang/String;)Ljava/io/File;")) { 28 34 if (!deferDrop) { 29 35 MetaBaseDroppable::dropClassRef(); 30 36 }
+44
src/external/android-jni-wrap/wrap/android.content.h
··· 8 8 #include <string> 9 9 10 10 namespace wrap { 11 + namespace java::io { 12 + class File; 13 + } // namespace java::io 14 + 11 15 namespace android::content { 12 16 class ComponentName; 13 17 class ContentResolver; ··· 27 31 class Uri; 28 32 class Uri_Builder; 29 33 } // namespace android::net 34 + 35 + namespace android::view { 36 + class Display; 37 + } // namespace android::view 30 38 31 39 namespace android::os { 32 40 class Bundle; ··· 153 161 */ 154 162 Context createPackageContext(std::string const &packageName, int32_t flags); 155 163 164 + /*! 165 + * Wrapper for the createDisplayContext method 166 + * 167 + * Java prototype: 168 + * `public abstract Context createDisplayContext(android.view.Display display)` 169 + * 170 + * JNI signature: (Landroid/view/Display;)Landroid/content/Context; 171 + * 172 + */ 173 + Context createDisplayContext(wrap::android::view::Display const &display); 174 + 175 + /*! 176 + * Wrapper for the getSystemService method 177 + * 178 + * Java prototype: 179 + * `public abstract java.lang.Object getSystemService(java.lang.String);` 180 + * 181 + * JNI signature: (Ljava/lang/String;)Ljava/lang/Object; 182 + * 183 + */ 184 + jni::Object getSystemService(std::string const &name); 185 + 186 + /*! 187 + * Wrapper for the getExternalFilesDir method 188 + * 189 + * Java prototype: 190 + * `public abstract java.io.File getExternalFilesDir(java.lang.String);` 191 + * 192 + * JNI signature: (Ljava/lang/String;)Ljava/io/File; 193 + * 194 + */ 195 + java::io::File getExternalFilesDir(std::string const &type); 196 + 156 197 enum { 157 198 CONTEXT_INCLUDE_CODE = 1, 158 199 CONTEXT_IGNORE_SECURITY = 2, ··· 171 212 jni::method_t startActivity; 172 213 jni::method_t startActivity1; 173 214 jni::method_t createPackageContext; 215 + jni::method_t createDisplayContext; 216 + jni::method_t getSystemService; 217 + jni::method_t getExternalFilesDir; 174 218 175 219 /*! 176 220 * Singleton accessor
+17
src/external/android-jni-wrap/wrap/android.content.impl.h
··· 9 9 #include "android.database.h" 10 10 #include "android.net.h" 11 11 #include "android.os.h" 12 + #include "android.view.h" 13 + #include "java.io.h" 12 14 #include "java.lang.h" 13 15 #include <string> 14 16 ··· 69 71 assert(!isNull()); 70 72 return Context(object().call<jni::Object>(Meta::data().createPackageContext, 71 73 packageName, flags)); 74 + } 75 + 76 + inline Context Context::createDisplayContext(const wrap::android::view::Display &display) { 77 + assert(!isNull()); 78 + return Context(object().call<jni::Object>(Meta::data().createDisplayContext, display.object())); 79 + } 80 + 81 + inline jni::Object Context::getSystemService(std::string const &name) { 82 + assert(!isNull()); 83 + return object().call<jni::Object>(Meta::data().getSystemService, name); 84 + } 85 + 86 + inline java::io::File Context::getExternalFilesDir(std::string const &type) { 87 + assert(!isNull()); 88 + return java::io::File(object().call<jni::Object>(Meta::data().getExternalFilesDir, type)); 72 89 } 73 90 74 91 inline net::Uri_Builder ContentUris::appendId(net::Uri_Builder &uri_Builder,
+15
src/external/android-jni-wrap/wrap/android.hardware.display.cpp
··· 1 + // Copyright 2022, Qualcomm Innovation Center, Inc. 2 + // SPDX-License-Identifier: BSL-1.0 3 + // Author: Jarvis Huang 4 + 5 + #include "android.hardware.display.h" 6 + 7 + namespace wrap { 8 + namespace android::hardware::display { 9 + DisplayManager::Meta::Meta() 10 + : MetaBaseDroppable(DisplayManager::getTypeName()), 11 + getDisplay(classRef().getMethod("getDisplay", "(I)Landroid/view/Display;")) { 12 + MetaBaseDroppable::dropClassRef(); 13 + } 14 + } // namespace android::hardware::display 15 + } // namespace wrap
+59
src/external/android-jni-wrap/wrap/android.hardware.display.h
··· 1 + // Copyright 2022, Qualcomm Innovation Center, Inc. 2 + // SPDX-License-Identifier: BSL-1.0 3 + // Author: Jarvis Huang 4 + 5 + #pragma once 6 + 7 + #include "ObjectWrapperBase.h" 8 + 9 + namespace wrap { 10 + namespace android::view { 11 + class Display; 12 + } // namespace android::view 13 + } // namespace wrap 14 + 15 + namespace wrap { 16 + namespace android::hardware::display { 17 + /*! 18 + * Wrapper for android.hardware.display.DisplayManager objects. 19 + */ 20 + class DisplayManager : public ObjectWrapperBase { 21 + public: 22 + using ObjectWrapperBase::ObjectWrapperBase; 23 + static constexpr const char *getTypeName() noexcept { 24 + return "android/hardware/display/DisplayManager"; 25 + } 26 + 27 + /*! 28 + * Wrapper for the getDisplay method 29 + * 30 + * Java prototype: 31 + * `public Display getDisplay(int)` 32 + * 33 + * JNI signature: (I)Landroid/view/Display; 34 + * 35 + */ 36 + android::view::Display getDisplay(int32_t displayId); 37 + 38 + /*! 39 + * Class metadata 40 + */ 41 + struct Meta : public MetaBaseDroppable { 42 + jni::method_t getDisplay; 43 + 44 + /*! 45 + * Singleton accessor 46 + */ 47 + static Meta &data() { 48 + static Meta instance{}; 49 + return instance; 50 + } 51 + 52 + private: 53 + Meta(); 54 + }; 55 + }; 56 + 57 + } // namespace android::hardware::display 58 + } // namespace wrap 59 + #include "android.hardware.display.impl.h"
+18
src/external/android-jni-wrap/wrap/android.hardware.display.impl.h
··· 1 + // Copyright 2022, Qualcomm Innovation Center, Inc. 2 + // SPDX-License-Identifier: BSL-1.0 3 + // Author: Jarvis Huang 4 + // Inline implementations: do not include on its own! 5 + 6 + #pragma once 7 + 8 + #include "android.view.h" 9 + 10 + namespace wrap { 11 + namespace android::hardware::display { 12 + inline android::view::Display DisplayManager::getDisplay(int32_t displayId) { 13 + assert(!isNull()); 14 + return android::view::Display( 15 + object().call<jni::Object>(Meta::data().getDisplay, displayId)); 16 + } 17 + } // namespace android::hardware::display 18 + } // namespace wrap
+3 -1
src/external/android-jni-wrap/wrap/android.provider.cpp
··· 8 8 namespace android::provider { 9 9 Settings::Meta::Meta() 10 10 : MetaBase(Settings::getTypeName()), 11 - ACTION_VR_LISTENER_SETTINGS(classRef(), "ACTION_VR_LISTENER_SETTINGS") {} 11 + ACTION_VR_LISTENER_SETTINGS(classRef(), "ACTION_VR_LISTENER_SETTINGS"), 12 + canDrawOverlays(classRef().getStaticMethod( 13 + "canDrawOverlays", "(Landroid/content/Context;)Z")) {} 12 14 } // namespace android::provider 13 15 } // namespace wrap
+18
src/external/android-jni-wrap/wrap/android.provider.h
··· 8 8 #include <string> 9 9 10 10 namespace wrap { 11 + namespace android::content { 12 + class Context; 13 + } // namespace android::content 14 + 11 15 namespace android::provider { 12 16 /*! 13 17 * Wrapper for android.provider.Settings objects. ··· 31 35 static std::string ACTION_VR_LISTENER_SETTINGS(); 32 36 33 37 /*! 38 + * Wrapper for the canDrawOverlays static method 39 + * 40 + * Java prototype: 41 + * `public static final boolean 42 + * canDrawOverlays(android.content.Context);` 43 + * 44 + * JNI signature: 45 + * (Landroid/content/Context;)Z 46 + * 47 + */ 48 + static bool canDrawOverlays(content::Context const &context); 49 + 50 + /*! 34 51 * Class metadata 35 52 */ 36 53 struct Meta : public MetaBase { 37 54 impl::StaticFieldId<std::string> ACTION_VR_LISTENER_SETTINGS; 55 + jni::method_t canDrawOverlays; 38 56 39 57 /*! 40 58 * Singleton accessor
+6
src/external/android-jni-wrap/wrap/android.provider.impl.h
··· 5 5 6 6 #pragma once 7 7 8 + #include "android.content.h" 9 + 8 10 namespace wrap { 9 11 namespace android::provider { 10 12 inline std::string Settings::ACTION_VR_LISTENER_SETTINGS() { 11 13 return get(Meta::data().ACTION_VR_LISTENER_SETTINGS, Meta::data().clazz()); 12 14 } 13 15 16 + inline bool Settings::canDrawOverlays(const content::Context &context) { 17 + return Meta::data().clazz().call<bool>(Meta::data().canDrawOverlays, 18 + context.object()); 19 + } 14 20 } // namespace android::provider 15 21 } // namespace wrap
+27 -3
src/external/android-jni-wrap/wrap/android.view.cpp
··· 6 6 7 7 namespace wrap { 8 8 namespace android::view { 9 - Display::Meta::Meta() 9 + Display::Meta::Meta(bool deferDrop) 10 10 : MetaBaseDroppable(Display::getTypeName()), 11 + DEFAULT_DISPLAY(classRef(), "DEFAULT_DISPLAY"), 11 12 getRealSize( 12 13 classRef().getMethod("getRealSize", "(Landroid/graphics/Point;)V")), 13 14 getRealMetrics(classRef().getMethod("getRealMetrics", 14 - "(Landroid/util/DisplayMetrics;)V")) { 15 - MetaBaseDroppable::dropClassRef(); 15 + "(Landroid/util/DisplayMetrics;)V")), 16 + getDisplayId(classRef().getMethod("getDisplayId", "()I")) { 17 + if (!deferDrop) { 18 + MetaBaseDroppable::dropClassRef(); 19 + } 16 20 } 17 21 Surface::Meta::Meta() 18 22 : MetaBaseDroppable(Surface::getTypeName()), ··· 24 28 getSurface( 25 29 classRef().getMethod("getSurface", "()Landroid/view/Surface;")) { 26 30 MetaBaseDroppable::dropClassRef(); 31 + } 32 + WindowManager::Meta::Meta() 33 + : MetaBaseDroppable(WindowManager::getTypeName()), 34 + getDefaultDisplay( 35 + classRef().getMethod("getDefaultDisplay", "()Landroid/view/Display;")) { 36 + MetaBaseDroppable::dropClassRef(); 37 + } 38 + WindowManager_LayoutParams::Meta::Meta(bool deferDrop) 39 + : MetaBaseDroppable(WindowManager_LayoutParams::getTypeName()), 40 + TYPE_APPLICATION(classRef(), "TYPE_APPLICATION"), 41 + TYPE_APPLICATION_OVERLAY(classRef(), "TYPE_APPLICATION_OVERLAY"), 42 + FLAG_FULLSCREEN(classRef(), "FLAG_FULLSCREEN"), 43 + FLAG_NOT_FOCUSABLE(classRef(), "FLAG_NOT_FOCUSABLE"), 44 + FLAG_NOT_TOUCHABLE(classRef(), "FLAG_NOT_TOUCHABLE"), 45 + init(classRef().getMethod("<init>", "()V")), 46 + init1(classRef().getMethod("<init>", "(I)V")), 47 + init2(classRef().getMethod("<init>", "(II)V")) { 48 + if (!deferDrop) { 49 + MetaBaseDroppable::dropClassRef(); 50 + } 27 51 } 28 52 } // namespace android::view 29 53 } // namespace wrap
+191 -3
src/external/android-jni-wrap/wrap/android.view.h
··· 34 34 } 35 35 36 36 /*! 37 + * Getter for the DEFAULT_DISPLAY static field value 38 + * 39 + * Java prototype: 40 + * `public static final int DEFAULT_DISPLAY;` 41 + * 42 + * JNI signature: I 43 + * 44 + */ 45 + static int32_t DEFAULT_DISPLAY(); 46 + 47 + /*! 37 48 * Wrapper for the getRealSize method 38 49 * 39 50 * Java prototype: ··· 56 67 void getRealMetrics(util::DisplayMetrics &out_displayMetrics); 57 68 58 69 /*! 70 + * Wrapper for the getDisplayId method 71 + * 72 + * Java prototype: 73 + * `public int getDisplayId();` 74 + * 75 + * JNI signature: ()I 76 + * 77 + */ 78 + int32_t getDisplayId(); 79 + 80 + /*! 59 81 * Class metadata 60 82 */ 61 83 struct Meta : public MetaBaseDroppable { 84 + impl::StaticFieldId<int32_t> DEFAULT_DISPLAY; 62 85 jni::method_t getRealSize; 63 86 jni::method_t getRealMetrics; 87 + jni::method_t getDisplayId; 64 88 65 89 /*! 66 90 * Singleton accessor 67 91 */ 68 - static Meta &data() { 69 - static Meta instance{}; 92 + static Meta &data(bool deferDrop = false) { 93 + static Meta instance{deferDrop}; 70 94 return instance; 71 95 } 72 96 73 97 private: 74 - Meta(); 98 + Meta(bool deferDrop); 75 99 }; 76 100 }; 77 101 ··· 152 176 153 177 private: 154 178 Meta(); 179 + }; 180 + }; 181 + 182 + /*! 183 + * Wrapper for android.view.WindowManager objects. 184 + */ 185 + class WindowManager : public ObjectWrapperBase { 186 + public: 187 + using ObjectWrapperBase::ObjectWrapperBase; 188 + static constexpr const char *getTypeName() noexcept { 189 + return "android/view/WindowManager"; 190 + } 191 + 192 + /*! 193 + * Wrapper for the getDefaultDisplay method 194 + * 195 + * Java prototype: 196 + * `public abstract android.view.Display getDefaultDisplay();` 197 + * 198 + * JNI signature: ()Landroid/view/Display; 199 + * 200 + */ 201 + Display getDefaultDisplay(); 202 + 203 + /*! 204 + * Class metadata 205 + */ 206 + struct Meta : public MetaBaseDroppable { 207 + jni::method_t getDefaultDisplay; 208 + 209 + /*! 210 + * Singleton accessor 211 + */ 212 + static Meta &data() { 213 + static Meta instance{}; 214 + return instance; 215 + } 216 + 217 + private: 218 + Meta(); 219 + }; 220 + }; 221 + 222 + /*! 223 + * Wrapper for android.view.WindowManager objects. 224 + */ 225 + class WindowManager_LayoutParams : public ObjectWrapperBase { 226 + public: 227 + using ObjectWrapperBase::ObjectWrapperBase; 228 + static constexpr const char *getTypeName() noexcept { 229 + return "android/view/WindowManager$LayoutParams"; 230 + } 231 + 232 + /*! 233 + * Getter for the TYPE_APPLICATION static field value 234 + * 235 + * Java prototype: 236 + * `public static final int TYPE_APPLICATION;` 237 + * 238 + * JNI signature: I 239 + * 240 + */ 241 + static int32_t TYPE_APPLICATION(); 242 + 243 + /*! 244 + * Getter for the TYPE_APPLICATION_OVERLAY static field value 245 + * 246 + * Java prototype: 247 + * `public static final int TYPE_APPLICATION_OVERLAY;` 248 + * 249 + * JNI signature: I 250 + * 251 + */ 252 + static int32_t TYPE_APPLICATION_OVERLAY(); 253 + 254 + /*! 255 + * Getter for the FLAG_FULLSCREEN static field value 256 + * 257 + * Java prototype: 258 + * `public static final int FLAG_FULLSCREEN;` 259 + * 260 + * JNI signature: I 261 + * 262 + */ 263 + static int32_t FLAG_FULLSCREEN(); 264 + 265 + /*! 266 + * Getter for the FLAG_NOT_FOCUSABLE static field value 267 + * 268 + * Java prototype: 269 + * `public static final int FLAG_NOT_FOCUSABLE;` 270 + * 271 + * JNI signature: I 272 + * 273 + */ 274 + static int32_t FLAG_NOT_FOCUSABLE(); 275 + 276 + /*! 277 + * Getter for the FLAG_NOT_TOUCHABLE static field value 278 + * 279 + * Java prototype: 280 + * `public static final int FLAG_NOT_TOUCHABLE;` 281 + * 282 + * JNI signature: I 283 + * 284 + */ 285 + static int32_t FLAG_NOT_TOUCHABLE(); 286 + 287 + /*! 288 + * Wrapper for a constructor 289 + * 290 + * Java prototype: 291 + * `public android.view.WindowManager$LayoutParams();` 292 + * 293 + * JNI signature: ()V 294 + * 295 + */ 296 + static WindowManager_LayoutParams construct(); 297 + 298 + /*! 299 + * Wrapper for a constructor 300 + * 301 + * Java prototype: 302 + * `public android.view.WindowManager$LayoutParams(int);` 303 + * 304 + * JNI signature: (I)V 305 + * 306 + */ 307 + static WindowManager_LayoutParams construct(int32_t type); 308 + 309 + /*! 310 + * Wrapper for a constructor 311 + * 312 + * Java prototype: 313 + * `public android.view.WindowManager$LayoutParams(int, int);` 314 + * 315 + * JNI signature: (II)V 316 + * 317 + */ 318 + static WindowManager_LayoutParams construct(int32_t type, int32_t flags); 319 + 320 + /*! 321 + * Class metadata 322 + */ 323 + struct Meta : public MetaBaseDroppable { 324 + impl::StaticFieldId<int32_t> TYPE_APPLICATION; 325 + impl::StaticFieldId<int32_t> TYPE_APPLICATION_OVERLAY; 326 + impl::StaticFieldId<int32_t> FLAG_FULLSCREEN; 327 + impl::StaticFieldId<int32_t> FLAG_NOT_FOCUSABLE; 328 + impl::StaticFieldId<int32_t> FLAG_NOT_TOUCHABLE; 329 + jni::method_t init; 330 + jni::method_t init1; 331 + jni::method_t init2; 332 + 333 + /*! 334 + * Singleton accessor 335 + */ 336 + static Meta &data(bool deferDrop = false) { 337 + static Meta instance{deferDrop}; 338 + return instance; 339 + } 340 + 341 + private: 342 + Meta(bool deferDrop); 155 343 }; 156 344 }; 157 345
+67
src/external/android-jni-wrap/wrap/android.view.impl.h
··· 10 10 11 11 namespace wrap { 12 12 namespace android::view { 13 + inline int32_t Display::DEFAULT_DISPLAY() { 14 + auto &data = Meta::data(true); 15 + auto ret = get(data.DEFAULT_DISPLAY, data.clazz()); 16 + data.dropClassRef(); 17 + return ret; 18 + } 19 + 13 20 inline void Display::getRealSize(graphics::Point &out_size) { 14 21 assert(!isNull()); 15 22 return object().call<void>(Meta::data().getRealSize, out_size.object()); ··· 21 28 out_displayMetrics.object()); 22 29 } 23 30 31 + inline int32_t Display::getDisplayId() { 32 + assert(!isNull()); 33 + return object().call<int32_t>(Meta::data().getDisplayId); 34 + } 35 + 24 36 inline bool Surface::isValid() const { 25 37 assert(!isNull()); 26 38 return object().call<bool>(Meta::data().isValid); ··· 29 41 inline Surface SurfaceHolder::getSurface() { 30 42 assert(!isNull()); 31 43 return Surface(object().call<jni::Object>(Meta::data().getSurface)); 44 + } 45 + 46 + inline Display WindowManager::getDefaultDisplay() { 47 + assert(!isNull()); 48 + return Display(object().call<jni::Object>(Meta::data().getDefaultDisplay)); 49 + } 50 + 51 + inline int32_t WindowManager_LayoutParams::TYPE_APPLICATION() { 52 + auto &data = Meta::data(true); 53 + auto ret = get(data.TYPE_APPLICATION, data.clazz()); 54 + data.dropClassRef(); 55 + return ret; 56 + } 57 + 58 + inline int32_t WindowManager_LayoutParams::TYPE_APPLICATION_OVERLAY() { 59 + auto &data = Meta::data(true); 60 + auto ret = get(data.TYPE_APPLICATION_OVERLAY, data.clazz()); 61 + data.dropClassRef(); 62 + return ret; 63 + } 64 + 65 + inline int32_t WindowManager_LayoutParams::FLAG_FULLSCREEN() { 66 + auto &data = Meta::data(true); 67 + auto ret = get(data.FLAG_FULLSCREEN, data.clazz()); 68 + data.dropClassRef(); 69 + return ret; 70 + } 71 + 72 + inline int32_t WindowManager_LayoutParams::FLAG_NOT_FOCUSABLE() { 73 + auto &data = Meta::data(true); 74 + auto ret = get(data.FLAG_NOT_FOCUSABLE, data.clazz()); 75 + data.dropClassRef(); 76 + return ret; 77 + } 78 + 79 + inline int32_t WindowManager_LayoutParams::FLAG_NOT_TOUCHABLE() { 80 + auto &data = Meta::data(true); 81 + auto ret = get(data.FLAG_NOT_TOUCHABLE, data.clazz()); 82 + data.dropClassRef(); 83 + return ret; 84 + } 85 + 86 + inline WindowManager_LayoutParams WindowManager_LayoutParams::construct() { 87 + return WindowManager_LayoutParams( 88 + Meta::data().clazz().newInstance(Meta::data().init)); 89 + } 90 + 91 + inline WindowManager_LayoutParams WindowManager_LayoutParams::construct(int32_t type) { 92 + return WindowManager_LayoutParams( 93 + Meta::data().clazz().newInstance(Meta::data().init1, type)); 94 + } 95 + 96 + inline WindowManager_LayoutParams WindowManager_LayoutParams::construct(int32_t type, int32_t flags) { 97 + return WindowManager_LayoutParams( 98 + Meta::data().clazz().newInstance(Meta::data().init2, type, flags)); 32 99 } 33 100 34 101 } // namespace android::view
+14
src/external/android-jni-wrap/wrap/java.io.cpp
··· 1 + // Copyright 2022, Qualcomm Innovation Center, Inc. 2 + // SPDX-License-Identifier: BSL-1.0 3 + // Author: Jarvis Huang 4 + 5 + #include "java.io.h" 6 + 7 + namespace wrap { 8 + namespace java::io { 9 + File::Meta::Meta() 10 + : MetaBase(File::getTypeName()), 11 + getAbsolutePath( 12 + classRef().getMethod("getAbsolutePath", "()Ljava/lang/String;")) {} 13 + } // namespace java::io 14 + } // namespace wrap
+53
src/external/android-jni-wrap/wrap/java.io.h
··· 1 + // Copyright 2022, Qualcomm Innovation Center, Inc. 2 + // SPDX-License-Identifier: BSL-1.0 3 + // Author: Jarvis Huang 4 + 5 + #pragma once 6 + 7 + #include "ObjectWrapperBase.h" 8 + 9 + namespace wrap { 10 + namespace java::io { 11 + /*! 12 + * Wrapper for java.io.File objects. 13 + */ 14 + class File : public ObjectWrapperBase { 15 + public: 16 + using ObjectWrapperBase::ObjectWrapperBase; 17 + static constexpr const char *getTypeName() noexcept { 18 + return "java/io/File"; 19 + } 20 + 21 + /*! 22 + * Wrapper for the getAbsolutePath method 23 + * 24 + * Java prototype: 25 + * `public java.lang.String getAbsolutePath();` 26 + * 27 + * JNI signature: ()Ljava/lang/String; 28 + * 29 + */ 30 + std::string getAbsolutePath() const; 31 + 32 + /*! 33 + * Class metadata 34 + */ 35 + struct Meta : public MetaBase { 36 + jni::method_t getAbsolutePath ; 37 + 38 + /*! 39 + * Singleton accessor 40 + */ 41 + static Meta &data() { 42 + static Meta instance{}; 43 + return instance; 44 + } 45 + 46 + private: 47 + Meta(); 48 + }; 49 + }; 50 + 51 + } // namespace java::io 52 + } // namespace wrap 53 + #include "java.io.impl.h"
+17
src/external/android-jni-wrap/wrap/java.io.impl.h
··· 1 + // Copyright 2022, Qualcomm Innovation Center, Inc. 2 + // SPDX-License-Identifier: BSL-1.0 3 + // Author: Jarvis Huang 4 + // Inline implementations: do not include on its own! 5 + 6 + #pragma once 7 + 8 + namespace wrap { 9 + namespace java::io { 10 + 11 + inline std::string File::getAbsolutePath() const { 12 + assert(!isNull()); 13 + return object().call<std::string>(Meta::data().getAbsolutePath); 14 + } 15 + 16 + } // namespace java::io 17 + } // namespace wrap