Loading services/java/com/android/server/EntropyService.java→services/java/com/android/server/EntropyMixer.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -47,8 +47,8 @@ import android.util.Slog; * <p>TODO: Investigate attempting to write entropy data at shutdown time * <p>TODO: Investigate attempting to write entropy data at shutdown time * instead of periodically. * instead of periodically. */ */ public class EntropyService extends Binder { public class EntropyMixer extends Binder { private static final String TAG = "EntropyService"; private static final String TAG = "EntropyMixer"; private static final int ENTROPY_WHAT = 1; private static final int ENTROPY_WHAT = 1; private static final int ENTROPY_WRITE_PERIOD = 3 * 60 * 60 * 1000; // 3 hrs private static final int ENTROPY_WRITE_PERIOD = 3 * 60 * 60 * 1000; // 3 hrs private static final long START_TIME = System.currentTimeMillis(); private static final long START_TIME = System.currentTimeMillis(); Loading @@ -72,12 +72,12 @@ public class EntropyService extends Binder { } } }; }; public EntropyService() { public EntropyMixer() { this(getSystemDir() + "/entropy.dat", "/dev/urandom"); this(getSystemDir() + "/entropy.dat", "/dev/urandom"); } } /** Test only interface, not for public use */ /** Test only interface, not for public use */ public EntropyService(String entropyFile, String randomDevice) { public EntropyMixer(String entropyFile, String randomDevice) { if (randomDevice == null) { throw new NullPointerException("randomDevice"); } if (randomDevice == null) { throw new NullPointerException("randomDevice"); } if (entropyFile == null) { throw new NullPointerException("entropyFile"); } if (entropyFile == null) { throw new NullPointerException("entropyFile"); } Loading services/java/com/android/server/SystemServer.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -133,8 +133,8 @@ class ServerThread extends Thread { // Critical services... // Critical services... try { try { Slog.i(TAG, "Entropy Service"); Slog.i(TAG, "Entropy Mixer"); ServiceManager.addService("entropy", new EntropyService()); ServiceManager.addService("entropy", new EntropyMixer()); Slog.i(TAG, "Power Manager"); Slog.i(TAG, "Power Manager"); power = new PowerManagerService(); power = new PowerManagerService(); Loading services/tests/servicestests/src/com/android/server/EntropyServiceTest.java→services/tests/servicestests/src/com/android/server/EntropyMixerTest.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -23,9 +23,9 @@ import android.test.AndroidTestCase; import java.io.File; import java.io.File; /** /** * Tests for {@link com.android.server.EntropyService} * Tests for {@link com.android.server.EntropyMixer} */ */ public class EntropyServiceTest extends AndroidTestCase { public class EntropyMixerTest extends AndroidTestCase { public void testInitialWrite() throws Exception { public void testInitialWrite() throws Exception { File dir = getContext().getDir("testInitialWrite", Context.MODE_PRIVATE); File dir = getContext().getDir("testInitialWrite", Context.MODE_PRIVATE); Loading @@ -34,7 +34,7 @@ public class EntropyServiceTest extends AndroidTestCase { assertEquals(0, FileUtils.readTextFile(file, 0, null).length()); assertEquals(0, FileUtils.readTextFile(file, 0, null).length()); // The constructor has the side effect of writing to file // The constructor has the side effect of writing to file new EntropyService("/dev/null", file.getCanonicalPath()); new EntropyMixer("/dev/null", file.getCanonicalPath()); assertTrue(FileUtils.readTextFile(file, 0, null).length() > 0); assertTrue(FileUtils.readTextFile(file, 0, null).length() > 0); } } Loading Loading
services/java/com/android/server/EntropyService.java→services/java/com/android/server/EntropyMixer.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -47,8 +47,8 @@ import android.util.Slog; * <p>TODO: Investigate attempting to write entropy data at shutdown time * <p>TODO: Investigate attempting to write entropy data at shutdown time * instead of periodically. * instead of periodically. */ */ public class EntropyService extends Binder { public class EntropyMixer extends Binder { private static final String TAG = "EntropyService"; private static final String TAG = "EntropyMixer"; private static final int ENTROPY_WHAT = 1; private static final int ENTROPY_WHAT = 1; private static final int ENTROPY_WRITE_PERIOD = 3 * 60 * 60 * 1000; // 3 hrs private static final int ENTROPY_WRITE_PERIOD = 3 * 60 * 60 * 1000; // 3 hrs private static final long START_TIME = System.currentTimeMillis(); private static final long START_TIME = System.currentTimeMillis(); Loading @@ -72,12 +72,12 @@ public class EntropyService extends Binder { } } }; }; public EntropyService() { public EntropyMixer() { this(getSystemDir() + "/entropy.dat", "/dev/urandom"); this(getSystemDir() + "/entropy.dat", "/dev/urandom"); } } /** Test only interface, not for public use */ /** Test only interface, not for public use */ public EntropyService(String entropyFile, String randomDevice) { public EntropyMixer(String entropyFile, String randomDevice) { if (randomDevice == null) { throw new NullPointerException("randomDevice"); } if (randomDevice == null) { throw new NullPointerException("randomDevice"); } if (entropyFile == null) { throw new NullPointerException("entropyFile"); } if (entropyFile == null) { throw new NullPointerException("entropyFile"); } Loading
services/java/com/android/server/SystemServer.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -133,8 +133,8 @@ class ServerThread extends Thread { // Critical services... // Critical services... try { try { Slog.i(TAG, "Entropy Service"); Slog.i(TAG, "Entropy Mixer"); ServiceManager.addService("entropy", new EntropyService()); ServiceManager.addService("entropy", new EntropyMixer()); Slog.i(TAG, "Power Manager"); Slog.i(TAG, "Power Manager"); power = new PowerManagerService(); power = new PowerManagerService(); Loading
services/tests/servicestests/src/com/android/server/EntropyServiceTest.java→services/tests/servicestests/src/com/android/server/EntropyMixerTest.java +3 −3 Original line number Original line Diff line number Diff line Loading @@ -23,9 +23,9 @@ import android.test.AndroidTestCase; import java.io.File; import java.io.File; /** /** * Tests for {@link com.android.server.EntropyService} * Tests for {@link com.android.server.EntropyMixer} */ */ public class EntropyServiceTest extends AndroidTestCase { public class EntropyMixerTest extends AndroidTestCase { public void testInitialWrite() throws Exception { public void testInitialWrite() throws Exception { File dir = getContext().getDir("testInitialWrite", Context.MODE_PRIVATE); File dir = getContext().getDir("testInitialWrite", Context.MODE_PRIVATE); Loading @@ -34,7 +34,7 @@ public class EntropyServiceTest extends AndroidTestCase { assertEquals(0, FileUtils.readTextFile(file, 0, null).length()); assertEquals(0, FileUtils.readTextFile(file, 0, null).length()); // The constructor has the side effect of writing to file // The constructor has the side effect of writing to file new EntropyService("/dev/null", file.getCanonicalPath()); new EntropyMixer("/dev/null", file.getCanonicalPath()); assertTrue(FileUtils.readTextFile(file, 0, null).length() > 0); assertTrue(FileUtils.readTextFile(file, 0, null).length() > 0); } } Loading