Added OpenPGP connection debugging

pull/183/head
M66B 5 years ago
parent 93c91ba4a5
commit 799a05c6ee

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

@ -98,6 +98,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvOpenPgp" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvOpenPgpStatus"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="OpenPgp status"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spOpenPgp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAutocrypt"
android:layout_width="0dp"
@ -107,7 +119,7 @@
android:text="@string/title_advanced_autocrypt"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spOpenPgp"
app:layout_constraintTop_toBottomOf="@id/tvOpenPgpStatus"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat

Loading…
Cancel
Save