Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c48f228 authored by Nick Kralevich's avatar Nick Kralevich Committed by Android Git Automerger
Browse files

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

Merge commit '0cd28fdd' into gingerbread-plus-aosp

* commit '0cd28fdd':
  Use the default SecureRandom provider.
parents 888bcdbe 0cd28fdd
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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();
        }