Fix ClassCastException
In "Change I95ed2aae: Stop using shared DUN APN when tethering stops",
sha1: 8beff9586f, an assumption is made
that the msg.obj is always an ApnContext, this is not true for CDMA.
Eventually we plan on removing the destinction between GSM and CDMA but
for now we need to handle it handle it.
Bug: 5904734
Change-Id: I86873dc7aeda5234c14a6fe1e4ec7345ee30e957
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user