Skip to content

Commit 585be2f

Browse files
committed
works with new ASAPJava version.
1 parent 0509770 commit 585be2f

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

app/src/main/java/net/sharksystem/asap/android/ASAPAndroid.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class ASAPAndroid {
77
public static final String SENDER_E2E = "senderE2E";
88
public static final String FOLDER = "folder";
99
public static final String RECEIVER = "receiver";
10-
public static final String ASAP_HOP = "asapHop";
10+
public static final String ASAP_HOPS = "asapHops";
1111

1212
public static final String ASAP_CHUNK_RECEIVED_ACTION = "net.sharksystem.asap.received";
1313

app/src/main/java/net/sharksystem/asap/android/ASAPChunkReceivedBroadcastIntent.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22

33
import android.content.Intent;
44

5-
import net.sharksystem.SharkNotSupportedException;
65
import net.sharksystem.asap.ASAPException;
76
import net.sharksystem.asap.ASAPHop;
87
import net.sharksystem.asap.utils.ASAPSerialization;
98
import net.sharksystem.utils.Log;
109

1110
import java.io.IOException;
11+
import java.util.List;
1212

1313
public class ASAPChunkReceivedBroadcastIntent extends Intent {
1414

15-
private final ASAPHop asapHop;
15+
private final List<ASAPHop> asapHops;
1616
private CharSequence folder;
1717
private CharSequence uri;
1818
private int era;
1919
private CharSequence senderE2E;
2020
private CharSequence format;
2121

2222
public ASAPChunkReceivedBroadcastIntent(CharSequence format, CharSequence senderE2E,
23-
CharSequence folderName,
24-
CharSequence uri, int era,
25-
ASAPHop asapHop) throws ASAPException {
23+
CharSequence folderName,
24+
CharSequence uri, int era,
25+
List<ASAPHop> asapHops) throws ASAPException {
2626

2727
super();
2828

@@ -37,20 +37,20 @@ public ASAPChunkReceivedBroadcastIntent(CharSequence format, CharSequence sender
3737
this.putExtra(ASAPServiceMethods.URI_TAG, uri);
3838
this.putExtra(ASAPAndroid.SENDER_E2E, senderE2E);
3939
try {
40-
byte[] asapHopBytes = ASAPSerialization.asapHop2ByteArray(asapHop);
41-
this.putExtra(ASAPAndroid.ASAP_HOP, asapHopBytes);
40+
byte[] asapHopBytes = ASAPSerialization.asapHopList2ByteArray(asapHops);
41+
this.putExtra(ASAPAndroid.ASAP_HOPS, asapHopBytes);
4242
}
4343
catch(IOException e) {
4444
// ignore
45-
Log.writeLogErr(this, "cannot serialize ASAPHop: " + asapHop);
45+
Log.writeLogErr(this, "cannot serialize ASAPHop: " + asapHops);
4646
}
4747

4848
this.format = format;
4949
this.folder = folderName;
5050
this.uri = uri;
5151
this.era = era;
5252
this.senderE2E = senderE2E;
53-
this.asapHop = asapHop;
53+
this.asapHops = asapHops;
5454
}
5555

5656
public ASAPChunkReceivedBroadcastIntent(Intent intent) throws ASAPException, IOException {
@@ -62,8 +62,8 @@ public ASAPChunkReceivedBroadcastIntent(Intent intent) throws ASAPException, IOE
6262
this.uri = intent.getStringExtra(ASAPServiceMethods.URI_TAG);
6363
this.era = intent.getIntExtra(ASAPServiceMethods.ERA_TAG, 0);
6464
this.senderE2E = intent.getStringExtra(ASAPAndroid.SENDER_E2E);
65-
byte[] asapHopBytes = intent.getByteArrayExtra(ASAPAndroid.ASAP_HOP);
66-
this.asapHop = ASAPSerialization.byteArray2ASAPHop(asapHopBytes);
65+
byte[] asapHopsBytes = intent.getByteArrayExtra(ASAPAndroid.ASAP_HOPS);
66+
this.asapHops = ASAPSerialization.byteArray2ASAPHopList(asapHopsBytes);
6767
}
6868

6969
public CharSequence getFoldername() {
@@ -85,7 +85,7 @@ public int getEra() {
8585

8686
public CharSequence getFormat() { return this.format; }
8787

88-
public ASAPHop getASAPHop() {
89-
return this.asapHop;
88+
public List<ASAPHop> getASAPHop() {
89+
return this.asapHops;
9090
}
9191
}

app/src/main/java/net/sharksystem/asap/android/example/ASAPExampleMessagingActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected void onCreate(Bundle savedInstanceState) {
4545
@Override
4646
public void asapMessagesReceived(ASAPMessages asapMessages,
4747
String senderE2E, // E2E part
48-
ASAPHop asapHop) {
48+
List<ASAPHop> asapHops) {
4949
Log.d(getLogStart(), "asapMessageReceived");
5050
ASAPExampleMessagingActivity.this.doHandleReceivedMessages(asapMessages);
5151
}

app/src/main/java/net/sharksystem/asap/android/service/ASAPService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,15 +401,15 @@ public void run() {
401401

402402
@Override
403403
public void chunkReceived(String format, String senderE2E, String uri, int era, // E2E part
404-
ASAPHop asapHop) {
404+
List<ASAPHop> asapHops) {
405405

406406
Log.d(this.getLogStart(), "was notified by asap engine that chunk received - broadcast. Uri: "
407407
+ uri);
408408
// issue broadcast
409409
ASAPChunkReceivedBroadcastIntent intent = null;
410410
try {
411411
intent = new ASAPChunkReceivedBroadcastIntent(
412-
format, senderE2E, this.getASAPRootFolderName(), uri, era, asapHop);
412+
format, senderE2E, this.getASAPRootFolderName(), uri, era, asapHops);
413413
} catch (ASAPException e) {
414414
e.printStackTrace();
415415
return;

0 commit comments

Comments
 (0)