Home
last modified time | relevance | path

Searched refs:ByteString (Results 1 – 25 of 88) sorted by relevance

1234

/packages/modules/Connectivity/nearby/tests/unit/src/com/android/server/nearby/provider/
DChreDiscoveryProviderTest.java47 import com.google.protobuf.ByteString;
166 .setSecretId(ByteString.copyFrom(new byte[] {1})) in testOnNearbyDeviceDiscovered()
167 .setAuthenticityKey(ByteString.copyFrom(new byte[2])) in testOnNearbyDeviceDiscovered()
168 .setPublicKey(ByteString.copyFrom(new byte[3])) in testOnNearbyDeviceDiscovered()
169 .setEncryptedMetadata(ByteString.copyFrom(new byte[4])) in testOnNearbyDeviceDiscovered()
170 .setEncryptedMetadataTag(ByteString.copyFrom(new byte[5])) in testOnNearbyDeviceDiscovered()
233 .setSecretId(ByteString.copyFrom(new byte[] {1})) in testOnNearbyDeviceDiscoveredWithDataElements_TIME()
234 .setAuthenticityKey(ByteString.copyFrom(new byte[2])) in testOnNearbyDeviceDiscoveredWithDataElements_TIME()
235 .setPublicKey(ByteString.copyFrom(new byte[3])) in testOnNearbyDeviceDiscoveredWithDataElements_TIME()
236 .setEncryptedMetadata(ByteString.copyFrom(new byte[4])) in testOnNearbyDeviceDiscoveredWithDataElements_TIME()
[all …]
/packages/modules/AdServices/adservices/libraries/cobalt/tests/src/com/android/cobalt/observations/
DStringHistogramEncoderTest.java34 import com.google.protobuf.ByteString;
77 .addStringHashesFf64(ByteString.copyFrom(HASH_CODE_1.asBytes())) in stringsHashesOrderedAndCompacted()
78 .addStringHashesFf64(ByteString.copyFrom(HASH_CODE_2.asBytes())) in stringsHashesOrderedAndCompacted()
79 .addStringHashesFf64(ByteString.copyFrom(HASH_CODE_3.asBytes())) in stringsHashesOrderedAndCompacted()
80 .addStringHashesFf64(ByteString.copyFrom(HASH_CODE_4.asBytes())) in stringsHashesOrderedAndCompacted()
87 ByteString.copyFrom(new byte[] {0, 0, 0, 0, 0, 0, 0, 0})) in stringsHashesOrderedAndCompacted()
133 .addStringHashesFf64(ByteString.copyFrom(HASH_CODE_1.asBytes())) in multipleEventsDisjointStrings()
134 .addStringHashesFf64(ByteString.copyFrom(HASH_CODE_2.asBytes())) in multipleEventsDisjointStrings()
135 .addStringHashesFf64(ByteString.copyFrom(HASH_CODE_3.asBytes())) in multipleEventsDisjointStrings()
136 .addStringHashesFf64(ByteString.copyFrom(HASH_CODE_4.asBytes())) in multipleEventsDisjointStrings()
[all …]
DNonPrivateObservationGeneratorTest.java41 import com.google.protobuf.ByteString;
88 private static final ByteString RANDOM_BYTES_1 =
89 ByteString.copyFrom(new byte[] {0, 0, 0, 0, 0, 0, 0, 0});
90 private static final ByteString RANDOM_BYTES_2 =
91 ByteString.copyFrom(new byte[] {1, 1, 1, 1, 1, 1, 1, 1});
92 private static final ByteString RANDOM_BYTES_3 =
93 ByteString.copyFrom(new byte[] {2, 2, 2, 2, 2, 2, 2, 2});
94 private static final ByteString RANDOM_BYTES_4 =
95 ByteString.copyFrom(new byte[] {3, 3, 3, 3, 3, 3, 3, 3});
DPrivateObservationGeneratorTest.java46 import com.google.protobuf.ByteString;
91 private static final ByteString RANDOM_BYTES_1 =
92 ByteString.copyFrom(new byte[] {0, 0, 0, 0, 0, 0, 0, 0});
93 private static final ByteString RANDOM_BYTES_2 =
94 ByteString.copyFrom(new byte[] {1, 1, 1, 1, 1, 1, 1, 1});
95 private static final ByteString RANDOM_BYTES_3 =
96 ByteString.copyFrom(new byte[] {2, 2, 2, 2, 2, 2, 2, 2});
97 private static final ByteString RANDOM_BYTES_4 =
98 ByteString.copyFrom(new byte[] {3, 3, 3, 3, 3, 3, 3, 3});
/packages/modules/OnDevicePersonalization/tests/frameworktests/src/android/federatedcompute/common/
DExampleConsumptionTest.java27 import com.google.protobuf.ByteString;
70 assertThat(ByteString.copyFrom(consumption.getSelectionCriteria())) in testBuilder_normalCaseWithoutResumptionToken()
71 .isEqualTo(ByteString.copyFrom(selectionCriteria)); in testBuilder_normalCaseWithoutResumptionToken()
85 assertThat(ByteString.copyFrom(consumption.getSelectionCriteria())) in testBuilder_normalCaseWithResumptionToken()
86 .isEqualTo(ByteString.copyFrom(selectionCriteria)); in testBuilder_normalCaseWithResumptionToken()
87 assertThat(ByteString.copyFrom(consumption.getResumptionToken())) in testBuilder_normalCaseWithResumptionToken()
88 .isEqualTo(ByteString.copyFrom(resumptionToken)); in testBuilder_normalCaseWithResumptionToken()
109 assertThat(ByteString.copyFrom(recoveredConsumption.getSelectionCriteria())) in testWriteToParcel()
110 .isEqualTo(ByteString.copyFrom(selectionCriteria)); in testWriteToParcel()
111 assertThat(ByteString.copyFrom(recoveredConsumption.getResumptionToken())) in testWriteToParcel()
[all …]
/packages/modules/OnDevicePersonalization/tests/federatedcomputetests/src/com/android/federatedcompute/services/training/jni/
DJavaExampleStoreTest.java32 import com.google.protobuf.ByteString;
61 ByteString data1 = ByteString.copyFromUtf8("data1"); in testCreateExampleIterator_success()
62 ByteString data2 = ByteString.copyFromUtf8("data2"); in testCreateExampleIterator_success()
63 List<ByteString> data = ImmutableList.of(data1, data2); in testCreateExampleIterator_success()
106 private final List<ByteString> mData;
109 FakeExampleIterator(List<ByteString> data) { in FakeExampleIterator()
/packages/apps/Dialer/java/com/android/voicemail/impl/transcribe/
DTranscriptionUtils.java26 import com.google.protobuf.ByteString;
36 static ByteString getAudioData(Context context, Uri voicemailUri) { in getAudioData()
38 return ByteString.readFrom(in); in getAudioData()
44 static AudioFormat getAudioFormat(ByteString audioData) { in getAudioFormat()
45 return audioData != null && audioData.startsWith(ByteString.copyFromUtf8(AMR_PREFIX)) in getAudioFormat()
51 static String getFingerprintFor(ByteString data, @Nullable String salt) { in getFingerprintFor()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/cobalt/
DCobaltApiKeys.java23 import com.google.protobuf.ByteString;
30 static ByteString copyFromHexApiKey(@NonNull String apiKey) { in copyFromHexApiKey()
33 ? ByteString.copyFromUtf8(apiKey) in copyFromHexApiKey()
34 : ByteString.copyFrom(BaseEncoding.base16().lowerCase().decode(apiKey)); in copyFromHexApiKey()
/packages/modules/Bluetooth/android/pandora/server/src/
DGattInstance.kt29 import com.google.protobuf.ByteString
57 var value: ByteString?,
73 fun get(address: ByteString): GattInstance { in get()
116 gattInstanceValueRead.value = ByteString.copyFrom(value) in onCharacteristicRead()
135 gattInstanceValueRead.value = ByteString.copyFrom(value) in onDescriptorRead()
261 ByteString.EMPTY, in readCharacteristicBlocking()
290 ByteString.EMPTY, in readCharacteristicUuidBlocking()
316 ByteString.EMPTY, in readCharacteristicUuidBlocking()
334 ByteString.EMPTY, in readDescriptorBlocking()
DUtils.kt33 import com.google.protobuf.ByteString in <lambda>()
331 fun ByteString.decodeAsMacAddressToString(): String = in Intent() method
334 fun ByteString.toBluetoothDevice(adapter: BluetoothAdapter): BluetoothDevice = in Intent() method
347 ByteString.copyFrom(MacAddress.fromString(this.address).toByteArray())!! in Intent()
352 .setAddress(ByteString.copyFrom(MacAddress.fromString(this.address).toByteArray())) in Intent()
/packages/modules/AdServices/adservices/libraries/cobalt/tests/src/com/android/cobalt/testing/crypto/
DNoOpEncrypterTest.java30 import com.google.protobuf.ByteString;
39 private static final ByteString CONTRIBUTION_ID =
40 ByteString.copyFromUtf8("test_contribution_id");
46 Envelope.newBuilder().setApiKey(ByteString.copyFromUtf8("test_api_key")).build(); in encryptEnvelope()
60 .setRandomId(ByteString.copyFromUtf8("test_random_id")) in encryptObservation()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/cobalt/
DCobaltApiKeysTest.java28 import com.google.protobuf.ByteString;
41 .isEqualTo(ByteString.copyFromUtf8(DEFAULT_API_KEY)); in defaultApiKey_copiedAsUtf8()
48 assertThat(copyFromHexApiKey(stringKey)).isEqualTo(ByteString.copyFrom(bytesKey)); in hexApiKey_encodedAsBytes()
53 assertThat(copyFromHexApiKey("")).isEqualTo(ByteString.EMPTY); in emptyApiKey_IsEmpty()
DCobaltUploaderTest.java46 import com.google.protobuf.ByteString;
100 .setCiphertext(ByteString.copyFrom(BYTES)) in environmentSet_devEnvironment()
123 .setCiphertext(ByteString.copyFrom(BYTES)) in environmentSet_prodEnvironment()
145 .setCiphertext(ByteString.copyFrom(BYTES)) in nullService_doesThrow()
170 .setCiphertext(ByteString.copyFrom(BYTES)) in uploadThrowsRemoteException_logsError()
/packages/modules/OnDevicePersonalization/tests/federatedcomputetests/src/com/android/federatedcompute/services/testutils/
DResettingExampleIterator.java24 import com.google.protobuf.ByteString;
31 ImmutableList<ByteString> mExamples;
47 ImmutableList.Builder<ByteString> exampleDatasetBuilder = new ImmutableList.Builder<>(); in ResettingExampleIterator()
63 public ResettingExampleIterator(int capacity, ByteString example) { in ResettingExampleIterator()
/packages/modules/AdServices/adservices/libraries/cobalt/java/com/android/cobalt/observations/
DRandomId.java19 import com.google.protobuf.ByteString;
27 static ByteString generate(SecureRandom secureRandom) { in generate()
30 return ByteString.copyFrom(randomId); in generate()
/packages/services/Car/service/src/com/android/car/telemetry/util/
DMetricsReportProtoUtils.java28 import com.google.protobuf.ByteString;
58 public static ByteString getByteString(PersistableBundle bundle) { in getByteString()
60 return bytes == null ? null : ByteString.copyFrom(bytes); in getByteString()
67 public static PersistableBundle getBundle(ByteString byteString) { in getBundle()
/packages/modules/AppSearch/testing/servicestests/src/com/android/server/appsearch/external/localstorage/visibilitystore/
DVisibilityToDocumentConverterTest.java32 import com.android.server.appsearch.protobuf.ByteString;
83 .setPackageSha256Cert(ByteString.copyFrom(cert1)) in testToGenericDocuments()
88 .setPackageSha256Cert(ByteString.copyFrom(cert2)) in testToGenericDocuments()
100 .setPackageSha256Cert(ByteString.copyFrom(cert4)) in testToGenericDocuments()
167 .setPackageSha256Cert(ByteString.copyFrom(cert1)) in testToVisibilityConfig()
172 .setPackageSha256Cert(ByteString.copyFrom(cert2)) in testToVisibilityConfig()
184 .setPackageSha256Cert(ByteString.copyFrom(cert4)) in testToVisibilityConfig()
/packages/modules/Bluetooth/framework/tests/bumble/src/android/bluetooth/
DRfcommTest.kt29 import com.google.protobuf.ByteString
228 Truth.assertThat(rxResponse.data).isEqualTo(ByteString.copyFrom(data)) in clientSendDataOverInsecureSocket()
248 Truth.assertThat(rxResponse.data).isEqualTo(ByteString.copyFrom(data)) in clientSendDataOverSecureSocket()
261 val data: ByteString = in clientReceiveDataOverInsecureSocket()
262 ByteString.copyFromUtf8("Test data for clientReceiveDataOverInsecureSocket") in clientReceiveDataOverInsecureSocket()
268 Truth.assertThat(ByteString.copyFrom(buffer).substring(0, numBytesFromBumble)) in clientReceiveDataOverInsecureSocket()
282 val data: ByteString = in clientReceiveDataOverSecureSocket()
283 ByteString.copyFromUtf8("Test data for clientReceiveDataOverSecureSocket") in clientReceiveDataOverSecureSocket()
289 Truth.assertThat(ByteString.copyFrom(buffer).substring(0, numBytesFromBumble)) in clientReceiveDataOverSecureSocket()
/packages/modules/RemoteKeyProvisioning/util/src/com/android/rkpdapp/
DRkpRegistrationCheck.java54 import co.nstant.in.cbor.model.ByteString;
100 mChallenge = ((ByteString) respItems.get(CHALLENGE_INDEX)).getBytes(); in FetchEekResponse()
226 byte[] sharedCertificates = ((ByteString) dataItems.get( in signCertificates()
231 fullChainWriter.write(((ByteString) leaf).getBytes()); in signCertificates()
324 Map macedCoseKey = (Map) decodeCbor(((ByteString) macedPayload).getBytes()); in buildMac0MessageForV1Csr()
331 .add(new ByteString(encodeCbor(protectedHeaders))) in buildMac0MessageForV1Csr()
333 .add(new ByteString(macedKeys)) in buildMac0MessageForV1Csr()
334 .add(new ByteString(csrTag)); in buildMac0MessageForV1Csr()
/packages/modules/AdServices/adservices/libraries/cobalt/java/com/android/cobalt/crypto/
DHpkeEncrypter.java40 import com.google.protobuf.ByteString;
112 ByteString.EMPTY); in encryptEnvelope()
156 ByteString contributionId) in encrypt()
181 .setCiphertext(ByteString.copyFrom(encryptedMessageBytes)) in encrypt()
/packages/modules/AdServices/adservices/libraries/cobalt/tests/src/com/android/cobalt/crypto/
DHpkeEncrypterTest.java46 import com.google.protobuf.ByteString;
62 private static final ByteString TEST_CONTRIBUTION_ID = ByteString.copyFromUtf8("testContId");
115 .setRandomId(ByteString.copyFromUtf8(testObservationIdString)) in encryptObservation_noOpRoundTripSuccess()
172 .setRandomId(ByteString.copyFromUtf8(testObservationIdString)) in encryptObservation_hpkeSingleTripSuccess()
/packages/modules/RemoteKeyProvisioning/app/src/com/android/rkpdapp/utils/
DCborUtils.java41 import co.nstant.in.cbor.model.ByteString;
119 ((ByteString) dataItems.get(SHARED_CERTIFICATES_INDEX)).getBytes(); in parseSignedCertificates()
128 concat.write(((ByteString) entry).getBytes()); in parseSignedCertificates()
256 resp.setChallenge(((ByteString) respItems.get(CHALLENGE_INDEX)).getBytes()); in parseGeekResponse()
360 byte[] xCor = ((ByteString) keyMap.get(new NegativeInteger(KEY_PARAMETER_X))).getBytes(); in extractRkpKeyFromMacedKey()
364 byte[] yCor = ((ByteString) keyMap.get(new NegativeInteger(KEY_PARAMETER_Y))).getBytes(); in extractRkpKeyFromMacedKey()
397 return ((ByteString) item).getBytes(); in getBytesFromBstr()
/packages/modules/RemoteKeyProvisioning/app/tests/unit/src/com/android/rkpdapp/unittest/
DCborUtilsTest.java47 import co.nstant.in.cbor.model.ByteString;
85 mGeekChain1.add(new ByteString(new byte[] {0x01, 0x02, 0x03})) in setUp()
86 .add(new ByteString(new byte[] {0x04, 0x05, 0x06})) in setUp()
87 .add(new ByteString(new byte[] {0x07, 0x08, 0x09})); in setUp()
91 mGeekChain2.add(new ByteString(new byte[] {0x09, 0x08, 0x07})) in setUp()
92 .add(new ByteString(new byte[] {0x06, 0x05, 0x04})) in setUp()
93 .add(new ByteString(new byte[] {0x03, 0x02, 0x01})); in setUp()
342 .add(new ByteString(CHALLENGE)) // Must be an array of bstrs in testParseGeekResponseFailsOnWrongType()
/packages/modules/RemoteKeyProvisioning/app/src/com/android/rkpdapp/interfaces/
DSystemInterface.java39 import co.nstant.in.cbor.model.ByteString;
132 .add(new ByteString(CborUtils.encodeCbor( in generateCsr()
135 .add(new ByteString(CborUtils.encodeCbor(macedKeys))) in generateCsr()
136 .add(new ByteString(csrTag)); in generateCsr()
/packages/modules/RemoteKeyProvisioning/app/tests/util/src/com/android/rkpdapp/testutil/
DFakeRkpServer.java24 import com.google.protobuf.ByteString;
89 private final ByteString mBody;
106 mBody = ByteString.copyFrom(body); in Response()

1234