am 6c48f228: am 0cd28fdd: Merge "Use the default SecureRandom provider." into gingerbread

Merge commit '6c48f228f10c63f83c25fc0c86a5a739266c61a9'

* commit '6c48f228f10c63f83c25fc0c86a5a739266c61a9':
  Use the default SecureRandom provider.
This commit is contained in:
Nick Kralevich
2010-09-24 15:57:16 -07:00
committed by Android Git Automerger

View File

@@ -327,10 +327,7 @@ public class SettingsProvider extends ContentProvider {
try {
final String value = c.moveToNext() ? c.getString(0) : null;
if (value == null) {
final SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
String serial = SystemProperties.get("ro.serialno", "");
random.setSeed(
(serial + System.nanoTime() + new SecureRandom().nextLong()).getBytes());
final SecureRandom random = new SecureRandom();
final String newAndroidIdValue = Long.toHexString(random.nextLong());
Log.d(TAG, "Generated and saved new ANDROID_ID [" + newAndroidIdValue + "]");
final ContentValues values = new ContentValues();
@@ -342,8 +339,6 @@ public class SettingsProvider extends ContentProvider {
}
}
return true;
} catch (NoSuchAlgorithmException e) {
return false;
} finally {
c.close();
}