summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Plass <mplass@google.com>2018-05-21 12:51:05 -0700
committerMichael Plass <mplass@google.com>2018-05-21 12:51:05 -0700
commitdacacbf69da8844232d938437b3b38471a3d2827 (patch)
tree739dd040633c9180d34a1b9def3922a543e72363
parenta332e6d65efbee41e08b86d56394db4431ca6e86 (diff)
Remove wifi/ScoringParams.hexDigest
Did not actually use this, so gc the method. Bug: 79482323 Test: Unit tests Change-Id: Ibdc44b7a5753b2670061958417eab0a737a8fc51
-rw-r--r--service/java/com/android/server/wifi/ScoringParams.java18
-rw-r--r--tests/wifitests/src/com/android/server/wifi/ScoringParamsTest.java19
2 files changed, 1 insertions, 36 deletions
diff --git a/service/java/com/android/server/wifi/ScoringParams.java b/service/java/com/android/server/wifi/ScoringParams.java
index 6c42faf6b..8f68627b7 100644
--- a/service/java/com/android/server/wifi/ScoringParams.java
+++ b/service/java/com/android/server/wifi/ScoringParams.java
@@ -27,11 +27,6 @@ import android.util.Log;
import com.android.internal.R;
-import libcore.util.HexEncoding;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
/**
* Holds parameters used for scoring networks.
*
@@ -391,17 +386,4 @@ public class ScoringParams {
public String toString() {
return mVal.toString();
}
-
- /**
- * Calculates the SHA-256 digest of the scoring params, encoded in hex.
- */
- public String hexDigest() {
- String digest = null;
- try {
- MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
- messageDigest.update(mVal.toString().getBytes());
- digest = HexEncoding.encodeToString(messageDigest.digest());
- } catch (NoSuchAlgorithmException e) { }
- return digest;
- }
}
diff --git a/tests/wifitests/src/com/android/server/wifi/ScoringParamsTest.java b/tests/wifitests/src/com/android/server/wifi/ScoringParamsTest.java
index fb7f868a7..56dca114a 100644
--- a/tests/wifitests/src/com/android/server/wifi/ScoringParamsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/ScoringParamsTest.java
@@ -102,18 +102,6 @@ public class ScoringParamsTest {
}
/**
- * Test hexDigest
- */
- @Test
- public void testHexDigest() throws Exception {
- mScoringParams = new ScoringParams();
- //hint: printf %s "$EXPECTED_DEFAULTS" | openssl dgst -hex -sha256
- String expect = "BC3DB98DD8DD16C251FE9A0592444106B8FB09026D66558242196C7E81D1FAC2";
- String actual = mScoringParams.hexDigest();
- assertEquals(expect, actual);
- }
-
- /**
* Test complete update
*/
@Test
@@ -213,19 +201,14 @@ public class ScoringParamsTest {
}
/**
- * Test that expid is hooked up, including effect on digest
+ * Test that expid is hooked up
*/
@Test
public void testExperimentIdentifier() throws Exception {
mScoringParams = new ScoringParams();
- String digestBefore = mScoringParams.hexDigest();
assertEquals(0, mScoringParams.getExperimentIdentifier());
assertTrue(mScoringParams.update("expid=99"));
assertEquals(99, mScoringParams.getExperimentIdentifier());
- String digestAfter = mScoringParams.hexDigest();
- assertTrue(!digestBefore.equals(digestAfter));
- assertTrue(mScoringParams.update("expid=0"));
- assertEquals(digestBefore, mScoringParams.hexDigest());
}
/**