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

View file

@ -654,7 +654,7 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
asyncExecuteTaskWithLock(mLock.readLock(), new Runnable() { asyncExecuteTaskWithLock(mLock.readLock(), new Runnable() {
@Override @Override
public void run() { 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); return result.get(null /* defaultValue */, TIMEOUT_FOR_READ_OPS_IN_MILLISECONDS);