mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-17 22:35:05 -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),
|
MSG_IS_SUCCESS (R.string.msg_is_success),
|
||||||
;
|
;
|
||||||
|
|
||||||
private int mMsgId;
|
private final int mMsgId;
|
||||||
LogType(int msgId) {
|
LogType(int msgId) {
|
||||||
mMsgId = msgId;
|
mMsgId = msgId;
|
||||||
}
|
}
|
||||||
|
public int getMsgId() {
|
||||||
|
return mMsgId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Enumeration of possible log levels. */
|
/** Enumeration of possible log levels. */
|
||||||
|
@ -152,13 +152,14 @@ public class PgpImportExport {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mProviderHelper.savePublicKeyRing(key);
|
mProviderHelper.resetLog();
|
||||||
/*switch(status) {
|
OperationResultParcel result = mProviderHelper.savePublicKeyRing(key);
|
||||||
case RETURN_UPDATED: oldKeys++; break;
|
for(OperationResultParcel.LogEntryParcel loge : result.mLog) {
|
||||||
case RETURN_OK: newKeys++; break;
|
Log.d(Constants.TAG,
|
||||||
case RETURN_BAD: badKeys++; break;
|
loge.mIndent
|
||||||
}*/
|
+ new String(new char[loge.mIndent]).replace("\0", " ")
|
||||||
// TODO proper import feedback
|
+ mContext.getString(loge.mType.getMsgId(), (Object[]) loge.mParameters));
|
||||||
|
}
|
||||||
newKeys += 1;
|
newKeys += 1;
|
||||||
|
|
||||||
} catch (PgpGeneralException e) {
|
} catch (PgpGeneralException e) {
|
||||||
|
@ -79,6 +79,13 @@ public class ProviderHelper {
|
|||||||
mIndent = indent;
|
mIndent = indent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetLog() {
|
||||||
|
if(mLog != null) {
|
||||||
|
mLog.clear();
|
||||||
|
mIndent = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class NotFoundException extends Exception {
|
public static class NotFoundException extends Exception {
|
||||||
public NotFoundException() {
|
public NotFoundException() {
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user