Home
last modified time | relevance | path

Searched refs:random (Results 1 – 25 of 61) sorted by relevance

123

/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/
DBinaryDictionaryTests.java263 final Random random = new Random(seed); in testRandomlyAddUnigramWord() local
264 final int[] codePointSet = CodePointUtils.generateCodePointSet(codePointSetSize, random); in testRandomlyAddUnigramWord()
266 final String word = CodePointUtils.generateWord(random, codePointSet); in testRandomlyAddUnigramWord()
267 probabilityMap.put(word, random.nextInt(0xFF)); in testRandomlyAddUnigramWord()
337 final Random random = new Random(seed); in testRandomlyAddBigramWords() local
342 final int[] codePointSet = CodePointUtils.generateCodePointSet(codePointSetSize, random); in testRandomlyAddBigramWords()
347 final String word = CodePointUtils.generateWord(random, codePointSet); in testRandomlyAddBigramWords()
349 final int unigramProbability = random.nextInt(0xFF); in testRandomlyAddBigramWords()
355 final String word0 = words.get(random.nextInt(wordCount)); in testRandomlyAddBigramWords()
356 final String word1 = words.get(random.nextInt(wordCount)); in testRandomlyAddBigramWords()
[all …]
DLatinImeStressTests.java32 final Random random = new Random(seed); in testSwitchLanguagesAndInputLatinRandomCodePoints() local
35 changeLanguageWithoutWait(locales[random.nextInt(locales.length)], in testSwitchLanguagesAndInputLatinRandomCodePoints()
37 final int wordCount = random.nextInt(maxWordCountToTypeInEachIteration); in testSwitchLanguagesAndInputLatinRandomCodePoints()
39 final String word = CodePointUtils.generateWord(random, codePointSet); in testSwitchLanguagesAndInputLatinRandomCodePoints()
49 final Random random = new Random(seed); in testSwitchLanguagesAndInputRandomCodePoints() local
51 final int[] codePointSet = CodePointUtils.generateCodePointSet(codePointSetSize, random); in testSwitchLanguagesAndInputRandomCodePoints()
53 changeLanguageWithoutWait(locales[random.nextInt(locales.length)], in testSwitchLanguagesAndInputRandomCodePoints()
55 final int wordCount = random.nextInt(maxWordCountToTypeInEachIteration); in testSwitchLanguagesAndInputRandomCodePoints()
57 final String word = CodePointUtils.generateWord(random, codePointSet); in testSwitchLanguagesAndInputRandomCodePoints()
/packages/inputmethods/LatinIME/common/src/com/android/inputmethod/latin/common/
DCodePointUtils.java72 @Nonnull final Random random) { in generateCodePointSet() argument
75 final int r = Math.abs(random.nextInt()); in generateCodePointSet()
98 public static String generateWord(@Nonnull final Random random, in generateWord() argument
104 final int count = 1 + (Math.abs(random.nextInt()) % 5) in generateWord()
105 + (Math.abs(random.nextInt()) % 5) in generateWord()
106 + (Math.abs(random.nextInt()) % 5) in generateWord()
107 + (Math.abs(random.nextInt()) % 5) in generateWord()
108 + (Math.abs(random.nextInt()) % 5) in generateWord()
109 + (Math.abs(random.nextInt()) % 5) in generateWord()
110 + (Math.abs(random.nextInt()) % 5) in generateWord()
[all …]
/packages/inputmethods/LatinIME/tools/dicttool/tests/com/android/inputmethod/latin/makedict/
DFusionDictionaryTest.java40 final Random random = new Random(seed); in prepare() local
42 generateWords(MAX_UNIGRAMS, random); in prepare()
48 private String generateWord(final Random random) { in generateWord() argument
50 int count = random.nextInt() % 30; in generateWord()
52 final long r = Math.abs(random.nextInt()); in generateWord()
60 if (builder.length() == 1) return generateWord(random); in generateWord()
64 private void generateWords(final int number, final Random random) { in generateWords() argument
66 sWords.add(generateWord(random)); in generateWords()
/packages/apps/Gallery2/src/com/android/photos/data/
DAlbumSetLoader.java39 double random = Math.random(); in createRandomRow() local
40 int id = (int) (500 * random); in createRandomRow()
44 (long) (System.currentTimeMillis() * random), in createRandomRow()
48 (random < .3 ? 1 : 0), in createRandomRow()
/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/message/
DIkeNoncePayload.java74 SecureRandom random = randomnessFactory.getRandom(); in IkeNoncePayload() local
75 random = random == null ? new SecureRandom() : random; in IkeNoncePayload()
76 random.nextBytes(nonceData); in IkeNoncePayload()
DIkeKePayload.java197 SecureRandom random = randomnessFactory.getRandom(); in IkeKePayload() local
198 random = random == null ? new SecureRandom() : random; in IkeKePayload()
199 dhKeyPairGen.initialize(dhParams, random); in IkeKePayload()
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/personalization/
DUserHistoryDictionaryTests.java133 final Random random = new Random(123456); in doTestRandomWords() local
135 dict, numberOfWords, random, true /* checksContents */, mCurrentTime)); in doTestRandomWords()
168 final Random random = new Random(123456); in doTestStressTestForSwitchingLanguagesAndAddingWords() local
191 random, in doTestStressTestForSwitchingLanguagesAndAddingWords()
224 final Random random = new Random(123456); in doTestAddManyWords() local
229 numberOfWords, random, true /* checksContents */, mCurrentTime)); in doTestAddManyWords()
DUserHistoryDictionaryTestsHelper.java78 final int numberOfWords, final Random random, final boolean checkContents, in addAndWriteRandomWords() argument
80 final List<String> words = generateWords(numberOfWords, random); in addAndWriteRandomWords()
123 public static List<String> generateWords(final int numberOfWords, final Random random) { in generateWords() argument
126 wordSet.add(generateWord(random.nextInt())); in generateWords()
/packages/apps/Dialer/java/com/android/dialer/simulator/impl/
DRttChatBot.java82 private final Random random = new Random(); field in RttChatBot.MessageHandler
108 obtainMessage(SEND_MESSAGE, nextTyping()), 1000 * (1 + random.nextInt(10))); in handleMessage()
111 sendMessageDelayed(obtainMessage(SEND_MESSAGE, nextTyping()), 200 * random.nextInt(10)); in handleMessage()
121 String text = CANDIDATE_MESSAGES[random.nextInt(CANDIDATE_MESSAGES.length)]; in nextTyping()
128 int size = random.nextInt(currentTypingMessage.length() - currentTypingPosition + 1); in nextTyping()
/packages/apps/DocumentsUI/perf-tests/src/com/android/documentsui/
DStressProvider.java235 final Random random = new Random(index); in createRandomId() local
238 builder.append((char) (random.nextInt(96) + 32)); in createRandomId()
245 final Random random = new Random(index); in createRandomSize() local
246 return random.nextInt(1024 * 1024 * 100); // Up to 100 MB. in createRandomSize()
250 final Random random = new Random(index); in createRandomTime() local
252 return REFERENCE_TIMESTAMP - random.nextLong() % 1000L * 60 * 60 * 24 * 30; in createRandomTime()
/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/utils/
DIkeSpiGenerator.java34 SecureRandom random = randomnessFactory.getRandom(); in IkeSpiGenerator() local
35 mRandom = random == null ? new SecureRandom() : random; in IkeSpiGenerator()
/packages/modules/IPsec/src/java/com/android/internal/net/eap/
DEapAuthenticator.java116 private static SecureRandom createNewRandomIfNull(SecureRandom random) { in createNewRandomIfNull() argument
117 return random == null ? new SecureRandom() : random; in createNewRandomIfNull()
/packages/apps/Gallery2/src/com/android/gallery3d/ui/
DSlideshowView.java128 public SlideshowAnimation(int width, int height, Random random) { in SlideshowAnimation() argument
132 MOVE_SPEED * mWidth * (random.nextFloat() - 0.5f), in SlideshowAnimation()
133 MOVE_SPEED * mHeight * (random.nextFloat() - 0.5f)); in SlideshowAnimation()
/packages/providers/ContactsProvider/src/com/android/providers/contacts/debug/
DDataExporter.java76 final byte[] random = new byte[256 / 8]; in generateRandomName()
77 rng.nextBytes(random); in generateRandomName()
79 return Hex.encodeHex(random, true); in generateRandomName()
/packages/apps/Dialer/java/com/android/incallui/spam/
DSpamCallListListener.java74 private final Random random; field in SpamCallListListener
84 this.random = rand; in SpamCallListListener()
309 int randomNumber = random.nextInt(100); in shouldThrottleSpamNotification()
333 int randomNumber = random.nextInt(100); in shouldThrottleNonSpamNotification()
/packages/services/Telecomm/testapps/src/com/android/server/telecom/testapps/
DTestVideoProvider.java59 private Random random; field in TestVideoProvider
80 random = new Random(); in TestVideoProvider()
188 long dataUsageKb = (10 *1024) + random.nextInt(50 * 1024); in onRequestConnectionDataUsage()
DSelfManagedConnectionService.java100 Random random = new Random(); in createSelfManagedConnection() local
101 connection.setCallerDisplayName(TEST_NAMES[random.nextInt(TEST_NAMES.length)], in createSelfManagedConnection()
/packages/inputmethods/LatinIME/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/
DBinaryDictOffdeviceUtilsTests.java67 private static void generateWords(final int maxUnigrams, final Random random) { in generateWords() argument
69 CODE_POINT_SET_SIZE, random); in generateWords()
72 wordSet.add(CodePointUtils.generateWord(random, codePointSet)); in generateWords()
/packages/screensavers/PhotoTable/src/com/android/dreams/phototable/
DBummerView.java52 final float newx = (float) (Math.random() * (framew - textw));
53 final float newy = (float) (Math.random() * (frameh - texth));
/packages/modules/NetworkStack/src/com/android/networkstack/metrics/
Dstats.proto108 // The random number between 0 ~ 999 for sampling
133 // The random number between 0 ~ 999 for sampling
158 // The random number between 0 ~ 999 for sampling
/packages/apps/Nfc/src/com/android/nfc/beam/
DFireflyRenderer.java382 mX = (float) (Math.random() * mDisplayWidth) * 4 - 2 * mDisplayWidth; in reset()
383 mY = (float) (Math.random() * mDisplayHeight) * 4 - 2 * mDisplayHeight; in reset()
384 mZ0 = mZ = (float) (Math.random()) * 2 - 1; in reset()
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/makedict/
DBinaryDictDecoderEncoderTests.java110 private static void generateWords(final int number, final Random random) { in generateWords() argument
112 random); in generateWords()
115 wordSet.add(CodePointUtils.generateWord(random, codePointSet)); in generateWords()
120 LARGE_CODE_POINT_SET_SIZE, random); in generateWords()
123 wordSet.add(CodePointUtils.generateWord(random, largeCodePointSet)); in generateWords()
/packages/apps/TV/tests/unit/src/com/android/tv/recommendation/
DRecommendationUtils.java86 public void resetRandom(Random random) { in resetRandom() argument
87 mRandom = random; in resetRandom()
/packages/apps/Gallery2/src/com/android/gallery3d/gadget/
DLocalPhotoSource.java108 Random random = new Random(); in getExponentialIndice() local
112 int row = (int)(-Math.log(random.nextDouble()) * total / 2); in getExponentialIndice()

123