Bug 713687 - Part 2 - Network API Android backend: listen to network changes and notify the DOM. r=dougt

This commit is contained in:
Mounir Lamouri committed 2012-01-17 19:40:39 +01:00
1 parent 307d171767
commit 92cf2dd6c8
9 files changed
+285 -90

No files matched your search

+10
View File
@@ -69,6 +69,8 @@ jfieldID AndroidGeckoEvent::jRangeForeColorField = 0;
jfieldID AndroidGeckoEvent::jRangeBackColorField = 0;
jfieldID AndroidGeckoEvent::jLocationField = 0;
jfieldID AndroidGeckoEvent::jAddressField = 0;
jfieldID AndroidGeckoEvent::jBandwidthField = 0;
jfieldID AndroidGeckoEvent::jCanBeMeteredField = 0;
jclass AndroidPoint::jPointClass = 0;
jfieldID AndroidPoint::jXField = 0;
@@ -177,6 +179,8 @@ AndroidGeckoEvent::InitGeckoEventClass(JNIEnv *jEnv)
jRangeBackColorField = getField("mRangeBackColor", "I");
jLocationField = getField("mLocation", "Landroid/location/Location;");
jAddressField = getField("mAddress", "Landroid/location/Address;");
jBandwidthField = getField("mBandwidth", "D");
jCanBeMeteredField = getField("mCanBeMetered", "Z");
}
void
@@ -491,6 +495,12 @@ AndroidGeckoEvent::Init(JNIEnv *jenv, jobject jobj)
break;
}
case NETWORK_CHANGED: {
mBandwidth = jenv->GetDoubleField(jobj, jBandwidthField);
mCanBeMetered = jenv->GetBooleanField(jobj, jCanBeMeteredField);
break;
}
default:
break;
}