Commit ba917e66 authored by Joshua Pawlicki's avatar Joshua Pawlicki Committed by Chromium LUCI CQ

Clank Omaha: Catch SecurityException when getting the device ID.

If the device ID cannot be fetched, we prefer to still send the request
with no ID. The client will be counted by CR counting, and we still
prefer the client to get up-to-dateness info rather
than fail the entire request.

Bug: 1158707
Change-Id: Ic6a1a8653ff6db7fbfa2ed79d1906d2c8b50095a
Fixed: 1158707
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643178Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
Commit-Queue: Joshua Pawlicki <waffles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845748}
parent e69b7646
......@@ -176,9 +176,14 @@ public abstract class RequestGenerator {
* Return a device-specific ID.
*/
public String getDeviceID() {
return UniqueIdentificationGeneratorFactory
.getInstance(SettingsSecureBasedIdentificationGenerator.GENERATOR_ID)
.getUniqueId(SALT);
try {
return UniqueIdentificationGeneratorFactory
.getInstance(SettingsSecureBasedIdentificationGenerator.GENERATOR_ID)
.getUniqueId(SALT);
} catch (SecurityException unused) {
// In some cases the browser lacks permission to get the ID. Consult crbug.com/1158707.
return "";
}
}
/**
......
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