Merge "Update SignalStrength CTS for copy constructor"
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/SignalStrengthTest.java b/tests/tests/telephony/current/src/android/telephony/cts/SignalStrengthTest.java
index 4cbe6ad..785916f 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/SignalStrengthTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/SignalStrengthTest.java
@@ -19,6 +19,7 @@
import static androidx.test.InstrumentationRegistry.getContext;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -73,7 +74,7 @@
}
@Test
- public void testSignalStrength() throws Throwable {
+ public void testSignalStrength() {
if (!mPm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
Log.d(TAG, "Skipping test that requires FEATURE_TELEPHONY");
return;
@@ -91,7 +92,10 @@
long curTime = SystemClock.elapsedRealtime();
assertTrue("Invalid timestamp in SignalStrength: " + ss.getTimestampMillis(),
ss.getTimestampMillis() > 0 && ss.getTimestampMillis() <= curTime);
- Log.d(TAG, "Timestamp of SignalStrength: " + Long.toString(ss.getTimestampMillis()));
+ Log.d(TAG, "Timestamp of SignalStrength: " + ss.getTimestampMillis());
+
+ SignalStrength copy = new SignalStrength(ss);
+ assertEquals(ss, copy);
List<CellSignalStrength> signalStrengths = ss.getCellSignalStrengths();