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

Commit 581a6313 authored by Jing Ji's avatar Jing Ji
Browse files

Wait for persisting data into the dropbox if system_server crashes

On process crashes, we'll kill the faulty process and also log
the event into the dropbox asynchronously. However, if that process
is the system_server itself, it might be killed before the event
is persisted into the dropbox successfully. So now we'll wait for
a while for the dropbox.

Bug: 295976585
Test: Manual - induce a system_server crash and check dropbox.
Change-Id: I0f3155d5ccfa039b9c5da6502ff5e9588e19acea
parent df7bb745
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -9543,6 +9543,14 @@ public class ActivityManagerService extends IActivityManager.Stub
            }
        } else {
            worker.start();
            if (process != null && process.mPid == MY_PID && "crash".equals(eventType)) {
                // We're actually crashing, let's wait for up to 2 seconds before killing ourselves,
                // so the data could be persisted into the dropbox.
                try {
                    worker.join(2000);
                } catch (InterruptedException ignored) {
                }
            }
        }
    }