Bug 1133390 - onfocuschanged(false) will be notified twice. r=dimi, a=bajaj
--- a/dom/nfc/gonk/Nfc.js
+++ b/dom/nfc/gonk/Nfc.js
@@ -173,18 +173,20 @@ XPCOMUtils.defineLazyGetter(this, "gMess
dump("invalid target");
return;
}
target.sendAsyncMessage("NFC:DOMEvent", options);
},
setFocusApp: function setFocusApp(id, isFocus) {
- // if calling setNFCFocus(true) on the same browser-element, ignore.
- if (isFocus && (id == this.focusApp)) {
+ // if calling setNFCFocus(true) on the browser-element which is already
+ // focused, or calling setNFCFocus(false) on the browser-element which has
+ // lost focus already, ignore.
+ if (isFocus == (id == this.focusApp)) {
return;
}
if (this.focusApp != NFC.SYSTEM_APP_ID) {
this.onFocusChanged(this.focusApp, false);
}
if (isFocus) {