Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here is what was changed:
I switched getDeviceName() to attempt deviceAttributes.getDeviceHostname and if it fails to use deviceAttributes.getDeviceAssetId and then fail to using a generic name.
.getDeviceHostname is supposed to come in Chrome 83 so theoretically this should work soon. .getDeviceAssetId returns the correct value now.
I changed getDeviceSerial() to use .deviceAttributes.getDeviceSerialNumber since DeviceId is not very helpful.
For CPU, the .trim() already removes the trailing space so the .endsWith method wasn't finding the CPU.
Memory was reported as 4.03 GB when it was 3.75 GB so I adjusted the calculation and added the _kb value as well.
Counting callbackTotal gave me 11.
There are two waitForSettings() so I commented out the first one.
After a day of trying I could not get hardwarePlatform.getHardwarePlatformInfo to return the make and model of the device. Maybe it doesn't work on Chrome devices? I added placeholders for machine_model and machine_model_friendly in the meantime.