Skip to content

Commit 74d10c7

Browse files
authored
Merge branch 'Ravbug:main' into main
2 parents 285e2b9 + 6eb4b93 commit 74d10c7

File tree

5 files changed

+54
-8
lines changed

5 files changed

+54
-8
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Update-Sample
2+
on: workflow_dispatch
3+
4+
jobs:
5+
update-sample:
6+
name: Update Sample
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: write
10+
steps:
11+
- name: Announce repo
12+
run: echo ${{ github.event.inputs.name }}
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
with:
16+
submodules: recursive
17+
- name: Execute
18+
run: |
19+
cd to-build/sdl3-sample
20+
git config pull.rebase false
21+
git pull
22+
- name: git config
23+
run: |
24+
git config user.name github-actions[bot]
25+
git config user.email 22283943+github-actions[bot]@users.noreply.github.com
26+
git stash
27+
git pull
28+
git stash pop
29+
- name: git commit
30+
run: git add . && git commit -m "Update android-project"
31+
- name: git push
32+
run: git push origin HEAD:main

app/proguard-rules.pro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
void manualBackButton();
3636
int messageboxShowMessageBox(int, java.lang.String, java.lang.String, int[], int[], java.lang.String[], int[]);
3737
void minimizeWindow();
38-
int openURL(java.lang.String);
38+
boolean openURL(java.lang.String);
3939
void requestPermission(java.lang.String, int);
40-
int showToast(java.lang.String, int, int, int, int);
40+
boolean showToast(java.lang.String, int, int, int, int);
4141
boolean sendMessage(int, int);
4242
boolean setActivityTitle(java.lang.String);
4343
boolean setCustomCursor(int);

app/src/main/AndroidManifest.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
<!-- Audio recording support -->
3535
<!-- if you want to record audio, uncomment this. -->
36+
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" /> -->
3637
<!-- <uses-feature
3738
android:name="android.hardware.microphone"
3839
android:required="false" /> -->
@@ -55,8 +56,11 @@
5556
<!-- Allow access to the vibrator -->
5657
<uses-permission android:name="android.permission.VIBRATE" />
5758

58-
<!-- if you want to record audio, uncomment this. -->
59-
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO" /> -->
59+
<!-- Allow access to Internet -->
60+
<!-- if you want to connect to the network or internet, uncomment this. -->
61+
<!--
62+
<uses-permission android:name="android.permission.INTERNET" />
63+
-->
6064

6165
<!-- Create a Java class extending SDLActivity and place it in a
6266
directory under app/src/main/java matching the package, e.g. app/src/main/java/com/gamemaker/game/MyGame.java
@@ -81,7 +85,7 @@
8185
android:label="@string/app_name"
8286
android:alwaysRetainTaskState="true"
8387
android:launchMode="singleInstance"
84-
android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
88+
android:configChanges="layoutDirection|locale|grammaticalGender|fontScale|fontWeightAdjustment|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
8589
android:preferMinimalPostProcessing="true"
8690
android:exported="true"
8791
>

app/src/main/java/org/libsdl/app/HIDDeviceUSB.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ public boolean open() {
154154

155155
@Override
156156
public int writeReport(byte[] report, boolean feature) {
157+
if (mConnection == null) {
158+
Log.w(TAG, "writeReport() called with no device connection");
159+
return -1;
160+
}
161+
157162
if (feature) {
158163
int res = -1;
159164
int offset = 0;
@@ -201,6 +206,11 @@ public boolean readReport(byte[] report, boolean feature) {
201206
boolean skipped_report_id = false;
202207
byte report_number = report[0];
203208

209+
if (mConnection == null) {
210+
Log.w(TAG, "readReport() called with no device connection");
211+
return false;
212+
}
213+
204214
if (report_number == 0x0) {
205215
/* Offset the return buffer by 1, so that the report ID
206216
will remain in byte 0. */

app/src/main/java/org/libsdl/app/SDLActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
6060
private static final String TAG = "SDL";
6161
private static final int SDL_MAJOR_VERSION = 3;
6262
private static final int SDL_MINOR_VERSION = 1;
63-
private static final int SDL_MICRO_VERSION = 2;
63+
private static final int SDL_MICRO_VERSION = 7;
6464
/*
6565
// Display InputType.SOURCE/CLASS of events and devices
6666
//
@@ -88,7 +88,7 @@ public static void debugSource(int sources, String prefix) {
8888
| InputDevice.SOURCE_CLASS_POSITION
8989
| InputDevice.SOURCE_CLASS_TRACKBALL);
9090
91-
if (s2 != 0) cls += "Some_Unkown";
91+
if (s2 != 0) cls += "Some_Unknown";
9292
9393
s2 = s_copy & InputDevice.SOURCE_ANY; // keep source only, no class;
9494
@@ -162,7 +162,7 @@ public static void debugSource(int sources, String prefix) {
162162
if (s == FLAG_TAINTED) src += " FLAG_TAINTED";
163163
s2 &= ~FLAG_TAINTED;
164164
165-
if (s2 != 0) src += " Some_Unkown";
165+
if (s2 != 0) src += " Some_Unknown";
166166
167167
Log.v(TAG, prefix + "int=" + s_copy + " CLASS={" + cls + " } source(s):" + src);
168168
}

0 commit comments

Comments
 (0)