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

Commit 0cd28fdd authored by Nick Kralevich's avatar Nick Kralevich Committed by Android (Google) Code Review
Browse files

Merge "Use the default SecureRandom provider." into gingerbread

parents 3ae249dc 9bb4ec48
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();
        }