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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user