@@ -1015,17 +1015,17 @@ private static void decodeUserDataPayload(UserData userData, boolean hasUserData
10151015 boolean decodingtypeUTF8 = Resources .getSystem ()
10161016 .getBoolean (com .android .internal .R .bool .config_sms_utf8_support );
10171017
1018- if (!decodingtypeUTF8 ) {
1019- // Strip off any padding bytes, meaning any differences between the length of the
1020- // array and the target length specified by numFields. This is to avoid any
1021- // confusion by code elsewhere that only considers the payload array length.
1022- byte [] payload = new byte [userData .numFields ];
1023- int copyLen = userData .numFields < userData .payload .length
1024- ? userData .numFields : userData .payload .length ;
1018+ // Strip off any padding bytes, meaning any differences between the length of the
1019+ // array and the target length specified by numFields. This is to avoid any
1020+ // confusion by code elsewhere that only considers the payload array length.
1021+ byte [] payload = new byte [userData .numFields ];
1022+ int copyLen = userData .numFields < userData .payload .length
1023+ ? userData .numFields : userData .payload .length ;
10251024
1026- System .arraycopy (userData .payload , 0 , payload , 0 , copyLen );
1027- userData .payload = payload ;
1025+ System .arraycopy (userData .payload , 0 , payload , 0 , copyLen );
1026+ userData .payload = payload ;
10281027
1028+ if (!decodingtypeUTF8 ) {
10291029 // There are many devices in the market that send 8bit text sms (latin encoded) as
10301030 // octet encoded.
10311031 userData .payloadStr = decodeLatin (userData .payload , offset , userData .numFields );
0 commit comments