Merge "Don't accept a user-defined dun-capable connection" into gingerbread

This commit is contained in:
Robert Greenwalt
2011-03-10 10:41:36 -08:00
committed by Android (Google) Code Review

View File

@@ -361,6 +361,12 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
@Override
protected boolean isApnTypeActive(String type) {
// TODO: support simultaneous with List instead
if (Phone.APN_TYPE_DUN.equals(type)) {
ApnSetting dunApn = fetchDunApn();
if (dunApn != null) {
return ((mActiveApn != null) && (dunApn.toString().equals(mActiveApn.toString())));
}
}
return mActiveApn != null && mActiveApn.canHandleType(type);
}