summaryrefslogtreecommitdiffstats
path: root/src/java/com/android
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2013-02-13 00:31:05 -0800
committerSteve Kondik <shade@chemlab.org>2013-02-13 00:31:05 -0800
commit95dbfaf134fcea7005a38d0e482e1c595d0050f9 (patch)
treec8228cbf976543aca0ff1e1d807f44ed44866854 /src/java/com/android
parent91c91511c9c3b92e4b3e9b4a66cd03786f267cab (diff)
parentf08c4c89622ddcbc4ed9315fe6b399941dad4939 (diff)
downloadframeworks_opt_telephony-95dbfaf134fcea7005a38d0e482e1c595d0050f9.zip
frameworks_opt_telephony-95dbfaf134fcea7005a38d0e482e1c595d0050f9.tar.gz
frameworks_opt_telephony-95dbfaf134fcea7005a38d0e482e1c595d0050f9.tar.bz2
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
Diffstat (limited to 'src/java/com/android')
-rw-r--r--src/java/com/android/internal/telephony/CallManager.java18
-rw-r--r--src/java/com/android/internal/telephony/IccFileHandler.java61
-rw-r--r--src/java/com/android/internal/telephony/SmsUsageMonitor.java2
-rw-r--r--src/java/com/android/internal/telephony/cat/CommandParamsFactory.java2
-rw-r--r--src/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java11
-rw-r--r--src/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java2
6 files changed, 76 insertions, 20 deletions
diff --git a/src/java/com/android/internal/telephony/CallManager.java b/src/java/com/android/internal/telephony/CallManager.java
index c4d5a6c..ddf1f78 100644
--- a/src/java/com/android/internal/telephony/CallManager.java
+++ b/src/java/com/android/internal/telephony/CallManager.java
@@ -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);
- if (!mSpeedUpAudioForMtCall) {
+ 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,
@@ -628,7 +634,7 @@ public final class CallManager {
int currMode = audioManager.getMode();
if ((currMode != AudioManager.MODE_IN_CALL) && !(ringingPhone instanceof SipPhone)) {
Log.d(LOG_TAG, "setAudioMode Setting audio mode from " +
- currMode + " to " + AudioManager.MODE_IN_CALL);
+ currMode + " to " + AudioManager.MODE_IN_CALL);
audioManager.setMode(AudioManager.MODE_IN_CALL);
mSpeedUpAudioForMtCall = true;
}
diff --git a/src/java/com/android/internal/telephony/IccFileHandler.java b/src/java/com/android/internal/telephony/IccFileHandler.java
index 98ab17b..fd4e3cc 100644
--- a/src/java/com/android/internal/telephony/IccFileHandler.java
+++ b/src/java/com/android/internal/telephony/IccFileHandler.java
@@ -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;
diff --git a/src/java/com/android/internal/telephony/SmsUsageMonitor.java b/src/java/com/android/internal/telephony/SmsUsageMonitor.java
index 5490c13..c2d764b 100644
--- a/src/java/com/android/internal/telephony/SmsUsageMonitor.java
+++ b/src/java/com/android/internal/telephony/SmsUsageMonitor.java
@@ -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;
diff --git a/src/java/com/android/internal/telephony/cat/CommandParamsFactory.java b/src/java/com/android/internal/telephony/cat/CommandParamsFactory.java
index 4f6a7b2..36993b6 100644
--- a/src/java/com/android/internal/telephony/cat/CommandParamsFactory.java
+++ b/src/java/com/android/internal/telephony/cat/CommandParamsFactory.java
@@ -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:
diff --git a/src/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java b/src/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
index b4a5dc7..5354a2d 100644
--- a/src/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
+++ b/src/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
@@ -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]=" +
diff --git a/src/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/src/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index d7a4d8c..8a4f07e 100644
--- a/src/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/src/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -616,7 +616,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
// update APN availability so that APN can be enabled.
notifyOffApnsOfAvailability(Phone.REASON_DATA_ATTACHED);
}
-
+ mAutoAttachOnCreation = true;
setupDataOnReadyApns(Phone.REASON_DATA_ATTACHED);
}