Skip to content

Commit fa1f593

Browse files
add our patches
1 parent bc526c8 commit fa1f593

File tree

7 files changed

+128
-0
lines changed

7 files changed

+128
-0
lines changed

conan_patches/flac/conandata.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
patches:
2+
"1.4.2":
3+
- patch_file: "patches/android-pre-21.diff"
4+
patch_description: "https://github.com/android/ndk/issues/1108"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/src/flac/utils.c
2+
+++ b/src/flac/utils.c
3+
@@ -200,7 +200,7 @@ size_t strlen_console(const char *text)
4+
{
5+
#ifdef _WIN32
6+
return strlen_utf8(text);
7+
-#elif defined(__DJGPP__) /* workaround for DJGPP missing wcswidth() */
8+
+#elif defined(__DJGPP__) || (defined(__ANDROID_API__) && __ANDROID_API__ < 21)
9+
return strlen(text);
10+
#else
11+
size_t len;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
patches:
2+
"1.3.1":
3+
- patch_file: "patches/android-pre-24.diff"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/contrib/minizip/ioapi.h
2+
+++ b/contrib/minizip/ioapi.h
3+
@@ -21,7 +21,7 @@
4+
#ifndef _ZLIBIOAPI64_H
5+
#define _ZLIBIOAPI64_H
6+
7+
-#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
8+
+#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) && !(defined(__ANDROID_API__) && __ANDROID_API__ < 24)
9+
10+
// Linux needs this to support file operation on files larger then 4+GB
11+
// But might need better if/def to select just the platforms that needs them.

conan_patches/qt/conandata.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
patches:
2+
"5.15.16":
3+
- "base_path": "qt5/qtbase"
4+
"patch_file": "patches/android-21-22.diff"
5+
- "base_path": "qt5/qtbase"
6+
"patch_file": "patches/xiaomi.diff"
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
diff --git a/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java b/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java
2+
index 9dba7f2..85a7027 100644
3+
--- a/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java
4+
+++ b/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java
5+
@@ -88,6 +88,7 @@ import java.io.FileOutputStream;
6+
import java.io.IOException;
7+
import java.io.OutputStreamWriter;
8+
import java.lang.reflect.Field;
9+
+import java.lang.reflect.Method;
10+
import java.util.ArrayList;
11+
import java.util.Arrays;
12+
import java.util.HashMap;
13+
@@ -903,11 +904,28 @@ public class ExtractStyle {
14+
}
15+
return json;
16+
}
17+
+
18+
+ private ContextThemeWrapper getContextThemeWrapper()
19+
+ {
20+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
21+
+ return new ContextThemeWrapper(m_context, m_theme);
22+
+
23+
+ int themeResId = 0;
24+
+ try {
25+
+ Class<?> clazz = ContextThemeWrapper.class;
26+
+ Method method = clazz.getMethod("getThemeResId");
27+
+ method.setAccessible(true);
28+
+ themeResId = (Integer)method.invoke(m_context);
29+
+ } catch (Exception e) {
30+
+ Log.e(QtNative.QtTAG, "Failed to get theme resource ID", e);
31+
+ }
32+
+ return new ContextThemeWrapper(m_context, themeResId);
33+
+ }
34+
35+
private TypedArray obtainStyledAttributes(int styleName, int[] attributes)
36+
{
37+
TypedValue typedValue = new TypedValue();
38+
- Context ctx = new ContextThemeWrapper(m_context, m_theme);
39+
+ Context ctx = getContextThemeWrapper();
40+
ctx.getTheme().resolveAttribute(styleName, typedValue, true);
41+
return ctx.obtainStyledAttributes(typedValue.data, attributes);
42+
}
43+
@@ -926,7 +944,7 @@ public class ExtractStyle {
44+
public void extractViewInformation(int styleName, JSONObject json, String qtClassName, AttributeSet attributeSet) {
45+
try {
46+
TypedValue typedValue = new TypedValue();
47+
- Context ctx = new ContextThemeWrapper(m_context, m_theme);
48+
+ Context ctx = getContextThemeWrapper();
49+
ctx.getTheme().resolveAttribute(styleName, typedValue, true);
50+
51+
int[] attributes = new int[]{
52+
@@ -1120,7 +1138,7 @@ public class ExtractStyle {
53+
54+
try {
55+
TypedValue typedValue = new TypedValue();
56+
- Context ctx = new ContextThemeWrapper(m_context, m_theme);
57+
+ Context ctx = getContextThemeWrapper();
58+
ctx.getTheme().resolveAttribute(styleName, typedValue, true);
59+
60+
// Get textAppearance values
61+
@@ -1391,7 +1409,7 @@ public class ExtractStyle {
62+
JSONObject json = extractTextAppearanceInformation(styleName, qtClass);
63+
64+
TypedValue typedValue = new TypedValue();
65+
- Context ctx = new ContextThemeWrapper(m_context, m_theme);
66+
+ Context ctx = getContextThemeWrapper();
67+
ctx.getTheme().resolveAttribute(styleName, typedValue, true);
68+
final int[] attributes = new int[]{android.R.attr.button};
69+
TypedArray array = ctx.obtainStyledAttributes(typedValue.data, attributes);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
2+
index 1218164d0..2545e683a 100644
3+
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
4+
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
5+
@@ -668,9 +668,6 @@ public class QtActivityDelegate
6+
activityClass.getMethod("super_dispatchGenericMotionEvent", MotionEvent.class);
7+
8+
m_softInputMode = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(), 0).softInputMode;
9+
-
10+
- DisplayManager displayManager = (DisplayManager)m_activity.getSystemService(Context.DISPLAY_SERVICE);
11+
- displayManager.registerDisplayListener(displayListener, null);
12+
}
13+
14+
public boolean loadApplication(Activity activity, ClassLoader classLoader, Bundle loaderParams)
15+
@@ -833,6 +830,9 @@ public class QtActivityDelegate
16+
}
17+
m_layout = new QtLayout(m_activity, startApplication);
18+
19+
+ DisplayManager displayManager = (DisplayManager)m_activity.getSystemService(Context.DISPLAY_SERVICE);
20+
+ displayManager.registerDisplayListener(displayListener, null);
21+
+
22+
int orientation = m_activity.getResources().getConfiguration().orientation;
23+
24+
try {

0 commit comments

Comments
 (0)