DictStats should mask account info in filename

Change-Id: I1985fcc352c1c0658c4177f906f1d71ee0d67c6f
This commit is contained in:
Jatin Matani 2015-03-30 16:56:07 -07:00 committed by Dan Zivkovic
parent 76de0a8f52
commit 6d63989197
2 changed files with 10 additions and 10 deletions

View file

@ -24,17 +24,17 @@ public class DictionaryStats {
public static final int NOT_AN_ENTRY_COUNT = -1;
public final Locale mLocale;
public final String mDictName;
public final String mDictFilePath;
public final String mDictType;
public final String mDictFileName;
public final long mDictFileSize;
public final int mContentVersion;
public DictionaryStats(final Locale locale, final String dictName, final File dictFile,
final int contentVersion) {
public DictionaryStats(final Locale locale, final String dictType, final String dictFileName,
final File dictFile, final int contentVersion) {
mLocale = locale;
mDictName = dictName;
mDictFilePath = (dictFile == null) ? null : dictFile.getName();
mDictType = dictType;
mDictFileSize = (dictFile == null || !dictFile.exists()) ? 0 : dictFile.length();
mDictFileName = dictFileName;
mContentVersion = contentVersion;
}
@ -56,14 +56,14 @@ public class DictionaryStats {
@Override
public String toString() {
final StringBuilder builder = new StringBuilder(mDictName);
if (mDictName.equals(Dictionary.TYPE_MAIN)) {
final StringBuilder builder = new StringBuilder(mDictType);
if (mDictType.equals(Dictionary.TYPE_MAIN)) {
builder.append(" (");
builder.append(mContentVersion);
builder.append(")");
}
builder.append(": ");
builder.append(mDictFilePath);
builder.append(mDictFileName);
builder.append(" / ");
builder.append(getFileSizeString());
return builder.toString();

View file

@ -654,7 +654,7 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
asyncExecuteTaskWithLock(mLock.readLock(), new Runnable() {
@Override
public void run() {
result.set(new DictionaryStats(mLocale, dictName, dictFile, 0));
result.set(new DictionaryStats(mLocale, dictName, dictName, dictFile, 0));
}
});
return result.get(null /* defaultValue */, TIMEOUT_FOR_READ_OPS_IN_MILLISECONDS);