Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 070e3185 authored by Siyuan Zhou's avatar Siyuan Zhou
Browse files

BootReceiver: Added an event log after the dropbox file copy is successful.

The log can be used to test if LAST KMSG or other items are copied
to dropbox successfully, especially in user builds without root
privilege.

BUG: 69685635

Test: manually verified the desired log from bugreport on user
and userdebug builds.

Change-Id: I6570d95538d678c98d261690ca3c20416d7a31c6
Merged-In: Ie6033bf04c7f79fc596761ab751aa5fcea2c1130
(cherry-picked from commit bafcd7b5)
parent e7120f50
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -530,6 +530,7 @@ java_library {
        "core/java/android/net/EventLogTags.logtags",
        "core/java/android/webkit/EventLogTags.logtags",
        "core/java/com/android/internal/logging/EventLogTags.logtags",
        "core/java/com/android/server/DropboxLogTags.logtags",
    ],

    aidl: {
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.os.storage.StorageManager;
import android.provider.Downloads;
import android.text.TextUtils;
import android.util.AtomicFile;
import android.util.EventLog;
import android.util.Slog;
import android.util.Xml;

@@ -40,6 +41,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.util.FastXmlSerializer;
import com.android.internal.util.XmlUtils;
import com.android.server.DropboxLogTags;

import java.io.File;
import java.io.FileInputStream;
@@ -297,6 +299,7 @@ public class BootReceiver extends BroadcastReceiver {
        Slog.i(TAG, "Copying " + filename + " to DropBox (" + tag + ")");
        db.addText(tag, headers + FileUtils.readTextFile(file, maxSize, "[[TRUNCATED]]\n") +
                footers);
        EventLog.writeEvent(DropboxLogTags.DROPBOX_FILE_COPY, filename, maxSize, tag);
    }

    private static void addAuditErrorsToDropBox(DropBoxManager db,
+12 −0
Original line number Diff line number Diff line
# See system/core/logcat/event.logtags for a description of the format of this file.

# The java package name happens to be the same as frameworks/base/services/core
# /java/com/android/server/EventLogTags.logtags. To avoid conflict, this file's name cannot
# be EventLogTags.logtags because it generates a class with the same name.

option java_package com.android.server;

# -----------------------------
# BootReceiver.java
# -----------------------------
81002 dropbox_file_copy (FileName|3),(Size|1),(Tag|3)