mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-01-11 21:48:17 -05:00
import-log: add output to logcat (for debugging)
This commit is contained in:
parent
e083ccc370
commit
118225d7d2
@ -126,10 +126,13 @@ public class OperationResultParcel implements Parcelable {
|
||||
MSG_IS_SUCCESS (R.string.msg_is_success),
|
||||
;
|
||||
|
||||
private int mMsgId;
|
||||
private final int mMsgId;
|
||||
LogType(int msgId) {
|
||||
mMsgId = msgId;
|
||||
}
|
||||
public int getMsgId() {
|
||||
return mMsgId;
|
||||
}
|
||||
}
|
||||
|
||||
/** Enumeration of possible log levels. */
|
||||
|
@ -152,13 +152,14 @@ public class PgpImportExport {
|
||||
}
|
||||
}
|
||||
|
||||
mProviderHelper.savePublicKeyRing(key);
|
||||
/*switch(status) {
|
||||
case RETURN_UPDATED: oldKeys++; break;
|
||||
case RETURN_OK: newKeys++; break;
|
||||
case RETURN_BAD: badKeys++; break;
|
||||
}*/
|
||||
// TODO proper import feedback
|
||||
mProviderHelper.resetLog();
|
||||
OperationResultParcel result = mProviderHelper.savePublicKeyRing(key);
|
||||
for(OperationResultParcel.LogEntryParcel loge : result.mLog) {
|
||||
Log.d(Constants.TAG,
|
||||
loge.mIndent
|
||||
+ new String(new char[loge.mIndent]).replace("\0", " ")
|
||||
+ mContext.getString(loge.mType.getMsgId(), (Object[]) loge.mParameters));
|
||||
}
|
||||
newKeys += 1;
|
||||
|
||||
} catch (PgpGeneralException e) {
|
||||
|
@ -79,6 +79,13 @@ public class ProviderHelper {
|
||||
mIndent = indent;
|
||||
}
|
||||
|
||||
public void resetLog() {
|
||||
if(mLog != null) {
|
||||
mLog.clear();
|
||||
mIndent = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static class NotFoundException extends Exception {
|
||||
public NotFoundException() {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user