diff options
| author | 2011-11-17 13:24:32 -0800 | |
|---|---|---|
| committer | 2011-11-17 13:29:58 -0800 | |
| commit | 6967cbc959b079fa7e4411360e40e2a0ed65da29 (patch) | |
| tree | e8519aff6adfdf00e384e7ce3a576001f74dfa4a | |
| parent | 131ed03f30ff85b00ee4f3cd01108f9742c356c2 (diff) | |
Rename EntropyService to EntropyMixer
EntropyService implies that this program provides entropy to other
programs, and is misleading. The EntropyMixer class is designed purely
to stir the existing entropy pool with some possibily random-ish data,
and carryover entropy across device reboots.
Change-Id: I086cd339a3b652d32371521e61e1b1f555ce2280
| -rw-r--r-- | services/java/com/android/server/EntropyMixer.java (renamed from services/java/com/android/server/EntropyService.java) | 8 | ||||
| -rw-r--r-- | services/java/com/android/server/SystemServer.java | 4 | ||||
| -rw-r--r-- | services/tests/servicestests/src/com/android/server/EntropyMixerTest.java (renamed from services/tests/servicestests/src/com/android/server/EntropyServiceTest.java) | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/services/java/com/android/server/EntropyService.java b/services/java/com/android/server/EntropyMixer.java index 788a2f53bbdf..b63a70ecc548 100644 --- a/services/java/com/android/server/EntropyService.java +++ b/services/java/com/android/server/EntropyMixer.java @@ -47,8 +47,8 @@ import android.util.Slog; * <p>TODO: Investigate attempting to write entropy data at shutdown time * instead of periodically. */ -public class EntropyService extends Binder { - private static final String TAG = "EntropyService"; +public class EntropyMixer extends Binder { + private static final String TAG = "EntropyMixer"; private static final int ENTROPY_WHAT = 1; private static final int ENTROPY_WRITE_PERIOD = 3 * 60 * 60 * 1000; // 3 hrs private static final long START_TIME = System.currentTimeMillis(); @@ -72,12 +72,12 @@ public class EntropyService extends Binder { } }; - public EntropyService() { + public EntropyMixer() { this(getSystemDir() + "/entropy.dat", "/dev/urandom"); } /** 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 (entropyFile == null) { throw new NullPointerException("entropyFile"); } diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 3ae62add369f..762acbbc3de8 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -133,8 +133,8 @@ class ServerThread extends Thread { // Critical services... try { - Slog.i(TAG, "Entropy Service"); - ServiceManager.addService("entropy", new EntropyService()); + Slog.i(TAG, "Entropy Mixer"); + ServiceManager.addService("entropy", new EntropyMixer()); Slog.i(TAG, "Power Manager"); power = new PowerManagerService(); diff --git a/services/tests/servicestests/src/com/android/server/EntropyServiceTest.java b/services/tests/servicestests/src/com/android/server/EntropyMixerTest.java index 636ba210191f..21a8ec2c0091 100644 --- a/services/tests/servicestests/src/com/android/server/EntropyServiceTest.java +++ b/services/tests/servicestests/src/com/android/server/EntropyMixerTest.java @@ -23,9 +23,9 @@ import android.test.AndroidTestCase; 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 { File dir = getContext().getDir("testInitialWrite", Context.MODE_PRIVATE); @@ -34,7 +34,7 @@ public class EntropyServiceTest extends AndroidTestCase { assertEquals(0, FileUtils.readTextFile(file, 0, null).length()); // 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); } |