|
17 | 17 |
|
18 | 18 | package com.googleresearch.capturesync;
|
19 | 19 |
|
| 20 | +import static android.hardware.camera2.CameraMetadata.CONTROL_AF_MODE_AUTO; |
20 | 21 | import static android.hardware.camera2.CameraMetadata.CONTROL_AF_MODE_OFF;
|
21 | 22 | import static android.hardware.camera2.CameraMetadata.CONTROL_AF_TRIGGER_CANCEL;
|
| 23 | +import static android.hardware.camera2.CameraMetadata.CONTROL_AF_TRIGGER_IDLE; |
22 | 24 | import static android.hardware.camera2.CaptureRequest.CONTROL_AF_MODE;
|
| 25 | +import static android.hardware.camera2.CaptureRequest.CONTROL_AF_TRIGGER; |
| 26 | +import static android.hardware.camera2.CaptureRequest.LENS_FOCUS_DISTANCE; |
| 27 | +import static java.security.AccessController.getContext; |
23 | 28 |
|
24 | 29 | import android.Manifest.permission;
|
25 | 30 | import android.annotation.SuppressLint;
|
|
45 | 50 | import android.media.CamcorderProfile;
|
46 | 51 | import android.media.MediaCodec;
|
47 | 52 | import android.media.MediaRecorder;
|
| 53 | +import android.net.wifi.WifiInfo; |
48 | 54 | import android.net.wifi.WifiManager;
|
49 | 55 | import android.os.Bundle;
|
50 | 56 | import android.os.Environment;
|
51 | 57 | import android.os.Handler;
|
52 | 58 | import android.os.HandlerThread;
|
53 | 59 | import android.provider.Settings;
|
| 60 | +import android.telephony.TelephonyManager; |
54 | 61 | import android.util.Log;
|
55 | 62 | import android.util.Size;
|
56 | 63 | import android.view.Gravity;
|
|
65 | 72 | import android.widget.SeekBar.OnSeekBarChangeListener;
|
66 | 73 | import android.widget.TextView;
|
67 | 74 | import android.widget.Toast;
|
| 75 | +import android.provider.Settings.Secure; |
68 | 76 |
|
69 | 77 | import com.googleresearch.capturesync.softwaresync.CSVLogger;
|
70 | 78 | import com.googleresearch.capturesync.softwaresync.SoftwareSyncLeader;
|
|
100 | 108 | import org.apache.hc.core5.http.HttpResponse;
|
101 | 109 | import org.apache.hc.core5.http.NameValuePair;
|
102 | 110 | import org.apache.hc.core5.http.message.BasicNameValuePair;
|
| 111 | +import org.jetbrains.annotations.NotNull; |
103 | 112 | import org.json.JSONArray;
|
104 | 113 | import org.json.JSONException;
|
105 | 114 | import org.json.JSONObject;
|
@@ -260,20 +269,23 @@ public void surfaceDestroyed(SurfaceHolder holder) {
|
260 | 269 | protected void onCreate(Bundle savedInstanceState) {
|
261 | 270 | super.onCreate(savedInstanceState);
|
262 | 271 | Log.v(TAG, "onCreate");
|
| 272 | + Toast.makeText(this, "RecSyncNG: creating ...", Toast.LENGTH_SHORT).show(); |
| 273 | + |
263 | 274 | periodCalculator = new PeriodCalculator();
|
264 | 275 | //checkPermissions();
|
265 | 276 | permissionsGranted = true;
|
266 | 277 | if (permissionsGranted) {
|
267 | 278 | onCreateWithPermission();
|
268 |
| - |
269 | 279 | } else {
|
270 | 280 | // Wait for user to finish permissions before setting up the app.
|
271 | 281 | }
|
| 282 | + Toast.makeText(this, "RecSyncNG: initializing SyncController ...", Toast.LENGTH_SHORT).show(); |
| 283 | + |
272 | 284 | softwareSyncController =
|
273 | 285 | new SoftwareSyncController(this, phaseAlignController, softwaresyncStatusTextView);
|
274 | 286 |
|
275 | 287 | if(softwareSyncController.isLeader()) {
|
276 |
| - Toast.makeText(this, "Starting websocket", Toast.LENGTH_LONG).show(); |
| 288 | + Toast.makeText(this, "Starting websocket", Toast.LENGTH_SHORT).show(); |
277 | 289 | Javalin jwsObj = Javalin.create().start(7867);
|
278 | 290 | jwsObj.ws("/remotecon", ws -> {
|
279 | 291 | ws.onConnect(ctx -> {
|
@@ -421,7 +433,7 @@ public void onResume() {
|
421 | 433 |
|
422 | 434 | }
|
423 | 435 |
|
424 |
| - private void handleWebSocketMsg(WsMessageContext wsMessageContext){ |
| 436 | + private void handleWebSocketMsg(@NotNull WsMessageContext wsMessageContext){ |
425 | 437 | String msg = wsMessageContext.message();
|
426 | 438 | String[] infoParts = msg.split("@@");
|
427 | 439 | String command = infoParts[0];
|
|
0 commit comments