Skip to content

Commit 09c6b46

Browse files
committed
merge: origin/dev into cloud/issues-048 — full merge with all prod fixes
Resolved 46 conflicts: - mobile/ (39 files): took origin/dev side (048 never touched mobile) - .github/workflows/porter-debug.yml: kept branch triggers from both sides - cloud/sdk types (app-to-cloud.ts, index.ts): kept v3 types + dev's SRT renames - cloud/bun-websocket.ts: kept 048's RECONNECT routing + dev's SRT changes - cloud/app-message-handler.ts: kept dev's roiPosition fix + SRT refactor - cloud/UnmanagedStreamingExtension.ts: took dev's SRT refactor - sdk/CameraManager.ts (v3): updated RTMP→Stream renames to match dev Post-merge fixes: - v3 CameraManager: RtmpStreamStatus→StreamStatus, RTMP_STREAM_*→STREAM_* - CloudflareStreamService: removed stale config.quality log reference Locally verified: types, sdk, cloud all build clean (zero TS errors).
2 parents 2cfb529 + 4bf563b commit 09c6b46

File tree

266 files changed

+25509
-3887
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+25509
-3887
lines changed

.github/workflows/china-deployment-dev.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: China Cloud Api Deployment (Dev)
33
on:
44
push:
55
branches:
6-
- "ya/clean-china-cicd"
6+
- "dev"
7+
- "ya/fix-china-cloud-acr"
78
paths:
89
- "cloud/**"
910
- ".github/workflows/china-deployment-dev.yml"
@@ -130,6 +131,8 @@ jobs:
130131
value: "cloud"
131132
- name: RESEND_API_KEY
132133
value: "${{ secrets.RESEND_API_KEY }}"
134+
- name: UDP_HOST
135+
value: "dev-udp-api.mentraglass.cn"
133136
EOL
134137
135138
# Create start.sh file
@@ -147,7 +150,7 @@ jobs:
147150
alibaba-access-key-secret: ${{ secrets.ALIBABA_ACCESS_KEY_SECRET }}
148151
deployment-region: "cn-shenzhen"
149152
app-name: "api"
150-
acr-instance-id: "cri-h675v46p9lj694l6"
153+
acr-instance-id: "cri-jqkk34lm32lg9ce7"
151154
acr-vpc-domain: "mentra-acr-cnsz-a-registry-vpc.cn-shenzhen.cr.aliyuncs.com"
152155
acr-public-domain: "mentra-acr-cnsz-a-registry.cn-shenzhen.cr.aliyuncs.com"
153156
docker-context: "./cloud"

.github/workflows/porter-debug.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ on:
66
branches:
77
- cloud/issues-048
88
- cloud/issues-048-merge
9+
- cloud/issues-044
10+
- new-context-soniox
11+
- cloud/044-ci-build-audit
12+
- hotfix/cloud-observability
13+
- hotfix/crash-diagnostics
14+
- cloud/062-mongodb-audit
15+
- hotfix/graceful-shutdown
16+
- hotfix/remove-forced-gc-add-livez
917
paths:
1018
- "cloud/**"
1119
- ".github/workflows/porter-debug.yml"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 🚀 Deploy cloud-prod to US West only
2+
3+
on:
4+
workflow_dispatch: # Manual trigger only — no auto-deploy
5+
push:
6+
branches:
7+
- cloud/064-bstack-cli
8+
paths:
9+
- "cloud/**"
10+
- ".github/workflows/porter-us-west.yml"
11+
jobs:
12+
us-west:
13+
runs-on: blacksmith-4vcpu-ubuntu-2404
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set Git SHA tag
19+
id: vars
20+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
21+
22+
- name: Setup Porter CLI
23+
uses: porter-dev/setup-porter@v0.1.0
24+
25+
- name: Deploy to us-west
26+
timeout-minutes: 30
27+
run: exec porter apply -f ./cloud/porter.yaml
28+
env:
29+
PORTER_APP_NAME: cloud-prod
30+
NODE_ENV: production
31+
PORTER_CLUSTER: "4965"
32+
PORTER_PROJECT: "15081"
33+
PORTER_HOST: https://dashboard.porter.run
34+
PORTER_PR_NUMBER: ${{ github.event.number }}
35+
PORTER_REPO_NAME: ${{ github.event.repository.name }}
36+
PORTER_TAG: ${{ steps.vars.outputs.sha_short }}
37+
PORTER_TOKEN: ${{ secrets.PORTER_APP_15081_4965 }}
38+
PORTER_DEPLOYMENT_TARGET_ID: 540690ee-b1d7-4a5e-80e9-683d11001c75

asg_client/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,7 @@ This removes your custom build and restores the factory app.
6161
### Build Notes
6262

6363
Must use Java SDK 17. To set this, in Android Studio, go to Settings > Build, Execution, Deployment > Build Tools > Gradle, go to Gradle JDK and select version 17
64+
65+
### Documentation
66+
67+
See [docs/](docs/README.md) for architecture overview, command API reference, feature docs, and the full Mentra Live setup guide.

asg_client/app/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ dependencies {
310310
// StreamPackLite dependencies
311311
implementation project(':core')
312312
implementation project(':extension-rtmp')
313+
implementation project(':extension-srt')
313314

314315
// OkHttp for network requests
315316
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
@@ -323,6 +324,11 @@ dependencies {
323324
// Sentry SDK for error reporting
324325
implementation 'io.sentry:sentry-android:7.5.0'
325326

327+
// Google WebRTC for Android (WHIP streaming)
328+
// Community-maintained prebuilt of the official Google WebRTC codebase; uses org.webrtc package.
329+
// Pinned to M114 (2023) — compiled with Java 11, compatible with this project's Java 17 toolchain.
330+
implementation 'io.github.webrtc-sdk:android:114.5735.08.1'
331+
326332
// AndroidX Test dependencies
327333
androidTestImplementation 'androidx.test:core:1.5.0'
328334
androidTestImplementation 'androidx.test:runner:1.5.2'

asg_client/app/src/main/AndroidManifest.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,18 @@
137137
</intent-filter>
138138
</receiver>
139139

140+
<!-- Intent IPC receiver for third-party app commands -->
141+
<receiver
142+
android:name="com.mentra.asg_client.receiver.IntentCommandReceiver"
143+
android:enabled="true"
144+
android:exported="true">
145+
<intent-filter>
146+
<action android:name="com.mentra.asg_client.ACTION_SEND_COMMAND" />
147+
<action android:name="com.mentra.asg_client.ACTION_REGISTER_LISTENER" />
148+
<action android:name="com.mentra.asg_client.ACTION_UNREGISTER_LISTENER" />
149+
</intent-filter>
150+
</receiver>
151+
140152
<service
141153
android:name="com.mentra.asg_client.service.core.AsgClientService"
142154
android:enabled="true"
@@ -159,6 +171,18 @@
159171
android:exported="true"
160172
android:foregroundServiceType="camera|microphone" />
161173

174+
<service
175+
android:name="com.mentra.asg_client.io.streaming.services.SrtStreamingService"
176+
android:enabled="true"
177+
android:exported="true"
178+
android:foregroundServiceType="camera|microphone" />
179+
180+
<service
181+
android:name="com.mentra.asg_client.io.streaming.services.WhipStreamingService"
182+
android:enabled="true"
183+
android:exported="true"
184+
android:foregroundServiceType="camera|microphone" />
185+
162186
<service
163187
android:name="com.mentra.asg_client.io.ota.services.OtaService"
164188
android:enabled="true"

asg_client/app/src/main/java/com/mentra/asg_client/SysControl.java

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,13 +452,35 @@ public static void flashRecordingLed(Context context, long durationMs) {
452452
* @param enable true to enable EIS, false to disable
453453
*/
454454
public static void setEisEnable(Context context, boolean enable) {
455-
Log.d(TAG, "🎥 Setting EIS (vendor.debug.pixsmart.vs) to: " + (enable ? "1" : "0"));
455+
Log.d(TAG, "🎥 Setting EIS to: " + (enable ? "ENABLED" : "DISABLED"));
456+
// Pixsmart EIS
456457
Intent nn = new Intent();
457458
nn.putExtra("cmd", "setProperty");
458459
nn.putExtra("name", "vendor.debug.pixsmart.vs");
459460
nn.putExtra("value", enable ? "1": "0");
460461
sendBroadcast(context, nn);
461-
Log.d(TAG, "✅ EIS property broadcast sent");
462+
// Morpho video EIS
463+
Intent nn2 = new Intent();
464+
nn2.putExtra("cmd", "setProperty");
465+
nn2.putExtra("name", "vendor.debug.morpho.videoeis.mode");
466+
nn2.putExtra("value", enable ? "1": "0");
467+
sendBroadcast(context, nn2);
468+
Log.d(TAG, "✅ EIS properties set (pixsmart + morpho)");
469+
}
470+
471+
/**
472+
* Restart the camera HAL so it picks up a new FOV/ROI value written via DevApi.setCameraFov.
473+
* Sends the same K900 SystemUI broadcast as K900Server_mentra (ctl.restart / camerahalserver).
474+
* @param context Application context
475+
*/
476+
public static void restartCameraHal(Context context) {
477+
Log.d(TAG, "Restarting camera HAL (ctl.restart / camerahalserver)");
478+
Intent nn = new Intent();
479+
nn.putExtra("cmd", "setProperty");
480+
nn.putExtra("name", "ctl.restart");
481+
nn.putExtra("value", "camerahalserver");
482+
sendBroadcast(context, nn);
483+
Log.d(TAG, "Camera HAL restart broadcast sent");
462484
}
463485

464486
/**

asg_client/app/src/main/java/com/mentra/asg_client/camera/CameraNeo.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.mentra.asg_client.io.hardware.interfaces.IHardwareManager;
55
import com.mentra.asg_client.service.utils.ServiceUtils;
66
import com.mentra.asg_client.io.hardware.core.HardwareManagerFactory;
7+
import com.mentra.asg_client.SysControl;
78

89
import android.annotation.SuppressLint;
910
import android.app.NotificationChannel;
@@ -659,11 +660,13 @@ public int onStartCommand(Intent intent, int flags, int startId) {
659660
} else {
660661
pendingVideoSettings = null; // Will use defaults
661662
}
663+
SysControl.setEisEnable(this, true);
662664
setupCameraAndStartRecording(currentVideoId, currentVideoPath);
663665
break;
664666
case ACTION_STOP_VIDEO_RECORDING:
665667
String videoIdToStop = intent.getStringExtra(EXTRA_VIDEO_ID);
666668
stopCurrentVideoRecording(videoIdToStop);
669+
SysControl.setEisEnable(this, false);
667670
break;
668671

669672
case ACTION_START_BUFFER:

asg_client/app/src/main/java/com/mentra/asg_client/io/bluetooth/core/BaseBluetoothManager.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
import com.mentra.asg_client.io.bluetooth.interfaces.IBluetoothManager;
77
import com.mentra.asg_client.io.bluetooth.interfaces.BluetoothStateListener;
8+
import com.mentra.asg_client.receiver.IntentResponseBroadcaster;
9+
10+
import org.json.JSONObject;
811

912
import java.util.ArrayList;
1013
import java.util.List;
@@ -76,6 +79,37 @@ protected void notifyDataReceived(byte[] data) {
7679
}
7780
}
7881

82+
/**
83+
* Template method: broadcasts JSON responses to registered intent listeners,
84+
* then delegates to the subclass-specific send implementation.
85+
*/
86+
@Override
87+
public final boolean sendData(byte[] data) {
88+
if (data == null || data.length == 0) {
89+
return false;
90+
}
91+
92+
// Try to broadcast JSON responses to intent listeners
93+
try {
94+
String str = new String(data, "UTF-8");
95+
if (str.startsWith("{")) {
96+
JSONObject json = new JSONObject(str);
97+
IntentResponseBroadcaster.getInstance().broadcastResponse(context, json);
98+
}
99+
} catch (Exception e) {
100+
// Not valid JSON — skip broadcast, still send over BLE
101+
}
102+
103+
return sendDataInternal(data);
104+
}
105+
106+
/**
107+
* Subclass-specific send implementation.
108+
* @param data The data to send
109+
* @return true if the data was sent successfully
110+
*/
111+
protected abstract boolean sendDataInternal(byte[] data);
112+
79113
@Override
80114
public boolean isConnected() {
81115
return isConnected;

asg_client/app/src/main/java/com/mentra/asg_client/io/bluetooth/managers/K900BluetoothManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public K900BluetoothManager(Context context) {
129129
}
130130

131131
@Override
132-
public boolean sendData(byte[] data) {
132+
protected boolean sendDataInternal(byte[] data) {
133133
Log.d(TAG, "📡 =========================================");
134134
Log.d(TAG, "📡 K900 BLUETOOTH SEND DATA");
135135
Log.d(TAG, "📡 =========================================");

0 commit comments

Comments
 (0)