Refactoring

This commit is contained in:
M66B
2021-11-27 08:07:35 +01:00
parent 8a5a79ef41
commit 38cbfc713d
3 changed files with 67 additions and 67 deletions

View File

@@ -7092,28 +7092,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
Intent result;
try {
// Decrypt message
Log.i("Executing " + data.getAction());
Log.logExtras(data);
// Call OpenPGP
OpenPgpServiceConnection pgpService = null;
try {
pgpService = PgpHelper.getConnection(context);
if (!pgpService.isBound())
throw new OperationCanceledException();
Log.i("Executing " + data.getAction());
Log.logExtras(data);
OpenPgpApi api = new OpenPgpApi(context, pgpService.getService());
result = api.executeApi(data, in, out);
} finally {
if (pgpService != null && pgpService.isBound())
pgpService.unbindFromService();
}
result = PgpHelper.execute(context, data, in, out);
int resultCode = result.getIntExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR);
Log.i("Result action=" + data.getAction() + " code=" + resultCode);
Log.logExtras(data);
switch (resultCode) {
case OpenPgpApi.RESULT_CODE_SUCCESS:
if (out != null)