Skip to content

Conversation

@donpui
Copy link
Contributor

@donpui donpui commented Jan 30, 2023

Fixing issue #192

Used native android function to get user device uniq number:
https://developer.android.com/reference/android/os/UserManager#getSerialNumberForUser(android.os.UserHandle)

Couldn't find native flutter/dart plugin method. Path_provider PR for Android downloads is closed: flutter/plugins#4559

Additionally jumped on interested bug, with get_it and setting download path. First time loading app worked, however, on second load (after app removed from process) it failed: get_it_impl.dart failed assertion instanceFactory.isReady. Making wait while all registry values are collected, helped to solved and avoid app crash.

I haven't added any tests for download paths, as basically would need to mockup different users profiles: (requires either time either ideas, how to automate this case)

Simple testing scenario:

  1. Launch app, go to Settings, you should see destination /storage/emulated/0/Download
  2. Go to Android settings-> Add user or profile, mark Allow multiple
  3. Add Guest user and Switch to User
  4. Deploy app to Guest user and open it
  5. Go to Settings and check destination: /storage/emulated/10/Download
    Additionally, worth to close/kill app and launch again to check if it opens.

Code Review Checklist

  • Description accurately reflects what changes are being made.
  • Description explains why the changes are being made (or references an issue containing one).
  • The PR appropriately sized.
  • New code has enough tests.
  • New code has enough documentation to answer "how do I use it?" and "what does it do?".
  • Existing documentation is up-to-date, if impacted.

@donpui donpui requested review from ewanas and wuan and removed request for wuan January 30, 2023 06:52
@donpui donpui marked this pull request as ready for review January 30, 2023 06:53
@donpui
Copy link
Contributor Author

donpui commented Jan 30, 2023

@ewanas @wuan take a look to verify, especially kotlin code part. Maybe we you have better way how to improve with downloads directory.

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.

2 participants