Home
last modified time | relevance | path

Searched refs:toBytes (Results 1 – 25 of 30) sorted by relevance

12

/aosp14/frameworks/base/core/java/android/util/
H A DDataUnit.java36 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 TERABYTES { @Override public long toBytes(long v) { return v * 1_000_000_000_000L; } }, in toBytes() method
40 KIBIBYTES { @Override public long toBytes(long v) { return v * 1_024; } }, in toBytes() method
41 MEBIBYTES { @Override public long toBytes(long v) { return v * 1_048_576; } }, in toBytes() method
42 GIBIBYTES { @Override public long toBytes(long v) { return v * 1_073_741_824; } }, in toBytes() method
43 TEBIBYTES { @Override public long toBytes(long v) { return v * 1_099_511_627_776L; } }; in toBytes() method
45 public long toBytes(long v) { in toBytes() method in DataUnit
/aosp14/frameworks/base/core/tests/coretests/src/android/util/
H A DDataUnitTest.java26 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()
29 assertEquals(12_000_000_000_000L, DataUnit.TERABYTES.toBytes(12)); in testSi()
33 assertEquals(12_288L, DataUnit.KIBIBYTES.toBytes(12)); in testIec()
34 assertEquals(12_582_912L, DataUnit.MEBIBYTES.toBytes(12)); in testIec()
35 assertEquals(12_884_901_888L, DataUnit.GIBIBYTES.toBytes(12)); in testIec()
36 assertEquals(13_194_139_533_312L, DataUnit.TEBIBYTES.toBytes(12)); in testIec()
/aosp14/frameworks/base/core/tests/privacytests/src/android/privacy/
H A DRapporEncoderTest.java97 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
/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/
H A DFakeGateKeeperService.java51 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()
H A DLockSettingsStorageTests.java386 .thenReturn(PersistentData.toBytes(PersistentData.TYPE_SP_WEAVER, SOME_USER_ID, in testPersistentDataBlock_withData()
407 byte[] serialized = PersistentData.toBytes(PersistentData.TYPE_SP_GATEKEEPER, SOME_USER_ID, in testPersistentData_serializeUnserialize()
/aosp14/frameworks/base/services/tests/mockingservicestests/src/com/android/server/job/controllers/
H A DConnectivityControllerTest.java168 .setEstimatedNetworkBytes(DataUnit.MEBIBYTES.toBytes(1), in testUsable()
169 DataUnit.MEBIBYTES.toBytes(1)) in testUsable()
173 DataUnit.MEBIBYTES.toBytes(1)) in testUsable()
282 DataUnit.MEBIBYTES.toBytes(1)) in testInsane()
307 DataUnit.MEBIBYTES.toBytes(1)) in testCongestion()
337 DataUnit.MEBIBYTES.toBytes(1)) in testMeteredAllowed()
461 DataUnit.MEBIBYTES.toBytes(1)) in testStrongEnough_Cellular()
635 DataUnit.MEBIBYTES.toBytes(1)) in testStrongEnough_Cellular_CheckDisabled()
809 DataUnit.MEBIBYTES.toBytes(1)) in testStrongEnough_Cellular_VPN()
865 DataUnit.MEBIBYTES.toBytes(1)) in testRelaxed()
[all …]
/aosp14/frameworks/base/services/tests/mockingservicestests/src/com/android/server/blob/
H A DBlobStoreConfigTest.java64 String.valueOf(DataUnit.MEBIBYTES.toBytes(1000)), in testGetAppDataBytesLimit()
72 DataUnit.MEBIBYTES.toBytes(1000)); in testGetAppDataBytesLimit()
76 String.valueOf(DataUnit.MEBIBYTES.toBytes(100)), in testGetAppDataBytesLimit()
/aosp14/frameworks/base/apct-tests/perftests/blobstore/src/com/android/perftests/blob/
H A DBlobStorePerfTests.java128 final long sizeBytes = DataUnit.MEBIBYTES.toBytes(fileSizeInMb); in testDirectReads()
149 final long sizeBytes = DataUnit.MEBIBYTES.toBytes(fileSizeInMb); in testBlobStoreReads()
168 final long sizeBytes = DataUnit.MEBIBYTES.toBytes(fileSizeInMb); in testDirectWrites()
185 final long sizeBytes = DataUnit.MEBIBYTES.toBytes(fileSizeInMb); in testBlobStoreWrites()
239 .setFileSize(DataUnit.MEBIBYTES.toBytes(fileSizeInMb)) in prepareDataBlob()
/aosp14/frameworks/base/core/tests/coretests/src/android/os/
H A DFileUtilsTest.java508 final long M256 = DataUnit.MEGABYTES.toBytes(256); in testRoundStorageSize()
509 final long M512 = DataUnit.MEGABYTES.toBytes(512); in testRoundStorageSize()
510 final long G1 = DataUnit.GIGABYTES.toBytes(1); in testRoundStorageSize()
511 final long G2 = DataUnit.GIGABYTES.toBytes(2); in testRoundStorageSize()
512 final long G32 = DataUnit.GIGABYTES.toBytes(32); in testRoundStorageSize()
513 final long G64 = DataUnit.GIGABYTES.toBytes(64); in testRoundStorageSize()
514 final long G512 = DataUnit.GIGABYTES.toBytes(512); in testRoundStorageSize()
515 final long G1000 = DataUnit.TERABYTES.toBytes(1); in testRoundStorageSize()
516 final long G2000 = DataUnit.TERABYTES.toBytes(2); in testRoundStorageSize()
/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/net/
H A DNetworkPolicyManagerServiceTest.java1330 DataUnit.MEBIBYTES.toBytes(2), false));
1334 DataUnit.MEBIBYTES.toBytes(2) - 512);
1365 DataUnit.MEGABYTES.toBytes(1800 - 360));
1380 DataUnit.MEGABYTES.toBytes(1800 - 1799));
1397 DataUnit.MEGABYTES.toBytes(1800 - 1799));
1841 DataUnit.MEGABYTES.toBytes(1800));
1852 assertEquals(DataUnit.MEGABYTES.toBytes(3),
1854 assertEquals(DataUnit.MEGABYTES.toBytes(3),
1862 DataUnit.MEGABYTES.toBytes(100));
1905 assertEquals(DataUnit.MEBIBYTES.toBytes(10),
[all …]
/aosp14/frameworks/base/services/core/java/com/android/server/power/
H A DWakeLockLog.java598 int toBytes(LogEntry entry, byte[] bytes, long timeReference) { in toBytes() method in WakeLockLog.EntryByteTranslator
785 int size = mTranslator.toBytes(entry, mTempBuffer, mLatestTime); in addEntry()
793 size = mTranslator.toBytes(entry, mTempBuffer, mLatestTime); in addEntry()
865 int size = mTranslator.toBytes(entry, null, mStartTime); in getAllItems()
933 int entryByteSize = mTranslator.toBytes(entry, null, 0L); in removeTagIndex()
982 int size = mTranslator.toBytes(entry, null, mStartTime); in removeOldestItem()
1024 int size = mTranslator.toBytes(entry, mReadWriteTempBuffer, timeReference); in writeEntryAt()
/aosp14/frameworks/base/core/java/android/os/
H A DFileUtils.java1323 private static long toBytes(long value, String unit) { in toBytes() method in FileUtils
1331 return DataUnit.KILOBYTES.toBytes(value); in toBytes()
1335 return DataUnit.MEGABYTES.toBytes(value); in toBytes()
1339 return DataUnit.GIGABYTES.toBytes(value); in toBytes()
1343 return DataUnit.KIBIBYTES.toBytes(value); in toBytes()
1347 return DataUnit.MEBIBYTES.toBytes(value); in toBytes()
1351 return DataUnit.GIBIBYTES.toBytes(value); in toBytes()
1399 return toBytes(value, unit); in parseSize()
/aosp14/frameworks/base/media/java/android/media/
H A DMediaCas.java439 EventHandler.MSG_CAS_EVENT, event, arg, toBytes(data)));
456 bundle.putByteArray(EventHandler.SESSION_KEY, toBytes(sessionId));
457 bundle.putByteArray(EventHandler.DATA_KEY, toBytes(data));
543 private byte[] toBytes(@NonNull ArrayList<Byte> byteArray) { in toBytes() method in MediaCas
1075 mSession = createFromSessionId(toBytes(sessionId)); in onValues()
1088 mSession = createFromSessionId(toBytes(sessionId)); in onValues()
/aosp14/frameworks/base/services/core/java/com/android/server/net/
H A DNetworkPolicyManagerService.java2386 return DataUnit.MEBIBYTES.toBytes(dataWarningConfig);
3533 .setDataLimit(DataUnit.GIBIBYTES.toBytes(5),
3535 .setDataUsage(DataUnit.GIBIBYTES.toBytes(1),
3543 .setDataUsage(DataUnit.GIBIBYTES.toBytes(5),
3549 .setDataLimit(DataUnit.GIBIBYTES.toBytes(5),
3551 .setDataUsage(DataUnit.GIBIBYTES.toBytes(5),
3560 .setDataLimit(DataUnit.GIBIBYTES.toBytes(5),
3562 .setDataUsage(DataUnit.GIBIBYTES.toBytes(1),
3568 .setDataLimit(DataUnit.GIBIBYTES.toBytes(5),
3570 .setDataUsage(DataUnit.GIBIBYTES.toBytes(5),
[all …]
/aosp14/frameworks/base/services/core/java/com/android/server/locksettings/
H A DSyntheticPasswordManager.java435 public byte[] toBytes() { in toBytes() method in SyntheticPasswordManager.PasswordData
1014 saveState(PASSWORD_DATA_NAME, pwd.toBytes(), protectorId, userId); in createLskfBasedProtector()
1121 requestedQuality, pwd.toBytes()); in synchronizeGatekeeperFrpPassword()
1134 requestedQuality, pwd.toBytes()); in synchronizeWeaverFrpPassword()
1166 PersistentData.TYPE_SP_WEAVER, weaverSlot, pwd.toBytes()); in writeRepairModeCredentialLocked()
1170 PersistentData.TYPE_SP_GATEKEEPER, userId, pwd.toBytes()); in writeRepairModeCredentialLocked()
1396 saveState(PASSWORD_DATA_NAME, pwd.toBytes(), protectorId, userId); in unlockLskfBasedProtector()
1469 saveState(PASSWORD_DATA_NAME, pwd.toBytes(), protectorId, userId); in refreshPinLengthOnDisk()
H A DLockSettingsStorage.java412 PersistentData.toBytes(persistentType, userId, /* qualityForUi= */0, payload)); in writeRepairModePersistentData()
596 persistentDataBlock.setFrpCredentialHandle(PersistentData.toBytes( in writePersistentDataBlock()
677 public static byte[] toBytes(int persistentType, int userId, int qualityForUi, in toBytes() method in LockSettingsStorage.PersistentData
/aosp14/frameworks/base/telephony/java/com/android/internal/telephony/uicc/asn1/
H A DAsn1Node.java548 public byte[] toBytes() { in toBytes() method in Asn1Node
556 return IccUtils.bytesToHexString(toBytes()); in toHex()
/aosp14/frameworks/base/core/java/com/android/internal/util/
H A DBitUtils.java158 public static byte[] toBytes(long l) { in toBytes() method in BitUtils
/aosp14/frameworks/base/services/core/java/com/android/server/testharness/
H A DTestHarnessModeService.java348 blockManager.setTestHarnessModeData(persistentData.toBytes()); in handleEnable()
451 byte[] toBytes() { in toBytes() method in TestHarnessModeService.PersistentData
/aosp14/frameworks/base/services/usage/java/com/android/server/usage/
H A DStorageStatsService.java104 private static final long DEFAULT_QUOTA = DataUnit.MEBIBYTES.toBytes(64);
265 if (roundedUserspaceBytes <= DataUnit.GIGABYTES.toBytes(512)) { in getTotalBytes()
275 if (totalBytesRounded - totalBytes <= DataUnit.GIGABYTES.toBytes(3)) { in getTotalBytes()
/aosp14/frameworks/base/services/core/java/com/android/server/storage/
H A DDeviceStorageMonitorService.java83 private static final long DEFAULT_LOG_DELTA_BYTES = DataUnit.MEBIBYTES.toBytes(64);
90 private static final long BOOT_IMAGE_STORAGE_REQUIREMENT = DataUnit.MEBIBYTES.toBytes(250);
/aosp14/frameworks/base/apex/blobstore/service/java/com/android/server/blob/
H A DBlobStoreConfig.java89 DataUnit.MEBIBYTES.toBytes(300); // 300 MiB
/aosp14/frameworks/base/services/core/java/com/android/server/stats/pull/
H A DStatsPullAtomService.java4703 byte[] surroundEncodings = toBytes(new ArrayList(surroundEncodingsMap.keySet()));
4704 byte[] sinkSurroundEncodings = toBytes(audioManager.getReportedSurroundFormats());
4714 byte[] disabledSurroundEncodings = toBytes(disabledSurroundEncodingsList);
4715 byte[] enabledSurroundEncodings = toBytes(enabledSurroundEncodingsList);
4724 sinkHdrFormats = toBytes(hdrCapabilities.getSupportedHdrTypes());
4726 byte[] sinkDisplayModes = toBytes(display.getSupportedModes());
4742 byte[] userDisabledHdrTypes = toBytes(displayManager.getUserDisabledHdrTypes());
4795 byte[] hdrOutputTypes = toBytes(displayManager.getSupportedHdrOutputTypes());
4876 private byte[] toBytes(List<Integer> audioEncodings) {
4886 private byte[] toBytes(int[] array) {
[all …]
/aosp14/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/
H A DSettingsState.java1527 return Base64.encodeToString(toBytes(s), Base64.NO_WRAP); in base64Encode()
1538 private static byte[] toBytes(String s) { in toBytes() method in SettingsState
/aosp14/frameworks/base/core/java/android/os/storage/
H A DStorageManager.java1482 private static final long DEFAULT_THRESHOLD_MAX_BYTES = DataUnit.MEBIBYTES.toBytes(500);
1484 private static final long DEFAULT_FULL_THRESHOLD_BYTES = DataUnit.MEBIBYTES.toBytes(1);

12