summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jinguang Dong <dongjinguang@huawei.com> 2018-07-17 11:53:18 +0800
committer Josh Gao <jmgao@google.com> 2018-07-19 17:01:53 +0000
commitfe8d2c9a8c86bc842871129600ad9fbbb9b60ab3 (patch)
tree4f179c6bb603bc1cb048609a660673be5d220780
parent600aeb124ba9bdb5c16da802dd1c85a4265ed1d8 (diff)
Ensure dropbox could copy tombstone files to special folder.
Process of tombstoned have changed the generation flow for tombstone, and dropbox could not be notified when generating new tombstone file any more, so dropbox could not copy and compress tombstone file to /data/system/dropbox. We need to modify observer events from CLOSE_WRITE to CREATE, and it could work normally. Bug: http://b/111608961 Test: 1 After tombstone is triggered, we could see the tombstone file in the data/system/dropbox directory. Signed-off-by: Haoran Li <lihaoran5@huawei.com> Change-Id: I9d6a31773e4a58658ffab214b1e337f27e9f3ae6
-rw-r--r--core/java/com/android/server/BootReceiver.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/com/android/server/BootReceiver.java b/core/java/com/android/server/BootReceiver.java
index 87fde4128ec5..cbca37d9b99e 100644
--- a/core/java/com/android/server/BootReceiver.java
+++ b/core/java/com/android/server/BootReceiver.java
@@ -254,13 +254,13 @@ public class BootReceiver extends BroadcastReceiver {
// Start watching for new tombstone files; will record them as they occur.
// This gets registered with the singleton file observer thread.
- sTombstoneObserver = new FileObserver(TOMBSTONE_DIR.getPath(), FileObserver.CLOSE_WRITE) {
+ sTombstoneObserver = new FileObserver(TOMBSTONE_DIR.getPath(), FileObserver.CREATE) {
@Override
public void onEvent(int event, String path) {
HashMap<String, Long> timestamps = readTimestamps();
try {
File file = new File(TOMBSTONE_DIR, path);
- if (file.isFile()) {
+ if (file.isFile() && file.getName().startsWith("tombstone_")) {
addFileToDropBox(db, timestamps, headers, file.getPath(), LOG_SIZE,
"SYSTEM_TOMBSTONE");
}