Skip to content

Commit 28cc23a

Browse files
committed
Restored some old imports. Restored a @NotNull annotation. Added a camera permission.
1 parent 6ae95ee commit 28cc23a

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
xmlns:tools="http://schemas.android.com/tools"
33
package="com.googleresearch.capturesync">
44

5+
<uses-feature
6+
android:name="android.hardware.camera"
7+
android:required="true" />
8+
59
<uses-permission android:name="android.permission.CAMERA" />
610
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
711
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"

app/src/main/java/com/googleresearch/capturesync/ImageMetadataSynchronizer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import android.os.Handler;
3131
import android.util.Log;
3232
import android.util.Pair;
33-
import android.widget.Toast;
3433

3534
import java.util.ArrayList;
3635
import java.util.LinkedList;

app/src/main/java/com/googleresearch/capturesync/MainActivity.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@
1717

1818
package com.googleresearch.capturesync;
1919

20+
import static android.hardware.camera2.CameraMetadata.CONTROL_AF_MODE_AUTO;
2021
import static android.hardware.camera2.CameraMetadata.CONTROL_AF_MODE_OFF;
2122
import static android.hardware.camera2.CameraMetadata.CONTROL_AF_TRIGGER_CANCEL;
23+
import static android.hardware.camera2.CameraMetadata.CONTROL_AF_TRIGGER_IDLE;
2224
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;
2328

2429
import android.Manifest.permission;
2530
import android.annotation.SuppressLint;
@@ -45,12 +50,14 @@
4550
import android.media.CamcorderProfile;
4651
import android.media.MediaCodec;
4752
import android.media.MediaRecorder;
53+
import android.net.wifi.WifiInfo;
4854
import android.net.wifi.WifiManager;
4955
import android.os.Bundle;
5056
import android.os.Environment;
5157
import android.os.Handler;
5258
import android.os.HandlerThread;
5359
import android.provider.Settings;
60+
import android.telephony.TelephonyManager;
5461
import android.util.Log;
5562
import android.util.Size;
5663
import android.view.Gravity;
@@ -65,6 +72,7 @@
6572
import android.widget.SeekBar.OnSeekBarChangeListener;
6673
import android.widget.TextView;
6774
import android.widget.Toast;
75+
import android.provider.Settings.Secure;
6876

6977
import com.googleresearch.capturesync.softwaresync.CSVLogger;
7078
import com.googleresearch.capturesync.softwaresync.SoftwareSyncLeader;
@@ -100,6 +108,7 @@
100108
import org.apache.hc.core5.http.HttpResponse;
101109
import org.apache.hc.core5.http.NameValuePair;
102110
import org.apache.hc.core5.http.message.BasicNameValuePair;
111+
import org.jetbrains.annotations.NotNull;
103112
import org.json.JSONArray;
104113
import org.json.JSONException;
105114
import org.json.JSONObject;
@@ -260,20 +269,23 @@ public void surfaceDestroyed(SurfaceHolder holder) {
260269
protected void onCreate(Bundle savedInstanceState) {
261270
super.onCreate(savedInstanceState);
262271
Log.v(TAG, "onCreate");
272+
Toast.makeText(this, "RecSyncNG: creating ...", Toast.LENGTH_SHORT).show();
273+
263274
periodCalculator = new PeriodCalculator();
264275
//checkPermissions();
265276
permissionsGranted = true;
266277
if (permissionsGranted) {
267278
onCreateWithPermission();
268-
269279
} else {
270280
// Wait for user to finish permissions before setting up the app.
271281
}
282+
Toast.makeText(this, "RecSyncNG: initializing SyncController ...", Toast.LENGTH_SHORT).show();
283+
272284
softwareSyncController =
273285
new SoftwareSyncController(this, phaseAlignController, softwaresyncStatusTextView);
274286

275287
if(softwareSyncController.isLeader()) {
276-
Toast.makeText(this, "Starting websocket", Toast.LENGTH_LONG).show();
288+
Toast.makeText(this, "Starting websocket", Toast.LENGTH_SHORT).show();
277289
Javalin jwsObj = Javalin.create().start(7867);
278290
jwsObj.ws("/remotecon", ws -> {
279291
ws.onConnect(ctx -> {
@@ -421,7 +433,7 @@ public void onResume() {
421433

422434
}
423435

424-
private void handleWebSocketMsg(WsMessageContext wsMessageContext){
436+
private void handleWebSocketMsg(@NotNull WsMessageContext wsMessageContext){
425437
String msg = wsMessageContext.message();
426438
String[] infoParts = msg.split("@@");
427439
String command = infoParts[0];

app/src/main/res/layout/activity_main.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
android:layout_height="wrap_content"
112112
android:text="Start Autofocus"/>
113113

114-
115114
</LinearLayout>
116115

117116
</LinearLayout>

0 commit comments

Comments
 (0)