summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Wang <johnwang@google.com>2010-01-14 17:07:30 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2010-01-14 17:07:30 -0800
commit7319d94ff1ca898c36d2da8dd0cd8469d91bc5af (patch)
treeb3b383c82f005e70c2a424a28564041db0bd68b0
parentb3699b14be3a3db1d75ea4c38853b0a53d14b1be (diff)
parent99f2a4bb519e390eacc9807443c74ca05f176242 (diff)
downloadframeworks_base-7319d94ff1ca898c36d2da8dd0cd8469d91bc5af.zip
frameworks_base-7319d94ff1ca898c36d2da8dd0cd8469d91bc5af.tar.gz
frameworks_base-7319d94ff1ca898c36d2da8dd0cd8469d91bc5af.tar.bz2
am 99f2a4bb: Merge "Add Event log for RAT switch." into eclair
Merge commit '99f2a4bb519e390eacc9807443c74ca05f176242' into eclair-plus-aosp * commit '99f2a4bb519e390eacc9807443c74ca05f176242': Add Event log for RAT switch.
-rw-r--r--telephony/java/com/android/internal/telephony/TelephonyEventLog.java1
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java16
2 files changed, 17 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/TelephonyEventLog.java b/telephony/java/com/android/internal/telephony/TelephonyEventLog.java
index cdce488..0f15cb6 100644
--- a/telephony/java/com/android/internal/telephony/TelephonyEventLog.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyEventLog.java
@@ -32,4 +32,5 @@ public final class TelephonyEventLog {
public static final int EVENT_LOG_PDP_NETWORK_DROP = 50109;
public static final int EVENT_LOG_CDMA_DATA_SETUP_FAILED = 50110;
public static final int EVENT_LOG_CDMA_DATA_DROP = 50111;
+ public static final int EVENT_LOG_GSM_RAT_SWITCHED = 50112;
}
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
index 8140654..3bf76d4 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
@@ -38,6 +38,7 @@ import android.provider.Settings.SettingNotFoundException;
import android.provider.Telephony.Intents;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
+import android.telephony.TelephonyManager;
import android.telephony.gsm.GsmCellLocation;
import android.text.TextUtils;
import android.util.Config;
@@ -848,6 +849,21 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
cellLoc = newCellLoc;
newCellLoc = tcl;
+
+ // Add an event log when network type switched
+ // TODO: we may add filtering to reduce the event logged,
+ // i.e. check preferred network setting, only switch to 2G, etc
+ if (hasNetworkTypeChanged) {
+ int cid = -1;
+ GsmCellLocation loc = ((GsmCellLocation)phone.getCellLocation());
+ if (loc != null) cid = loc.getCid();
+ EventLog.List val = new EventLog.List(cid, networkType, newNetworkType);
+ EventLog.writeEvent(TelephonyEventLog.EVENT_LOG_GSM_RAT_SWITCHED, val);
+ Log.d(LOG_TAG,
+ "RAT switched " + networkTypeToString(networkType) + " -> "
+ + networkTypeToString(newNetworkType) + " at cell " + cid);
+ }
+
gprsState = newGPRSState;
networkType = newNetworkType;