Home
last modified time | relevance | path

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

12345678910

/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/services/tests/servicestests/src/com/android/server/pm/backup/
DBackupUtilsTest.java37 sigs[i] = new Signature(signatures[i].getBytes()); in genSignatures()
53 "abc".getBytes())); in testSignaturesMatch()
55 "abc".getBytes(), "def".getBytes())); in testSignaturesMatch()
86 final byte[] sig1 = "abc".getBytes(); in testHashSignature()
87 final byte[] sig2 = "def".getBytes(); in testHashSignature()
104 "abc".getBytes(), "def".getBytes())); in testHashSignature()
107 new Signature("abc".getBytes()), new Signature("def".getBytes())}); in testHashSignature()
/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/keystore/java/android/security/keystore/
DAttestationUtils.java133 Build.getSerial().getBytes(StandardCharsets.UTF_8)); in attestDeviceIds()
141 imei.getBytes(StandardCharsets.UTF_8)); in attestDeviceIds()
150 meid.getBytes(StandardCharsets.UTF_8)); in attestDeviceIds()
158 Build.BRAND.getBytes(StandardCharsets.UTF_8)); in attestDeviceIds()
160 Build.DEVICE.getBytes(StandardCharsets.UTF_8)); in attestDeviceIds()
162 Build.PRODUCT.getBytes(StandardCharsets.UTF_8)); in attestDeviceIds()
164 Build.MANUFACTURER.getBytes(StandardCharsets.UTF_8)); in attestDeviceIds()
166 Build.MODEL.getBytes(StandardCharsets.UTF_8)); in attestDeviceIds()
/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/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/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/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.java85 writeEntity(bdo, KEY1, DATA1.getBytes()); in testSingle()
93 readAndVerifyEntity(bdi, KEY1, DATA1.getBytes()); in testSingle()
105 writeEntity(bdo, KEYS[i], DATA[i].getBytes()); in testMultiple()
114 readAndVerifyEntity(bdi, KEYS[count], DATA[count].getBytes()); in testMultiple()
149 writeEntity(bdo, KEYS[i], DATA[i].getBytes()); i++; in testMixed()
150 writeEntity(bdo, KEYS[i], DATA[i].getBytes()); i++; in testMixed()
161 readAndVerifyEntity(bdi, KEYS[out], DATA[out].getBytes()); out++; in testMixed()
163 readAndVerifyEntity(bdi, KEYS[out], DATA[out].getBytes()); out++; in testMixed()
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/
DNetworkListStoreDataTest.java269 return (openNetworkXml + eapNetworkXml).getBytes(StandardCharsets.UTF_8); in getTestNetworksXmlBytes()
421 openNetwork.shared, openNetwork.creatorUid).getBytes(StandardCharsets.UTF_8); in parseNetworkWithUnknownTag()
438 .getBytes(StandardCharsets.UTF_8); in parseNetworkWithMismatchConfigKey()
459 deserializeData(xmlString.getBytes(StandardCharsets.UTF_8), true /* shared */); in parseNetworkListWithOneNetworkIllegalArgException()
481 .getBytes(StandardCharsets.UTF_8); in parseNetworkWithInvalidCreatorUidResetsToSystem()
507 .getBytes(StandardCharsets.UTF_8); in parseNetworkWithInvalidCreatorNameResetsToPackageNameForCreatorUid()
532 .getBytes(StandardCharsets.UTF_8); in parseNetworkWithNullCreatorNameResetsToPackageNameForCreatorUid()
551 .getBytes(StandardCharsets.UTF_8); in parseNetworkWithValidCreatorUid()
DWifiConfigStoreTest.java194 assertTrue(Arrays.equals(EMPTY_FILE_CONTENT.getBytes(StandardCharsets.UTF_8), in testWriteWithEmptyData()
196 assertTrue(Arrays.equals(EMPTY_FILE_CONTENT.getBytes(StandardCharsets.UTF_8), in testWriteWithEmptyData()
394 byte[] xmlBytes = xmlString.getBytes(StandardCharsets.UTF_8); in testReadWifiConfigStoreData()
439 byte[] xmlBytes = xmlString.getBytes(StandardCharsets.UTF_8); in testWriteWifiConfigStoreData()
462 mUserStore.storeRawDataToWrite(storeFileData.getBytes(StandardCharsets.UTF_8)); in testReadUserStoreContainedUnknownData()
481 mSharedStore.storeRawDataToWrite(storeFileData.getBytes(StandardCharsets.UTF_8)); in testReadShareStoreContainedUnknownData()
/frameworks/base/wifi/tests/src/android/net/wifi/aware/
DWifiAwareManagerTest.java295 publishSession.getValue().sendMessage(peerHandle, messageId, string1.getBytes()); in testPublishFlow()
296 sessionProxyCallback.getValue().onMatch(peerHandle.peerId, string1.getBytes(), matchFilter); in testPublishFlow()
297 sessionProxyCallback.getValue().onMessageReceived(peerHandle.peerId, string1.getBytes()); in testPublishFlow()
303 eq(peerHandle.peerId), eq(string1.getBytes()), eq(messageId), eq(0)); in testPublishFlow()
305 eq(string1.getBytes()), in testPublishFlow()
319 eq(string1.getBytes())); in testPublishFlow()
443 subscribeSession.getValue().sendMessage(peerHandle, messageId, string1.getBytes()); in testSubscribeFlow()
444 sessionProxyCallback.getValue().onMatch(peerHandle.peerId, string1.getBytes(), matchFilter); in testSubscribeFlow()
445 sessionProxyCallback.getValue().onMessageReceived(peerHandle.peerId, string1.getBytes()); in testSubscribeFlow()
451 eq(peerHandle.peerId), eq(string1.getBytes()), eq(messageId), eq(0)); in testSubscribeFlow()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/
DSyntheticPasswordTests.java273 long handle = mService.addEscrowToken(TOKEN.getBytes(), PRIMARY_USER_ID); in testTokenBasedResetPassword()
281 handle, TOKEN.getBytes(), PASSWORD_QUALITY_SOMETHING, PRIMARY_USER_ID); in testTokenBasedResetPassword()
302 long handle = mService.addEscrowToken(TOKEN.getBytes(), PRIMARY_USER_ID); in testTokenBasedClearPassword()
309 TOKEN.getBytes(), PASSWORD_QUALITY_UNSPECIFIED, PRIMARY_USER_ID); in testTokenBasedClearPassword()
311 handle, TOKEN.getBytes(), PASSWORD_QUALITY_SOMETHING, PRIMARY_USER_ID); in testTokenBasedClearPassword()
326 long handle = mService.addEscrowToken(TOKEN.getBytes(), PRIMARY_USER_ID); in testTokenBasedResetPasswordAfterCredentialChanges()
336 handle, TOKEN.getBytes(), PASSWORD_QUALITY_ALPHABETIC, PRIMARY_USER_ID); in testTokenBasedResetPasswordAfterCredentialChanges()
346 long handle = mService.addEscrowToken(TOKEN.getBytes(), PRIMARY_USER_ID); in testEscrowTokenActivatedImmediatelyIfNoUserPasswordNeedsMigration()
355 long handle = mService.addEscrowToken(TOKEN.getBytes(), PRIMARY_USER_ID); in testEscrowTokenActivatedImmediatelyIfNoUserPasswordNoMigration()
370 long handle = mService.addEscrowToken(TOKEN.getBytes(), PRIMARY_USER_ID); in testEscrowTokenActivatedLaterWithUserPasswordNeedsMigration()
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/aware/
DWifiAwareStateManagerTest.java1205 .setServiceSpecificInfo(ssi.getBytes()) in testMatchAndMessages()
1242 mDut.onMatchNotification(subscribeId, requestorId, peerMac, peerSsi.getBytes(), in testMatchAndMessages()
1243 peerMatchFilter.getBytes()); in testMatchAndMessages()
1245 inOrder.verify(mockSessionCallback).onMatch(peerIdCaptor.capture(), eq(peerSsi.getBytes()), in testMatchAndMessages()
1246 eq(peerMatchFilter.getBytes())); in testMatchAndMessages()
1249 mDut.onMessageReceivedNotification(subscribeId, requestorId, peerMac, peerMsg.getBytes()); in testMatchAndMessages()
1252 peerMsg.getBytes()); in testMatchAndMessages()
1255 mDut.sendMessage(clientId, sessionId.getValue(), peerIdCaptor.getValue(), ssi.getBytes(), in testMatchAndMessages()
1259 eq(requestorId), eq(peerMac), eq(ssi.getBytes()), eq(messageId)); in testMatchAndMessages()
1265 mDut.sendMessage(clientId, sessionId.getValue(), peerIdCaptor.getValue(), ssi.getBytes(), in testMatchAndMessages()
[all …]
/frameworks/base/core/tests/coretests/src/android/util/
DBase64Test.java42 String b64 = Base64.encodeToString(in.getBytes(), flags); in encodeToString()
249 assertEquals("YWJj".getBytes(), 4, encoder.output, encoder.op); in XXXtestEncodeInternal()
253 assertEquals("YWJj".getBytes(), 4, encoder.output, encoder.op); in XXXtestEncodeInternal()
265 assertEquals("YWFh".getBytes(), 4, encoder.output, encoder.op); in XXXtestEncodeInternal()
273 assertEquals("YWJh".getBytes(), 4, encoder.output, encoder.op); in XXXtestEncodeInternal()
277 assertEquals("YmFi".getBytes(), 4, encoder.output, encoder.op); in XXXtestEncodeInternal()
281 assertEquals("YQ".getBytes(), 2, encoder.output, encoder.op); in XXXtestEncodeInternal()
319 byte[] plain = (lipsum + lipsum + lipsum + lipsum + lipsum).getBytes(); in testInputStream()
413 new ByteArrayInputStream("/v8=".getBytes()), Base64.DEFAULT); in testSingleByteReads()
434 byte[] plain = (lipsum + lipsum).getBytes(); in testOutputStream()
/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_SP_SPLIT = "sp-split".getBytes();
125 private static final byte[] PERSONALIZATION_E0 = "e0-encryption".getBytes();
126 private static final byte[] PERSONALISATION_WEAVER_PASSWORD = "weaver-pwd".getBytes();
127 private static final byte[] PERSONALISATION_WEAVER_KEY = "weaver-key".getBytes();
128 private static final byte[] PERSONALISATION_WEAVER_TOKEN = "weaver-token".getBytes();
[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/opt/telephony/src/java/com/google/android/mms/pdu/
DSendReq.java35 setContentType("application/vnd.wap.multipart.related".getBytes()); in SendReq()
36 setFrom(new EncodedStringValue(PduHeaders.FROM_INSERT_ADDRESS_TOKEN_STR.getBytes())); in SendReq()
47 return transactionId.getBytes(); in generateTransactionId()
DPduComposer.java312 appendTextString(str.getBytes()); in appendTextString()
452 appendQuotedString(str.getBytes()); in appendQuotedString()
463 temp.appendTextString(STRING_PHONE_NUMBER_ADDRESS_TYPE.getBytes()); in appendAddressType()
466 temp.appendTextString(STRING_IPV4_ADDRESS_TYPE.getBytes()); in appendAddressType()
469 temp.appendTextString(STRING_IPV6_ADDRESS_TYPE.getBytes()); in appendAddressType()
605 PduHeaders.MESSAGE_CLASS_ADVERTISEMENT_STR.getBytes())) { in appendHeader()
608 PduHeaders.MESSAGE_CLASS_AUTO_STR.getBytes())) { in appendHeader()
611 PduHeaders.MESSAGE_CLASS_PERSONAL_STR.getBytes())) { in appendHeader()
614 PduHeaders.MESSAGE_CLASS_INFORMATIONAL_STR.getBytes())) { in appendHeader()
DPduPart.java96 static final byte[] DISPOSITION_FROM_DATA = "from-data".getBytes();
97 static final byte[] DISPOSITION_ATTACHMENT = "attachment".getBytes();
98 static final byte[] DISPOSITION_INLINE = "inline".getBytes();
/frameworks/base/core/java/android/content/pm/
DInstantAppResolveInfo.java170 final byte[] hostBytes = hostName.getBytes(); in generateDigest()
177 digests.add(digest.digest(hostName.getBytes())); in generateDigest()
180 hostName.substring(prevDot + 1, hostName.length()).getBytes(); in generateDigest()
186 hostName.substring(prevDot + 1, hostName.length()).getBytes(); in generateDigest()
/frameworks/base/wifi/java/android/net/wifi/p2p/nsd/
DWifiP2pDnsSdServiceInfo.java129 byte[] data = instanceName.getBytes(); in createPtrServiceQuery()
219 sb.append(WifiP2pServiceInfo.bin2HexStr(dnsName.getBytes())); in compressDnsName()
229 sb.append(WifiP2pServiceInfo.bin2HexStr(name.getBytes())); in compressDnsName()

12345678910