Work on issue #3101415: Crespo apps seem to have their UID changed over time.

fsync!

Change-Id: Ie6c5397202579935ac69bf61d3e7b3081ecf269c
This commit is contained in:
Dianne Hackborn
2010-10-15 12:54:40 -07:00
parent efb581018b
commit 8bdf5935c0
11 changed files with 52 additions and 9 deletions

View File

@@ -26,6 +26,7 @@ import android.database.ContentObserver;
import android.net.Uri;
import android.os.Debug;
import android.os.DropBoxManager;
import android.os.FileUtils;
import android.os.Handler;
import android.os.ParcelFileDescriptor;
import android.os.StatFs;
@@ -183,7 +184,8 @@ public final class DropBoxManagerService extends IDropBoxManagerService.Stub {
int bufferSize = mBlockSize;
if (bufferSize > 4096) bufferSize = 4096;
if (bufferSize < 512) bufferSize = 512;
output = new BufferedOutputStream(new FileOutputStream(temp), bufferSize);
FileOutputStream foutput = new FileOutputStream(temp);
output = new BufferedOutputStream(foutput, bufferSize);
if (read == buffer.length && ((flags & DropBoxManager.IS_GZIPPED) == 0)) {
output = new GZIPOutputStream(output);
flags = flags | DropBoxManager.IS_GZIPPED;
@@ -200,6 +202,7 @@ public final class DropBoxManagerService extends IDropBoxManagerService.Stub {
read = input.read(buffer);
if (read <= 0) {
FileUtils.sync(foutput);
output.close(); // Get a final size measurement
output = null;
} else {