Commit f014ac53 authored by dfalcantara's avatar dfalcantara Committed by Commit bot

Attempt to head off OmahaClient ANR

* Move code to initialize member variables to when they're actually needed
  by the OmahaClient instead of creating them in onCreate().

* Fully remove the ability to force OmahaClient to send a request to the
  server.  The code that hooked into that was killed ages ago.

BUG=515312

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

Cr-Commit-Position: refs/heads/master@{#346770}
parent 5591967b
......@@ -21,10 +21,9 @@ public class VersionNumberGetter {
* @return The latest version if we retrieved one from the Omaha server, or "" if we haven't.
*/
public String getLatestKnownVersion(
Context applicationContext, String prefPackage, String prefLatestVersion) {
Context context, String prefPackage, String prefLatestVersion) {
assert Looper.myLooper() != Looper.getMainLooper();
SharedPreferences prefs = applicationContext.getSharedPreferences(
prefPackage, Context.MODE_PRIVATE);
SharedPreferences prefs = context.getSharedPreferences(prefPackage, Context.MODE_PRIVATE);
return prefs.getString(prefLatestVersion, "");
}
......@@ -32,7 +31,7 @@ public class VersionNumberGetter {
* Retrieve the version of Chrome we're using.
* @return The latest version if we retrieved one from the Omaha server, or "" if we haven't.
*/
public String getCurrentlyUsedVersion(Context applicationContext) {
return BuildInfo.getPackageVersionName(applicationContext);
public String getCurrentlyUsedVersion(Context context) {
return BuildInfo.getPackageVersionName(context);
}
}
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