give and retrieve shard payload

This commit is contained in:
ameba23
2021-04-15 21:25:13 +02:00
parent 79369f4e7a
commit f4d667f50a
2 changed files with 4 additions and 3 deletions

View File

@@ -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

View File

@@ -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();