-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add device class field for Android #951
Conversation
@saurabh-sagrawal , @larvacea - Could you please help review this PR. Thanks. |
@lalitb , @saurabh-sagrawal , @larvacea All CI build has passed, please help to review this pr, thanks~ |
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
return "Android.PC"; | ||
} else { | ||
return "Android.Phone"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- These should be constants declared somewhere at a common place.
- 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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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??
There was a problem hiding this comment.
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.
I'd like to complete this PR if there is no more comments. |
Yes, looks good to go now. |
* 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]>
* 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]>
https://1dsdocs.azurewebsites.net/schema/PartA/device.html#deviceclass