Skip to content

Commit f11f264

Browse files
committed
fix activelook crash bug, fix ultralite wrap bug, re-enable live captions debug system
1 parent 3f5dff2 commit f11f264

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

android_smart_phone/main/app/src/main/java/com/smartglassesmanager/androidsmartphone/commands/CommandSystem.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void goHome(String args, long commandTime) {
110110

111111
public void loadDefaultCommands() {
112112
//live life captions - test scrolling view text
113-
// registerCommand("Live Captions", UUID.fromString("933b8950-412e-429e-8fb6-430f973cc9dc"), new String[]{"live captions", "live life captions", "captions", "transcription"}, "Starts streaming captions live to the glasses display.", this::launchLiveCaptions);
113+
registerLocalCommand("Live Captions", UUID.fromString("933b8950-412e-429e-8fb6-430f973cc9dc"), new String[]{"live captions", "live life captions", "captions", "transcription"}, "Starts streaming captions live to the glasses display.", this::launchLiveCaptions);
114114

115115
//test reference card
116116
registerLocalCommand("Test", UUID.fromString("f4290426-18d5-431a-aea4-21844b832735"), new String[]{"test", "test", "show me a test card", "test card", "testing", "show test card"}, "Shows a test Reference Card on the glasses display.", this::launchTestCard);

android_smart_phone/main/app/src/main/java/com/smartglassesmanager/androidsmartphone/hci/MicrophoneLocalAndBluetooth.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,11 @@ private void startBluetoothSco(){
206206
private void stopBluetoothSco(){
207207
mIsCountDownOn = false;
208208
mCountDown.cancel();
209-
mContext.unregisterReceiver(bluetoothStateReceiver);
209+
try{
210+
mContext.unregisterReceiver(bluetoothStateReceiver);
211+
} catch(IllegalArgumentException e) {
212+
e.printStackTrace();
213+
}
210214
}
211215

212216
private void startRecording() {
@@ -369,7 +373,11 @@ public void destroy(){
369373
deactivateBluetoothSco();
370374
audioManager.setMode(AudioManager.MODE_NORMAL);
371375
if (mContext != null) {
372-
mContext.unregisterReceiver(bluetoothStateReceiver);
376+
try{
377+
mContext.unregisterReceiver(bluetoothStateReceiver);
378+
} catch(IllegalArgumentException e) {
379+
e.printStackTrace();
380+
}
373381
}
374382
}
375383
}

android_smart_phone/main/app/src/main/java/com/smartglassesmanager/androidsmartphone/smartglassescommunicators/ActiveLookSGC.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ private void onUpdateError(final GlassesUpdate glassesUpdate) {
231231
}
232232

233233
public void displayReferenceCardSimple(String title, String body){
234+
Log.d(TAG, "Checking if connected... Displaying simpel reference card");
234235
if (isConnected()) {
236+
Log.d(TAG, "Displaying simpel reference card");
235237
connectedGlasses.clear();
236238
ArrayList<Object> stuffToDisplay = new ArrayList<>();
237239
stuffToDisplay.add(new TextLineSG(title, LARGE_FONT));
@@ -245,7 +247,12 @@ public void displayBulletList(String title, String [] bullets){
245247
}
246248

247249
public void displayBulletList(String title, String [] bullets, int lingerTime){
248-
250+
Log.d(TAG, "Displaying bullet list");
251+
String body = "";
252+
for (String bullet : bullets){
253+
body = body.concat("⬤ " + bullet + "\n");
254+
}
255+
displayReferenceCardSimple(title, body);
249256
}
250257

251258

@@ -395,6 +402,7 @@ private int computeStringCenterInfo(TextLineSG textLine){
395402
}
396403

397404
private void sendTextToGlasses(TextLineSG textLine, Point percentLoc){
405+
Log.d(TAG, "Sending text to glasses");
398406
Point pixelLoc = percentScreenToPixelsLocation(percentLoc.x, percentLoc.y);
399407
connectedGlasses.txt(pixelLoc, Rotation.TOP_LR, (byte) textLine.getFontSizeCode(), (byte) 0x0F, textLine.getText());
400408
}

android_smart_phone/main/app/src/main/java/com/smartglassesmanager/androidsmartphone/smartglassescommunicators/UltraliteSGC.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ public void displayBulletList(String title, String [] bullets, int lingerTime){
343343
int displaceY = 80;
344344
int displaceX = 35;
345345
for (String bullet : bullets){
346-
ultraliteCanvas.createText("⬤ " + bullet, TextAlignment.AUTO, UltraliteColor.WHITE, Anchor.TOP_LEFT, displaceX, displaceY, 640, -1, TextWrapMode.WRAP, true);
346+
ultraliteCanvas.createText("⬤ " + bullet, TextAlignment.AUTO, UltraliteColor.WHITE, Anchor.TOP_LEFT, displaceX, displaceY, 640 - displaceX, -1, TextWrapMode.WRAP, true);
347347
displaceY += 80;
348348
}
349349

0 commit comments

Comments
 (0)