Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95dbfaf1 authored by Steve Kondik's avatar Steve Kondik
Browse files

Merge tag 'android-4.2.2_r1' of...

Merge tag 'android-4.2.2_r1' of https://android.googlesource.com/platform/frameworks/opt/telephony into 1.1

Android 4.2.2 release 1

Conflicts:
	src/java/com/android/internal/telephony/CallManager.java

Change-Id: Ia67be62cdd0f4f7123a19706ada701449897c796
parents 91c91511 f08c4c89
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -404,14 +404,20 @@ public final class CallManager {
        // but only on audio mode transitions
        switch (state) {
            case RINGING:
                if (lastAudioMode != AudioManager.MODE_RINGTONE) {
                    updateRingingAudioFocus(context);
                int curAudioMode = audioManager.getMode();
                if (curAudioMode != AudioManager.MODE_RINGTONE) {
                    // only request audio focus if the ringtone is going to be heard
                    if (audioManager.getStreamVolume(AudioManager.STREAM_RING) > 0) {
                        if (VDBG) Log.d(LOG_TAG, "requestAudioFocus on STREAM_RING");
                        audioManager.requestAudioFocusForCall(AudioManager.STREAM_RING,
                                AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
                    }
                    if(!mSpeedUpAudioForMtCall) {
                        audioManager.setMode(AudioManager.MODE_RINGTONE);
                    }
                }

                if (mSpeedUpAudioForMtCall && lastAudioMode != AudioManager.MODE_IN_CALL) {
                if (mSpeedUpAudioForMtCall && (curAudioMode != AudioManager.MODE_IN_CALL)) {
                    audioManager.setMode(AudioManager.MODE_IN_CALL);
                }
                break;
@@ -428,7 +434,7 @@ public final class CallManager {
                    // enable IN_COMMUNICATION audio mode instead for sipPhone
                    newAudioMode = AudioManager.MODE_IN_COMMUNICATION;
                }
                if (lastAudioMode != newAudioMode || mSpeedUpAudioForMtCall) {
                if (audioManager.getMode() != newAudioMode || mSpeedUpAudioForMtCall) {
                    // request audio focus before setting the new mode
                    if (VDBG) Log.d(LOG_TAG, "requestAudioFocus on STREAM_VOICE_CALL");
                    audioManager.requestAudioFocusForCall(AudioManager.STREAM_VOICE_CALL,
+54 −7
Original line number Diff line number Diff line
@@ -88,6 +88,8 @@ public abstract class IccFileHandler extends Handler implements IccConstants {
    static protected final int EVENT_READ_IMG_DONE = 9;
    /** Finished retrieving icon data; post result. */
    static protected final int EVENT_READ_ICON_DONE = 10;
    /** Finished retrieving size of record for EFimg now. */
    static protected final int EVENT_GET_RECORD_SIZE_IMG_DONE = 11;

     // member variables
    protected final CommandsInterface mCi;
@@ -162,14 +164,14 @@ public abstract class IccFileHandler extends Handler implements IccConstants {
     *
     */
    public void loadEFImgLinearFixed(int recordNum, Message onLoaded) {
        Message response = obtainMessage(EVENT_READ_IMG_DONE,
        Message response = obtainMessage(EVENT_GET_RECORD_SIZE_IMG_DONE,
                new LoadLinearFixedContext(IccConstants.EF_IMG, recordNum,
                        onLoaded));

        // TODO(): Verify when path changes are done.
        mCi.iccIOForApp(COMMAND_GET_RESPONSE, IccConstants.EF_IMG, "img",
                recordNum, READ_RECORD_MODE_ABSOLUTE,
                GET_RESPONSE_EF_IMG_SIZE_BYTES, null, null, mAid, response);
        mCi.iccIOForApp(COMMAND_GET_RESPONSE, IccConstants.EF_IMG,
                    getEFPath(IccConstants.EF_IMG), recordNum,
                    READ_RECORD_MODE_ABSOLUTE, GET_RESPONSE_EF_IMG_SIZE_BYTES,
                    null, null, mAid, response);
    }

    /**
@@ -257,8 +259,17 @@ public abstract class IccFileHandler extends Handler implements IccConstants {
        Message response = obtainMessage(EVENT_READ_ICON_DONE, fileid, 0,
                onLoaded);

        mCi.iccIOForApp(COMMAND_READ_BINARY, fileid, "img", highOffset, lowOffset,
                length, null, null, mAid, response);
        logd("IccFileHandler: loadEFImgTransparent fileid = " + fileid
                + " filePath = " + getEFPath(fileid) + " highOffset = " + highOffset
                + " lowOffset = " + lowOffset + " length = " + length);
        /*
         * Per TS 31.102, for displaying of Icon, under
         * DF Telecom and DF Graphics , EF instance(s) (4FXX,transparent files)
         * are present. The possible image file identifiers (EF instance) for
         * EF img ( 4F20, linear fixed file) are : 4F01 ... 4F05.
         */
        mCi.iccIOForApp(COMMAND_READ_BINARY, fileid, getEFPath(fileid),
                highOffset, lowOffset, length, null, null, mAid, response);
    }

    /**
@@ -322,6 +333,42 @@ public abstract class IccFileHandler extends Handler implements IccConstants {

        try {
            switch (msg.what) {
            case EVENT_GET_RECORD_SIZE_IMG_DONE:
                logd("IccFileHandler: get record size img done");
                ar = (AsyncResult) msg.obj;
                lc = (LoadLinearFixedContext) ar.userObj;
                result = (IccIoResult) ar.result;
                response = lc.onLoaded;

                if (ar.exception != null) {
                    sendResult(response, null, ar.exception);
                    break;
                }

                iccException = result.getException();

                if (iccException != null) {
                    sendResult(response, null, iccException);
                    break;
                }

                data = result.payload;
                lc.recordSize = data[RESPONSE_DATA_RECORD_LENGTH] & 0xFF;

                if ((TYPE_EF != data[RESPONSE_DATA_FILE_TYPE]) ||
                    (EF_TYPE_LINEAR_FIXED != data[RESPONSE_DATA_STRUCTURE])) {
                    loge("IccFileHandler: File type mismatch: Throw Exception");
                    throw new IccFileTypeMismatch();
                }

                logd("IccFileHandler: read EF IMG");
                mCi.iccIOForApp(COMMAND_READ_RECORD, lc.efid, getEFPath(lc.efid),
                        lc.recordNum,
                        READ_RECORD_MODE_ABSOLUTE,
                        lc.recordSize, null, null, mAid,
                        obtainMessage(EVENT_READ_IMG_DONE, IccConstants.EF_IMG, 0, response));
                break;

            case EVENT_READ_IMG_DONE:
                ar = (AsyncResult) msg.obj;
                lc = (LoadLinearFixedContext) ar.userObj;
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ public class SmsUsageMonitor {
    private static final String SHORT_CODE_PATH = "/data/misc/sms/codes";

    /** Default checking period for SMS sent without user permission. */
    private static final int DEFAULT_SMS_CHECK_PERIOD = 1800000;    // 30 minutes
    private static final int DEFAULT_SMS_CHECK_PERIOD = 60000;      // 1 minute

    /** Default number of SMS sent in checking period without user permission. */
    private static final int DEFAULT_SMS_MAX_COUNT = 30;
+1 −1
Original line number Diff line number Diff line
@@ -204,7 +204,7 @@ class CommandParamsFactory extends Handler {
        int iconIndex = 0;

        if (data == null) {
            return ResultCode.PRFRMD_ICON_NOT_DISPLAYED;
            return ResultCode.OK;
        }
        switch(mIconLoadState) {
        case LOAD_SINGLE_ICON:
+7 −4
Original line number Diff line number Diff line
@@ -167,29 +167,32 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
                                operatorNumeric + " e=" + e);
                        mnc = Integer.MAX_VALUE;
                    }

                    // Use Integer#decode to be generous in what we receive and allow
                    // decimal, hex or octal values.
                    try {
                        tac = Integer.parseInt(states[6], 16);
                        tac = Integer.decode(states[6]);
                    } catch (Exception e) {
                        loge("handlePollStateResultMessage: bad tac states[6]=" +
                                states[6] + " e=" + e);
                        tac = Integer.MAX_VALUE;
                    }
                    try {
                        pci = Integer.parseInt(states[7], 16);
                        pci = Integer.decode(states[7]);
                    } catch (Exception e) {
                        loge("handlePollStateResultMessage: bad pci states[7]=" +
                                states[7] + " e=" + e);
                        pci = Integer.MAX_VALUE;
                    }
                    try {
                        eci = Integer.parseInt(states[8], 16);
                        eci = Integer.decode(states[8]);
                    } catch (Exception e) {
                        loge("handlePollStateResultMessage: bad eci states[8]=" +
                                states[8] + " e=" + e);
                        eci = Integer.MAX_VALUE;
                    }
                    try {
                        csgid = Integer.parseInt(states[9], 16);
                        csgid = Integer.decode(states[9]);
                    } catch (Exception e) {
                        // FIX: Always bad so don't pollute the logs
                        // loge("handlePollStateResultMessage: bad csgid states[9]=" +
Loading