Added OpenPGP connection debugging

This commit is contained in:
M66B
2020-07-01 15:39:25 +02:00
parent 93c91ba4a5
commit 799a05c6ee
2 changed files with 19 additions and 5 deletions

View File

@@ -71,6 +71,7 @@ public class FragmentOptionsEncryption extends FragmentBase implements SharedPre
private SwitchCompat swAutoDecrypt;
private Spinner spOpenPgp;
private TextView tvOpenPgpStatus;
private SwitchCompat swAutocrypt;
private SwitchCompat swAutocryptMutual;
@@ -106,6 +107,7 @@ public class FragmentOptionsEncryption extends FragmentBase implements SharedPre
swAutoDecrypt = view.findViewById(R.id.swAutoDecrypt);
spOpenPgp = view.findViewById(R.id.spOpenPgp);
tvOpenPgpStatus = view.findViewById(R.id.tvOpenPgpStatus);
swAutocrypt = view.findViewById(R.id.swAutocrypt);
swAutocryptMutual = view.findViewById(R.id.swAutocryptMutual);
@@ -361,19 +363,19 @@ public class FragmentOptionsEncryption extends FragmentBase implements SharedPre
if (pgpService != null && pgpService.isBound())
pgpService.unbindFromService();
Log.i("PGP binding to " + pkg);
tvOpenPgpStatus.setText("PGP binding to " + pkg);
pgpService = new OpenPgpServiceConnection(getContext(), pkg, new OpenPgpServiceConnection.OnBound() {
@Override
public void onBound(IOpenPgpService2 service) {
Log.i("PGP bound to " + pkg);
tvOpenPgpStatus.setText("PGP bound to " + pkg);
}
@Override
public void onError(Exception ex) {
if ("bindService() returned false!".equals(ex.getMessage()))
Log.i(ex.getMessage());
tvOpenPgpStatus.setText(ex.getMessage());
else
Log.e("PGP", ex);
tvOpenPgpStatus.setText(ex.toString());
}
});
pgpService.bindToService();