summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-prod (mdb)2018-10-11 21:11:24 -0500
committerandroid-build-prod (mdb)2018-10-11 21:11:24 -0500
commitdb084990f39825b053eaaf1dbf26d0ad5a77f07e (patch)
tree5aea4406ced9d38c447198d72398bfd091b8bae2
parentd14b18d80e98e099607f53f7009a5749f136a138 (diff)
parent59cc3bcdaf79afd37033d4263d8286d5c079a753 (diff)
downloadplatform-packages-services-car-master-cuttlefish-testing-release.tar.gz
platform-packages-services-car-master-cuttlefish-testing-release.tar.xz
platform-packages-services-car-master-cuttlefish-testing-release.zip
Snap for 5061196 from 59cc3bcdaf79afd37033d4263d8286d5c079a753 to master-cuttlefish-testing-releasemaster-cuttlefish-testing-release
Change-Id: Idd63e37fa7688f7f395268aa7687177bbda17049
-rw-r--r--tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/storagelifetime/StorageLifetimeFragment.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/storagelifetime/StorageLifetimeFragment.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/storagelifetime/StorageLifetimeFragment.java
index fc4052e4..c420af67 100644
--- a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/storagelifetime/StorageLifetimeFragment.java
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/storagelifetime/StorageLifetimeFragment.java
@@ -29,6 +29,7 @@ import android.os.Bundle;
29import android.os.StatFs; 29import android.os.StatFs;
30import android.support.v4.app.Fragment; 30import android.support.v4.app.Fragment;
31import android.system.ErrnoException; 31import android.system.ErrnoException;
32import android.system.Os;
32import android.util.Log; 33import android.util.Log;
33import android.view.LayoutInflater; 34import android.view.LayoutInflater;
34import android.view.View; 35import android.view.View;
@@ -40,8 +41,6 @@ import android.widget.TextView;
40import com.google.android.car.kitchensink.KitchenSinkActivity; 41import com.google.android.car.kitchensink.KitchenSinkActivity;
41import com.google.android.car.kitchensink.R; 42import com.google.android.car.kitchensink.R;
42 43
43import libcore.io.Libcore;
44
45import java.io.File; 44import java.io.File;
46import java.io.FileDescriptor; 45import java.io.FileDescriptor;
47import java.io.IOException; 46import java.io.IOException;
@@ -147,16 +146,16 @@ public class StorageLifetimeFragment extends Fragment {
147 private void fsyncFile() { 146 private void fsyncFile() {
148 try { 147 try {
149 final Path filePath = getFilePath(); 148 final Path filePath = getFilePath();
150 FileDescriptor fd = Libcore.os.open(filePath.toString(), O_APPEND | O_RDWR, 0); 149 FileDescriptor fd = Os.open(filePath.toString(), O_APPEND | O_RDWR, 0);
151 if (!fd.valid()) { 150 if (!fd.valid()) {
152 Log.w(TAG, "file descriptor is invalid"); 151 Log.w(TAG, "file descriptor is invalid");
153 return; 152 return;
154 } 153 }
155 // fill byteBuffer with arbitrary data in order to make an fsync() meaningful 154 // fill byteBuffer with arbitrary data in order to make an fsync() meaningful
156 ByteBuffer byteBuffer = ByteBuffer.wrap(new byte[] {101, 110, 114, 105, 99, 111}); 155 ByteBuffer byteBuffer = ByteBuffer.wrap(new byte[] {101, 110, 114, 105, 99, 111});
157 Libcore.os.write(fd, byteBuffer); 156 Os.write(fd, byteBuffer);
158 Libcore.os.fsync(fd); 157 Os.fsync(fd);
159 Libcore.os.close(fd); 158 Os.close(fd);
160 } catch (ErrnoException | IOException e) { 159 } catch (ErrnoException | IOException e) {
161 Log.w(TAG, "could not fsync data", e); 160 Log.w(TAG, "could not fsync data", e);
162 } 161 }