Loading core/java/com/android/internal/util/JournaledFile.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.util; import android.annotation.UnsupportedAppUsage; import java.io.File; import java.io.IOException; Loading @@ -33,6 +35,7 @@ public class JournaledFile { File mTemp; boolean mWriting; @UnsupportedAppUsage public JournaledFile(File real, File temp) { mReal = real; mTemp = temp; Loading @@ -44,6 +47,7 @@ public class JournaledFile { * it to the real one. If there is both a real file and a temp one, assumes that the * temp one isn't fully written and deletes it. */ @UnsupportedAppUsage public File chooseForRead() { File result; if (mReal.exists()) { Loading @@ -68,6 +72,7 @@ public class JournaledFile { * <p> * Call {@link #commit} to commit the changes, or {@link #rollback} to forget the changes. */ @UnsupportedAppUsage public File chooseForWrite() { if (mWriting) { throw new IllegalStateException("uncommitted write already in progress"); Loading Loading @@ -95,6 +100,7 @@ public class JournaledFile { /** * Commit changes. */ @UnsupportedAppUsage public void commit() { if (!mWriting) { throw new IllegalStateException("no file to commit"); Loading @@ -106,6 +112,7 @@ public class JournaledFile { /** * Roll back changes. */ @UnsupportedAppUsage public void rollback() { if (!mWriting) { throw new IllegalStateException("no file to roll back"); Loading Loading
core/java/com/android/internal/util/JournaledFile.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.util; import android.annotation.UnsupportedAppUsage; import java.io.File; import java.io.IOException; Loading @@ -33,6 +35,7 @@ public class JournaledFile { File mTemp; boolean mWriting; @UnsupportedAppUsage public JournaledFile(File real, File temp) { mReal = real; mTemp = temp; Loading @@ -44,6 +47,7 @@ public class JournaledFile { * it to the real one. If there is both a real file and a temp one, assumes that the * temp one isn't fully written and deletes it. */ @UnsupportedAppUsage public File chooseForRead() { File result; if (mReal.exists()) { Loading @@ -68,6 +72,7 @@ public class JournaledFile { * <p> * Call {@link #commit} to commit the changes, or {@link #rollback} to forget the changes. */ @UnsupportedAppUsage public File chooseForWrite() { if (mWriting) { throw new IllegalStateException("uncommitted write already in progress"); Loading Loading @@ -95,6 +100,7 @@ public class JournaledFile { /** * Commit changes. */ @UnsupportedAppUsage public void commit() { if (!mWriting) { throw new IllegalStateException("no file to commit"); Loading @@ -106,6 +112,7 @@ public class JournaledFile { /** * Roll back changes. */ @UnsupportedAppUsage public void rollback() { if (!mWriting) { throw new IllegalStateException("no file to roll back"); Loading