android
android copied to clipboard
Clean account types
trafficstars
Actual behaviour
The app handles account using 4 (!) different formats:
Account- obviouslyOwnCloudAccount- wraps account, platform API + adds some own APIString- needs to get account by nameint- get by hash code?
Of course the conversion, getters, etc code spills to code that actually uses account data.
Expected behaviour
- 1 (one) data type to deal with.
- data type provides all required API to query about account capabilities (this logic taints the UI heavily)
- no ad-hoc conversions are required to manage app accounts
Solution
- Immutable
NextcloudAccounttype providing all the functionalities. - Current account available directly in
UserAccontManager, avoiding expensive queries to platformAccountManager - No references to
Account(long term, I guess)
Alternatives
- sanitizing
OwnCloudAccountbut it's not a data type as it brings a lot of platform services with and does not provide too much functionality right now