eliminate byte-typed cdma sms fields

This commit is contained in:
Tammo Spalink
2009-06-28 15:44:10 +08:00
parent 0178afe415
commit 8561de157c
2 changed files with 15 additions and 15 deletions

View File

@@ -83,7 +83,7 @@ public final class BearerData {
public static final int MESSAGE_TYPE_DELIVER_REPORT = 0x07; public static final int MESSAGE_TYPE_DELIVER_REPORT = 0x07;
public static final int MESSAGE_TYPE_SUBMIT_REPORT = 0x08; public static final int MESSAGE_TYPE_SUBMIT_REPORT = 0x08;
public byte messageType; public int messageType;
/** /**
* 16-bit value indicating the message ID, which increments modulo 65536. * 16-bit value indicating the message ID, which increments modulo 65536.
@@ -102,7 +102,7 @@ public final class BearerData {
public static final int PRIORITY_EMERGENCY = 0x3; public static final int PRIORITY_EMERGENCY = 0x3;
public boolean priorityIndicatorSet = false; public boolean priorityIndicatorSet = false;
public byte priority = PRIORITY_NORMAL; public int priority = PRIORITY_NORMAL;
/** /**
* Supported privacy modes for CDMA SMS messages * Supported privacy modes for CDMA SMS messages
@@ -114,7 +114,7 @@ public final class BearerData {
public static final int PRIVACY_SECRET = 0x3; public static final int PRIVACY_SECRET = 0x3;
public boolean privacyIndicatorSet = false; public boolean privacyIndicatorSet = false;
public byte privacy = PRIVACY_NOT_RESTRICTED; public int privacy = PRIVACY_NOT_RESTRICTED;
/** /**
* Supported alert priority modes for CDMA SMS messages * Supported alert priority modes for CDMA SMS messages
@@ -139,7 +139,7 @@ public final class BearerData {
public static final int DISPLAY_MODE_USER = 0x2; public static final int DISPLAY_MODE_USER = 0x2;
public boolean displayModeSet = false; public boolean displayModeSet = false;
public byte displayMode = DISPLAY_MODE_DEFAULT; public int displayMode = DISPLAY_MODE_DEFAULT;
/** /**
* Language Indicator values. NOTE: the spec (3GPP2 C.S0015-B, * Language Indicator values. NOTE: the spec (3GPP2 C.S0015-B,
@@ -789,7 +789,7 @@ public final class BearerData {
if (inStream.read(8) != 3) { if (inStream.read(8) != 3) {
throw new CodingException("MESSAGE_IDENTIFIER subparam size incorrect"); throw new CodingException("MESSAGE_IDENTIFIER subparam size incorrect");
} }
bData.messageType = (byte)inStream.read(4); bData.messageType = inStream.read(4);
bData.messageId = inStream.read(8) << 8; bData.messageId = inStream.read(8) << 8;
bData.messageId |= inStream.read(8); bData.messageId |= inStream.read(8);
bData.hasUserDataHeader = (inStream.read(1) == 1); bData.hasUserDataHeader = (inStream.read(1) == 1);
@@ -1103,16 +1103,16 @@ public final class BearerData {
{ {
int paramBytes = inStream.read(8); int paramBytes = inStream.read(8);
CdmaSmsAddress addr = new CdmaSmsAddress(); CdmaSmsAddress addr = new CdmaSmsAddress();
addr.digitMode = (byte)inStream.read(1); addr.digitMode = inStream.read(1);
byte fieldBits = 4; byte fieldBits = 4;
byte consumedBits = 1; byte consumedBits = 1;
if (addr.digitMode == CdmaSmsAddress.DIGIT_MODE_8BIT_CHAR) { if (addr.digitMode == CdmaSmsAddress.DIGIT_MODE_8BIT_CHAR) {
addr.ton = inStream.read(3); addr.ton = inStream.read(3);
addr.numberPlan = (byte)inStream.read(4); addr.numberPlan = inStream.read(4);
fieldBits = 8; fieldBits = 8;
consumedBits += 7; consumedBits += 7;
} }
addr.numberOfDigits = (byte)inStream.read(8); addr.numberOfDigits = inStream.read(8);
consumedBits += 8; consumedBits += 8;
int remainingBits = (paramBytes * 8) - consumedBits; int remainingBits = (paramBytes * 8) - consumedBits;
int dataBits = addr.numberOfDigits * fieldBits; int dataBits = addr.numberOfDigits * fieldBits;
@@ -1192,7 +1192,7 @@ public final class BearerData {
if (inStream.read(8) != 1) { if (inStream.read(8) != 1) {
throw new CodingException("PRIVACY_INDICATOR subparam size incorrect"); throw new CodingException("PRIVACY_INDICATOR subparam size incorrect");
} }
bData.privacy = (byte)inStream.read(2); bData.privacy = inStream.read(2);
inStream.skip(6); inStream.skip(6);
bData.privacyIndicatorSet = true; bData.privacyIndicatorSet = true;
} }
@@ -1213,7 +1213,7 @@ public final class BearerData {
if (inStream.read(8) != 1) { if (inStream.read(8) != 1) {
throw new CodingException("DISPLAY_MODE subparam size incorrect"); throw new CodingException("DISPLAY_MODE subparam size incorrect");
} }
bData.displayMode = (byte)inStream.read(2); bData.displayMode = inStream.read(2);
inStream.skip(6); inStream.skip(6);
bData.displayModeSet = true; bData.displayModeSet = true;
} }
@@ -1224,7 +1224,7 @@ public final class BearerData {
if (inStream.read(8) != 1) { if (inStream.read(8) != 1) {
throw new CodingException("PRIORITY_INDICATOR subparam size incorrect"); throw new CodingException("PRIORITY_INDICATOR subparam size incorrect");
} }
bData.priority = (byte)inStream.read(2); bData.priority = inStream.read(2);
inStream.skip(6); inStream.skip(6);
bData.priorityIndicatorSet = true; bData.priorityIndicatorSet = true;
} }

View File

@@ -29,7 +29,7 @@ public class CdmaSmsAddress extends SmsAddress {
static public final int DIGIT_MODE_4BIT_DTMF = 0x00; static public final int DIGIT_MODE_4BIT_DTMF = 0x00;
static public final int DIGIT_MODE_8BIT_CHAR = 0x01; static public final int DIGIT_MODE_8BIT_CHAR = 0x01;
public byte digitMode; public int digitMode;
/** /**
* Number Mode Indicator is 1-bit value that indicates whether the * Number Mode Indicator is 1-bit value that indicates whether the
@@ -39,7 +39,7 @@ public class CdmaSmsAddress extends SmsAddress {
static public final int NUMBER_MODE_NOT_DATA_NETWORK = 0x00; static public final int NUMBER_MODE_NOT_DATA_NETWORK = 0x00;
static public final int NUMBER_MODE_DATA_NETWORK = 0x01; static public final int NUMBER_MODE_DATA_NETWORK = 0x01;
public byte numberMode; public int numberMode;
/** /**
* Number Types for data networks. * Number Types for data networks.
@@ -65,7 +65,7 @@ public class CdmaSmsAddress extends SmsAddress {
* This field shall be set to the number of address digits * This field shall be set to the number of address digits
* (See 3GPP2 C.S0015-B, v2, 3.4.3.3) * (See 3GPP2 C.S0015-B, v2, 3.4.3.3)
*/ */
public byte numberOfDigits; public int numberOfDigits;
/** /**
* Numbering Plan identification is a 0 or 4-bit value that * Numbering Plan identification is a 0 or 4-bit value that
@@ -78,7 +78,7 @@ public class CdmaSmsAddress extends SmsAddress {
//static protected final int NUMBERING_PLAN_TELEX = 0x4; //static protected final int NUMBERING_PLAN_TELEX = 0x4;
//static protected final int NUMBERING_PLAN_PRIVATE = 0x9; //static protected final int NUMBERING_PLAN_PRIVATE = 0x9;
public byte numberPlan; public int numberPlan;
/** /**
* NOTE: the parsed string address and the raw byte array values * NOTE: the parsed string address and the raw byte array values