Projects >> platform_frameworks_base >>56ce933cf125e5c2d365dbfddd5f3f7fb3d4f327

Chunk
Conflicting content
                    }
     */
    public static String
    adnStringFieldToString(byte[] data, int offset, int length) {
<<<<<<< HEAD
        if (length == 0) {
            return "";
        }
=======
        String s = adnStringFieldToStringUcs2Helper(data, offset, length);
        if (s == null) {
            s = adnStringFieldToStringGsm8BitHelper(data, offset, length);
        }
        return s;
    }

    /**
     * Almost identical to the method {@link #adnStringFieldToString}.
     *
     * Exception:
     * If the SIM is Korean (MCC equals "450"), KSC5601 encoding will be
     * assumed (instead of GSM8Bit). This could lead to unintended consequences,
     * if the ADN alphaTag was saved with GSM8Bit. This is considered an
     * acceptable risk.
     */
    public static String
    adnStringFieldToStringKsc5601Support(byte[] data, int offset, int length) {
        String s = adnStringFieldToStringUcs2Helper(data, offset, length);

        if (s == null) {
            if (SimRegionCache.getRegion() == SimRegionCache.MCC_KOREAN) {
                try {
                    int len = offset;
                    byte stop = (byte)0xFF;
                    while (len < length && data[len] != stop) {
                        len++;
                    return new String(data, offset, len, "KSC5601");
                } catch (UnsupportedEncodingException e) {
                    Log.e(LOG_TAG, "implausible UnsupportedEncodingException", e);
                }
            }

            return adnStringFieldToStringGsm8BitHelper(data, offset, length);
        }
        return s;
    }

    private static String
    adnStringFieldToStringUcs2Helper(byte[] data, int offset, int length) {
>>>>>>> b3177c135bb7a3db3318893335a9ac0bc39d9cf8
        if (length >= 1) {
            if (data[offset] == (byte) 0x80) {
                int ucslen = (length - 1) / 2;
Solution content
     */
    public static String
    adnStringFieldToString(byte[] data, int offset, int length) {
        if (length == 0) {
            return "";
        }
        if (length >= 1) {
            if (data[offset] == (byte) 0x80) {
                int ucslen = (length - 1) / 2;
File
IccUtils.java
Developer's decision
Version 1
Kind of conflict
Comment
If statement
Method declaration
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
            return ret.toString();
        }

<<<<<<< HEAD
        Resources resource = Resources.getSystem();
        String defaultCharset = "";
        try {
            defaultCharset =
                    resource.getString(com.android.internal.R.string.gsm_alphabet_default_charset);
        } catch (NotFoundException e) {
            // Ignore Exception and defaultCharset is set to a empty string.
        }
        return GsmAlphabet.gsm8BitUnpackedToString(data, offset, length, defaultCharset.trim());
=======
        return null;
    }

    private static String
    adnStringFieldToStringGsm8BitHelper(byte[] data, int offset, int length) {
        return GsmAlphabet.gsm8BitUnpackedToString(data, offset, length);
>>>>>>> b3177c135bb7a3db3318893335a9ac0bc39d9cf8
    }

    static int
Solution content
            return ret.toString();
        }

        Resources resource = Resources.getSystem();
        String defaultCharset = "";
        try {
            defaultCharset =
                    resource.getString(com.android.internal.R.string.gsm_alphabet_default_charset);
        } catch (NotFoundException e) {
            // Ignore Exception and defaultCharset is set to a empty string.
        }
        return GsmAlphabet.gsm8BitUnpackedToString(data, offset, length, defaultCharset.trim());
    }

    static int
File
IccUtils.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Method signature
Return statement
Try statement
Variable
Chunk
Conflicting content
        }

        /**
<<<<<<< HEAD
         * Interprets the user data payload as KSC-5601 characters, and
         * decodes them into a String.
=======
         * Interprets the user data payload as KSC5601 characters, and
         * decodes them into a String
>>>>>>> b3177c135bb7a3db3318893335a9ac0bc39d9cf8
         *
         * @param byteCount the number of bytes in the user data payload
         * @return a String with the decoded characters
Solution content
        }

        /**
         * Interprets the user data payload as KSC-5601 characters, and
         * decodes them into a String.
         *
         * @param byteCount the number of bytes in the user data payload
         * @return a String with the decoded characters
File
SmsMessage.java
Developer's decision
Version 1
Kind of conflict
Comment
Chunk
Conflicting content
            try {
                ret = new String(pdu, cur, byteCount, "KSC5601");
            } catch (UnsupportedEncodingException ex) {
<<<<<<< HEAD
                ret = "";
=======
                // Should return same as ENCODING_UNKNOWN on error.
                ret = null;
>>>>>>> b3177c135bb7a3db3318893335a9ac0bc39d9cf8
                Log.e(LOG_TAG, "implausible UnsupportedEncodingException", ex);
            }
Solution content
            try {
                ret = new String(pdu, cur, byteCount, "KSC5601");
            } catch (UnsupportedEncodingException ex) {
                ret = "";
                Log.e(LOG_TAG, "implausible UnsupportedEncodingException", ex);
            }
File
SmsMessage.java
Developer's decision
Version 1
Kind of conflict
Comment
Variable