summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWink Saville <>2009-04-02 11:00:54 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-02 11:00:54 -0700
commit04e71b3db84fd5f7fc4eefb49a33154ea91ec9fc (patch)
tree1e96e55835f059a7b4b7b89a62ca0a9d7f0a5c17 /tests
parent3afdd56470d6d4dcb20fe0f68ec9e54a167a9d74 (diff)
downloadframeworks_base-04e71b3db84fd5f7fc4eefb49a33154ea91ec9fc.zip
frameworks_base-04e71b3db84fd5f7fc4eefb49a33154ea91ec9fc.tar.gz
frameworks_base-04e71b3db84fd5f7fc4eefb49a33154ea91ec9fc.tar.bz2
AI 144245: Fix merge conflict for megering in the CDMA changes in to master from donutburger.
Automated import of CL 144245
Diffstat (limited to 'tests')
-rw-r--r--tests/AndroidTests/src/com/android/unit_tests/SMSTest.java6
-rw-r--r--tests/CoreTests/com/android/internal/telephony/AdnRecordTest.java (renamed from tests/CoreTests/com/android/internal/telephony/gsm/AdnRecordTest.java)32
-rw-r--r--tests/CoreTests/com/android/internal/telephony/GsmAlphabetTest.java (renamed from tests/CoreTests/com/android/internal/telephony/gsm/GsmAlphabetTest.java)8
-rw-r--r--tests/CoreTests/com/android/internal/telephony/SMSDispatcherTest.java (renamed from tests/CoreTests/com/android/internal/telephony/gsm/SMSDispatcherTest.java)20
-rw-r--r--tests/CoreTests/com/android/internal/telephony/SimPhoneBookTest.java (renamed from tests/CoreTests/com/android/internal/telephony/gsm/SimPhoneBookTest.java)38
-rw-r--r--tests/CoreTests/com/android/internal/telephony/SimSmsTest.java (renamed from tests/CoreTests/com/android/internal/telephony/gsm/SimSmsTest.java)4
-rw-r--r--tests/CoreTests/com/android/internal/telephony/SimUtilsTest.java (renamed from tests/CoreTests/com/android/internal/telephony/gsm/SimUtilsTest.java)34
-rw-r--r--tests/CoreTests/com/android/internal/telephony/TelephonyTests.java12
-rw-r--r--tests/framework-tests/src/com/android/internal/policy/impl/LockPatternKeyguardViewTest.java9
9 files changed, 81 insertions, 82 deletions
diff --git a/tests/AndroidTests/src/com/android/unit_tests/SMSTest.java b/tests/AndroidTests/src/com/android/unit_tests/SMSTest.java
index ce0b53d..360352b 100644
--- a/tests/AndroidTests/src/com/android/unit_tests/SMSTest.java
+++ b/tests/AndroidTests/src/com/android/unit_tests/SMSTest.java
@@ -16,10 +16,10 @@
package com.android.unit_tests;
-import com.android.internal.telephony.gsm.GsmAlphabet;
-import com.android.internal.telephony.gsm.SmsHeader;
+import com.android.internal.telephony.GsmAlphabet;
+import com.android.internal.telephony.SmsHeader;
+import com.android.internal.telephony.gsm.SmsMessage;
import com.android.internal.util.HexDump;
-import android.telephony.gsm.SmsMessage;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
diff --git a/tests/CoreTests/com/android/internal/telephony/gsm/AdnRecordTest.java b/tests/CoreTests/com/android/internal/telephony/AdnRecordTest.java
index 6cafdf0..8a4a285 100644
--- a/tests/CoreTests/com/android/internal/telephony/gsm/AdnRecordTest.java
+++ b/tests/CoreTests/com/android/internal/telephony/AdnRecordTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.telephony.gsm;
+package com.android.internal.telephony;
import junit.framework.TestCase;
import android.test.suitebuilder.annotation.SmallTest;
@@ -32,7 +32,7 @@ public class AdnRecordTest extends TestCase {
// Typical record
//
adn = new AdnRecord(
- SimUtils.hexStringToBytes("566F696365204D61696C07918150367742F3FFFFFFFFFFFF"));
+ IccUtils.hexStringToBytes("566F696365204D61696C07918150367742F3FFFFFFFFFFFF"));
assertEquals("Voice Mail", adn.getAlphaTag());
assertEquals("+18056377243", adn.getNumber());
@@ -42,7 +42,7 @@ public class AdnRecordTest extends TestCase {
// Empty records, empty strings
//
adn = new AdnRecord(
- SimUtils.hexStringToBytes("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"));
+ IccUtils.hexStringToBytes("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"));
assertEquals("", adn.getAlphaTag());
assertEquals("", adn.getNumber());
@@ -51,7 +51,7 @@ public class AdnRecordTest extends TestCase {
//
// Record too short
//
- adn = new AdnRecord(SimUtils.hexStringToBytes( "FF"));
+ adn = new AdnRecord(IccUtils.hexStringToBytes( "FF"));
assertEquals("", adn.getAlphaTag());
assertEquals("", adn.getNumber());
@@ -61,7 +61,7 @@ public class AdnRecordTest extends TestCase {
// TOA = 0xff ("control string")
//
adn = new AdnRecord(
- SimUtils.hexStringToBytes("566F696365204D61696C07FF8150367742F3FFFFFFFFFFFF"));
+ IccUtils.hexStringToBytes("566F696365204D61696C07FF8150367742F3FFFFFFFFFFFF"));
assertEquals("Voice Mail", adn.getAlphaTag());
assertEquals("18056377243", adn.getNumber());
@@ -71,7 +71,7 @@ public class AdnRecordTest extends TestCase {
// TOA = 0x81 (unknown)
//
adn = new AdnRecord(
- SimUtils.hexStringToBytes("566F696365204D61696C07818150367742F3FFFFFFFFFFFF"));
+ IccUtils.hexStringToBytes("566F696365204D61696C07818150367742F3FFFFFFFFFFFF"));
assertEquals("Voice Mail", adn.getAlphaTag());
assertEquals("18056377243", adn.getNumber());
@@ -81,7 +81,7 @@ public class AdnRecordTest extends TestCase {
// Number Length is too long
//
adn = new AdnRecord(
- SimUtils.hexStringToBytes("566F696365204D61696C0F918150367742F3FFFFFFFFFFFF"));
+ IccUtils.hexStringToBytes("566F696365204D61696C0F918150367742F3FFFFFFFFFFFF"));
assertEquals("Voice Mail", adn.getAlphaTag());
assertEquals("", adn.getNumber());
@@ -91,7 +91,7 @@ public class AdnRecordTest extends TestCase {
// Number Length is zero (invalid)
//
adn = new AdnRecord(
- SimUtils.hexStringToBytes("566F696365204D61696C00918150367742F3FFFFFFFFFFFF"));
+ IccUtils.hexStringToBytes("566F696365204D61696C00918150367742F3FFFFFFFFFFFF"));
assertEquals("Voice Mail", adn.getAlphaTag());
assertEquals("", adn.getNumber());
@@ -101,7 +101,7 @@ public class AdnRecordTest extends TestCase {
// Number Length is 2, first number byte is FF, TOA is international
//
adn = new AdnRecord(
- SimUtils.hexStringToBytes("566F696365204D61696C0291FF50367742F3FFFFFFFFFFFF"));
+ IccUtils.hexStringToBytes("566F696365204D61696C0291FF50367742F3FFFFFFFFFFFF"));
assertEquals("Voice Mail", adn.getAlphaTag());
assertEquals("", adn.getNumber());
@@ -111,7 +111,7 @@ public class AdnRecordTest extends TestCase {
// Number Length is 2, first number digit is valid, TOA is international
//
adn = new AdnRecord(
- SimUtils.hexStringToBytes("566F696365204D61696C0291F150367742F3FFFFFFFFFFFF"));
+ IccUtils.hexStringToBytes("566F696365204D61696C0291F150367742F3FFFFFFFFFFFF"));
assertEquals("Voice Mail", adn.getAlphaTag());
assertEquals("+1", adn.getNumber());
@@ -121,7 +121,7 @@ public class AdnRecordTest extends TestCase {
// An extended record
//
adn = new AdnRecord(
- SimUtils.hexStringToBytes(
+ IccUtils.hexStringToBytes(
"4164676A6DFFFFFFFFFFFFFFFFFFFFFF0B918188551512C221436587FF01"));
assertEquals("Adgjm", adn.getAlphaTag());
@@ -129,7 +129,7 @@ public class AdnRecordTest extends TestCase {
assertFalse(adn.isEmpty());
assertTrue(adn.hasExtendedRecord());
- adn.appendExtRecord(SimUtils.hexStringToBytes("0206092143658709ffffffffff"));
+ adn.appendExtRecord(IccUtils.hexStringToBytes("0206092143658709ffffffffff"));
assertEquals("Adgjm", adn.getAlphaTag());
assertEquals("+18885551212,12345678901234567890", adn.getNumber());
@@ -139,7 +139,7 @@ public class AdnRecordTest extends TestCase {
// An extended record with an invalid extension
//
adn = new AdnRecord(
- SimUtils.hexStringToBytes(
+ IccUtils.hexStringToBytes(
"4164676A6DFFFFFFFFFFFFFFFFFFFFFF0B918188551512C221436587FF01"));
assertEquals("Adgjm", adn.getAlphaTag());
@@ -147,7 +147,7 @@ public class AdnRecordTest extends TestCase {
assertFalse(adn.isEmpty());
assertTrue(adn.hasExtendedRecord());
- adn.appendExtRecord(SimUtils.hexStringToBytes("0106092143658709ffffffffff"));
+ adn.appendExtRecord(IccUtils.hexStringToBytes("0106092143658709ffffffffff"));
assertEquals("Adgjm", adn.getAlphaTag());
assertEquals("+18885551212,12345678", adn.getNumber());
@@ -157,7 +157,7 @@ public class AdnRecordTest extends TestCase {
// An extended record with an invalid extension
//
adn = new AdnRecord(
- SimUtils.hexStringToBytes(
+ IccUtils.hexStringToBytes(
"4164676A6DFFFFFFFFFFFFFFFFFFFFFF0B918188551512C221436587FF01"));
assertEquals("Adgjm", adn.getAlphaTag());
@@ -165,7 +165,7 @@ public class AdnRecordTest extends TestCase {
assertFalse(adn.isEmpty());
assertTrue(adn.hasExtendedRecord());
- adn.appendExtRecord(SimUtils.hexStringToBytes("020B092143658709ffffffffff"));
+ adn.appendExtRecord(IccUtils.hexStringToBytes("020B092143658709ffffffffff"));
assertEquals("Adgjm", adn.getAlphaTag());
assertEquals("+18885551212,12345678", adn.getNumber());
diff --git a/tests/CoreTests/com/android/internal/telephony/gsm/GsmAlphabetTest.java b/tests/CoreTests/com/android/internal/telephony/GsmAlphabetTest.java
index f36d96b..5df8991 100644
--- a/tests/CoreTests/com/android/internal/telephony/gsm/GsmAlphabetTest.java
+++ b/tests/CoreTests/com/android/internal/telephony/GsmAlphabetTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.telephony.gsm;
+package com.android.internal.telephony;
import junit.framework.TestCase;
@@ -216,12 +216,12 @@ public class GsmAlphabetTest extends TestCase {
byte unpacked[];
- unpacked = SimUtils.hexStringToBytes("566F696365204D61696C");
+ unpacked = IccUtils.hexStringToBytes("566F696365204D61696C");
assertEquals("Voice Mail",
GsmAlphabet.gsm8BitUnpackedToString(unpacked, 0, unpacked.length));
- assertEquals(SimUtils.bytesToHexString(unpacked),
- SimUtils.bytesToHexString(
+ assertEquals(IccUtils.bytesToHexString(unpacked),
+ IccUtils.bytesToHexString(
GsmAlphabet.stringToGsm8BitPacked("Voice Mail")));
unpacked = GsmAlphabet.stringToGsm8BitPacked(sGsmExtendedChars);
diff --git a/tests/CoreTests/com/android/internal/telephony/gsm/SMSDispatcherTest.java b/tests/CoreTests/com/android/internal/telephony/SMSDispatcherTest.java
index 6db230f..5d5d1f9 100644
--- a/tests/CoreTests/com/android/internal/telephony/gsm/SMSDispatcherTest.java
+++ b/tests/CoreTests/com/android/internal/telephony/SMSDispatcherTest.java
@@ -14,15 +14,15 @@
* limitations under the License.
*/
-package com.android.internal.telephony.gsm;
+package com.android.internal.telephony;
import android.test.suitebuilder.annotation.MediumTest;
import com.android.internal.telephony.TestPhoneNotifier;
+import com.android.internal.telephony.gsm.SmsMessage;
import com.android.internal.telephony.test.SimulatedCommands;
import com.android.internal.telephony.test.SimulatedRadioControl;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.Suppress;
-import android.telephony.gsm.SmsMessage;
import java.util.Iterator;
@@ -37,24 +37,24 @@ public class SMSDispatcherTest extends AndroidTestCase {
Iterator<SmsHeader.Element> elements;
String[] lines = new String[2];
-
- lines[0] = "+CMT: ,158";
+
+ lines[0] = "+CMT: ,158";
lines[1] = "07914140279510F6440A8111110301003BF56080426101748A8C0B05040B"
+ "8423F000035502010106276170706C69636174696F6E2F766E642E776170"
+ "2E6D6D732D6D65737361676500AF848D0185B4848C8298524F347839776F"
+ "7547514D4141424C3641414141536741415A4B554141414141008D908918"
+ "802B31363530323438363137392F545950453D504C4D4E008A808E028000"
+ "88058103093A8083687474703A2F2F36";
-
+
sms = SmsMessage.newFromCMT(lines);
header = sms.getUserDataHeader();
assertNotNull(header);
assertNotNull(sms.getUserData());
-
+
elements = header.getElements().iterator();
assertNotNull(elements);
}
-
+
@MediumTest
public void testCMT2() throws Exception {
SmsMessage sms;
@@ -62,7 +62,7 @@ public class SMSDispatcherTest extends AndroidTestCase {
Iterator<SmsHeader.Element> elements;
String[] lines = new String[2];
-
+
lines[0] = "+CMT: ,77";
lines[1] = "07914140279510F6440A8111110301003BF56080426101848A3B0B05040B8423F"
@@ -74,7 +74,7 @@ public class SMSDispatcherTest extends AndroidTestCase {
System.out.println("header = " + header);
assertNotNull(header);
assertNotNull(sms.getUserData());
-
+
elements = header.getElements().iterator();
assertNotNull(elements);
}
@@ -89,7 +89,7 @@ public class SMSDispatcherTest extends AndroidTestCase {
+ "b0986c46abd96eb89c6ec7ebf97ec0a070482c1a8fc8a472c96c3a9fd0a874"
+ "4aad5aafd8ac76cbed7abfe0b0784c2e9bcfe8b47acd6ebbdff0b87c4eafdb"
+ "eff8bc7ecfeffbffffffffffffffffffffffffffff";
- byte[] data = SimUtils.hexStringToBytes(s);
+ byte[] data = IccUtils.hexStringToBytes(s);
sms = SmsMessage.createFromEfRecord(1, data);
assertNotNull(sms.getMessageBody());
diff --git a/tests/CoreTests/com/android/internal/telephony/gsm/SimPhoneBookTest.java b/tests/CoreTests/com/android/internal/telephony/SimPhoneBookTest.java
index db55bca..609e768 100644
--- a/tests/CoreTests/com/android/internal/telephony/gsm/SimPhoneBookTest.java
+++ b/tests/CoreTests/com/android/internal/telephony/SimPhoneBookTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.telephony.gsm;
+package com.android.internal.telephony;
import android.os.ServiceManager;
import android.test.suitebuilder.annotation.Suppress;
@@ -27,19 +27,19 @@ import junit.framework.TestCase;
public class SimPhoneBookTest extends TestCase {
public void testBasic() throws Exception {
- ISimPhoneBook simPhoneBook =
- ISimPhoneBook.Stub.asInterface(ServiceManager.getService("simphonebook"));
+ IIccPhoneBook simPhoneBook =
+ IIccPhoneBook.Stub.asInterface(ServiceManager.getService("simphonebook"));
assertNotNull(simPhoneBook);
- int size[] = simPhoneBook.getAdnRecordsSize(SimConstants.EF_ADN);
+ int size[] = simPhoneBook.getAdnRecordsSize(IccConstants.EF_ADN);
assertNotNull(size);
assertEquals(3, size.length);
assertEquals(size[0] * size[2], size[1]);
assertTrue(size[2] >= 100);
- List<AdnRecord> adnRecordList = simPhoneBook.getAdnRecordsInEf(SimConstants.EF_ADN);
+ List<AdnRecord> adnRecordList = simPhoneBook.getAdnRecordsInEf(IccConstants.EF_ADN);
// do it twice cause the second time shall read from cache only
- adnRecordList = simPhoneBook.getAdnRecordsInEf(SimConstants.EF_ADN);
+ adnRecordList = simPhoneBook.getAdnRecordsInEf(IccConstants.EF_ADN);
assertNotNull(adnRecordList);
// Test for phone book update
@@ -47,58 +47,58 @@ public class SimPhoneBookTest extends TestCase {
AdnRecord originalAdn = null;
// We need to maintain the state of the SIM before and after the test.
// Since this test doesn't mock the SIM we try to get a valid ADN record,
- // for 3 tries and if this fails, we bail out.
+ // for 3 tries and if this fails, we bail out.
for (adnIndex = 3 ; adnIndex >= 1; adnIndex--) {
listIndex = adnIndex - 1; // listIndex is zero based.
originalAdn = adnRecordList.get(listIndex);
assertNotNull("Original Adn is Null.", originalAdn);
assertNotNull("Original Adn alpha tag is null.", originalAdn.getAlphaTag());
assertNotNull("Original Adn number is null.", originalAdn.getNumber());
-
- if (originalAdn.getNumber().length() > 0 &&
- originalAdn.getAlphaTag().length() > 0) {
+
+ if (originalAdn.getNumber().length() > 0 &&
+ originalAdn.getAlphaTag().length() > 0) {
break;
}
}
if (adnIndex == 0) return;
-
+
AdnRecord emptyAdn = new AdnRecord("", "");
AdnRecord firstAdn = new AdnRecord("John", "4085550101");
AdnRecord secondAdn = new AdnRecord("Andy", "6505550102");
String pin2 = null;
// udpate by index
- boolean success = simPhoneBook.updateAdnRecordsInEfByIndex(SimConstants.EF_ADN,
+ boolean success = simPhoneBook.updateAdnRecordsInEfByIndex(IccConstants.EF_ADN,
firstAdn.getAlphaTag(), firstAdn.getNumber(), adnIndex, pin2);
- adnRecordList = simPhoneBook.getAdnRecordsInEf(SimConstants.EF_ADN);
+ adnRecordList = simPhoneBook.getAdnRecordsInEf(IccConstants.EF_ADN);
AdnRecord tmpAdn = adnRecordList.get(listIndex);
assertTrue(success);
assertTrue(firstAdn.isEqual(tmpAdn));
// replace by search
- success = simPhoneBook.updateAdnRecordsInEfBySearch(SimConstants.EF_ADN,
+ success = simPhoneBook.updateAdnRecordsInEfBySearch(IccConstants.EF_ADN,
firstAdn.getAlphaTag(), firstAdn.getNumber(),
secondAdn.getAlphaTag(), secondAdn.getNumber(), pin2);
- adnRecordList = simPhoneBook.getAdnRecordsInEf(SimConstants.EF_ADN);
+ adnRecordList = simPhoneBook.getAdnRecordsInEf(IccConstants.EF_ADN);
tmpAdn = adnRecordList.get(listIndex);
assertTrue(success);
assertFalse(firstAdn.isEqual(tmpAdn));
assertTrue(secondAdn.isEqual(tmpAdn));
// erase be search
- success = simPhoneBook.updateAdnRecordsInEfBySearch(SimConstants.EF_ADN,
+ success = simPhoneBook.updateAdnRecordsInEfBySearch(IccConstants.EF_ADN,
secondAdn.getAlphaTag(), secondAdn.getNumber(),
emptyAdn.getAlphaTag(), emptyAdn.getNumber(), pin2);
- adnRecordList = simPhoneBook.getAdnRecordsInEf(SimConstants.EF_ADN);
+ adnRecordList = simPhoneBook.getAdnRecordsInEf(IccConstants.EF_ADN);
tmpAdn = adnRecordList.get(listIndex);
assertTrue(success);
assertTrue(tmpAdn.isEmpty());
// restore the orginial adn
- success = simPhoneBook.updateAdnRecordsInEfByIndex(SimConstants.EF_ADN,
+ success = simPhoneBook.updateAdnRecordsInEfByIndex(IccConstants.EF_ADN,
originalAdn.getAlphaTag(), originalAdn.getNumber(), adnIndex,
pin2);
- adnRecordList = simPhoneBook.getAdnRecordsInEf(SimConstants.EF_ADN);
+ adnRecordList = simPhoneBook.getAdnRecordsInEf(IccConstants.EF_ADN);
tmpAdn = adnRecordList.get(listIndex);
assertTrue(success);
assertTrue(originalAdn.isEqual(tmpAdn));
diff --git a/tests/CoreTests/com/android/internal/telephony/gsm/SimSmsTest.java b/tests/CoreTests/com/android/internal/telephony/SimSmsTest.java
index 6ced23d..1609680 100644
--- a/tests/CoreTests/com/android/internal/telephony/gsm/SimSmsTest.java
+++ b/tests/CoreTests/com/android/internal/telephony/SimSmsTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.telephony.gsm;
+package com.android.internal.telephony;
import android.os.ServiceManager;
import android.test.suitebuilder.annotation.MediumTest;
@@ -33,7 +33,7 @@ public class SimSmsTest extends TestCase {
ISms sms = ISms.Stub.asInterface(ServiceManager.getService("isms"));
assertNotNull(sms);
- List<SmsRawData> records = sms.getAllMessagesFromSimEf();
+ List<SmsRawData> records = sms.getAllMessagesFromIccEf();
assertNotNull(records);
assertTrue(records.size() >= 0);
diff --git a/tests/CoreTests/com/android/internal/telephony/gsm/SimUtilsTest.java b/tests/CoreTests/com/android/internal/telephony/SimUtilsTest.java
index 3fbc8f5..e733af9 100644
--- a/tests/CoreTests/com/android/internal/telephony/gsm/SimUtilsTest.java
+++ b/tests/CoreTests/com/android/internal/telephony/SimUtilsTest.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package com.android.internal.telephony.gsm;
+package com.android.internal.telephony;
import com.android.internal.telephony.gsm.SimTlv;
-import com.android.internal.telephony.gsm.SimUtils;
+import com.android.internal.telephony.IccUtils;
import junit.framework.TestCase;
import android.test.suitebuilder.annotation.SmallTest;
@@ -33,46 +33,46 @@ public class SimUtilsTest extends TestCase {
*/
// An EF[ICCID] record
- data = SimUtils.hexStringToBytes("981062400510444868f2");
- assertEquals("8901260450014484862", SimUtils.bcdToString(data, 0, data.length));
+ data = IccUtils.hexStringToBytes("981062400510444868f2");
+ assertEquals("8901260450014484862", IccUtils.bcdToString(data, 0, data.length));
// skip the first and last bytes
- assertEquals("0126045001448486", SimUtils.bcdToString(data, 1, data.length - 2));
+ assertEquals("0126045001448486", IccUtils.bcdToString(data, 1, data.length - 2));
// Stops on invalid BCD value
- data = SimUtils.hexStringToBytes("98F062400510444868f2");
- assertEquals("890", SimUtils.bcdToString(data, 0, data.length));
+ data = IccUtils.hexStringToBytes("98F062400510444868f2");
+ assertEquals("890", IccUtils.bcdToString(data, 0, data.length));
/*
* bcdByteToInt()
*/
- assertEquals(98, SimUtils.bcdByteToInt((byte) 0x89));
+ assertEquals(98, IccUtils.bcdByteToInt((byte) 0x89));
// Out of range is treated as 0
- assertEquals(8, SimUtils.bcdByteToInt((byte) 0x8c));
+ assertEquals(8, IccUtils.bcdByteToInt((byte) 0x8c));
/*
* adnStringFieldToString()
*/
- data = SimUtils.hexStringToBytes("00566f696365204d61696c07918150367742f3ffffffffffff");
+ data = IccUtils.hexStringToBytes("00566f696365204d61696c07918150367742f3ffffffffffff");
// Again, skip prepended 0
// (this is an EF[ADN] record)
- assertEquals("Voice Mail", SimUtils.adnStringFieldToString(data, 1, data.length - 15));
+ assertEquals("Voice Mail", IccUtils.adnStringFieldToString(data, 1, data.length - 15));
- data = SimUtils.hexStringToBytes("809673539A5764002F004DFFFFFFFFFF");
+ data = IccUtils.hexStringToBytes("809673539A5764002F004DFFFFFFFFFF");
// (this is from an EF[ADN] record)
- assertEquals("\u9673\u539A\u5764/M", SimUtils.adnStringFieldToString(data, 0, data.length));
+ assertEquals("\u9673\u539A\u5764/M", IccUtils.adnStringFieldToString(data, 0, data.length));
- data = SimUtils.hexStringToBytes("810A01566fec6365204de0696cFFFFFF");
+ data = IccUtils.hexStringToBytes("810A01566fec6365204de0696cFFFFFF");
// (this is made up to test since I don't have a real one)
- assertEquals("Vo\u00ECce M\u00E0il", SimUtils.adnStringFieldToString(data, 0, data.length));
+ assertEquals("Vo\u00ECce M\u00E0il", IccUtils.adnStringFieldToString(data, 0, data.length));
- data = SimUtils.hexStringToBytes("820505302D82d32d31");
+ data = IccUtils.hexStringToBytes("820505302D82d32d31");
// Example from 3GPP TS 11.11 V18.1.3.0 annex B
- assertEquals("-\u0532\u0583-1", SimUtils.adnStringFieldToString(data, 0, data.length));
+ assertEquals("-\u0532\u0583-1", IccUtils.adnStringFieldToString(data, 0, data.length));
}
}
diff --git a/tests/CoreTests/com/android/internal/telephony/TelephonyTests.java b/tests/CoreTests/com/android/internal/telephony/TelephonyTests.java
index eb2bd23..b4fb324 100644
--- a/tests/CoreTests/com/android/internal/telephony/TelephonyTests.java
+++ b/tests/CoreTests/com/android/internal/telephony/TelephonyTests.java
@@ -16,13 +16,13 @@
package com.android.internal.telephony;
-import com.android.internal.telephony.gsm.AdnRecordTest;
+import com.android.internal.telephony.AdnRecordTest;
import com.android.internal.telephony.gsm.GSMPhoneTest;
-import com.android.internal.telephony.gsm.GsmAlphabetTest;
-import com.android.internal.telephony.gsm.SMSDispatcherTest;
-import com.android.internal.telephony.gsm.SimPhoneBookTest;
-import com.android.internal.telephony.gsm.SimSmsTest;
-import com.android.internal.telephony.gsm.SimUtilsTest;
+import com.android.internal.telephony.GsmAlphabetTest;
+import com.android.internal.telephony.SMSDispatcherTest;
+import com.android.internal.telephony.SimPhoneBookTest;
+import com.android.internal.telephony.SimSmsTest;
+import com.android.internal.telephony.SimUtilsTest;
import junit.framework.TestSuite;
diff --git a/tests/framework-tests/src/com/android/internal/policy/impl/LockPatternKeyguardViewTest.java b/tests/framework-tests/src/com/android/internal/policy/impl/LockPatternKeyguardViewTest.java
index 0368651..fd05fed 100644
--- a/tests/framework-tests/src/com/android/internal/policy/impl/LockPatternKeyguardViewTest.java
+++ b/tests/framework-tests/src/com/android/internal/policy/impl/LockPatternKeyguardViewTest.java
@@ -17,8 +17,7 @@
package com.android.internal.policy.impl;
import android.content.Context;
-
-import com.android.internal.telephony.SimCard;
+import com.android.internal.telephony.IccCard;
import android.test.AndroidTestCase;
import android.view.View;
import android.view.KeyEvent;
@@ -39,7 +38,7 @@ public class LockPatternKeyguardViewTest extends AndroidTestCase {
private static class MockUpdateMonitor extends KeyguardUpdateMonitor {
- public SimCard.State simState = SimCard.State.READY;
+ public IccCard.State simState = IccCard.State.READY;
public boolean inPortrait = false;
public boolean keyboardOpen = false;
@@ -48,7 +47,7 @@ public class LockPatternKeyguardViewTest extends AndroidTestCase {
}
@Override
- public SimCard.State getSimState() {
+ public IccCard.State getSimState() {
return simState;
}
@@ -339,7 +338,7 @@ public class LockPatternKeyguardViewTest extends AndroidTestCase {
public void testMenuDoesntGoToUnlockScreenOnWakeWhenPukLocked() {
// PUK locked
- mUpdateMonitor.simState = SimCard.State.PUK_REQUIRED;
+ mUpdateMonitor.simState = IccCard.State.PUK_REQUIRED;
// wake by menu
mLPKV.wakeWhenReadyTq(KeyEvent.KEYCODE_MENU);