mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 874253 - Persist profile creation time. r=wesj
This commit is contained in:
parent
e8fb58c2d0
commit
84bc146651
@ -17,8 +17,11 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Hashtable;
|
||||
@ -398,6 +401,20 @@ public final class GeckoProfile {
|
||||
parser.addSection(profileSection);
|
||||
parser.write();
|
||||
|
||||
// Write out profile creation time, mirroring the logic in nsToolkitProfileService.
|
||||
try {
|
||||
FileOutputStream stream = new FileOutputStream(profileDir.getAbsolutePath() + File.separator + "times.json");
|
||||
OutputStreamWriter writer = new OutputStreamWriter(stream, Charset.forName("UTF-8"));
|
||||
try {
|
||||
writer.append("{\"created\": " + System.currentTimeMillis() + "}\n");
|
||||
} finally {
|
||||
writer.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Best-effort.
|
||||
Log.w(LOGTAG, "Couldn't write times.json.", e);
|
||||
}
|
||||
|
||||
return profileDir;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user