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