Searched refs:random (Results 1 - 25 of 39) sorted by relevance

12

/packages/apps/Gallery2/src/com/android/photos/data/
H A DAlbumSetLoader.java39 double random = Math.random();
40 int id = (int) (500 * random);
44 (long) (System.currentTimeMillis() * random),
48 (random < .3 ? 1 : 0),
/packages/inputmethods/LatinIME/common/src/com/android/inputmethod/latin/common/
H A DCodePointUtils.java72 @Nonnull final Random random) {
75 final int r = Math.abs(random.nextInt());
94 * Generates a random word.
98 public static String generateWord(@Nonnull final Random random, argument
101 // 8 * 4 = 32 chars max, but we do it the following way so as to bias the random toward
104 final int count = 1 + (Math.abs(random.nextInt()) % 5)
105 + (Math.abs(random.nextInt()) % 5)
106 + (Math.abs(random.nextInt()) % 5)
107 + (Math.abs(random.nextInt()) % 5)
108 + (Math.abs(random
71 generateCodePointSet(final int codePointSetSize, @Nonnull final Random random) argument
[all...]
/packages/apps/TV/src/com/android/tv/recommendation/
H A DRandomEvaluator.java22 return Math.random();
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/
H A DLatinImeStressTests.java32 final Random random = new Random(seed);
35 changeLanguageWithoutWait(locales[random.nextInt(locales.length)],
37 final int wordCount = random.nextInt(maxWordCountToTypeInEachIteration);
39 final String word = CodePointUtils.generateWord(random, codePointSet);
49 final Random random = new Random(seed);
51 final int[] codePointSet = CodePointUtils.generateCodePointSet(codePointSetSize, random);
53 changeLanguageWithoutWait(locales[random.nextInt(locales.length)],
55 final int wordCount = random.nextInt(maxWordCountToTypeInEachIteration);
57 final String word = CodePointUtils.generateWord(random, codePointSet);
H A DBinaryDictionaryTests.java247 final Random random = new Random(seed);
248 final int[] codePointSet = CodePointUtils.generateCodePointSet(codePointSetSize, random);
250 final String word = CodePointUtils.generateWord(random, codePointSet);
251 probabilityMap.put(word, random.nextInt(0xFF));
319 final Random random = new Random(seed);
324 final int[] codePointSet = CodePointUtils.generateCodePointSet(codePointSetSize, random);
329 final String word = CodePointUtils.generateWord(random, codePointSet);
331 final int unigramProbability = random.nextInt(0xFF);
337 final String word0 = words.get(random.nextInt(wordCount));
338 final String word1 = words.get(random
[all...]
/packages/inputmethods/LatinIME/tools/dicttool/tests/com/android/inputmethod/latin/makedict/
H A DFusionDictionaryTest.java40 final Random random = new Random(seed);
42 generateWords(MAX_UNIGRAMS, random);
46 * Generates a random word.
48 private String generateWord(final Random random) { argument
50 int count = random.nextInt() % 30;
52 final long r = Math.abs(random.nextInt());
60 if (builder.length() == 1) return generateWord(random);
64 private void generateWords(final int number, final Random random) { argument
66 sWords.add(generateWord(random));
/packages/apps/Email/tests/src/com/android/emailcommon/utility/
H A DSSLUtilsTest.java76 Random random = new Random(314159 /* seed */);
79 String s1 = randomString(random);
80 String s2 = randomString(random);
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/personalization/
H A DUserHistoryDictionaryTestsHelper.java45 * Characters for generating random words.
66 * Generates and writes random words to dictionary. Caller can be assured
72 * @param random helps generate random words.
78 final int numberOfWords, final Random random, final boolean checkContents,
80 final List<String> words = generateWords(numberOfWords, random);
81 // Add random words to the user history dictionary.
118 * Generates random words.
121 * @param random salt used for generating random word
77 addAndWriteRandomWords(final UserHistoryDictionary dict, final int numberOfWords, final Random random, final boolean checkContents, final int currentTime) argument
123 generateWords(final int numberOfWords, final Random random) argument
[all...]
H A DUserHistoryDictionaryTests.java120 final Random random = new Random(123456);
122 dict, numberOfWords, random, true /* checksContents */, mCurrentTime));
151 final Random random = new Random(123456);
174 random,
205 final Random random = new Random(123456);
210 numberOfWords, random, true /* checksContents */, mCurrentTime));
/packages/experimental/Bummer/src/com/android/dreams/bummer/
H A DBummerView.java52 final float newx = (float) (Math.random() * (framew - textw));
53 final float newy = (float) (Math.random() * (frameh - texth));
/packages/screensavers/PhotoTable/src/com/android/dreams/phototable/
H A DBummerView.java52 final float newx = (float) (Math.random() * (framew - textw));
53 final float newy = (float) (Math.random() * (frameh - texth));
/packages/apps/Gallery2/src/com/android/gallery3d/ui/
H A DSlideshowView.java128 public SlideshowAnimation(int width, int height, Random random) { argument
132 MOVE_SPEED * mWidth * (random.nextFloat() - 0.5f),
133 MOVE_SPEED * mHeight * (random.nextFloat() - 0.5f));
/packages/apps/UnifiedEmail/src/org/apache/james/mime4j/util/
H A DSimpleTempStorage.java45 private Random random = new Random(); field in class:SimpleTempStorage
64 long n = Math.abs(random.nextLong());
93 long n = Math.abs(random.nextLong());
/packages/providers/ContactsProvider/src/com/android/providers/contacts/debug/
H A DDataExporter.java73 /** @return long random string for a file name */
76 final byte[] random = new byte[256 / 8];
77 rng.nextBytes(random);
79 return Hex.encodeHex(random, true);
/packages/inputmethods/LatinIME/native/jni/tests/dictionary/utils/
H A Dbloom_filter_test.cpp24 #include <random>
36 // Initialize data set with random integers.
/packages/apps/TV/tests/unit/src/com/android/tv/recommendation/
H A DRecommendationUtils.java81 public void resetRandom(Random random) { argument
82 mRandom = random;
125 // Time hopping with random minutes.
/packages/services/Telecomm/testapps/src/com/android/server/telecom/testapps/
H A DTestVideoProvider.java59 private Random random; field in class:TestVideoProvider
80 random = new Random();
188 long dataUsageKb = (10 *1024) + random.nextInt(50 * 1024);
/packages/experimental/StrictModeTest/src/com/android/strictmodetest/
H A DStrictModeActivity.java164 // Now try a random hostname to evade libcore's
167 String random = "" + Math.random();
168 random = random.substring(random.indexOf(".") + 1);
169 String domain = random + ".livejournal.com";
171 Log.d(TAG, "for random domain " + domain + ": " + addr);
/packages/inputmethods/LatinIME/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/
H A DBinaryDictOffdeviceUtilsTests.java67 private static void generateWords(final int maxUnigrams, final Random random) { argument
69 CODE_POINT_SET_SIZE, random);
72 wordSet.add(CodePointUtils.generateWord(random, codePointSet));
136 // Test that a random data file actually fails
149 // Test that a compressed random data file actually fails
164 // Add some random options for test
/packages/apps/UnifiedEmail/src/com/android/emailcommon/internet/
H A DMimeMultipart.java62 sb.append(Integer.toString((int)(Math.random() * 35), 36));
/packages/services/Telephony/src/com/android/phone/common/mail/internet/
H A DMimeMultipart.java61 sb.append(Integer.toString((int)(Math.random() * 35), 36));
/packages/apps/Email/emailcommon/src/com/android/emailcommon/utility/
H A DSSLSocketFactory.java182 final SecureRandom random,
199 sslcontext.init(keymanagers, trustmanagers, random);
177 SSLSocketFactory( String algorithm, final KeyStore keystore, final String keystorePassword, final KeyStore truststore, final SecureRandom random, final HostNameResolver nameResolver) argument
/packages/apps/Gallery2/src/com/android/gallery3d/gadget/
H A DLocalPhotoSource.java108 Random random = new Random();
112 int row = (int)(-Math.log(random.nextDouble()) * total / 2);
/packages/apps/Nfc/src/com/android/nfc/beam/
H A DFireflyRenderer.java382 mX = (float) (Math.random() * mDisplayWidth) * 4 - 2 * mDisplayWidth;
383 mY = (float) (Math.random() * mDisplayHeight) * 4 - 2 * mDisplayHeight;
384 mZ0 = mZ = (float) (Math.random()) * 2 - 1;
/packages/apps/Nfc/src/com/android/nfc/handover/
H A DHandoverDataParser.java101 byte[] random = new byte[2];
102 new Random().nextBytes(random);
103 return new NdefRecord(NdefRecord.TNF_WELL_KNOWN, RTD_COLLISION_RESOLUTION, null, random);
422 payload.position(payload.position() + 1); // advance over random byte

Completed in 2338 milliseconds

12