Projects >> android-frameworks-base-with-screenshot-tweaks >>ee60f3fb1b4e61ac8027293a658ba710e36d36b6

Chunk
Conflicting content
package com.android.internal.telephony;

<<<<<<< HEAD
import android.text.TextUtils;
=======
import android.content.res.Resources;
>>>>>>> 18cc814c94edb188b73a92f0d34878d9dc054ff6
import android.util.SparseIntArray;

import android.util.Log;
Solution content
package com.android.internal.telephony;

import android.content.res.Resources;
import android.text.TextUtils;
import android.util.SparseIntArray;

import android.util.Log;
File
GsmAlphabet.java
Developer's decision
Concatenation
Kind of conflict
Import
Chunk
Conflicting content
import android.util.Log;

<<<<<<< HEAD
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
=======
import com.android.internal.R;

import java.util.ArrayList;
import java.util.List;

import static android.telephony.SmsMessage.ENCODING_7BIT;
import static android.telephony.SmsMessage.MAX_USER_DATA_SEPTETS;
import static android.telephony.SmsMessage.MAX_USER_DATA_SEPTETS_WITH_HEADER;
>>>>>>> 18cc814c94edb188b73a92f0d34878d9dc054ff6

/**
 * This class implements the character set mapping between
Solution content
import android.util.Log;

import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import com.android.internal.R;

import java.util.ArrayList;
import java.util.List;

import static android.telephony.SmsMessage.ENCODING_7BIT;
import static android.telephony.SmsMessage.MAX_USER_DATA_SEPTETS;
import static android.telephony.SmsMessage.MAX_USER_DATA_SEPTETS_WITH_HEADER;

/**
 * This class implements the character set mapping between
File
GsmAlphabet.java
Developer's decision
Concatenation
Kind of conflict
Import
Chunk
Conflicting content
     */
    public static String
    gsm8BitUnpackedToString(byte[] data, int offset, int length) {
<<<<<<< HEAD
        return gsm8BitUnpackedToString(data, offset, length, "");
    }

    /**
     * Convert a GSM alphabet string that's stored in 8-bit unpacked
     * format (as it often appears in SIM records) into a String
     *
     * Field may be padded with trailing 0xff's. The decode stops
     * at the first 0xff encountered.
     *
     * Additionally, in some country(ex. Korea), there are non-ASCII or MBCS characters.
     * If a character set is given, characters in data are treat as MBCS.
     */
    public static String
    gsm8BitUnpackedToString(byte[] data, int offset, int length, String characterset) {
        boolean isMbcs = false;
        Charset charset = null;
        ByteBuffer mbcsBuffer = null;

        if (!TextUtils.isEmpty(characterset)
                && !characterset.equalsIgnoreCase("us-ascii")
                && Charset.isSupported(characterset)) {
            isMbcs = true;
            charset = Charset.forName(characterset);
            mbcsBuffer = ByteBuffer.allocate(2);
        }
        boolean prevWasEscape;
        StringBuilder ret = new StringBuilder(length);
=======
        // Always use GSM 7 bit default alphabet table for this method
        String languageTableToChar = sLanguageTables[0];
        String shiftTableToChar = sLanguageShiftTables[0];
>>>>>>> 18cc814c94edb188b73a92f0d34878d9dc054ff6

        StringBuilder ret = new StringBuilder(length);
        boolean prevWasEscape = false;
Solution content
     */
    public static String
    gsm8BitUnpackedToString(byte[] data, int offset, int length) {
        return gsm8BitUnpackedToString(data, offset, length, "");
    }

    /**
     * Convert a GSM alphabet string that's stored in 8-bit unpacked
     * format (as it often appears in SIM records) into a String
     *
     * Field may be padded with trailing 0xff's. The decode stops
     * at the first 0xff encountered.
     *
     * Additionally, in some country(ex. Korea), there are non-ASCII or MBCS characters.
     * If a character set is given, characters in data are treat as MBCS.
     */
    public static String
    gsm8BitUnpackedToString(byte[] data, int offset, int length, String characterset) {
        boolean isMbcs = false;
        Charset charset = null;
        ByteBuffer mbcsBuffer = null;

        if (!TextUtils.isEmpty(characterset)
                && !characterset.equalsIgnoreCase("us-ascii")
                && Charset.isSupported(characterset)) {
            isMbcs = true;
            charset = Charset.forName(characterset);
            mbcsBuffer = ByteBuffer.allocate(2);
        }

        // Always use GSM 7 bit default alphabet table for this method
        String languageTableToChar = sLanguageTables[0];
        String shiftTableToChar = sLanguageShiftTables[0];

        StringBuilder ret = new StringBuilder(length);
        boolean prevWasEscape = false;
File
GsmAlphabet.java
Developer's decision
Combination
Kind of conflict
Array access
Comment
If statement
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
<<<<<<< HEAD
                        ret.append(shiftChar);
                    }
                } else {
                    if (!isMbcs || c < 0x80 || i + 1 >= offset + length) {
                        ret.append((char)gsmToChar.get(c, ' '));
                    } else {
                        // isMbcs must be true. So both mbcsBuffer and charset are initialized.
                        mbcsBuffer.clear();
                        mbcsBuffer.put(data, i++, 2);
                        mbcsBuffer.flip();
                        ret.append(charset.decode(mbcsBuffer).toString());
                    }
=======
                    ret.append(languageTableToChar.charAt(c));
>>>>>>> 18cc814c94edb188b73a92f0d34878d9dc054ff6
                }
                prevWasEscape = false;
            }
Solution content
                        ret.append(shiftChar);
                    }
                } else {
                    if (!isMbcs || c < 0x80 || i + 1 >= offset + length) {
                        ret.append(languageTableToChar.charAt(c));
                    } else {
                        // isMbcs must be true. So both mbcsBuffer and charset are initialized.
                        mbcsBuffer.clear();
                        mbcsBuffer.put(data, i++, 2);
                        mbcsBuffer.flip();
                        ret.append(charset.decode(mbcsBuffer).toString());
                    }
                }
                prevWasEscape = false;
            }
File
GsmAlphabet.java
Developer's decision
Combination
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
            return userDataHeader;
        }

<<<<<<< HEAD
/*
        XXX Not sure what this one is supposed to be doing, and no one is using
        it.
        String getUserDataGSM8bit() {
            // System.out.println("remainder of pdu:" +
            // HexDump.dumpHexString(pdu, cur, pdu.length - cur));
            int count = pdu[cur++] & 0xff;
            int size = pdu[cur++];

            // skip over header for now
            cur += size;

            if (pdu[cur - 1] == 0x01) {
                int tid = pdu[cur++] & 0xff;
                int type = pdu[cur++] & 0xff;

                size = pdu[cur++] & 0xff;

                int i = cur;

                while (pdu[i++] != '\0') {
                }

                int length = i - cur;
                String mimeType = new String(pdu, cur, length);

                cur += length;

                if (false) {
                    System.out.println("tid = 0x" + HexDump.toHexString(tid));
                    System.out.println("type = 0x" + HexDump.toHexString(type));
                    System.out.println("header size = " + size);
                    System.out.println("mimeType = " + mimeType);
                    System.out.println("remainder of header:" +
                     HexDump.dumpHexString(pdu, cur, (size - mimeType.length())));
                }

                cur += size - mimeType.length();

                // System.out.println("data count = " + count + " cur = " + cur
                // + " :" + HexDump.dumpHexString(pdu, cur, pdu.length - cur));

                MMSMessage msg = MMSMessage.parseEncoding(mContext, pdu, cur,
                        pdu.length - cur);
            } else {
                System.out.println(new String(pdu, cur, pdu.length - cur - 1));
            }

            return IccUtils.bytesToHexString(pdu);
        }
*/

=======
>>>>>>> 18cc814c94edb188b73a92f0d34878d9dc054ff6
        /**
         * Interprets the user data payload as packed GSM 7bit characters, and
         * decodes them into a String.
Solution content
            return userDataHeader;
        }

        /**
         * Interprets the user data payload as packed GSM 7bit characters, and
         * decodes them into a String.
File
SmsMessage.java
Developer's decision
Version 2
Kind of conflict
Comment