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

Commit 884056f8 authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Avoid infinite loop in case system_server does not have delete access.

This must not ever happen, but if it does then let's crash with a good
error message instead of hanging and getting out of stack memory
exception.

Bug: 269072872
Test: atest ShortcutManagerTest1
Change-Id: I7e4d9ac612c9e4e45d1521e3bebfb787fe21c953
parent a584474a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -230,7 +230,9 @@ final class ResilientAtomicFile implements Closeable {
                            + Log.getStackTraceString(e));
        }

        mCurrentFile.delete();
        if (!mCurrentFile.delete()) {
            throw new IllegalStateException("Failed to remove " + mCurrentFile);
        }
        mCurrentFile = null;
    }