Moved PGP debugging to encryption options

This commit is contained in:
M66B
2020-04-24 17:23:21 +02:00
parent a6e4296b1d
commit 63b83fb480
3 changed files with 47 additions and 33 deletions

View File

@@ -136,7 +136,6 @@ import org.jsoup.nodes.Node;
import org.jsoup.nodes.TextNode;
import org.jsoup.select.Elements;
import org.jsoup.select.NodeFilter;
import org.openintents.openpgp.IOpenPgpService2;
import org.openintents.openpgp.OpenPgpError;
import org.openintents.openpgp.util.OpenPgpApi;
import org.openintents.openpgp.util.OpenPgpServiceConnection;
@@ -885,20 +884,7 @@ public class FragmentCompose extends FragmentBase {
final String pkg = Helper.getOpenKeychainPackage(getContext());
Log.i("PGP binding to " + pkg);
pgpService = new OpenPgpServiceConnection(getContext(), pkg, new OpenPgpServiceConnection.OnBound() {
@Override
public void onBound(IOpenPgpService2 service) {
Log.i("PGP bound to " + pkg);
}
@Override
public void onError(Exception ex) {
if ("bindService() returned false!".equals(ex.getMessage()))
Log.i("PGP " + ex.getMessage());
else
Log.e("PGP", ex);
}
});
pgpService = new OpenPgpServiceConnection(getContext(), pkg);
pgpService.bindToService();
return view;
@@ -1016,8 +1002,10 @@ public class FragmentCompose extends FragmentBase {
public void onDestroyView() {
adapter = null;
if (pgpService != null && pgpService.isBound())
if (pgpService != null && pgpService.isBound()) {
Log.i("PGP unbinding");
pgpService.unbindFromService();
}
pgpService = null;
super.onDestroyView();