6

I'm currently working on integrating Firebase Analytics into my android app. The problem that I'm encountering is that Firebase adds some new permissions. These permissions are

permission.WAKE_LOCK
com.google.android.c2dm.permission.RECEIVE

My question is: What happens when the user wants to (automatically) update my app in pre Marshmallow versions? Is he asked for permission or not, because it is a normal permission?

In post Marshmallow the documentation is quite clear. It simply doesn't ask the user at all, because it is a normal permission (https://developer.android.com/guide/topics/security/normal-permissions.html).

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
antumin
  • 167
  • 1
  • 12

2 Answers2

7

no WAKE_LOCK is not type of danger permission and user are asked only for danger permissions. as you can read more about this here Types Of permissions

Anwar Kamal
  • 405
  • 2
  • 15
  • so I can simply update it and the user would not notice this permission change at all in any android version? – antumin Jul 05 '16 at 10:34
  • yes as I told you in Marshmallow and + they only ask for danger permission and in your case this is not a danger permission. so enjoy – Anwar Kamal Jul 05 '16 at 10:36
  • And what about pre Marshmallow? – antumin Jul 05 '16 at 10:37
  • in pre Marshmallow they only ask for all permissions you have set in manifest file once when you are installing the app, and after that they never ask at runtime. – Anwar Kamal Jul 05 '16 at 10:40
7

On Android it is not possible to reliably start a service from a broadcast receiver w/o the use of wakelock for the hand off period from the receiver to the service. To support this common scenario Android provides WakefulBroadcastReceiver class. One of the objective of Firebase Analytics is to accurately measure your app. To do so it needs to a properly handle the data you provide and therefore required WAKE_LOCK permissions. Firebase Analytics is also built to either provide reliable data or no data at all so if your app is missing the WAKE_LOCK permission Firebase Analytics will refuse to report any data.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
djabi
  • 5,601
  • 18
  • 25