Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(660)

Issue 1842223003: Remove outdated devices from Android device chooser (Closed)

Created:
4 years, 8 months ago by perja
Modified:
4 years, 5 months ago
Reviewers:
scheib, ortuno
CC:
chromium-reviews, darin-cc_chromium.org, jam, ortuno+watch_chromium.org, scheib+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

On Android there is no notification when a device is lost. This change keeps track of when a device was last seen and removes outdated devices. This was already implemented for OSX and the code has been moved to make it accessible to Android as well. BUG=581544 Committed: https://crrev.com/849f95f6082cd71789e966de3b5a31ba87d1084e Cr-Commit-Position: refs/heads/master@{#401940}

Patch Set 1 : Re-populate the device chooser with known devices #

Patch Set 2 : Don't remove devices from device chooser #

Patch Set 3 : Remove devices from adapter if not seen for 30 seconds #

Patch Set 4 : Moved and updated unit tests #

Patch Set 5 : Rebased on master #

Patch Set 6 : Remove outdated devices before populating the chooser #

Patch Set 7 : Fixed unit test for ItemChooserDialog #

Total comments: 9

Patch Set 8 : Use timer to purge outdated devices for Android as well. #

Patch Set 9 : Changed timeout back to 180 seconds. #

Patch Set 10 : Rebased on master #

Total comments: 2

Patch Set 11 : Changed polling to 1 s when discovering and 11 s otherwise. #

Patch Set 12 : Rebased on master. #

Patch Set 13 : Fixed unit test. #

Patch Set 14 : Rebased on master. #

Total comments: 15

Patch Set 15 : Reverted clean-up in device chooser. #

Patch Set 16 : Don't purge devices continuously. Added more tests. #

Total comments: 15

Patch Set 17 : Address most of the review issues. #

Total comments: 8

Patch Set 18 : Fixed naming and type so that it follows C++ style guide. #

Total comments: 4

Patch Set 19 : Actually remove device before calling DeviceRemoved. #

Total comments: 2

Patch Set 20 : Rebased on latest master. #

Patch Set 21 : Reverted two small unnecessary changes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+281 lines, -192 lines) Patch
M device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +27 lines, -68 lines 0 comments Download
M device/bluetooth/bluetooth_adapter.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +9 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +36 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +7 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 8 chunks +74 lines, -4 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_mac.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -4 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +0 lines, -32 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_mac_unittest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +0 lines, -64 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +87 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_classic_device_mac.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_classic_device_mac.mm View 1 2 2 chunks +4 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_device.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 5 chunks +15 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_device.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +13 lines, -1 line 0 comments Download
M device/bluetooth/bluetooth_device_mac.h View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M device/bluetooth/bluetooth_low_energy_device_mac.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +0 lines, -6 lines 0 comments Download
M device/bluetooth/bluetooth_low_energy_device_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +1 line, -5 lines 0 comments Download
M device/bluetooth/test/bluetooth_test.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +2 lines, -0 lines 0 comments Download
M device/bluetooth/test/bluetooth_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 34 (8 generated)
perja
@scheib: Here is my suggestion for how to solve the problem with outdated devices in ...
4 years, 8 months ago (2016-04-06 14:52:07 UTC) #5
scheib
https://codereview.chromium.org/1842223003/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java File chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java (right): https://codereview.chromium.org/1842223003/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java#newcode395 chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java:395: @VisibleForTesting Is this needed for this patch? https://codereview.chromium.org/1842223003/diff/160001/content/browser/bluetooth/bluetooth_dispatcher_host.cc File ...
4 years, 8 months ago (2016-04-07 22:05:02 UTC) #6
perja
https://codereview.chromium.org/1842223003/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java File chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java (right): https://codereview.chromium.org/1842223003/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java#newcode395 chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java:395: @VisibleForTesting On 2016/04/07 22:05:02, scheib wrote: > Is this ...
4 years, 8 months ago (2016-04-08 07:47:35 UTC) #7
scheib
https://codereview.chromium.org/1842223003/diff/160001/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/1842223003/diff/160001/device/bluetooth/bluetooth_adapter.h#newcode430 device/bluetooth/bluetooth_adapter.h:430: void RemoveTimedOutDevices(); On 2016/04/08 07:47:35, perja wrote: > On ...
4 years, 8 months ago (2016-04-12 05:01:57 UTC) #8
perja
@scheib:please take a look again. It is using a timer to purge the devices now. ...
4 years, 7 months ago (2016-05-03 09:23:42 UTC) #9
scheib
Sorry I've been taking a while on this. It's a problem I'm unsure if we ...
4 years, 7 months ago (2016-05-06 00:41:50 UTC) #10
ortuno
On 2016/05/06 at 00:41:50, scheib wrote: > Sorry I've been taking a while on this. ...
4 years, 7 months ago (2016-05-06 16:09:53 UTC) #11
ortuno
On 2016/05/06 at 16:09:53, ortuno wrote: > On 2016/05/06 at 00:41:50, scheib wrote: > > ...
4 years, 7 months ago (2016-05-06 16:15:11 UTC) #12
scheib
On 2016/05/06 16:15:11, ortuno wrote: > On 2016/05/06 at 16:09:53, ortuno wrote: > > On ...
4 years, 7 months ago (2016-05-06 18:01:05 UTC) #13
perja
Change the code now so that it scans every second when there is an active ...
4 years, 6 months ago (2016-06-13 07:30:34 UTC) #14
ortuno
https://codereview.chromium.org/1842223003/diff/300001/chrome/browser/ui/android/bluetooth_chooser_android.cc File chrome/browser/ui/android/bluetooth_chooser_android.cc (left): https://codereview.chromium.org/1842223003/diff/300001/chrome/browser/ui/android/bluetooth_chooser_android.cc#oldcode106 chrome/browser/ui/android/bluetooth_chooser_android.cc:106: void BluetoothChooserAndroid::RemoveDevice(const std::string& device_id) { I would separate this ...
4 years, 6 months ago (2016-06-14 15:29:33 UTC) #16
perja
Addressed all the comments except the test case for classic devices which I'm not sure ...
4 years, 6 months ago (2016-06-15 13:03:40 UTC) #17
ortuno
Thanks for doing this! It's looking good! https://codereview.chromium.org/1842223003/diff/300001/chrome/browser/ui/android/bluetooth_chooser_android.cc File chrome/browser/ui/android/bluetooth_chooser_android.cc (left): https://codereview.chromium.org/1842223003/diff/300001/chrome/browser/ui/android/bluetooth_chooser_android.cc#oldcode106 chrome/browser/ui/android/bluetooth_chooser_android.cc:106: void BluetoothChooserAndroid::RemoveDevice(const ...
4 years, 6 months ago (2016-06-15 17:20:16 UTC) #18
perja
ortuno: I have address most of the issues you pointed out, but still a bit ...
4 years, 6 months ago (2016-06-17 13:39:27 UTC) #19
ortuno
I thought we had some support for testing BT Classic code but it seems there ...
4 years, 6 months ago (2016-06-17 19:31:41 UTC) #20
perja
Fixed the remaining review issues. https://codereview.chromium.org/1842223003/diff/360001/device/bluetooth/bluetooth_adapter_android.cc File device/bluetooth/bluetooth_adapter_android.cc (right): https://codereview.chromium.org/1842223003/diff/360001/device/bluetooth/bluetooth_adapter_android.cc#newcode239 device/bluetooth/bluetooth_adapter_android.cc:239: bool sessionAdded = false; ...
4 years, 6 months ago (2016-06-22 07:41:52 UTC) #21
ortuno
lgtm bar two nits https://codereview.chromium.org/1842223003/diff/380001/device/bluetooth/bluetooth_adapter.cc File device/bluetooth/bluetooth_adapter.cc (right): https://codereview.chromium.org/1842223003/diff/380001/device/bluetooth/bluetooth_adapter.cc#newcode388 device/bluetooth/bluetooth_adapter.cc:388: removed_devices.insert(it->first); nit: I would change ...
4 years, 6 months ago (2016-06-22 17:23:11 UTC) #22
perja
https://codereview.chromium.org/1842223003/diff/380001/device/bluetooth/bluetooth_adapter.cc File device/bluetooth/bluetooth_adapter.cc (right): https://codereview.chromium.org/1842223003/diff/380001/device/bluetooth/bluetooth_adapter.cc#newcode388 device/bluetooth/bluetooth_adapter.cc:388: removed_devices.insert(it->first); On 2016/06/22 17:23:11, ortuno wrote: > nit: I ...
4 years, 6 months ago (2016-06-23 14:31:26 UTC) #23
ortuno
lgtm with one small question/suggestion https://codereview.chromium.org/1842223003/diff/400001/device/bluetooth/bluetooth_adapter.cc File device/bluetooth/bluetooth_adapter.cc (right): https://codereview.chromium.org/1842223003/diff/400001/device/bluetooth/bluetooth_adapter.cc#newcode393 device/bluetooth/bluetooth_adapter.cc:393: it = next; Any ...
4 years, 6 months ago (2016-06-23 15:43:00 UTC) #24
ortuno
https://codereview.chromium.org/1842223003/diff/400001/device/bluetooth/bluetooth_adapter.cc File device/bluetooth/bluetooth_adapter.cc (right): https://codereview.chromium.org/1842223003/diff/400001/device/bluetooth/bluetooth_adapter.cc#newcode393 device/bluetooth/bluetooth_adapter.cc:393: it = next; On 2016/06/23 at 15:42:59, ortuno wrote: ...
4 years, 6 months ago (2016-06-23 17:57:34 UTC) #25
perja
ortuno: I've rebased on master and reverted two small changes. So if I haven't missed ...
4 years, 6 months ago (2016-06-24 14:15:29 UTC) #26
ortuno
Still lgtm
4 years, 6 months ago (2016-06-24 16:25:40 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/1842223003/440001
4 years, 6 months ago (2016-06-24 17:40:57 UTC) #29
commit-bot: I haz the power
Committed patchset #21 (id:440001)
4 years, 6 months ago (2016-06-24 19:43:49 UTC) #31
commit-bot: I haz the power
Patchset 21 (id:??) landed as https://crrev.com/849f95f6082cd71789e966de3b5a31ba87d1084e Cr-Commit-Position: refs/heads/master@{#401940}
4 years, 6 months ago (2016-06-24 19:46:05 UTC) #33
scheib
4 years, 5 months ago (2016-06-30 23:03:15 UTC) #34
Message was sent while issue was closed.
LGTM after being distracted and post land.

Powered by Google App Engine
This is Rietveld 408576698