Skip to content

Commit f522e09

Browse files
Jake HambyAndroid (Google) Code Review
authored andcommitted
Merge "Add wrapper method to GsmAlphabet for API compatibility." into ics-mr0
2 parents 601d581 + d8e147c commit f522e09

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

telephony/java/com/android/internal/telephony/GsmAlphabet.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,24 @@ private GsmAlphabet() { }
204204
}
205205
}
206206

207+
/**
208+
* Converts a String into a byte array containing the 7-bit packed
209+
* GSM Alphabet representation of the string. If a header is provided,
210+
* this is included in the returned byte array and padded to a septet
211+
* boundary. This method is used by OEM code.
212+
*
213+
* @param data The text string to encode.
214+
* @param header Optional header (including length byte) that precedes
215+
* the encoded data, padded to septet boundary.
216+
* @return Byte array containing header and encoded data.
217+
* @throws EncodeException if String is too large to encode
218+
* @see #stringToGsm7BitPackedWithHeader(String, byte[], int, int)
219+
*/
220+
public static byte[] stringToGsm7BitPackedWithHeader(String data, byte[] header)
221+
throws EncodeException {
222+
return stringToGsm7BitPackedWithHeader(data, header, 0, 0);
223+
}
224+
207225
/**
208226
* Converts a String into a byte array containing the 7-bit packed
209227
* GSM Alphabet representation of the string. If a header is provided,

0 commit comments

Comments
 (0)