Update language to comply with Android’s inclusive language guidance.
See https://source.android.com/setup/contribute/respectful-code for reference Bug: 161896447 Test: atest --test-mapping apex/blobstore Change-Id: If04f63361bab424abf5aa6e980067f689fd46622
This commit is contained in:
@@ -27,7 +27,7 @@ import android.support.test.uiautomator.UiDevice;
|
|||||||
import androidx.test.filters.LargeTest;
|
import androidx.test.filters.LargeTest;
|
||||||
import androidx.test.platform.app.InstrumentationRegistry;
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
|
|
||||||
import com.android.utils.blob.DummyBlobData;
|
import com.android.utils.blob.FakeBlobData;
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
@@ -96,7 +96,7 @@ public class BlobStorePerfTests {
|
|||||||
mAtraceUtils.startTrace(ATRACE_CATEGORY_SYSTEM_SERVER);
|
mAtraceUtils.startTrace(ATRACE_CATEGORY_SYSTEM_SERVER);
|
||||||
try {
|
try {
|
||||||
final List<Long> durations = new ArrayList<>();
|
final List<Long> durations = new ArrayList<>();
|
||||||
final DummyBlobData blobData = prepareDataBlob(fileSizeInMb);
|
final FakeBlobData blobData = prepareDataBlob(fileSizeInMb);
|
||||||
final TraceMarkParser parser = new TraceMarkParser(
|
final TraceMarkParser parser = new TraceMarkParser(
|
||||||
line -> line.name.startsWith(ATRACE_COMPUTE_DIGEST_PREFIX));
|
line -> line.name.startsWith(ATRACE_COMPUTE_DIGEST_PREFIX));
|
||||||
while (mState.keepRunning(durations)) {
|
while (mState.keepRunning(durations)) {
|
||||||
@@ -120,15 +120,15 @@ public class BlobStorePerfTests {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private DummyBlobData prepareDataBlob(int fileSizeInMb) throws Exception {
|
private FakeBlobData prepareDataBlob(int fileSizeInMb) throws Exception {
|
||||||
final DummyBlobData blobData = new DummyBlobData.Builder(mContext)
|
final FakeBlobData blobData = new FakeBlobData.Builder(mContext)
|
||||||
.setFileSize(fileSizeInMb * 1024 * 1024 /* bytes */)
|
.setFileSize(fileSizeInMb * 1024 * 1024 /* bytes */)
|
||||||
.build();
|
.build();
|
||||||
blobData.prepare();
|
blobData.prepare();
|
||||||
return blobData;
|
return blobData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void commitBlob(DummyBlobData blobData) throws Exception {
|
private void commitBlob(FakeBlobData blobData) throws Exception {
|
||||||
final long sessionId = mBlobStoreManager.createSession(blobData.getBlobHandle());
|
final long sessionId = mBlobStoreManager.createSession(blobData.getBlobHandle());
|
||||||
try (BlobStoreManager.Session session = mBlobStoreManager.openSession(sessionId)) {
|
try (BlobStoreManager.Session session = mBlobStoreManager.openSession(sessionId)) {
|
||||||
blobData.writeToSession(session);
|
blobData.writeToSession(session);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import java.security.MessageDigest;
|
|||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
public class DummyBlobData {
|
public class FakeBlobData {
|
||||||
private static final long DEFAULT_SIZE_BYTES = 10 * 1024L * 1024L;
|
private static final long DEFAULT_SIZE_BYTES = 10 * 1024L * 1024L;
|
||||||
|
|
||||||
private final Random mRandom;
|
private final Random mRandom;
|
||||||
@@ -47,7 +47,7 @@ public class DummyBlobData {
|
|||||||
byte[] mFileDigest;
|
byte[] mFileDigest;
|
||||||
long mExpiryTimeMs;
|
long mExpiryTimeMs;
|
||||||
|
|
||||||
private DummyBlobData(Builder builder) {
|
private FakeBlobData(Builder builder) {
|
||||||
mRandom = new Random(builder.getRandomSeed());
|
mRandom = new Random(builder.getRandomSeed());
|
||||||
mFile = new File(builder.getContext().getFilesDir(), builder.getFileName());
|
mFile = new File(builder.getContext().getFilesDir(), builder.getFileName());
|
||||||
mFileSize = builder.getFileSize();
|
mFileSize = builder.getFileSize();
|
||||||
@@ -116,8 +116,8 @@ public class DummyBlobData {
|
|||||||
return mExpiryDurationMs;
|
return mExpiryDurationMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DummyBlobData build() {
|
public FakeBlobData build() {
|
||||||
return new DummyBlobData(this);
|
return new FakeBlobData(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user