Home
last modified time | relevance | path

Searched refs:getBytes (Results 1 – 25 of 280) sorted by relevance

12345678910>>...12

/frameworks/base/core/tests/coretests/src/android/os/
DFileBridgeTest.java90 client.write("meow".getBytes(StandardCharsets.UTF_8)); in testWriteNoSync()
92 assertContents("meow".getBytes(StandardCharsets.UTF_8)); in testWriteNoSync()
97 client.write("cake".getBytes(StandardCharsets.UTF_8)); in testWriteSync()
100 assertContents("cake".getBytes(StandardCharsets.UTF_8)); in testWriteSync()
105 client.write("meow".getBytes(StandardCharsets.UTF_8)); in testWriteSyncWrite()
107 client.write("cake".getBytes(StandardCharsets.UTF_8)); in testWriteSyncWrite()
109 assertContents("meowcake".getBytes(StandardCharsets.UTF_8)); in testWriteSyncWrite()
121 client.write("meow".getBytes(StandardCharsets.UTF_8)); in testWriteAfterClose()
124 client.write("cake".getBytes(StandardCharsets.UTF_8)); in testWriteAfterClose()
128 assertContents("meow".getBytes(StandardCharsets.UTF_8)); in testWriteAfterClose()
/frameworks/base/core/tests/coretests/src/com/android/internal/os/
DKernelWakelockReaderTest.java49 public byte[] getBytes() throws Exception { in getBytes() method in KernelWakelockReaderTest.ProcFileBuilder
51 byte[] data = mStringBuilder.toString().getBytes(Charset.forName("UTF-8")); in getBytes()
77 byte[] buffer = new ProcFileBuilder().getBytes(); in testOnlyHeader()
87 .getBytes(); in testOneWakelock()
103 .getBytes(); in testTwoWakelocks()
116 .getBytes(); in testDuplicateWakelocksAccumulate()
131 .getBytes(); in testWakelocksBecomeStale()
140 .getBytes(); in testWakelocksBecomeStale()
DLoggingPrintStreamTest.java136 out.write(expected.getBytes("UTF-8")); in testMultiByteCharactersSpanningBuffers()
143 for (byte b : expected.getBytes()) { in testWriteOneByteAtATimeMultibyteCharacters()
152 out.write(expected.getBytes()); in testWriteByteArrayAtATimeMultibyteCharacters()
159 byte[] bytes = expected.getBytes(); in testWriteWithOffsetsMultibyteCharacters()
175 out.write(toWrite.getBytes()); in testWriteFlushesOnNewlines()
/frameworks/base/wifi/tests/src/android/net/wifi/hotspot2/
DConfigParserTest.java127 "application/x-wifi-config", configStr.getBytes()); in parseConfigFile()
140 "application/wifi-config", configStr.getBytes())); in parseConfigFileWithInvalidMimeType()
152 "application/x-wifi-config", configStr.getBytes())); in parseConfigFileWithUnencodedData()
164 "application/x-wifi-config", configStr.getBytes())); in parseConfigFileWithInvalidPart()
176 "application/x-wifi-config", configStr.getBytes())); in parseConfigFileWithMissingBoundary()
189 "application/x-wifi-config", configStr.getBytes())); in parseConfigFileWithInvalidContentType()
201 "application/x-wifi-config", configStr.getBytes())); in parseConfigFileWithoutPasspointProfile()
/frameworks/base/keystore/java/android/security/keystore/
DAttestationUtils.java147 Build.getSerial().getBytes(StandardCharsets.UTF_8)); in prepareAttestationArguments()
155 imei.getBytes(StandardCharsets.UTF_8)); in prepareAttestationArguments()
164 meid.getBytes(StandardCharsets.UTF_8)); in prepareAttestationArguments()
172 Build.BRAND.getBytes(StandardCharsets.UTF_8)); in prepareAttestationArguments()
174 Build.DEVICE.getBytes(StandardCharsets.UTF_8)); in prepareAttestationArguments()
176 Build.PRODUCT.getBytes(StandardCharsets.UTF_8)); in prepareAttestationArguments()
178 Build.MANUFACTURER.getBytes(StandardCharsets.UTF_8)); in prepareAttestationArguments()
180 Build.MODEL.getBytes(StandardCharsets.UTF_8)); in prepareAttestationArguments()
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/
DSecureBoxTest.java66 private static final byte[] VAULT_CHALLENGE = getBytes("Not a real vault challenge");
67 private static final byte[] THM_KF_HASH = getBytes("12345678901234567890123456789012");
91 private static final byte[] KEY_CLAIMANT = getBytes("asdfasdfasdfasdf");
120 private static final byte[] TEST_SHARED_SECRET = getBytes("TEST_SHARED_SECRET");
121 private static final byte[] TEST_HEADER = getBytes("TEST_HEADER");
122 private static final byte[] TEST_PAYLOAD = getBytes("TEST_PAYLOAD");
175 SecureBox.concat(getBytes("V1 KF_claim"), VAULT_PARAMS, VAULT_CHALLENGE), in decryptRecoveryClaim()
185 SecureBox.concat(getBytes("V1 THM_encrypted_recovery_key"), VAULT_PARAMS), in decryptRecoveryKey_doesNotThrowForValidAuthenticationTag()
355 private static byte[] getBytes(String str) { in getBytes() method in SecureBoxTest
356 return str.getBytes(StandardCharsets.UTF_8); in getBytes()
DTestData.java166 return xml.getBytes(StandardCharsets.UTF_8); in getCertXmlWithSerial()
174 return THM_SIG_XML.getBytes(StandardCharsets.UTF_8); in getSigXml()
434 return str.getBytes(StandardCharsets.UTF_8); in getInsecureCertXmlBytesWithEndpoint1()
443 return str.getBytes(StandardCharsets.UTF_8); in getInsecureCertXmlBytesWithEndpoint2()
/frameworks/base/services/tests/servicestests/src/com/android/server/updates/
DCertPinInstallReceiverTest.java131 byte[] encoded = content.getBytes(); in getCurrentHash()
142 byte[] derKey = Base64.decode(TEST_KEY.getBytes(), Base64.DEFAULT); in createKey()
149 byte[] derCert = Base64.decode(TEST_CERT.getBytes(), Base64.DEFAULT); in createCertificate()
157 fw.write(content.getBytes(), 0, content.length()); in makeTemporaryContentFile()
166 signer.update(content.trim().getBytes()); in createSignature()
167 signer.update(version.trim().getBytes()); in createSignature()
168 signer.update(requiredHash.getBytes()); in createSignature()
179 signer.update(content.trim().getBytes()); in verifySignature()
180 signer.update(version.trim().getBytes()); in verifySignature()
181 signer.update(requiredPrevious.trim().getBytes()); in verifySignature()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/wm/
DWindowTracingTest.java152 "TEST_WHERE".getBytes(StandardCharsets.UTF_8))); in tracing_endsUpInFile()
154 "TEST_WM_PROTO".getBytes(StandardCharsets.UTF_8))); in tracing_endsUpInFile()
184 byte[] haystack = "hello_world".getBytes(StandardCharsets.UTF_8); in test_containsBytes()
186 "hello".getBytes(StandardCharsets.UTF_8))); in test_containsBytes()
188 "world".getBytes(StandardCharsets.UTF_8))); in test_containsBytes()
190 "world".getBytes(StandardCharsets.UTF_8))); in test_containsBytes()
192 "world_".getBytes(StandardCharsets.UTF_8))); in test_containsBytes()
194 "absent".getBytes(StandardCharsets.UTF_8))); in test_containsBytes()
/frameworks/base/wifi/java/android/net/wifi/hotspot2/pps/
DUpdateParameter.java297 if (mServerUri.getBytes(StandardCharsets.UTF_8).length > MAX_URI_BYTES) { in validate()
299 + mServerUri.getBytes(StandardCharsets.UTF_8).length); in validate()
307 if (mUsername.getBytes(StandardCharsets.UTF_8).length > MAX_USERNAME_BYTES) { in validate()
309 + mUsername.getBytes(StandardCharsets.UTF_8).length); in validate()
317 if (mBase64EncodedPassword.getBytes(StandardCharsets.UTF_8).length > MAX_PASSWORD_BYTES) { in validate()
319 + mBase64EncodedPassword.getBytes(StandardCharsets.UTF_8).length); in validate()
333 if (mTrustRootCertUrl.getBytes(StandardCharsets.UTF_8).length > MAX_URL_BYTES) { in validate()
335 + mTrustRootCertUrl.getBytes(StandardCharsets.UTF_8).length); in validate()
/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/
DKeySyncUtils.java51 "V1 THM_encrypted_recovery_key".getBytes(StandardCharsets.UTF_8);
53 "V1 locally_encrypted_recovery_key".getBytes(StandardCharsets.UTF_8);
55 "V1 encrypted_application_key".getBytes(StandardCharsets.UTF_8);
57 "V1 KF_claim".getBytes(StandardCharsets.UTF_8);
59 "V1 reencrypted_recovery_key".getBytes(StandardCharsets.UTF_8);
61 private static final byte[] THM_KF_HASH_PREFIX = "THM_KF_hash".getBytes(StandardCharsets.UTF_8);
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/
DCertUtilsTest.java124 assertThat(CertUtils.decodeBase64("VEVTVA==")).isEqualTo("TEST".getBytes(UTF_8)); in decodeBase64_succeeds()
139 Element root = CertUtils.getXmlRootNode(XML_STR.getBytes(UTF_8)); in getXmlRootNode_succeeds()
150 Element root = CertUtils.getXmlRootNode(XML_STR.getBytes(UTF_8)); in getXmlNodeContents_singleLevel_succeeds()
157 Element root = CertUtils.getXmlRootNode(XML_STR.getBytes(UTF_8)); in getXmlNodeContents_multipleLevels_succeeds()
164 Element root = CertUtils.getXmlRootNode(XML_STR.getBytes(UTF_8)); in getXmlNodeContents_mustExistFalse_succeedsIfNotExist()
173 Element root = CertUtils.getXmlRootNode(XML_STR.getBytes(UTF_8)); in getXmlNodeContents_mustExistAtLeastOne_throwsIfNotExist()
186 Element root = CertUtils.getXmlRootNode(XML_STR.getBytes(UTF_8)); in getXmlNodeContents_mustExistExactlyOne_throwsIfNotExist()
199 Element root = CertUtils.getXmlRootNode(XML_STR.getBytes(UTF_8)); in getXmlNodeContents_mustExistExactlyOne_throwsIfMultipleExist()
214 SIGNED_STR.getBytes(UTF_8)); in verifyRsaSha256Signature_succeeds()
219 byte[] modifiedBytes = SIGNED_STR.getBytes(UTF_8); in verifyRsaSha256Signature_throwsIfMismatchSignature()
[all …]
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/hotspot2/anqp/
DIconInfoTestUtil.java55 out.write(TEST_LANGUAGE.getBytes(StandardCharsets.US_ASCII)); in getTestData()
57 writeByteArrayWithLength(out, TEST_TYPE.getBytes(StandardCharsets.US_ASCII)); in getTestData()
58 writeByteArrayWithLength(out, TEST_FILENAME.getBytes(StandardCharsets.UTF_8)); in getTestData()
DOsuProviderInfoTestUtil.java109 writeByteArrayWithLength(out, TEST_SERVER_URI.getBytes(StandardCharsets.UTF_8)); in getTestPayload()
122 writeByteArrayWithLength(out, TEST_NAI.getBytes(StandardCharsets.UTF_8)); in getTestPayload()
151 out.write(value.getLanguage().getBytes(StandardCharsets.US_ASCII)); in getI18NameData()
153 out.write(value.getText().getBytes(StandardCharsets.UTF_8)); in getI18NameData()
/frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/
DWap230WspContentTypeTest.java267 out.write(testType.getBytes("US-ASCII")); in testConstrainedMediaExtensionMedia()
283 out.write(testType.getBytes("US-ASCII")); in testGeneralFormShortLengthExtensionMedia()
451 out.write(testType.getBytes("US-ASCII")); in testGeneralFormLengthQuoteExtensionMedia()
476 out.write(testType.getBytes("US-ASCII")); in testGeneralFormLengthQuoteExtensionMediaWithNiceLongMimeType()
494 out.write(testType.getBytes("US-ASCII")); in testConstrainedMediaExtensionMediaWithSpace()
537 out.write("wdstechnology.com".getBytes("US-ASCII")); in testTypedParamWellKnownShortIntegerTokenText()
562 out.write("wdstechnology.com".getBytes("US-ASCII")); in testTypedParamWellKnownLongIntegerTokenText()
587 out.write("wdstechnology.com".getBytes("US-ASCII")); in testTypedParamWellKnownShortIntegerQuotedText()
655 out.write("imapc".getBytes("US-ASCII")); in testTypedParamWellKnownShortIntegerMultipleParameters()
676 out.write("MYPARAM".getBytes("US-ASCII")); in testUntypedParamIntegerValueShortInteger()
[all …]
/frameworks/base/core/tests/coretests/src/android/app/backup/
DBackupDataTest.java87 writeEntity(bdo, KEY1, DATA1.getBytes()); in testSingle()
95 readAndVerifyEntity(bdi, KEY1, DATA1.getBytes()); in testSingle()
107 writeEntity(bdo, KEYS[i], DATA[i].getBytes()); in testMultiple()
116 readAndVerifyEntity(bdi, KEYS[count], DATA[count].getBytes()); in testMultiple()
151 writeEntity(bdo, KEYS[i], DATA[i].getBytes()); i++; in testMixed()
152 writeEntity(bdo, KEYS[i], DATA[i].getBytes()); i++; in testMixed()
163 readAndVerifyEntity(bdi, KEYS[out], DATA[out].getBytes()); out++; in testMixed()
165 readAndVerifyEntity(bdi, KEYS[out], DATA[out].getBytes()); out++; in testMixed()
/frameworks/base/services/core/java/com/android/server/locksettings/
DSyntheticPasswordManager.java119 …private static final byte[] PERSONALISATION_SECDISCARDABLE = "secdiscardable-transform".getBytes();
120 private static final byte[] PERSONALIZATION_KEY_STORE_PASSWORD = "keystore-password".getBytes();
121 private static final byte[] PERSONALIZATION_USER_GK_AUTH = "user-gk-authentication".getBytes();
122 private static final byte[] PERSONALIZATION_SP_GK_AUTH = "sp-gk-authentication".getBytes();
123 private static final byte[] PERSONALIZATION_FBE_KEY = "fbe-key".getBytes();
124 private static final byte[] PERSONALIZATION_AUTHSECRET_KEY = "authsecret-hal".getBytes();
125 private static final byte[] PERSONALIZATION_SP_SPLIT = "sp-split".getBytes();
126 private static final byte[] PERSONALIZATION_PASSWORD_HASH = "pw-hash".getBytes();
127 private static final byte[] PERSONALIZATION_E0 = "e0-encryption".getBytes();
128 private static final byte[] PERSONALISATION_WEAVER_PASSWORD = "weaver-pwd".getBytes();
[all …]
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/
DWifiConfigStoreTest.java211 assertTrue(Arrays.equals(EMPTY_FILE_CONTENT.getBytes(StandardCharsets.UTF_8), in testWriteWithEmptyData()
213 assertTrue(Arrays.equals(EMPTY_FILE_CONTENT.getBytes(StandardCharsets.UTF_8), in testWriteWithEmptyData()
440 byte[] xmlBytes = xmlString.getBytes(StandardCharsets.UTF_8); in testReadWifiConfigStoreData()
487 byte[] xmlBytes = xmlString.getBytes(StandardCharsets.UTF_8); in testWriteWifiConfigStoreData()
527 mSharedStore.storeRawDataToWrite(fileContentsXmlStringWithOnlyStoreData1.getBytes()); in testReadWifiConfigStoreDataIndicateClientsThatThereIsNoDataForThem()
540 mUserStore.storeRawDataToWrite(fileContentsXmlStringWithOnlyStoreData2.getBytes()); in testReadWifiConfigStoreDataIndicateClientsThatThereIsNoDataForThem()
551 mSharedStore.storeRawDataToWrite(fileContentsXmlStringWithOnlyStoreData1.getBytes()); in testReadWifiConfigStoreDataIndicateClientsThatThereIsNoDataForThem()
552 mUserStore.storeRawDataToWrite(fileContentsXmlStringWithOnlyStoreData2.getBytes()); in testReadWifiConfigStoreDataIndicateClientsThatThereIsNoDataForThem()
565 fileContentsXmlStringWithStoreData1AndStoreData2.getBytes()); in testReadWifiConfigStoreDataIndicateClientsThatThereIsNoDataForThem()
593 mUserStore.storeRawDataToWrite(storeFileData.getBytes(StandardCharsets.UTF_8)); in testReadUserStoreContainedUnknownData()
[all …]
DNetworkListStoreDataTest.java279 return (openNetworkXml + eapNetworkXml).getBytes(StandardCharsets.UTF_8); in getTestNetworksXmlBytes()
433 .getBytes(StandardCharsets.UTF_8); in parseNetworkWithUnknownTag()
451 .getBytes(StandardCharsets.UTF_8); in parseNetworkWithMismatchConfigKey()
472 deserializeData(xmlString.getBytes(StandardCharsets.UTF_8), true /* shared */); in parseNetworkListWithOneNetworkIllegalArgException()
496 .getBytes(StandardCharsets.UTF_8); in parseNetworkWithInvalidCreatorUidResetsToSystem()
524 .getBytes(StandardCharsets.UTF_8); in parseNetworkWithInvalidCreatorNameResetsToPackageNameForCreatorUid()
551 .getBytes(StandardCharsets.UTF_8); in parseNetworkWithNullCreatorNameResetsToPackageNameForCreatorUid()
572 .getBytes(StandardCharsets.UTF_8); in parseNetworkWithValidCreatorUid()
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/
DRecoverableKeyStoreDbHelperTest.java47 private static final byte[] TEST_NONCE = "test-nonce".getBytes(UTF_8);
48 private static final byte[] TEST_WRAPPED_KEY = "test-wrapped-key".getBytes(UTF_8);
55 private static final byte[] TEST_PUBLIC_KEY = "test-public-key".getBytes(UTF_8);
58 private static final byte[] TEST_SERVER_PARAMS = "test-server-params".getBytes(UTF_8);
60 private static final byte[] TEST_CERT_PATH = "test-cert-path".getBytes(UTF_8);
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/aware/
DWifiAwareStateManagerTest.java1376 .setServiceSpecificInfo(ssi.getBytes()) in testMatchAndMessages()
1421 mDut.onMatchNotification(subscribeId, requestorId, peerMac, peerSsi.getBytes(), in testMatchAndMessages()
1422 peerMatchFilter.getBytes(), 0, 0); in testMatchAndMessages()
1424 inOrder.verify(mockSessionCallback).onMatch(peerIdCaptor.capture(), eq(peerSsi.getBytes()), in testMatchAndMessages()
1425 eq(peerMatchFilter.getBytes())); in testMatchAndMessages()
1428 mDut.onMatchNotification(subscribeId, requestorId, peerMac, peerSsi.getBytes(), in testMatchAndMessages()
1429 peerMatchFilter.getBytes(), EGRESS_MET_MASK, rangedDistance); in testMatchAndMessages()
1432 eq(peerSsi.getBytes()), eq(peerMatchFilter.getBytes()), eq(rangedDistance)); in testMatchAndMessages()
1436 mDut.onMessageReceivedNotification(subscribeId, requestorId, peerMac, peerMsg.getBytes()); in testMatchAndMessages()
1439 peerMsg.getBytes()); in testMatchAndMessages()
[all …]
/frameworks/base/core/tests/coretests/src/android/util/
DBase64Test.java44 String b64 = Base64.encodeToString(in.getBytes(), flags); in encodeToString()
251 assertEquals("YWJj".getBytes(), 4, encoder.output, encoder.op); in XXXtestEncodeInternal()
255 assertEquals("YWJj".getBytes(), 4, encoder.output, encoder.op); in XXXtestEncodeInternal()
267 assertEquals("YWFh".getBytes(), 4, encoder.output, encoder.op); in XXXtestEncodeInternal()
275 assertEquals("YWJh".getBytes(), 4, encoder.output, encoder.op); in XXXtestEncodeInternal()
279 assertEquals("YmFi".getBytes(), 4, encoder.output, encoder.op); in XXXtestEncodeInternal()
283 assertEquals("YQ".getBytes(), 2, encoder.output, encoder.op); in XXXtestEncodeInternal()
321 byte[] plain = (lipsum + lipsum + lipsum + lipsum + lipsum).getBytes(); in testInputStream()
415 new ByteArrayInputStream("/v8=".getBytes()), Base64.DEFAULT); in testSingleByteReads()
436 byte[] plain = (lipsum + lipsum).getBytes(); in testOutputStream()
/frameworks/base/wifi/tests/src/android/net/wifi/aware/
DWifiAwareManagerTest.java96 private static final byte[] PMK_VALID = "01234567890123456789012345678901".getBytes();
97 private static final byte[] PMK_INVALID = "012".getBytes();
318 publishSession.getValue().sendMessage(peerHandle, messageId, string1.getBytes()); in testPublishFlow()
319 sessionProxyCallback.getValue().onMatch(peerHandle.peerId, string1.getBytes(), matchFilter); in testPublishFlow()
320 sessionProxyCallback.getValue().onMessageReceived(peerHandle.peerId, string1.getBytes()); in testPublishFlow()
326 eq(peerHandle.peerId), eq(string1.getBytes()), eq(messageId), eq(0)); in testPublishFlow()
328 eq(string1.getBytes()), in testPublishFlow()
342 eq(string1.getBytes())); in testPublishFlow()
467 subscribeSession.getValue().sendMessage(peerHandle, messageId, string1.getBytes()); in testSubscribeFlow()
468 sessionProxyCallback.getValue().onMatch(peerHandle.peerId, string1.getBytes(), matchFilter); in testSubscribeFlow()
[all …]
/frameworks/base/core/java/android/nfc/
DNdefRecord.java224 public static final byte[] RTD_ANDROID_APP = "android.com:pkg".getBytes();
316 packageName.getBytes(StandardCharsets.UTF_8)); in createApplicationRecord()
355 byte[] uriBytes = uriString.getBytes(StandardCharsets.UTF_8); in createUri()
427 byte[] typeBytes = mimeType.getBytes(StandardCharsets.US_ASCII); in createMime()
467 byte[] byteDomain = domain.getBytes(StandardCharsets.UTF_8); in createExternal()
468 byte[] byteType = type.getBytes(StandardCharsets.UTF_8); in createExternal()
493 byte[] textBytes = text.getBytes(StandardCharsets.UTF_8); in createTextRecord()
497 languageCodeBytes = languageCode.getBytes(StandardCharsets.US_ASCII); in createTextRecord()
500 getBytes(StandardCharsets.US_ASCII); in createTextRecord()
/frameworks/base/services/tests/servicestests/src/com/android/server/display/
DPersistentDataStoreTest.java78 InputStream is = new ByteArrayInputStream(contents.getBytes(StandardCharsets.UTF_8)); in testLoadingBrightnessConfigurations()
111 InputStream is = new ByteArrayInputStream(contents.getBytes(StandardCharsets.UTF_8)); in testBrightnessConfigWithInvalidCurveIsIgnored()
130 InputStream is = new ByteArrayInputStream(contents.getBytes(StandardCharsets.UTF_8)); in testBrightnessConfigWithInvalidFloatsIsIgnored()
142 InputStream is = new ByteArrayInputStream(contents.getBytes(StandardCharsets.UTF_8)); in testEmptyBrightnessConfigurationsDoesntCrash()

12345678910>>...12