Commit dfbf6469 authored by mattreynolds's avatar mattreynolds Committed by Commit bot

Avoid empty nearby URL list after onboarding by permitting unresolved URLs

We currently resolve nearby URLs twice, once before showing a "nearby web
pages found" notification and once just before displaying the list of
nearby URLs. If a URL was not resolvable for the notification we avoid
re-resolving it for display. This prevents costly delays at display time
as we are only requesting data expected to already be cached by the
resolution service.

During onboarding (ie, before the user has explicitly opted into the
physical web feature) we still scan for nearby URLs but do not resolve
them for privacy reasons. This causes all URLs to be considered
"unresolvable" immediately after opting in as none have been sent to the
resolution service yet.

To fix, at display time allow ListUrlsActivity to receive the full
list of nearby URLs (including unresolved) only if the resolved list is
empty.

BUG=529962

Review URL: https://codereview.chromium.org/1556453002

Cr-Commit-Position: refs/heads/master@{#367041}
parent 1028db14
...@@ -99,7 +99,7 @@ public class ListUrlsActivity extends AppCompatActivity implements AdapterView.O ...@@ -99,7 +99,7 @@ public class ListUrlsActivity extends AppCompatActivity implements AdapterView.O
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
mAdapter.clear(); mAdapter.clear();
Collection<String> urls = UrlManager.getInstance(this).getUrls(); Collection<String> urls = UrlManager.getInstance(this).getUrls(true);
final long timestamp = SystemClock.elapsedRealtime(); final long timestamp = SystemClock.elapsedRealtime();
mPwsClient.resolve(urls, new PwsClient.ResolveScanCallback() { mPwsClient.resolve(urls, new PwsClient.ResolveScanCallback() {
@Override @Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment