Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove isNearby filter from AppHelper functions #2011

Merged
merged 3 commits into from
Jan 29, 2024

Conversation

luizgrp
Copy link
Member

@luizgrp luizgrp commented Jan 26, 2024

WHAT

  1. Remove isNearby filter from connectedNodes and connectedAndInstalledNodes functions from AppHelper.

  2. Add isNearby property to AppHelperNodeStatus and update samples to display it.

Phone sample

Screen_recording_20240126_165742.mp4

Wear sample

Screen_recording_20240129_110520.mp4

WHY

I think it was being used as a way to filter "connected" nodes, however, this is not correct.
Retrieving reachable nodes from CapabilityClient already returns nodes that are connected.
IsNearby is only filtering by those connected directly to the caller device.

Use case which shows that it was not working as intended:

  1. Switch off bluetooth from the phone;
  2. Have a paired watch device connected to wifi;
  3. Launch datalayer sample on the phone, go the Nodes or Nodes Listener screen;

Expected result: watch device should be listed.
Actual result: watch device is not listed.

Checklist 📋

  • Add explicit visibility modifier and explicit return types for public declarations
  • Run spotless check
  • Run tests
  • Update metalava's signature text files

@luizgrp luizgrp requested a review from garanj January 26, 2024 14:38
@luizgrp luizgrp self-assigned this Jan 26, 2024
@luizgrp luizgrp requested a review from yschimke January 26, 2024 14:38
@garanj
Copy link
Collaborator

garanj commented Jan 26, 2024

The original intention of using isNearby was to only include those devices that were connected via BT (as that's the only 1-hop transport supported right now?). This was with the assumptions that:

  1. The user would be needing their phone and watch with them (so in close proximity) for whatever they were doing
  2. Bluetooth was enabled

Maybe (2) doesn't hold? Maybe some people have BT off?

@luizgrp luizgrp requested a review from yschimke January 29, 2024 11:12
@luizgrp
Copy link
Member Author

luizgrp commented Jan 29, 2024

@yschimke @garanj added more changes after our discussion - updated the PR description, including video to the samples - please review again when you get a chance

@luizgrp luizgrp merged commit b8eac12 into google:main Jan 29, 2024
4 checks passed
@luizgrp luizgrp deleted the datalayer_apphelper_isnearby branch January 29, 2024 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants