tls-psk: improve error handling on connection error

This commit is contained in:
Vincent Breitmoser
2017-05-30 22:54:09 +02:00
parent a441df2bd7
commit 7df2619232
3 changed files with 80 additions and 33 deletions

View File

@@ -249,6 +249,16 @@ public class TransferPresenter implements KeyTransferCallback, LoaderCallbacks<L
}, 750);
}
@Override
public void onConnectionErrorConnect() {
view.showErrorConnectionFailed();
}
@Override
public void onConnectionErrorListen() {
view.showErrorListenFailed();
}
private void connectionStartConnect(String qrCodeContent) {
connectionClear();
@@ -336,6 +346,7 @@ public class TransferPresenter implements KeyTransferCallback, LoaderCallbacks<L
void showErrorBadKey();
void showErrorConnectionFailed();
void showErrorListenFailed();
void showResultNotification(ImportKeyResult result);
void setSecretKeyAdapter(Adapter adapter);

View File

@@ -229,6 +229,11 @@ public class TransferFragment extends Fragment implements TransferMvpView {
Notify.create(getActivity(), "Connection failed!", Style.ERROR).show();
}
@Override
public void showErrorListenFailed() {
Notify.create(getActivity(), "Error setting up server!", Style.ERROR).show();
}
@Override
public void showResultNotification(ImportKeyResult result) {
result.createNotify(getActivity()).show();