From d8e147ce79e8424d22be501c87e43cd8f2427ddb Mon Sep 17 00:00:00 2001 From: Jake Hamby Date: Mon, 17 Oct 2011 23:36:48 -0700 Subject: [PATCH] Add wrapper method to GsmAlphabet for API compatibility. An internal method was changed to add parameters to support a new feature (7-bit national language tables). Add a compatibility wrapper for the original method signature, which is used by OEM code. Bug: 5334032 Change-Id: I1acba369b1c1da52c4a950fd4ae21d693652e9c5 --- .../internal/telephony/GsmAlphabet.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/telephony/java/com/android/internal/telephony/GsmAlphabet.java b/telephony/java/com/android/internal/telephony/GsmAlphabet.java index a3f4f1fe2f22d..2e998490e8754 100644 --- a/telephony/java/com/android/internal/telephony/GsmAlphabet.java +++ b/telephony/java/com/android/internal/telephony/GsmAlphabet.java @@ -204,6 +204,24 @@ public class GsmAlphabet { } } + /** + * Converts a String into a byte array containing the 7-bit packed + * GSM Alphabet representation of the string. If a header is provided, + * this is included in the returned byte array and padded to a septet + * boundary. This method is used by OEM code. + * + * @param data The text string to encode. + * @param header Optional header (including length byte) that precedes + * the encoded data, padded to septet boundary. + * @return Byte array containing header and encoded data. + * @throws EncodeException if String is too large to encode + * @see #stringToGsm7BitPackedWithHeader(String, byte[], int, int) + */ + public static byte[] stringToGsm7BitPackedWithHeader(String data, byte[] header) + throws EncodeException { + return stringToGsm7BitPackedWithHeader(data, header, 0, 0); + } + /** * Converts a String into a byte array containing the 7-bit packed * GSM Alphabet representation of the string. If a header is provided,