feat(device_info_plus): Add User Device Name in Android #3437
feat(device_info_plus): Add User Device Name in Android #3437FaizanUllahDev wants to merge 0 commit intofluttercommunity:mainfrom
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.
Don't pass context here, instead pass the ContentResolver.
| 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.
This API is only available from Android N (API 25), this code needs to check for the version. Android Studio should show a warning.
| final String product; | ||
|
|
||
| /// The name of the device. | ||
| /// https://developer.android.com/reference/android/os/Build#NAME |
There was a problem hiding this comment.
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 |
Description
This PR updates the functionality of the
NAMEproperty 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, theNAMEproperty 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.mdnor the plugin version inpubspec.yamlfiles.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?