New issue
Advanced search Search tips

Issue 736543 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Feature



Sign in to add a comment

Check if we can simplify AwMetricsServiceClient.java

Project Member Reported by paulmiller@chromium.org, Jun 23 2017

Issue description

There is a deliberate race condition in metrics setup, between the Java and native side, since both do asynchronous work. In Java, AwBrowserProcess.handleMinidumpsAndSetMetricsConsent asynchronously queries GMS, and passes the result to AwMetricsServiceClient.setConsentSetting. In native, AwMetricsServiceClient::Initialize asynchronously reads the GUID, then passes the result to AwMetricsServiceClient::InitializeWithGUID. Either path may finish first, and AwMetricsServiceClient.java is written to handle this race condition.

But with the Finch project, the GUID read is being made synchronous. If the entire code path from WebViewChromiumFactoryProvider to AwMetricsServiceClient::Initialize is synchronous (and we can rely on it remaining that way in the future) then it's impossible for the GMS callback (which happens on the UI thread) to fire before AwMetricsServiceClient initialization. Then there is no race condition, and we can simplify the logic in AwMetricsServiceClient.java.
 

Comment 1 by sgu...@chromium.org, Sep 27 2017

Cc: -sgu...@chromium.org
Status: Assigned (was: Untriaged)
Assigning to owner. Please triage as appropriate.

Comment 3 by kmilka@chromium.org, May 26 2018

Cc: -kmilka@google.com

Sign in to add a comment