Skip to content

Commit c8e82c9

Browse files
beaufortfrancoisChromium LUCI CQ
authored andcommitted
[WebNFC] Notify client once when error happens
Instead of calling `mClient.onError(error)` as many times as the number of watchers, this CL makes sure we only call it once as the client takes care of dispatching to all readers. Bug: 520391 Change-Id: I82f2cf985d86e824c8a8cb9cbec85b7016334484 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2557018 Reviewed-by: Rijubrata Bhaumik <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Commit-Queue: François Beaufort <[email protected]> Cr-Commit-Position: refs/heads/master@{#832234}
1 parent 6231ee5 commit c8e82c9

File tree

1 file changed

+1
-3
lines changed
  • services/device/nfc/android/java/src/org/chromium/device/nfc

1 file changed

+1
-3
lines changed

services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,7 @@ private void processPendingWatchOperations() {
560560
* Notify all active watchers that an error happened when trying to read the tag coming nearby.
561561
*/
562562
private void notifyErrorToAllWatchers(NdefError error) {
563-
for (int i = 0; i < mWatchIds.size(); i++) {
564-
mClient.onError(error);
565-
}
563+
if (mWatchIds.size() != 0) mClient.onError(error);
566564
}
567565

568566
/**

0 commit comments

Comments
 (0)