Merge change 6146 into donut
* changes: Fixing 1949086 Sholes telephony crash after waking from sleep.
This commit is contained in:
@@ -96,6 +96,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
* Constants for the data connection activity:
|
* Constants for the data connection activity:
|
||||||
* physical link down/up
|
* physical link down/up
|
||||||
*/
|
*/
|
||||||
|
private static final int DATA_CONNECTION_ACTIVE_PH_LINK_INACTIVE = 0;
|
||||||
private static final int DATA_CONNECTION_ACTIVE_PH_LINK_DOWN = 1;
|
private static final int DATA_CONNECTION_ACTIVE_PH_LINK_DOWN = 1;
|
||||||
private static final int DATA_CONNECTION_ACTIVE_PH_LINK_UP = 2;
|
private static final int DATA_CONNECTION_ACTIVE_PH_LINK_UP = 2;
|
||||||
|
|
||||||
@@ -832,7 +833,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onCdmaDataAttached() {
|
private void onCdmaDataDetached() {
|
||||||
if (state == State.CONNECTED) {
|
if (state == State.CONNECTED) {
|
||||||
startNetStatPoll();
|
startNetStatPoll();
|
||||||
phone.notifyDataConnection(Phone.REASON_CDMA_DATA_DETACHED);
|
phone.notifyDataConnection(Phone.REASON_CDMA_DATA_DETACHED);
|
||||||
@@ -852,6 +853,14 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void writeEventLogCdmaDataDrop() {
|
||||||
|
CdmaCellLocation loc = (CdmaCellLocation)(phone.getCellLocation());
|
||||||
|
int bsid = (loc != null) ? loc.getBaseStationId() : -1;
|
||||||
|
EventLog.List val = new EventLog.List(bsid,
|
||||||
|
TelephonyManager.getDefault().getNetworkType());
|
||||||
|
EventLog.writeEvent(TelephonyEventLog.EVENT_LOG_CDMA_DATA_DROP, val);
|
||||||
|
}
|
||||||
|
|
||||||
protected void onDataStateChanged (AsyncResult ar) {
|
protected void onDataStateChanged (AsyncResult ar) {
|
||||||
ArrayList<DataCallState> dataCallStates = (ArrayList<DataCallState>)(ar.result);
|
ArrayList<DataCallState> dataCallStates = (ArrayList<DataCallState>)(ar.result);
|
||||||
|
|
||||||
@@ -863,24 +872,37 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (state == State.CONNECTED) {
|
if (state == State.CONNECTED) {
|
||||||
if (dataCallStates.get(0).active == DATA_CONNECTION_ACTIVE_PH_LINK_UP ) {
|
if (dataCallStates.size() >= 1) {
|
||||||
|
switch (dataCallStates.get(0).active) {
|
||||||
|
case DATA_CONNECTION_ACTIVE_PH_LINK_UP:
|
||||||
|
Log.v(LOG_TAG, "onDataStateChanged: active=LINK_ACTIVE && CONNECTED, ignore");
|
||||||
activity = Activity.NONE;
|
activity = Activity.NONE;
|
||||||
phone.notifyDataActivity();
|
phone.notifyDataActivity();
|
||||||
} else if (dataCallStates.get(0).active == DATA_CONNECTION_ACTIVE_PH_LINK_DOWN ) {
|
break;
|
||||||
|
case DATA_CONNECTION_ACTIVE_PH_LINK_INACTIVE:
|
||||||
|
Log.v(LOG_TAG,
|
||||||
|
"onDataStateChanged active=LINK_INACTIVE && CONNECTED, disconnecting/cleanup");
|
||||||
|
writeEventLogCdmaDataDrop();
|
||||||
|
cleanUpConnection(true, null);
|
||||||
|
break;
|
||||||
|
case DATA_CONNECTION_ACTIVE_PH_LINK_DOWN:
|
||||||
|
Log.v(LOG_TAG, "onDataStateChanged active=LINK_DOWN && CONNECTED, dormant");
|
||||||
activity = Activity.DORMANT;
|
activity = Activity.DORMANT;
|
||||||
phone.notifyDataActivity();
|
phone.notifyDataActivity();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Log.v(LOG_TAG, "onDataStateChanged: IGNORE unexpected DataCallState.active="
|
||||||
|
+ dataCallStates.get(0).active);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Log.v(LOG_TAG, "onDataStateChanged: network disconnected, clean up");
|
||||||
CdmaCellLocation loc = (CdmaCellLocation)(phone.getCellLocation());
|
writeEventLogCdmaDataDrop();
|
||||||
int bsid = (loc != null) ? loc.getBaseStationId() : -1;
|
|
||||||
EventLog.List val = new EventLog.List(bsid,
|
|
||||||
TelephonyManager.getDefault().getNetworkType());
|
|
||||||
EventLog.writeEvent(TelephonyEventLog.EVENT_LOG_CDMA_DATA_DROP, val);
|
|
||||||
|
|
||||||
cleanUpConnection(true, null);
|
cleanUpConnection(true, null);
|
||||||
}
|
}
|
||||||
Log.i(LOG_TAG, "Data connection has changed.");
|
} else {
|
||||||
|
// TODO: Do we need to do anything?
|
||||||
|
Log.i(LOG_TAG, "onDataStateChanged: not connected, state=" + state + " ignoring");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String getInterfaceName() {
|
String getInterfaceName() {
|
||||||
@@ -932,7 +954,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EVENT_CDMA_DATA_DETACHED:
|
case EVENT_CDMA_DATA_DETACHED:
|
||||||
onCdmaDataAttached();
|
onCdmaDataDetached();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVENT_DATA_STATE_CHANGED:
|
case EVENT_DATA_STATE_CHANGED:
|
||||||
|
|||||||
Reference in New Issue
Block a user