summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2015-06-21 04:52:57 -0700
committerSergio Giro <sgiro@google.com>2015-06-22 16:09:41 +0100
commit04dd85923b7af9f5009d9aa557f60731e619780a (patch)
tree40adc7f92969982115a3bc2c3560749ff4c5be87 /luni
parent163383e2c40b8e22d7557b9a40d74ebd490c0756 (diff)
downloadlibcore-04dd85923b7af9f5009d9aa557f60731e619780a.zip
libcore-04dd85923b7af9f5009d9aa557f60731e619780a.tar.gz
libcore-04dd85923b7af9f5009d9aa557f60731e619780a.tar.bz2
Make sure the Services cache is refreshed
During the class initialization, a special path is taken when all the built-in providers are initialized. This means that the "needsRefresh" flag is not set initially and the cache is not refreshed when the SecureRandom service is checked. Bug: 21970647 Change-Id: Idb796ec5e3ac04424e5fd3a90607666ae23817d5 (cherry picked from commit 10dced1155cb3689ca63383a3b0b794bc3735268)
Diffstat (limited to 'luni')
-rw-r--r--luni/src/main/java/org/apache/harmony/security/fortress/Services.java1
-rw-r--r--luni/src/test/java/libcore/java/security/SecureRandomTest.java2
2 files changed, 3 insertions, 0 deletions
diff --git a/luni/src/main/java/org/apache/harmony/security/fortress/Services.java b/luni/src/main/java/org/apache/harmony/security/fortress/Services.java
index 5f3dfe0..234f4a2 100644
--- a/luni/src/main/java/org/apache/harmony/security/fortress/Services.java
+++ b/luni/src/main/java/org/apache/harmony/security/fortress/Services.java
@@ -90,6 +90,7 @@ public class Services {
}
}
Engine.door.renumProviders();
+ setNeedRefresh();
}
/**
diff --git a/luni/src/test/java/libcore/java/security/SecureRandomTest.java b/luni/src/test/java/libcore/java/security/SecureRandomTest.java
index f9edbaa..cf12120 100644
--- a/luni/src/test/java/libcore/java/security/SecureRandomTest.java
+++ b/luni/src/test/java/libcore/java/security/SecureRandomTest.java
@@ -102,6 +102,8 @@ public class SecureRandomTest extends TestCase {
public void testNewConstructors_Success() throws Exception {
SecureRandom sr1 = new SecureRandom();
+ assertNotNull(sr1);
+ assertNotNull(sr1.getProvider());
assertEquals(EXPECTED_PROVIDER, sr1.getProvider().getClass().getName());
test_SecureRandom(sr1);