javiersantos / WhatsAppBetaUpdater

An app to update WhatsApp to the latest beta version available on Android. Based on Material Design.
GNU General Public License v3.0
192 stars 57 forks source link

only request WRITE_EXTERNAL_STORAGE when needed #14

Open graingert opened 8 years ago

graingert commented 8 years ago

eg when the "save in "Downloads"" options is chosen in the "Do you want to keep the update?" dialog, trigger the request for permission.

javiersantos commented 8 years ago

That would be interesting. Right now I am not using the permissions feature of Android 6.0 because it will require the WRITE_EXTERNAL_STORAGE permission at the first startup. Moreover, if you decline the permission, the app won't work.

Beta Updater downloads the updates on the "Downloads" directory. When the dialog is shown, if the user keeps the update, it just do nothing. But, if the user decides to delete the update, the file is removed from the "Downloads" directory.

I think that should be a directory where the app could write the update (maybe Context.getApplicationInfo().dataDir) without requesting the permission, and the file will be moved to the "Downloads" directory if the user decides to keep the update (and request for the permission).

graingert commented 8 years ago

I think that should be a directory where the app could write the update (maybe Context.getApplicationInfo().dataDir) without requesting the permission, and the file will be moved to the "Downloads" directory if the user decides to keep the update (and request for the permission).

This