Merge "Fix ClassCastException"

This commit is contained in:
Wink Saville
2012-01-25 13:45:02 -08:00
committed by Android (Google) Code Review

View File

@@ -328,8 +328,11 @@ public abstract class DataConnection extends StateMachine {
String reason = null;
if (dp.onCompletedMsg != null) {
// Get ApnContext, but only valid on GSM devices this is a string on CDMA devices.
Message msg = dp.onCompletedMsg;
alreadySent = (ApnContext)msg.obj;
if (msg.obj instanceof ApnContext) {
alreadySent = (ApnContext)msg.obj;
}
reason = dp.reason;
if (VDBG) {
log(String.format("msg=%s msg.obj=%s", msg.toString(),