Home
last modified time | relevance | path

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

123

/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()
227 .setSecretId(ByteString.copyFrom(new byte[] {1})) in testOnNearbyDeviceDiscoveredWithDataElements()
228 .setAuthenticityKey(ByteString.copyFrom(new byte[2])) in testOnNearbyDeviceDiscoveredWithDataElements()
229 .setPublicKey(ByteString.copyFrom(new byte[3])) in testOnNearbyDeviceDiscoveredWithDataElements()
230 .setEncryptedMetadata(ByteString.copyFrom(new byte[4])) in testOnNearbyDeviceDiscoveredWithDataElements()
[all …]
/packages/modules/OnDevicePersonalization/tests/federatedcomputetests/src/com/android/federatedcompute/services/http/
DFederatedComputeHttpRequestTest.java26 import com.google.protobuf.ByteString;
45 ByteString.copyFromUtf8("payload"), in testCreateRequestInvalidUri_fails()
58 ByteString.copyFromUtf8("non_empty_request_body"), in testCreateWithInvalidRequestBody_fails()
73 ByteString.copyFromUtf8("non_empty_request_body"), in testCreateWithContentLengthHeader_fails()
85 ByteString.EMPTY, in createGetRequest_valid()
90 assertThat(request.getBody()).isEqualTo(ByteString.EMPTY); in createGetRequest_valid()
105 ByteString.EMPTY, in createGetRequestWithHeader_valid()
121 ByteString.EMPTY, in createPostRequestWithoutBody_valid()
127 assertThat(request.getBody()).isEqualTo(ByteString.EMPTY); in createPostRequestWithoutBody_valid()
133 ByteString expectedBody = ByteString.copyFromUtf8("non_empty_request_body"); in createPostRequestWithBody_valid()
[all …]
DHttpClientTest.java33 import com.google.protobuf.ByteString;
67 ByteString.EMPTY, in testUnableToOpenconnection_returnFailure()
81 ByteString.EMPTY, in testPerformGetRequestSuccess()
109 ByteString.EMPTY, in testPerformGetRequestFails()
133 ByteString.copyFromUtf8("payload"), in testPerformPostRequestSuccess()
/packages/modules/Connectivity/nearby/tests/multidevices/clients/test_support/fastpair_provider/src/android/nearby/fastpair/provider/crypto/
DCrypto.java25 import com.google.protobuf.ByteString;
41 public static ByteString aesEcbNoPaddingEncrypt(ByteString key, ByteString data) { in aesEcbNoPaddingEncrypt()
46 public static ByteString aesEcbNoPaddingDecrypt(ByteString key, ByteString data) { in aesEcbNoPaddingDecrypt()
51 private static ByteString aesEcbOperation(ByteString key, ByteString data, int operation) { in aesEcbOperation()
61 return ByteString.copyFrom(output); in aesEcbOperation()
DE2eeCalculator.java23 import com.google.protobuf.ByteString;
60 public static ByteString computeE2eeEid( in computeE2eeEid()
61 ByteString identityKey, int exponent, int deviceClockSeconds) { in computeE2eeEid()
65 private static ByteString computePublicKey(BigInteger privateKey) { in computePublicKey()
70 ByteString identityKey, int exponent, int deviceClockSeconds) { in computePrivateKey()
87 Crypto.aesEcbNoPaddingEncrypt(identityKey, ByteString.copyFrom(data)).toByteArray(); in computePrivateKey()
95 private static ByteString getXCoordinateBytes(ECPoint point) { in getXCoordinateBytes()
117 return ByteString.copyFrom(bytes); in getXCoordinateBytes()
/packages/modules/Connectivity/nearby/service/java/com/android/server/nearby/common/bluetooth/fastpair/
DFastPairHistoryItem.java22 import com.google.protobuf.ByteString;
34 private final ByteString mAccountKey;
35 private final ByteString mSha256AccountKeyPublicAddress;
37 FastPairHistoryItem(ByteString accountkey, ByteString sha256AccountKeyPublicAddress) { in FastPairHistoryItem()
49 ByteString accountKey, ByteString sha256AccountKeyPublicAddress) { in create()
53 ByteString accountKey() { in accountKey()
57 ByteString sha256AccountKeyPublicAddress() { in sha256AccountKeyPublicAddress()
/packages/modules/OnDevicePersonalization/tests/frameworktests/src/android/federatedcompute/common/
DExampleConsumptionTest.java27 import com.google.protobuf.ByteString;
82 assertThat(ByteString.copyFrom(consumption.getSelectionCriteria())) in testBuilder_normalCaseWithoutResumptionToken()
83 .isEqualTo(ByteString.copyFrom(selectionCriteria)); in testBuilder_normalCaseWithoutResumptionToken()
98 assertThat(ByteString.copyFrom(consumption.getSelectionCriteria())) in testBuilder_normalCaseWithResumptionToken()
99 .isEqualTo(ByteString.copyFrom(selectionCriteria)); in testBuilder_normalCaseWithResumptionToken()
100 assertThat(ByteString.copyFrom(consumption.getResumptionToken())) in testBuilder_normalCaseWithResumptionToken()
101 .isEqualTo(ByteString.copyFrom(resumptionToken)); in testBuilder_normalCaseWithResumptionToken()
123 assertThat(ByteString.copyFrom(recoveredConsumption.getSelectionCriteria())) in testWriteToParcel()
124 .isEqualTo(ByteString.copyFrom(selectionCriteria)); in testWriteToParcel()
125 assertThat(ByteString.copyFrom(recoveredConsumption.getResumptionToken())) in testWriteToParcel()
[all …]
/packages/modules/OnDevicePersonalization/federatedcompute/src/com/android/federatedcompute/services/http/
DCheckinResult.java19 import com.google.protobuf.ByteString;
25 private ByteString mCheckpointData;
26 private ByteString mPlanData;
28 public CheckinResult(ByteString mCheckpointData, ByteString mPlanData) { in CheckinResult()
34 public ByteString getCheckpointData() { in getCheckpointData()
38 public ByteString getPlanData() { in getPlanData()
DHttpClientUtil.java21 import com.google.protobuf.ByteString;
50 public static ByteString compressWithGzip(ByteString uncompressedData) { in compressWithGzip()
51 try (ByteString.Output outputStream = ByteString.newOutput(uncompressedData.size()); in compressWithGzip()
DFederatedComputeHttpRequest.java25 import com.google.protobuf.ByteString;
38 private ByteString mBody;
44 ByteString body) { in FederatedComputeHttpRequest()
56 ByteString body, in create()
83 public ByteString getBody() { in getBody()
/packages/modules/Connectivity/nearby/service/java/com/android/server/nearby/fastpair/footprint/
DFastPairUploadInfo.java20 import com.google.protobuf.ByteString;
31 private ByteString mAccountKey;
33 private ByteString mSha256AccountKeyPublicAddress;
36 public FastPairUploadInfo(Cache.StoredDiscoveryItem storedDiscoveryItem, ByteString accountKey, in FastPairUploadInfo()
37 ByteString sha256AccountKeyPublicAddress) { in FastPairUploadInfo()
47 public ByteString getAccountKey() { in getAccountKey()
52 public ByteString getSha256AccountKeyPublicAddress() { in getSha256AccountKeyPublicAddress()
/packages/modules/Connectivity/nearby/tests/unit/src/com/android/server/nearby/fastpair/
DFastPairAdvHandlerTest.java40 import com.google.protobuf.ByteString;
126 .thenReturn(ByteString.copyFrom(ACCOUNT_KEY)); in setup()
130 .thenReturn(ByteString.copyFrom(ACCOUNT_KEY_2), ByteString.copyFrom(ACCOUNT_KEY_2)); in setup()
218 .thenReturn(ByteString.copyFrom(ACCOUNT_KEY), ByteString.copyFrom(ACCOUNT_KEY)); in testSubsequentBroadcast_cached_notShowNotification()
236 .thenReturn(ByteString.copyFrom(ACCOUNT_KEY), ByteString.copyFrom(ACCOUNT_KEY)); in testFindRecognizedDevice_bloomFilterNotContains_notFound()
246 .thenReturn(ByteString.copyFrom(ACCOUNT_KEY), ByteString.copyFrom(ACCOUNT_KEY)); in testFindRecognizedDevice_bloomFilterContains_found()
256 .thenReturn(ByteString.copyFrom(ACCOUNT_KEY), ByteString.copyFrom(ACCOUNT_KEY)); in testFindRecognizedDeviceFromCachedItem_bloomFilterNotContains_notFound()
266 .thenReturn(ByteString.copyFrom(ACCOUNT_KEY), ByteString.copyFrom(ACCOUNT_KEY)); in testFindRecognizedDeviceFromCachedItem_bloomFilterContains_found()
/packages/modules/Connectivity/nearby/tests/multidevices/clients/test_support/fastpair_provider/src/android/nearby/fastpair/provider/
DFastPairSimulatorDatabase.java30 import com.google.protobuf.ByteString;
60 Set<ByteString> accountKeys = new HashSet<>(getAccountKeys()); in addAccountKey()
62 Set<ByteString> removedKeys = new HashSet<>(); in addAccountKey()
64 for (ByteString key : accountKeys) { in addAccountKey()
75 accountKeys.add(ByteString.copyFrom(accountKey)); in addAccountKey()
80 public void setAccountKeys(Set<ByteString> accountKeys) { in setAccountKeys()
86 for (ByteString item : accountKeys) { in setAccountKeys()
94 public Set<ByteString> getAccountKeys() { in getAccountKeys()
100 Set<ByteString> accountKeys = new HashSet<>(); in getAccountKeys()
103 accountKeys.add(ByteString.copyFrom(base16().decode(key))); in getAccountKeys()
DFastPairSimulator.java113 import com.google.protobuf.ByteString;
632 private final ByteString mEddystoneIdentityKey;
650 @Nullable ByteString eddystoneIdentityKey) { in Options()
734 public ByteString getEddystoneIdentityKey() { in getEddystoneIdentityKey()
804 private ByteString mEddystoneIdentityKey;
928 public Builder setEddystoneIdentityKey(@Nullable ByteString eddystoneIdentityKey) { in setEddystoneIdentityKey()
1289 for (ByteString accountKey : getAccountKeys()) { in sendSetBufferActionResponse()
1500 for (ByteString key : getAccountKeys()) { in startGattServer()
1720 private ByteString mIdentityKey = mOptions.getEddystoneIdentityKey(); in startGattServer()
1801 ByteString accountKey = getOwnerAccountKey(); in startGattServer()
[all …]
/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/Bluetooth/android/pandora/server/src/com/android/pandora/
DGattInstance.kt29 import com.google.protobuf.ByteString
56 var value: ByteString?,
71 fun get(address: ByteString): GattInstance { in get()
114 gattInstanceValueRead.value = ByteString.copyFrom(value) in onCharacteristicRead()
133 gattInstanceValueRead.value = ByteString.copyFrom(value) in onDescriptorRead()
255 ByteString.EMPTY, in readCharacteristicBlocking()
284 ByteString.EMPTY, in readCharacteristicUuidBlocking()
307 GattInstanceValueRead(uuid, startHandle, ByteString.EMPTY, AttStatusCode.UNKNOWN_ERROR) in readCharacteristicUuidBlocking()
323 ByteString.EMPTY, in readDescriptorBlocking()
/packages/modules/Connectivity/nearby/tests/unit/src/com/android/server/nearby/common/bluetooth/fastpair/
DFastPairHistoryItemTest.java30 import com.google.protobuf.ByteString;
53 .create(ByteString.copyFrom(accountKey), ByteString.copyFrom(hashValue)); in inputMatchedPublicAddress_isMatchedReturnTrue()
69 .create(ByteString.copyFrom(accountKey), ByteString.copyFrom(hashValue)); in inputNotMatchedPublicAddress_isMatchedReturnFalse()
/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/Connectivity/nearby/tests/unit/src/com/android/server/nearby/fastpair/cache/
DFastPairCacheManagerTest.java29 import com.google.protobuf.ByteString;
44 private static final ByteString ACCOUNT_KEY = ByteString.copyFromUtf8("axgs");
46 private static final ByteString ACCOUNT_KEY_B = ByteString.copyFromUtf8("axgb");
/packages/modules/Connectivity/nearby/tests/unit/src/com/android/server/nearby/util/
DDataUtilsTest.java22 import com.google.protobuf.ByteString;
69 assertThat(item.getIconPng()).isEqualTo(ByteString.copyFrom(DEVICE_IMAGE)); in test_toScanFastPairStoreItem_withAccount()
72 .isEqualTo(ByteString.copyFrom(DEVICE_PUBLIC_KEY)); in test_toScanFastPairStoreItem_withAccount()
149 ByteString.copyFrom(DEVICE_PUBLIC_KEY))) in createObservedDeviceResponse()
160 .setImage(ByteString.copyFrom(DEVICE_IMAGE)) in createObservedDeviceResponse()
/packages/modules/Connectivity/nearby/tests/multidevices/clients/test_support/fastpair_provider/simulator_app/src/android/nearby/fastpair/provider/simulator/testing/
DLocalFileStreamIOHandler.java27 import com.google.protobuf.ByteString;
73 public ByteString read() throws IOException { in read()
92 return ByteString.copyFrom(base16().decode(new String(data))); in read()
101 public void write(ByteString output) throws IOException { in write()
DStreamIOHandler.java19 import com.google.protobuf.ByteString;
34 ByteString read() throws IOException; in read()
42 void write(ByteString output) throws IOException; in write()
/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/Connectivity/nearby/service/java/com/android/server/nearby/provider/
DUtils.java29 import com.google.protobuf.ByteString;
60 ByteString.copyFrom(metadataParcel.deviceAccountKey)); in convertToFastPairDevicesWithAccountKey()
64 ByteString.copyFrom(metadataParcel.sha256DeviceAccountKeyPublicAddress)); in convertToFastPairDevicesWithAccountKey()
84 ByteString.copyFrom( in convertToFastPairDevicesWithAccountKey()
107 ByteString.copyFrom(metadataParcel.discoveryItem.iconPng)); in convertToFastPairDevicesWithAccountKey()
229 .setPublicKey(ByteString.copyFrom(metadata.antispoofPublicKey)) in convertToDevice()
266 private static @Nullable ByteString convertToImage( in convertToImage()
272 return ByteString.copyFrom(metadata.deviceMetadata.image); in convertToImage()
356 ByteString image = convertToImage(metadata); in convertToGetObservedDeviceResponse()
/packages/modules/RemoteKeyProvisioning/app/tests/unit/src/com/android/rkpdapp/unittest/
DCborUtilsTest.java45 import co.nstant.in.cbor.model.ByteString;
80 mGeekChain1.add(new ByteString(new byte[] {0x01, 0x02, 0x03})) in setUp()
81 .add(new ByteString(new byte[] {0x04, 0x05, 0x06})) in setUp()
82 .add(new ByteString(new byte[] {0x07, 0x08, 0x09})); in setUp()
86 mGeekChain2.add(new ByteString(new byte[] {0x09, 0x08, 0x07})) in setUp()
87 .add(new ByteString(new byte[] {0x06, 0x05, 0x04})) in setUp()
88 .add(new ByteString(new byte[] {0x03, 0x02, 0x01})); in setUp()
293 .add(new ByteString(CHALLENGE)) // Must be an array of bstrs in testParseGeekResponseFailsOnWrongType()

123