-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(device_info_plus): Add User Device Name in Android #3437
Conversation
Need Manual Testing |
Hello, can you fix the markdown of the PR description, as well as adding the plugin name between The feature seems good to me, I'll take a deeper look when I got the time. |
The title format is still not right, please read the contributor guidelines and look at other PRs on how it is done |
Check Now |
thanks, although I don't think this is a breaking change |
Yes! but this change will save the time and give possibles user name of the current user device. |
I've been working today on this PR and found several things that need changes, however when I tried to push my changes I've got remote rejected. Can you enable that we can push to your branch? |
val handler = MethodCallHandlerImpl(packageManager, activityManager) | ||
val activityManager: ActivityManager = | ||
context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager | ||
val handler = MethodCallHandlerImpl(packageManager, activityManager, 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.
Don't pass context
here, instead pass the ContentResolver
.
@@ -37,6 +40,7 @@ internal class MethodCallHandlerImpl( | |||
build["manufacturer"] = Build.MANUFACTURER | |||
build["model"] = Build.MODEL | |||
build["product"] = Build.PRODUCT | |||
build["name"] = Settings.Global.getString(context.contentResolver, Settings.Global.DEVICE_NAME) |
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.
This API is only available from Android N (API 25), this code needs to check for the version. Android Studio should show a warning.
@@ -89,6 +90,10 @@ class AndroidDeviceInfo extends BaseDeviceInfo { | |||
/// https://developer.android.com/reference/android/os/Build#PRODUCT | |||
final String product; | |||
|
|||
/// The name of the device. | |||
/// https://developer.android.com/reference/android/os/Build#NAME |
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.
this documentation is incorrect, it should link to https://developer.android.com/reference/android/provider/Settings.Global#DEVICE_NAME
Please check now I set the bypass rule for the update |
It won't let me push, probably because the PR was created from |
I added you as contributor so, I think now you can do changes |
ugh what just happened, I pushed and it closed the PR? |
Reopening |
Well, I don't know. Git is giving me lots of problems, opening a pr from |
…3456) Co-authored-by: Miguel Beltran <[email protected]>
Description
This PR updates the functionality of the
NAME
property to now include and send the customer's device name. This enhancement ensures that the application can capture and utilize the user device name for better identification, personalization, and debugging. Prior to this change, theNAME
property did not include device-specific details. This update significantly improves logging, user tracking, and system behavior analysis.Related Issues
In the current package, the user is unable to obtain the Android user's custom device name
Checklist
CHANGELOG.md
nor the plugin version inpubspec.yaml
files.flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?