Projects >> frameworks_base_disabled >>0cb17a52ee278e6fd1575a086dac155e11574287

Chunk
Conflicting content
     * message identifier. Note that if two different clients enable the same
     * message identifier, they must both disable it for the device to stop
     * receiving those messages. All received messages will be broadcast in an
<<<<<<< HEAD
     * intent with the action "android.provider.telephony.SMS_CB_RECEIVED".
=======
     * intent with the action "android.provider.Telephony.SMS_CB_RECEIVED".
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739
     * Note: This call is blocking, callers may want to avoid calling it from
     * the main thread of an application.
     *
Solution content
     * message identifier. Note that if two different clients enable the same
     * message identifier, they must both disable it for the device to stop
     * receiving those messages. All received messages will be broadcast in an
     * intent with the action "android.provider.Telephony.SMS_CB_RECEIVED".
     * Note: This call is blocking, callers may want to avoid calling it from
     * the main thread of an application.
     *
File
SmsManager.java
Developer's decision
Version 2
Kind of conflict
Comment
Chunk
Conflicting content
        return success;
    }
<<<<<<< HEAD
=======

    /**
     * Enable reception of cell broadcast (SMS-CB) messages with the given
     * message identifier range. Note that if two different clients enable the same
     * message identifier, they must both disable it for the device to stop
     * receiving those messages. All received messages will be broadcast in an
     * intent with the action "android.provider.Telephony.SMS_CB_RECEIVED".
     * Note: This call is blocking, callers may want to avoid calling it from
     * the main thread of an application.
     *
     * @param startMessageId first message identifier as specified in TS 23.041
     * @param endMessageId last message identifier as specified in TS 23.041
     * @return true if successful, false otherwise
     * @see #disableCellBroadcastRange(int, int)
     *
     * {@hide}
     */
    public boolean enableCellBroadcastRange(int startMessageId, int endMessageId) {
        boolean success = false;

        try {
            ISms iccISms = ISms.Stub.asInterface(ServiceManager.getService("isms"));
            if (iccISms != null) {
                success = iccISms.enableCellBroadcastRange(startMessageId, endMessageId);
            }
        } catch (RemoteException ex) {
            // ignore it
        }

        return success;
    }

    /**
     * Disable reception of cell broadcast (SMS-CB) messages with the given
     * message identifier range. Note that if two different clients enable the same
     * message identifier, they must both disable it for the device to stop
     * receiving those messages.
     * Note: This call is blocking, callers may want to avoid calling it from
     * the main thread of an application.
     *
     * @param startMessageId first message identifier as specified in TS 23.041
     * @param endMessageId last message identifier as specified in TS 23.041
     * @return true if successful, false otherwise
     *
     * @see #enableCellBroadcastRange(int, int)
     *
     * {@hide}
     */
    public boolean disableCellBroadcastRange(int startMessageId, int endMessageId) {
        boolean success = false;

        try {
            ISms iccISms = ISms.Stub.asInterface(ServiceManager.getService("isms"));
            if (iccISms != null) {
                success = iccISms.disableCellBroadcastRange(startMessageId, endMessageId);
            }
        } catch (RemoteException ex) {
            // ignore it
        }

        return success;
    }
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739

    /**
     * Create a list of SmsMessages from a list of RawSmsData
Solution content
        return success;
    }

    /**
     * Enable reception of cell broadcast (SMS-CB) messages with the given
     * message identifier range. Note that if two different clients enable the same
     * message identifier, they must both disable it for the device to stop
     * receiving those messages. All received messages will be broadcast in an
     * intent with the action "android.provider.Telephony.SMS_CB_RECEIVED".
     * Note: This call is blocking, callers may want to avoid calling it from
     * the main thread of an application.
     *
     * @param startMessageId first message identifier as specified in TS 23.041
     * @param endMessageId last message identifier as specified in TS 23.041
     * @return true if successful, false otherwise
     * @see #disableCellBroadcastRange(int, int)
     *
     * {@hide}
     */
    public boolean enableCellBroadcastRange(int startMessageId, int endMessageId) {
        boolean success = false;

        try {
            ISms iccISms = ISms.Stub.asInterface(ServiceManager.getService("isms"));
            if (iccISms != null) {
                success = iccISms.enableCellBroadcastRange(startMessageId, endMessageId);
            }
        } catch (RemoteException ex) {
            // ignore it
        }

        return success;
    }

    /**
     * Disable reception of cell broadcast (SMS-CB) messages with the given
     * message identifier range. Note that if two different clients enable the same
     * message identifier, they must both disable it for the device to stop
     * receiving those messages.
     * Note: This call is blocking, callers may want to avoid calling it from
     * the main thread of an application.
     *
     * @param startMessageId first message identifier as specified in TS 23.041
     * @param endMessageId last message identifier as specified in TS 23.041
     * @return true if successful, false otherwise
     *
     * @see #enableCellBroadcastRange(int, int)
     *
     * {@hide}
     */
    public boolean disableCellBroadcastRange(int startMessageId, int endMessageId) {
        boolean success = false;

        try {
            ISms iccISms = ISms.Stub.asInterface(ServiceManager.getService("isms"));
            if (iccISms != null) {
                success = iccISms.disableCellBroadcastRange(startMessageId, endMessageId);
            }
        } catch (RemoteException ex) {
            // ignore it
        }

        return success;
    }

    /**
     * Create a list of SmsMessages from a list of RawSmsData
File
SmsManager.java
Developer's decision
Version 2
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
        return mIccSmsInterfaceManager.disableCellBroadcast(messageIdentifier);
    }

<<<<<<< HEAD
=======
    public boolean enableCellBroadcastRange(int startMessageId, int endMessageId)
            throws android.os.RemoteException {
        return mIccSmsInterfaceManager.enableCellBroadcastRange(startMessageId, endMessageId);
    }

    public boolean disableCellBroadcastRange(int startMessageId, int endMessageId)
            throws android.os.RemoteException {
        return mIccSmsInterfaceManager.disableCellBroadcastRange(startMessageId, endMessageId);
    }
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739
}
Solution content
        return mIccSmsInterfaceManager.disableCellBroadcast(messageIdentifier);
    }

    public boolean enableCellBroadcastRange(int startMessageId, int endMessageId)
            throws android.os.RemoteException {
        return mIccSmsInterfaceManager.enableCellBroadcastRange(startMessageId, endMessageId);
    }

    public boolean disableCellBroadcastRange(int startMessageId, int endMessageId)
            throws android.os.RemoteException {
        return mIccSmsInterfaceManager.disableCellBroadcastRange(startMessageId, endMessageId);
    }
}
File
IccSmsInterfaceManagerProxy.java
Developer's decision
Version 2
Kind of conflict
Method declaration
Chunk
Conflicting content
=======

    protected abstract void handleBroadcastSms(AsyncResult ar);

<<<<<<< HEAD
    protected void dispatchBroadcastPdus(byte[][] pdus) {
        Intent intent = new Intent("android.provider.telephony.SMS_CB_RECEIVED");
        intent.putExtra("pdus", pdus);

        if (Config.LOGD)
            Log.d(TAG, "Dispatching " + pdus.length + " SMS CB pdus");

        dispatch(intent, "android.permission.RECEIVE_SMS");
    }

    protected void dispatchBroadcastPdus(byte[][] pdus, boolean isEmergencyMessage) {
        if (isEmergencyMessage) {
            Intent intent = new Intent(Intents.SMS_EMERGENCY_CB_RECEIVED_ACTION);
            intent.putExtra("pdus", pdus);
            if (Config.LOGD)
                Log.d(TAG, "Dispatching " + pdus.length + " emergency SMS CB pdus");

            dispatch(intent, "android.permission.RECEIVE_EMERGENCY_BROADCAST");
        } else {
            Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
            intent.putExtra("pdus", pdus);
            if (Config.LOGD)
                Log.d(TAG, "Dispatching " + pdus.length + " SMS CB pdus");

            dispatch(intent, "android.permission.RECEIVE_SMS");
        }
    }
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739
}
Solution content
        if (isEmergencyMessage) {

    protected abstract void handleBroadcastSms(AsyncResult ar);

    protected void dispatchBroadcastPdus(byte[][] pdus, boolean isEmergencyMessage) {
            Intent intent = new Intent(Intents.SMS_EMERGENCY_CB_RECEIVED_ACTION);
            intent.putExtra("pdus", pdus);
            if (Config.LOGD)
                Log.d(TAG, "Dispatching " + pdus.length + " emergency SMS CB pdus");

            dispatch(intent, "android.permission.RECEIVE_EMERGENCY_BROADCAST");
        } else {
            Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
            intent.putExtra("pdus", pdus);
            if (Config.LOGD)
                Log.d(TAG, "Dispatching " + pdus.length + " SMS CB pdus");

            dispatch(intent, "android.permission.RECEIVE_SMS");
        }
    }
}
File
SMSDispatcher.java
Developer's decision
Version 2
Kind of conflict
Method declaration
Chunk
Conflicting content
        return false;
    }

<<<<<<< HEAD
=======
    public boolean enableCellBroadcastRange(int startMessageId, int endMessageId) {
        // Not implemented
        Log.e(LOG_TAG, "Error! Not implemented for CDMA.");
        return false;
    }

    public boolean disableCellBroadcastRange(int startMessageId, int endMessageId) {
        // Not implemented
        Log.e(LOG_TAG, "Error! Not implemented for CDMA.");
        return false;
    }

>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739
    protected void log(String msg) {
        Log.d(LOG_TAG, "[RuimSmsInterfaceManager] " + msg);
    }
Solution content
        return false;
    }

    public boolean enableCellBroadcastRange(int startMessageId, int endMessageId) {
        // Not implemented
        Log.e(LOG_TAG, "Error! Not implemented for CDMA.");
        return false;
    }

    public boolean disableCellBroadcastRange(int startMessageId, int endMessageId) {
        // Not implemented
        Log.e(LOG_TAG, "Error! Not implemented for CDMA.");
        return false;
    }

    protected void log(String msg) {
        Log.d(LOG_TAG, "[RuimSmsInterfaceManager] " + msg);
    }
File
RuimSmsInterfaceManager.java
Developer's decision
Version 2
Kind of conflict
Method declaration
Chunk
Conflicting content
        Log.e(LOG_TAG, "[GSMPhone] setCellBroadcastSmsConfig() is obsolete; use SmsManager");
        response.sendToTarget();
    }
<<<<<<< HEAD

    public boolean isCspPlmnEnabled() {
        return mSIMRecords.isCspPlmnEnabled();
    }
=======
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739
}
Solution content
        Log.e(LOG_TAG, "[GSMPhone] setCellBroadcastSmsConfig() is obsolete; use SmsManager");
        response.sendToTarget();
    }
    public boolean isCspPlmnEnabled() {
        return mSIMRecords.isCspPlmnEnabled();
    }
}
File
GSMPhone.java
Developer's decision
Version 1
Kind of conflict
Method declaration
Chunk
Conflicting content
    }

    // This map holds incomplete concatenated messages waiting for assembly
<<<<<<< HEAD
    private HashMap mSmsCbPageMap =
            new HashMap();

=======
    private final HashMap mSmsCbPageMap =
            new HashMap();

    @Override
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739
    protected void handleBroadcastSms(AsyncResult ar) {
        try {
            byte[][] pdus = null;
Solution content
    }

    // This map holds incomplete concatenated messages waiting for assembly
    private final HashMap mSmsCbPageMap =
            new HashMap();

    @Override
    protected void handleBroadcastSms(AsyncResult ar) {
        try {
            byte[][] pdus = null;
File
GsmSMSDispatcher.java
Developer's decision
Version 2
Kind of conflict
Annotation
Attribute
Method invocation
Chunk
Conflicting content
                    for (int j = i; j < i + 8 && j < receivedPdu.length; j++) {
                        int b = receivedPdu[j] & 0xff;
                        if (b < 0x10) {
<<<<<<< HEAD
                            sb.append("0");
                        }
                        sb.append(Integer.toHexString(b)).append(" ");
=======
                            sb.append('0');
                        }
                        sb.append(Integer.toHexString(b)).append(' ');
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739
                    }
                    Log.d(TAG, sb.toString());
                }
Solution content
                    for (int j = i; j < i + 8 && j < receivedPdu.length; j++) {
                        int b = receivedPdu[j] & 0xff;
                        if (b < 0x10) {
                            sb.append('0');
                        }
                        sb.append(Integer.toHexString(b)).append(' ');
                    }
                    Log.d(TAG, sb.toString());
                }
File
GsmSMSDispatcher.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
                pdus[0] = receivedPdu;
            }

<<<<<<< HEAD
            dispatchBroadcastPdus(pdus);
=======
            boolean isEmergencyMessage = SmsCbHeader.isEmergencyMessage(header.messageIdentifier);
            dispatchBroadcastPdus(pdus, isEmergencyMessage);
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739

            // Remove messages that are out of scope to prevent the map from
            // growing indefinitely, containing incomplete messages that were
Solution content
                pdus[0] = receivedPdu;
            }

            boolean isEmergencyMessage = SmsCbHeader.isEmergencyMessage(header.messageIdentifier);
            dispatchBroadcastPdus(pdus, isEmergencyMessage);

            // Remove messages that are out of scope to prevent the map from
            // growing indefinitely, containing incomplete messages that were
File
GsmSMSDispatcher.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
    }

    public boolean enableCellBroadcast(int messageIdentifier) {
<<<<<<< HEAD
        if (DBG) log("enableCellBroadcast");
=======
        return enableCellBroadcastRange(messageIdentifier, messageIdentifier);
    }

    public boolean disableCellBroadcast(int messageIdentifier) {
        return disableCellBroadcastRange(messageIdentifier, messageIdentifier);
    }

    public boolean enableCellBroadcastRange(int startMessageId, int endMessageId) {
        if (DBG) log("enableCellBroadcastRange");
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739

        Context context = mPhone.getContext();
Solution content
    }

    public boolean enableCellBroadcast(int messageIdentifier) {
        return enableCellBroadcastRange(messageIdentifier, messageIdentifier);
    }

    public boolean disableCellBroadcast(int messageIdentifier) {
        return disableCellBroadcastRange(messageIdentifier, messageIdentifier);
    }

    public boolean enableCellBroadcastRange(int startMessageId, int endMessageId) {
        if (DBG) log("enableCellBroadcastRange");

        Context context = mPhone.getContext();
File
SimSmsInterfaceManager.java
Developer's decision
Version 2
Kind of conflict
If statement
Method declaration
Method invocation
Method signature
Return statement
Chunk
Conflicting content
        String client = context.getPackageManager().getNameForUid(
                Binder.getCallingUid());
<<<<<<< HEAD
        HashSet clients = mCellBroadcastSubscriptions.get(messageIdentifier);

        if (clients == null) {
            // This is a new message identifier
            clients = new HashSet();
            mCellBroadcastSubscriptions.put(messageIdentifier, clients);

            if (!updateCellBroadcastConfig()) {
                mCellBroadcastSubscriptions.remove(messageIdentifier);
                return false;
            }
        }

        clients.add(client);

        if (DBG)
            log("Added cell broadcast subscription for MID " + messageIdentifier
                    + " from client " + client);
=======

        if (!mCellBroadcastRangeManager.enableRange(startMessageId, endMessageId, client)) {
            log("Failed to add cell broadcast subscription for MID range " + startMessageId
                    + " to " + endMessageId + " from client " + client);
            return false;
        }

        if (DBG)
            log("Added cell broadcast subscription for MID range " + startMessageId
                    + " to " + endMessageId + " from client " + client);
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739

        return true;
    }
Solution content
        return true;


        String client = context.getPackageManager().getNameForUid(
                Binder.getCallingUid());

        if (!mCellBroadcastRangeManager.enableRange(startMessageId, endMessageId, client)) {
            log("Failed to add cell broadcast subscription for MID range " + startMessageId
                    + " to " + endMessageId + " from client " + client);
            return false;
        }

        if (DBG)
            log("Added cell broadcast subscription for MID range " + startMessageId
                    + " to " + endMessageId + " from client " + client);
    }
File
SimSmsInterfaceManager.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Variable
Chunk
Conflicting content
        return true;
    }

<<<<<<< HEAD
    public boolean disableCellBroadcast(int messageIdentifier) {
        if (DBG) log("disableCellBroadcast");
=======
    public boolean disableCellBroadcastRange(int startMessageId, int endMessageId) {
        if (DBG) log("disableCellBroadcastRange");
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739

        Context context = mPhone.getContext();
Solution content
        return true;
    }

    public boolean disableCellBroadcastRange(int startMessageId, int endMessageId) {
        if (DBG) log("disableCellBroadcastRange");

        Context context = mPhone.getContext();
File
SimSmsInterfaceManager.java
Developer's decision
Version 2
Kind of conflict
If statement
Method signature
Chunk
Conflicting content
        String client = context.getPackageManager().getNameForUid(
                Binder.getCallingUid());
<<<<<<< HEAD
        HashSet clients = mCellBroadcastSubscriptions.get(messageIdentifier);

        if (clients != null && clients.remove(client)) {
            if (DBG)
                log("Removed cell broadcast subscription for MID " + messageIdentifier
                        + " from client " + client);

            if (clients.isEmpty()) {
                mCellBroadcastSubscriptions.remove(messageIdentifier);
                updateCellBroadcastConfig();
            }
            return true;
        }

        return false;
    }

    private boolean updateCellBroadcastConfig() {
        Set messageIdentifiers = mCellBroadcastSubscriptions.keySet();

        if (messageIdentifiers.size() > 0) {
            SmsBroadcastConfigInfo[] configs =
                    new SmsBroadcastConfigInfo[messageIdentifiers.size()];
            int i = 0;

            for (int messageIdentifier : messageIdentifiers) {
                configs[i++] = new SmsBroadcastConfigInfo(messageIdentifier, messageIdentifier,
                        SMS_CB_CODE_SCHEME_MIN, SMS_CB_CODE_SCHEME_MAX, true);
            }

            return setCellBroadcastConfig(configs) && setCellBroadcastActivation(true);
        } else {
            return setCellBroadcastActivation(false);
=======

        if (!mCellBroadcastRangeManager.disableRange(startMessageId, endMessageId, client)) {
            log("Failed to remove cell broadcast subscription for MID range " + startMessageId
                    + " to " + endMessageId + " from client " + client);
            return false;
        }

        if (DBG)
            log("Removed cell broadcast subscription for MID range " + startMessageId
                    + " to " + endMessageId + " from client " + client);

        return true;
    }

    class CellBroadcastRangeManager extends IntRangeManager {
        private ArrayList mConfigList =
                new ArrayList();

        /**
         * Called when the list of enabled ranges has changed. This will be
         * followed by zero or more calls to {@link #addRange} followed by
         * a call to {@link #finishUpdate}.
         */
        protected void startUpdate() {
            mConfigList.clear();
        }

        /**
         * Called after {@link #startUpdate} to indicate a range of enabled
         * values.
         * @param startId the first id included in the range
         * @param endId the last id included in the range
         */
        protected void addRange(int startId, int endId, boolean selected) {
            mConfigList.add(new SmsBroadcastConfigInfo(startId, endId,
                        SMS_CB_CODE_SCHEME_MIN, SMS_CB_CODE_SCHEME_MAX, selected));
        }

        /**
         * Called to indicate the end of a range update started by the
         * previous call to {@link #startUpdate}.
         */
        protected boolean finishUpdate() {
            if (mConfigList.isEmpty()) {
                return setCellBroadcastActivation(false);
            } else {
                SmsBroadcastConfigInfo[] configs =
                        mConfigList.toArray(new SmsBroadcastConfigInfo[mConfigList.size()]);
                return setCellBroadcastConfig(configs) && setCellBroadcastActivation(true);
            }
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739
        }
    }
Solution content
        String client = context.getPackageManager().getNameForUid(
                Binder.getCallingUid());

        if (!mCellBroadcastRangeManager.disableRange(startMessageId, endMessageId, client)) {
            log("Failed to remove cell broadcast subscription for MID range " + startMessageId
                    + " to " + endMessageId + " from client " + client);
            return false;
        }

        if (DBG)
            log("Removed cell broadcast subscription for MID range " + startMessageId
                    + " to " + endMessageId + " from client " + client);

        return true;
    }

    class CellBroadcastRangeManager extends IntRangeManager {
        private ArrayList mConfigList =
                new ArrayList();

        /**
         * Called when the list of enabled ranges has changed. This will be
         * followed by zero or more calls to {@link #addRange} followed by
         * a call to {@link #finishUpdate}.
         */
        protected void startUpdate() {
            mConfigList.clear();
        }

        /**
         * Called after {@link #startUpdate} to indicate a range of enabled
         * values.
         * @param startId the first id included in the range
         * @param endId the last id included in the range
         */
        protected void addRange(int startId, int endId, boolean selected) {
            mConfigList.add(new SmsBroadcastConfigInfo(startId, endId,
                        SMS_CB_CODE_SCHEME_MIN, SMS_CB_CODE_SCHEME_MAX, selected));
        }

        /**
         * Called to indicate the end of a range update started by the
         * previous call to {@link #startUpdate}.
         */
        protected boolean finishUpdate() {
            if (mConfigList.isEmpty()) {
                return setCellBroadcastActivation(false);
            } else {
                SmsBroadcastConfigInfo[] configs =
                        mConfigList.toArray(new SmsBroadcastConfigInfo[mConfigList.size()]);
                return setCellBroadcastConfig(configs) && setCellBroadcastActivation(true);
            }
        }
    }
File
SimSmsInterfaceManager.java
Developer's decision
Version 2
Kind of conflict
Attribute
Class signature
Comment
For statement
If statement
Method declaration
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
    private boolean setCellBroadcastActivation(boolean activate) {
        if (DBG)
<<<<<<< HEAD
            log("Calling setCellBroadcastActivation(" + activate + ")");
=======
            log("Calling setCellBroadcastActivation(" + activate + ')');
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739

        synchronized (mLock) {
            Message response = mHandler.obtainMessage(EVENT_SET_BROADCAST_ACTIVATION_DONE);
Solution content
    private boolean setCellBroadcastActivation(boolean activate) {
        if (DBG)
            log("Calling setCellBroadcastActivation(" + activate + ')');

        synchronized (mLock) {
            Message response = mHandler.obtainMessage(EVENT_SET_BROADCAST_ACTIVATION_DONE);
File
SimSmsInterfaceManager.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
        return mSuccess;
    }

<<<<<<< HEAD
=======
    @Override
>>>>>>> ab79ee4adcbc6eb9fb9c509766753f65d3857739
    protected void log(String msg) {
        Log.d(LOG_TAG, "[SimSmsInterfaceManager] " + msg);
    }
Solution content
        return mSuccess;
    }

    @Override
    protected void log(String msg) {
        Log.d(LOG_TAG, "[SimSmsInterfaceManager] " + msg);
    }
File
SimSmsInterfaceManager.java
Developer's decision
Version 2
Kind of conflict
Annotation