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

Commit a36a6edb authored by Tao Wu's avatar Tao Wu
Browse files

Fix StrictMode violation.

Bug: 391559919
Bug: 361799815
Flag: EXEMPT bugfix
Test: manual - Launching new chrome tab after killing chrome_zygote
Change-Id: I01cc725c5badd65d621ff2ba4f75126600dda819
parent 651a6713
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -67,12 +67,15 @@ public class ChildZygoteProcess extends ZygoteProcess {
        if (mDead.get()) {
        if (mDead.get()) {
            return true;
            return true;
        }
        }
        StrictMode.ThreadPolicy oldStrictModeThreadPolicy = StrictMode.allowThreadDiskReads();
        try {
        try {
            if (Os.stat("/proc/" + mPid).st_uid == mUid) {
            if (Os.stat("/proc/" + mPid).st_uid == mUid) {
                return false;
                return false;
            }
            }
        } catch (ErrnoException e) {
        } catch (ErrnoException e) {
            // Do nothing, it's dead.
            // Do nothing, it's dead.
        } finally {
            StrictMode.setThreadPolicy(oldStrictModeThreadPolicy);
        }
        }
        mDead.set(true);
        mDead.set(true);
        return true;
        return true;