Source:
<code>public List<ImapResponse> internalOpen(OpenMode mode) throws MessagingException { if (isOpen() && mMode == mode) { try { List<ImapResponse> responses = executeSimpleCommand("NOOP"); return responses; } catch (IOException ioe) { ioExceptionHandler(mConnection, ioe); } } releaseConnection(mConnection); synchronized (this) { mConnection = getConnection(); } try { msgSeqUidMap.clear(); String command = String.format("%s %s", mode == OpenMode.READ_WRITE ? "SELECT" : "EXAMINE", encodeString(encodeFolderName(getPrefixedName()))); List<ImapResponse> responses = executeSimpleCommand(command); mMode = mode; for (ImapResponse response : responses) { if (response.size() >= 2) { Object bracketedObj = response.get(1); if (!(bracketedObj instanceof ImapList)) { continue; } ImapList bracketed = (ImapList) bracketedObj; if (bracketed.isEmpty()) { continue; } ImapList flags = bracketed.getKeyedList("PERMANENTFLAGS"); if (flags != null) { <START> parseFlags(flags, mPermanentFlagsIndex); <END> } else { Object keyObj = bracketed.get(0); if (keyObj instanceof String) { String key = (String) keyObj; if (response.mTag != null) { if ("READ-ONLY".equalsIgnoreCase(key)) { mMode = OpenMode.READ_ONLY; } else if ("READ-WRITE".equalsIgnoreCase(key)) { mMode = OpenMode.READ_WRITE; } } } } } } mExists = true; return responses; } catch (IOException ioe) { throw ioExceptionHandler(mConnection, ioe); } catch (MessagingException me) { Log.e(K9.LOG_TAG, "Unable to open connection for " + getLogId(), me); throw me; } }</code><technical_language>Sorry, I realized parseFlags() static. mPermamantFlagsIndex is a member variable, this a one-argument method (taking flags) parseFlags() manipulate mPermanantFlagsIndex</technical_language>

Target:
public List<ImapResponse> internalOpen(OpenMode mode) throws MessagingException { if (isOpen() && mMode == mode) { try { List<ImapResponse> responses = executeSimpleCommand("NOOP"); return responses; } catch (IOException ioe) { ioExceptionHandler(mConnection, ioe); } } releaseConnection(mConnection); synchronized (this) { mConnection = getConnection(); } try { msgSeqUidMap.clear(); String command = String.format("%s %s", mode == OpenMode.READ_WRITE ? "SELECT" : "EXAMINE", encodeString(encodeFolderName(getPrefixedName()))); List<ImapResponse> responses = executeSimpleCommand(command); mMode = mode; for (ImapResponse response : responses) { if (response.size() >= 2) { Object bracketedObj = response.get(1); if (!(bracketedObj instanceof ImapList)) { continue; } ImapList bracketed = (ImapList) bracketedObj; if (bracketed.isEmpty()) { continue; } ImapList flags = bracketed.getKeyedList("PERMANENTFLAGS"); if (flags != null) { parseFlags(flags); } else { Object keyObj = bracketed.get(0); if (keyObj instanceof String) { String key = (String) keyObj; if (response.mTag != null) { if ("READ-ONLY".equalsIgnoreCase(key)) { mMode = OpenMode.READ_ONLY; } else if ("READ-WRITE".equalsIgnoreCase(key)) { mMode = OpenMode.READ_WRITE; } } } } } } mExists = true; return responses; } catch (IOException ioe) { throw ioExceptionHandler(mConnection, ioe); } catch (MessagingException me) { Log.e(K9.LOG_TAG, "Unable to open connection for " + getLogId(), me); throw me; } }