This source file includes following definitions.
- findDumpFile
- onCreate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.gnu.emacs;
21
22 import java.io.File;
23 import java.io.FileFilter;
24
25 import android.content.Context;
26
27 import android.app.Application;
28 import android.util.Log;
29
30 public final class EmacsApplication extends Application
31 {
32 private static final String TAG = "EmacsApplication";
33
34
35 public static String dumpFileName;
36
37 public static void
38 findDumpFile (Context context)
39 {
40 File filesDirectory;
41 File[] allFiles;
42 String wantedDumpFile;
43 int i;
44
45 wantedDumpFile = ("emacs-" + EmacsNative.getFingerprint ()
46 + ".pdmp");
47
48
49
50
51 filesDirectory = context.getFilesDir ();
52
53 allFiles = filesDirectory.listFiles (new FileFilter () {
54 @Override
55 public boolean
56 accept (File file)
57 {
58 return (!file.isDirectory ()
59 && file.getName ().endsWith (".pdmp"));
60 }
61 });
62
63 if (allFiles == null)
64 return;
65
66
67 for (i = 0; i < allFiles.length; ++i)
68 {
69 if (allFiles[i].getName ().equals (wantedDumpFile))
70 dumpFileName = allFiles[i].getAbsolutePath ();
71 else
72
73 allFiles[i].delete ();
74 }
75 }
76
77 @Override
78 public void
79 onCreate ()
80 {
81
82
83
84 EmacsNative.setupSystemThread ();
85
86
87 findDumpFile (this);
88
89
90 super.onCreate ();
91 }
92 };