Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add device class field for Android #951

Merged
merged 7 commits into from
Nov 17, 2021

Conversation

BiliBoomBo
Copy link
Contributor

@ghost
Copy link

ghost commented Nov 5, 2021

CLA assistant check
All CLA requirements met.

@lalitb
Copy link
Contributor

lalitb commented Nov 9, 2021

@saurabh-sagrawal , @larvacea - Could you please help review this PR. Thanks.
@BiliBoomBo - The CI build for android is failing, can you check if it's related to your changes.

@BiliBoomBo
Copy link
Contributor Author

@lalitb , @saurabh-sagrawal , @larvacea All CI build has passed, please help to review this pr, thanks~

Copy link
Contributor

@lalitb lalitb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We can probably wait for a couple of days more for any feedback and merge then.

@@ -274,6 +275,8 @@ private void calculateAndSetSystemInfo(android.content.Context context) {

String time_zone = getTimeZone();

String device_class = getDeviceClass(context);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"final String device_class", it's better to mark the variable final to avoid accidental value changes down the line.
Similarly update other variables as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, have made the change.

Comment on lines 315 to 317
return "Android.PC";
} else {
return "Android.Phone";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. These should be constants declared somewhere at a common place.
  2. What's the source for this and how are these values determined, is the list of values complete and why are you not expecting tablet here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the source for this and how are these values determined, is the list of values complete and why are you not expecting tablet here?

@saurabh-sagrawal - the list is coming from common schema Part A extension:

https://github.com/microsoft/common-schema/blob/main/PartA/device.md#deviceclass

iOS iOS.Emulator iOS.Phone iOS.Tablet iOS.Phablet iOS.AppleTV
Android Android.Phone Android.PC

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks lalitb for help to reply!
And I have made the related change for 1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's cool, my minor suggestion would be to revisit / review this in schema forum. These definitions were just someone's random suggestion, and may not be very neatly tuned / optimal for today's realities as of 2021... i.e. Android.PC - what is that exactly, like a Chromebook or a Tablet with external keyboard attached??

Copy link
Contributor Author

@BiliBoomBo BiliBoomBo Nov 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be a random suggestion, but it may hard to change these values right now, the low version Edge app uploads these strings, and the other apps may have the similiar situation, we may need to keep them consistent.

@BiliBoomBo
Copy link
Contributor Author

I'd like to complete this PR if there is no more comments.

@lalitb
Copy link
Contributor

lalitb commented Nov 16, 2021

I'd like to complete this PR if there is no more comments.

Yes, looks good to go now.

@BiliBoomBo BiliBoomBo merged commit 23aa259 into microsoft:main Nov 17, 2021
BiliBoomBo added a commit to BiliBoomBo/cpp_client_telemetry that referenced this pull request Jan 12, 2022
* add device class for Android

* Fix CI build fail and add test for device_class

* Fix test build fail

* Resolve comments

Co-authored-by: Wangyang Dai <[email protected]>
Co-authored-by: Lalit Kumar Bhasin <[email protected]>
BiliBoomBo added a commit that referenced this pull request Jan 12, 2022
* add device class for Android

* Fix CI build fail and add test for device_class

* Fix test build fail

* Resolve comments

Co-authored-by: Wangyang Dai <[email protected]>
Co-authored-by: Lalit Kumar Bhasin <[email protected]>

Co-authored-by: Wangyang Dai <[email protected]>
Co-authored-by: Lalit Kumar Bhasin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants