/frameworks/base/core/java/android/util/ |
D | DataUnit.java | 36 KILOBYTES { @Override public long toBytes(long v) { return v * 1_000; } }, in toBytes() method 37 MEGABYTES { @Override public long toBytes(long v) { return v * 1_000_000; } }, in toBytes() method 38 GIGABYTES { @Override public long toBytes(long v) { return v * 1_000_000_000; } }, in toBytes() method 39 KIBIBYTES { @Override public long toBytes(long v) { return v * 1_024; } }, in toBytes() method 40 MEBIBYTES { @Override public long toBytes(long v) { return v * 1_048_576; } }, in toBytes() method 41 GIBIBYTES { @Override public long toBytes(long v) { return v * 1_073_741_824; } }; in toBytes() method 43 public long toBytes(long v) { in toBytes() method in DataUnit
|
/frameworks/base/tests/net/java/com/android/server/connectivity/ |
D | MultipathPolicyTrackerTest.java | 247 DataUnit.MEGABYTES.toBytes(2) /* usedBytesToday */, in testGetMultipathPreference_SubscriptionQuota() 248 DataUnit.MEGABYTES.toBytes(14) /* subscriptionQuota */, in testGetMultipathPreference_SubscriptionQuota() 249 DataUnit.MEGABYTES.toBytes(100) /* policyWarning */, in testGetMultipathPreference_SubscriptionQuota() 251 DataUnit.MEGABYTES.toBytes(12) /* defaultGlobalSetting */, in testGetMultipathPreference_SubscriptionQuota() 256 any(), anyInt(), eq(DataUnit.MEGABYTES.toBytes(12)), any(), any()); in testGetMultipathPreference_SubscriptionQuota() 262 DataUnit.MEGABYTES.toBytes(7) /* usedBytesToday */, in testGetMultipathPreference_UserWarningQuota() 265 DataUnit.MEGABYTES.toBytes(15 * 29 * 20) /* policyWarning */, in testGetMultipathPreference_UserWarningQuota() 267 DataUnit.MEGABYTES.toBytes(12) /* defaultGlobalSetting */, in testGetMultipathPreference_UserWarningQuota() 273 any(), anyInt(), eq(DataUnit.MEGABYTES.toBytes(8)), any(), any()); in testGetMultipathPreference_UserWarningQuota() 279 DataUnit.MEGABYTES.toBytes(7) /* usedBytesToday */, in testGetMultipathPreference_SnoozedWarningQuota() [all …]
|
/frameworks/base/core/tests/coretests/src/android/util/ |
D | DataUnitTest.java | 26 assertEquals(12_000L, DataUnit.KILOBYTES.toBytes(12)); in testSi() 27 assertEquals(12_000_000L, DataUnit.MEGABYTES.toBytes(12)); in testSi() 28 assertEquals(12_000_000_000L, DataUnit.GIGABYTES.toBytes(12)); in testSi() 32 assertEquals(12_288L, DataUnit.KIBIBYTES.toBytes(12)); in testIec() 33 assertEquals(12_582_912L, DataUnit.MEBIBYTES.toBytes(12)); in testIec() 34 assertEquals(12_884_901_888L, DataUnit.GIBIBYTES.toBytes(12)); in testIec()
|
/frameworks/base/core/tests/privacytests/src/android/privacy/ |
D | RapporEncoderTest.java | 97 assertEquals(expectedPrrValue, toLong(encoder1.encodeBits(toBytes(inputValue)))); in testRapporEncoder_IRRWithPRR() 112 toLong(encoder2.encodeBits(toBytes(expectedPrrValue)))); in testRapporEncoder_IRRWithPRR() 125 assertEquals(expectedPrrAndIrrValue, toLong(encoder3.encodeBits(toBytes(inputValue)))); in testRapporEncoder_IRRWithPRR() 146 assertEquals(prrValue, toLong(encoder1.encodeBits(toBytes(inputValue)))); in testRapporEncoder_ensureSecureEncoderIsSecure() 162 encoder2.encodeBits(toBytes(prrValue)))); in testRapporEncoder_ensureSecureEncoderIsSecure() 181 encoder3.encodeBits(toBytes(inputValue)))); in testRapporEncoder_ensureSecureEncoderIsSecure() 188 private static byte[] toBytes(long value) { in toBytes() method in RapporEncoderTest
|
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/ |
D | FakeGateKeeperService.java | 51 public byte[] toBytes() { in toBytes() method in FakeGateKeeperService.VerifyHandle 78 public byte[] toBytes() { in toBytes() method in FakeGateKeeperService.AuthToken 101 handleMap.put(uid, newHandle.toBytes()); in enroll() 102 return GateKeeperResponse.createOkResponse(newHandle.toBytes(), false); in enroll() 113 handleMap.put(uid, newHandle.toBytes()); in enroll() 114 return GateKeeperResponse.createOkResponse(newHandle.toBytes(), false); in enroll() 138 return GateKeeperResponse.createOkResponse(token.toBytes(), false); in verifyChallenge()
|
D | LockSettingsStorageTests.java | 370 .thenReturn(PersistentData.toBytes(PersistentData.TYPE_SP_WEAVER, SOME_USER_ID, in testPersistentDataBlock_withData() 389 byte[] serialized = PersistentData.toBytes(PersistentData.TYPE_SP, SOME_USER_ID, in testPersistentData_serializeUnserialize() 440 PAYLOAD, LockPatternUtils.CREDENTIAL_TYPE_PASSWORD).toBytes(); in testCredentialHash_serializeUnserialize()
|
/frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/uicc/euicc/ |
D | EuiccCardTest.java | 568 Asn1Node.newBuilder(0xA0).build().toBytes(), in testAuthenticateServer() 569 Asn1Node.newBuilder(0xA1).build().toBytes(), in testAuthenticateServer() 570 Asn1Node.newBuilder(0xA2).build().toBytes(), in testAuthenticateServer() 571 Asn1Node.newBuilder(0xA3).build().toBytes(), resultCaptor, mHandler); in testAuthenticateServer() 594 Asn1Node.newBuilder(0xA0).build().toBytes(), in testAuthenticateServer_Error() 595 Asn1Node.newBuilder(0xA1).build().toBytes(), in testAuthenticateServer_Error() 596 Asn1Node.newBuilder(0xA2).build().toBytes(), in testAuthenticateServer_Error() 597 Asn1Node.newBuilder(0xA3).build().toBytes(), resultCaptor, mHandler); in testAuthenticateServer_Error() 625 Asn1Node.newBuilder(0xA0).build().toBytes(), in testAuthenticateService_devCap() 626 Asn1Node.newBuilder(0xA1).build().toBytes(), in testAuthenticateService_devCap() [all …]
|
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/job/controllers/ |
D | ConnectivityControllerTest.java | 137 .setEstimatedNetworkBytes(DataUnit.MEBIBYTES.toBytes(1)) in testInsane() 154 .setEstimatedNetworkBytes(DataUnit.MEBIBYTES.toBytes(1)) in testCongestion() 181 .setEstimatedNetworkBytes(DataUnit.MEBIBYTES.toBytes(1)) in testRelaxed() 229 .setEstimatedNetworkBytes(DataUnit.MEBIBYTES.toBytes(1), 0) in testUpdates() 232 .setEstimatedNetworkBytes(DataUnit.MEBIBYTES.toBytes(1), 0) in testUpdates() 301 .setEstimatedNetworkBytes(DataUnit.MEBIBYTES.toBytes(1), 0) in testRequestStandbyExceptionLocked() 304 .setEstimatedNetworkBytes(DataUnit.MEBIBYTES.toBytes(1), 0) in testRequestStandbyExceptionLocked() 338 .setEstimatedNetworkBytes(DataUnit.MEBIBYTES.toBytes(1), 0) in testWouldBeReadyWithConnectivityLocked() 360 .setEstimatedNetworkBytes(DataUnit.MEBIBYTES.toBytes(1), 0) in testEvaluateStateLocked_HeartbeatsOn() 387 .setEstimatedNetworkBytes(DataUnit.MEBIBYTES.toBytes(1), 0) in testEvaluateStateLocked_JobWouldBeReady() [all …]
|
/frameworks/opt/gamesdk/third_party/protobuf-3.0.0/java/core/src/test/java/com/google/protobuf/ |
D | MapForProto2LiteTest.java | 63 .putInt32ToBytesField(1, TestUtil.toBytes("11")) in setMapValues() 64 .putInt32ToBytesField(2, TestUtil.toBytes("22")) in setMapValues() 65 .putInt32ToBytesField(3, TestUtil.toBytes("33")) in setMapValues() 109 assertEquals(TestUtil.toBytes("11"), message.getInt32ToBytesField().get(1)); in assertMapValuesSet() 110 assertEquals(TestUtil.toBytes("22"), message.getInt32ToBytesField().get(2)); in assertMapValuesSet() 111 assertEquals(TestUtil.toBytes("33"), message.getInt32ToBytesField().get(3)); in assertMapValuesSet() 139 .putInt32ToBytesField(1, TestUtil.toBytes("111")) in updateMapValues() 141 .putInt32ToBytesField(4, TestUtil.toBytes("44")) in updateMapValues() 180 assertEquals(TestUtil.toBytes("111"), message.getInt32ToBytesField().get(1)); in assertMapValuesUpdated() 181 assertEquals(TestUtil.toBytes("33"), message.getInt32ToBytesField().get(3)); in assertMapValuesUpdated() [all …]
|
D | MapForProto2Test.java | 65 builder.getMutableInt32ToBytesField().put(1, TestUtil.toBytes("11")); in setMapValuesUsingMutableMap() 66 builder.getMutableInt32ToBytesField().put(2, TestUtil.toBytes("22")); in setMapValuesUsingMutableMap() 67 builder.getMutableInt32ToBytesField().put(3, TestUtil.toBytes("33")); in setMapValuesUsingMutableMap() 95 .putInt32ToBytesField(1, TestUtil.toBytes("11")) in setMapValuesUsingAccessors() 96 .putInt32ToBytesField(2, TestUtil.toBytes("22")) in setMapValuesUsingAccessors() 97 .putInt32ToBytesField(3, TestUtil.toBytes("33")) in setMapValuesUsingAccessors() 147 assertEquals(TestUtil.toBytes("11"), message.getInt32ToBytesField().get(1)); in assertMapValuesSet() 148 assertEquals(TestUtil.toBytes("22"), message.getInt32ToBytesField().get(2)); in assertMapValuesSet() 149 assertEquals(TestUtil.toBytes("33"), message.getInt32ToBytesField().get(3)); in assertMapValuesSet() 176 builder.getMutableInt32ToBytesField().put(1, TestUtil.toBytes("111")); in updateMapValuesUsingMutableMap() [all …]
|
D | MapTest.java | 67 builder.getMutableInt32ToBytesField().put(1, TestUtil.toBytes("11")); in setMapValuesUsingMutableMap() 68 builder.getMutableInt32ToBytesField().put(2, TestUtil.toBytes("22")); in setMapValuesUsingMutableMap() 69 builder.getMutableInt32ToBytesField().put(3, TestUtil.toBytes("33")); in setMapValuesUsingMutableMap() 97 .putInt32ToBytesField(1, TestUtil.toBytes("11")) in setMapValuesUsingAccessors() 98 .putInt32ToBytesField(2, TestUtil.toBytes("22")) in setMapValuesUsingAccessors() 99 .putInt32ToBytesField(3, TestUtil.toBytes("33")) in setMapValuesUsingAccessors() 149 assertEquals(TestUtil.toBytes("11"), message.getInt32ToBytesField().get(1)); in assertMapValuesSet() 150 assertEquals(TestUtil.toBytes("22"), message.getInt32ToBytesField().get(2)); in assertMapValuesSet() 151 assertEquals(TestUtil.toBytes("33"), message.getInt32ToBytesField().get(3)); in assertMapValuesSet() 178 builder.getMutableInt32ToBytesField().put(1, TestUtil.toBytes("111")); in updateMapValuesUsingMutableMap() [all …]
|
D | TestUtilLite.java | 146 static ByteString toBytes(String str) { in toBytes() method in TestUtilLite 195 builder.setOptionalBytes (toBytes("116")); in setAllFields() 233 builder.addRepeatedBytes (toBytes("216")); in setAllFields() 268 builder.addRepeatedBytes (toBytes("316")); in setAllFields() 304 builder.setDefaultBytes (toBytes("416")); in setAllFields() 317 builder.setOneofBytes(toBytes("604")); in setAllFields() 360 message.setExtension(optionalBytesExtensionLite , toBytes("116")); in setAllExtensions() 398 message.addExtension(repeatedBytesExtensionLite , toBytes("216")); in setAllExtensions() 433 message.addExtension(repeatedBytesExtensionLite , toBytes("316")); in setAllExtensions() 469 message.setExtension(defaultBytesExtensionLite , toBytes("416")); in setAllExtensions() [all …]
|
D | TestUtil.java | 258 static ByteString toBytes(String str) { in toBytes() method in TestUtil 329 message.setOptionalBytes (toBytes("116")); in setAllFields() 367 message.addRepeatedBytes (toBytes("216")); in setAllFields() 402 message.addRepeatedBytes (toBytes("316")); in setAllFields() 438 message.setDefaultBytes (toBytes("416")); in setAllFields() 451 message.setOneofBytes(toBytes("604")); in setAllFields() 475 message.setRepeatedBytes (1, toBytes("516")); in modifyRepeatedFields() 550 Assert.assertEquals(toBytes("116"), message.getOptionalBytes()); in assertAllFieldsSet() 610 Assert.assertEquals(toBytes("216"), message.getRepeatedBytes(0)); in assertAllFieldsSet() 639 Assert.assertEquals(toBytes("316"), message.getRepeatedBytes(1)); in assertAllFieldsSet() [all …]
|
D | GeneratedMessageTest.java | 314 builder.addRepeatedBytes(TestUtil.toBytes("one")); in testRepeatedSettersRejectNull() 315 builder.addRepeatedBytes(TestUtil.toBytes("two")); in testRepeatedSettersRejectNull() 398 builder.addAllRepeatedBytes(Arrays.asList(TestUtil.toBytes("one"), null)); in testRepeatedAppendRejectsNull() 1291 message = builder.setFooBytes(TestUtil.toBytes("qux")).buildPartial(); in testSetOneofClearsOthers() 1353 assertEquals(message.getFooStringBytes(), TestUtil.toBytes("foo")); in testOneofTypes() 1359 assertEquals(message2.getFooStringBytes(), TestUtil.toBytes("")); in testOneofTypes() 1364 assertEquals(builder.getFooStringBytes(), TestUtil.toBytes("")); in testOneofTypes() 1369 assertEquals(message.getFooStringBytes(), TestUtil.toBytes("")); in testOneofTypes() 1383 assertEquals(message.getFooCordBytes(), TestUtil.toBytes("foo")); in testOneofTypes() 1389 assertEquals(message2.getFooCordBytes(), TestUtil.toBytes("")); in testOneofTypes() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/net/ |
D | NetworkPolicyManagerServiceTest.java | 1049 ZonedDateTime.parse("2015-11-01T00:00:00.00Z"), DataUnit.MEGABYTES.toBytes(1800)); 1062 new NetworkStats.Entry(DataUnit.MEGABYTES.toBytes(360), 0L, 0L, 0L, 0)); 1071 DataUnit.MEGABYTES.toBytes(1800 - 360)); 1079 new NetworkStats.Entry(DataUnit.MEGABYTES.toBytes(1799), 0L, 0L, 0L, 0)); 1088 DataUnit.MEGABYTES.toBytes(1800 - 1799)); 1097 new NetworkStats.Entry(DataUnit.MEGABYTES.toBytes(1799), 0L, 0L, 0L, 0)); 1107 DataUnit.MEGABYTES.toBytes(1800 - 1799)); 1116 new NetworkStats.Entry(DataUnit.MEGABYTES.toBytes(1810), 0L, 0L, 0L, 0)); 1173 ZonedDateTime.parse("2015-11-01T00:00:00.00Z"), DataUnit.MEGABYTES.toBytes(1800)); 1186 new NetworkStats.Entry(DataUnit.MEGABYTES.toBytes(360), 0L, 0L, 0L, 0)); [all …]
|
/frameworks/opt/gamesdk/third_party/protobuf-3.0.0/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ |
D | TestUtil.java | 166 static ByteString toBytes(String str) { in toBytes() method in TestUtil 241 message.setOptionalBytes (toBytes("116")); in setAllFields() 279 message.addRepeatedBytes (toBytes("216")); in setAllFields() 314 message.addRepeatedBytes (toBytes("316")); in setAllFields() 350 message.setDefaultBytes (toBytes("416")); in setAllFields() 381 message.setRepeatedBytes (1, toBytes("516")); in modifyRepeatedFields() 456 Assert.assertEquals(toBytes("116"), message.getOptionalBytes()); in assertAllFieldsSet() 516 Assert.assertEquals(toBytes("216"), message.getRepeatedBytes(0)); in assertAllFieldsSet() 545 Assert.assertEquals(toBytes("316"), message.getRepeatedBytes(1)); in assertAllFieldsSet() 599 Assert.assertEquals(toBytes("416"), message.getDefaultBytes()); in assertAllFieldsSet() [all …]
|
D | GeneratedMessageTest.java | 292 builder.addRepeatedBytes(TestUtil.toBytes("one")); in testRepeatedSettersRejectNull() 293 builder.addRepeatedBytes(TestUtil.toBytes("two")); in testRepeatedSettersRejectNull() 376 builder.addAllRepeatedBytes(Arrays.asList(TestUtil.toBytes("one"), null)); in testRepeatedAppendRejectsNull()
|
/frameworks/base/media/java/android/media/ |
D | MediaCas.java | 160 toBytes((ArrayList<Byte>) msg.obj)); in handleMessage() 187 bundle.putByteArray(EventHandler.SESSION_KEY, toBytes(sessionId)); 188 bundle.putByteArray(EventHandler.DATA_KEY, toBytes(data)); 243 private byte[] toBytes(@NonNull ArrayList<Byte> byteArray) { in toBytes() method in MediaCas
|
/frameworks/opt/telephony/tests/telephonytests/src/com/android/internal/telephony/uicc/euicc/asn1/ |
D | Asn1NodeTest.java | 45 assertArrayEquals(new byte[] {0x65, 0x00}, node.toBytes()); in testCreateConstructedNodeWithShortTag() 56 assertArrayEquals(new byte[] {0x3F, 0x34, 0x00}, node.toBytes()); in testCreateConstructedNodeWithLongTag()
|
/frameworks/base/core/java/com/android/internal/util/ |
D | BitUtils.java | 158 public static byte[] toBytes(long l) { in toBytes() method in BitUtils
|
/frameworks/base/telephony/java/com/android/internal/telephony/uicc/asn1/ |
D | Asn1Node.java | 548 public byte[] toBytes() { in toBytes() method in Asn1Node 556 return IccUtils.bytesToHexString(toBytes()); in toHex()
|
/frameworks/base/services/core/java/com/android/server/testharness/ |
D | TestHarnessModeService.java | 332 blockManager.setTestHarnessModeData(persistentData.toBytes()); in handleEnable() 435 byte[] toBytes() { in toBytes() method in TestHarnessModeService.PersistentData
|
/frameworks/base/services/core/java/com/android/server/locksettings/ |
D | SyntheticPasswordManager.java | 261 public byte[] toBytes() { in toBytes() method in SyntheticPasswordManager.PasswordData 674 saveState(PASSWORD_DATA_NAME, pwd.toBytes(), handle, userId); in createPasswordBasedSyntheticPassword() 729 pwd.toBytes()); in synchronizeFrpPassword() 743 requestedQuality, pwd.toBytes()); in synchronizeWeaverFrpPassword() 899 saveState(PASSWORD_DATA_NAME, pwd.toBytes(), handle, userId); in unwrapPasswordBasedSyntheticPassword()
|
D | LockSettingsStorage.java | 143 public byte[] toBytes() { in toBytes() method in LockSettingsStorage.CredentialHash 630 persistentDataBlock.setFrpCredentialHandle(PersistentData.toBytes( in writePersistentDataBlock() 695 public static byte[] toBytes(int persistentType, int userId, int qualityForUi, in toBytes() method in LockSettingsStorage.PersistentData
|
/frameworks/base/services/core/java/com/android/server/storage/ |
D | DeviceStorageMonitorService.java | 83 private static final long DEFAULT_LOG_DELTA_BYTES = DataUnit.MEBIBYTES.toBytes(64); 89 private static final long BOOT_IMAGE_STORAGE_REQUIREMENT = DataUnit.MEBIBYTES.toBytes(250);
|