diff --git a/src/external/android-jni-wrap/wrap/android.view.cpp b/src/external/android-jni-wrap/wrap/android.view.cpp index 686479621..b805900e8 100644 --- a/src/external/android-jni-wrap/wrap/android.view.cpp +++ b/src/external/android-jni-wrap/wrap/android.view.cpp @@ -49,5 +49,12 @@ WindowManager_LayoutParams::Meta::Meta(bool deferDrop) MetaBaseDroppable::dropClassRef(); } } +Display_Mode::Meta::Meta() : MetaBaseDroppable(Display_Mode::getTypeName()), + getModeId(classRef().getMethod("getModeId", "()I")), + getPhysicalHeight(classRef().getMethod("getPhysicalHeight", "()I")), + getPhysicalWidth(classRef().getMethod("getPhysicalWidth", "()I")), + getRefreshRate(classRef().getMethod("getRefreshRate", "()F")) { + MetaBaseDroppable::dropClassRef(); +} } // namespace android::view } // namespace wrap diff --git a/src/external/android-jni-wrap/wrap/android.view.h b/src/external/android-jni-wrap/wrap/android.view.h index 0251436af..e2397a732 100644 --- a/src/external/android-jni-wrap/wrap/android.view.h +++ b/src/external/android-jni-wrap/wrap/android.view.h @@ -343,6 +343,37 @@ public: }; }; +class Display_Mode : public ObjectWrapperBase { +public: + using ObjectWrapperBase::ObjectWrapperBase; + static constexpr const char *getTypeName() noexcept { + return "android/view/Display$Mode"; + } + + int getModeId(); + + int getPhysicalHeight(); + + int getPhysicalWidth(); + + float getRefreshRate(); + + struct Meta : public MetaBaseDroppable { + jni::method_t getModeId; + jni::method_t getPhysicalHeight; + jni::method_t getPhysicalWidth; + jni::method_t getRefreshRate; + + static Meta &data() { + static Meta instance{}; + return instance; + } + + private: + Meta(); + }; +}; + } // namespace android::view } // namespace wrap #include "android.view.impl.h" diff --git a/src/external/android-jni-wrap/wrap/android.view.impl.h b/src/external/android-jni-wrap/wrap/android.view.impl.h index 3fd50134d..16de358aa 100644 --- a/src/external/android-jni-wrap/wrap/android.view.impl.h +++ b/src/external/android-jni-wrap/wrap/android.view.impl.h @@ -98,5 +98,25 @@ inline WindowManager_LayoutParams WindowManager_LayoutParams::construct(int32_t Meta::data().clazz().newInstance(Meta::data().init2, type, flags)); } +inline int Display_Mode::getModeId() { + assert(!isNull()); + return object().call(Meta::data().getModeId); +} + +inline int Display_Mode::getPhysicalHeight() { + assert(!isNull()); + return object().call(Meta::data().getPhysicalHeight); +} + +inline int Display_Mode::getPhysicalWidth() { + assert(!isNull()); + return object().call(Meta::data().getPhysicalWidth); +} + +inline float Display_Mode::getRefreshRate() { + assert(!isNull()); + return object().call(Meta::data().getRefreshRate); +} + } // namespace android::view } // namespace wrap