mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 06:09:55 +01:00
give and retrieve shard payload
This commit is contained in:
@@ -71,7 +71,7 @@ public class CustodianReturnShardViewModel extends AndroidViewModel
|
|||||||
this.task = task;
|
this.task = task;
|
||||||
qrCodeDecoder = new QrCodeDecoder(androidExecutor, ioExecutor, this);
|
qrCodeDecoder = new QrCodeDecoder(androidExecutor, ioExecutor, this);
|
||||||
task.cancel();
|
task.cancel();
|
||||||
task.start(this);
|
task.start(this, "replace this with the shard".getBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
@IoExecutor
|
@IoExecutor
|
||||||
|
|||||||
@@ -137,12 +137,13 @@ public class OwnerReturnShardActivity extends BaseActivity
|
|||||||
|
|
||||||
private void onReturnShardStateChanged(SecretOwnerTask.State state) {
|
private void onReturnShardStateChanged(SecretOwnerTask.State state) {
|
||||||
if (state instanceof SecretOwnerTask.State.Success) {
|
if (state instanceof SecretOwnerTask.State.Success) {
|
||||||
|
byte[] shardPayload = ((SecretOwnerTask.State.Success) state).getRemotePayload();
|
||||||
Toast.makeText(this,
|
Toast.makeText(this,
|
||||||
"Success - got shard",
|
"Success - got shard " + shardPayload.length,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
} else if (state instanceof SecretOwnerTask.State.Failure) {
|
} else if (state instanceof SecretOwnerTask.State.Failure) {
|
||||||
// TODO error screen
|
// TODO error screen, handle reason
|
||||||
Toast.makeText(this,
|
Toast.makeText(this,
|
||||||
"Shard return failed!",
|
"Shard return failed!",
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
|
|||||||
Reference in New Issue
Block a user