mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 911006 - B2G RIL: Improve the flow of requestNetworkInfo in ril_worker.js. r=hsinyi
This commit is contained in:
parent
3ceec5c14a
commit
f46298fd44
@ -353,6 +353,14 @@ let RIL = {
|
||||
*/
|
||||
this._processingNetworkInfo = false;
|
||||
|
||||
/**
|
||||
* Multiple requestNetworkInfo() in a row before finishing the first
|
||||
* request, hence we need to fire requestNetworkInfo() again after
|
||||
* gathering all necessary stuffs. This is to make sure that ril_worker
|
||||
* gets precise network information.
|
||||
*/
|
||||
this._needRepollNetworkInfo = false;
|
||||
|
||||
/**
|
||||
* Pending messages to be send in batch from requestNetworkInfo()
|
||||
*/
|
||||
@ -1130,6 +1138,7 @@ let RIL = {
|
||||
requestNetworkInfo: function requestNetworkInfo() {
|
||||
if (this._processingNetworkInfo) {
|
||||
if (DEBUG) debug("Network info requested, but we're already requesting network info.");
|
||||
this._needRepollNetworkInfo = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3142,6 +3151,11 @@ let RIL = {
|
||||
for (let i = 0; i < NETWORK_INFO_MESSAGE_TYPES.length; i++) {
|
||||
delete RIL._pendingNetworkInfo[NETWORK_INFO_MESSAGE_TYPES[i]];
|
||||
}
|
||||
|
||||
if (RIL._needRepollNetworkInfo) {
|
||||
RIL._needRepollNetworkInfo = false;
|
||||
RIL.requestNetworkInfo();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user