4

I am about to publish an ap and notice that it requires "prevent phone from sleeping" permission which I did not include in my ap manifest.

Looking at the aps' manifest-merger debug report, I notice that it's coming from play-services-measurement:8.4.0 dependency which I have not included in my ap. I also notice that there is another dependency which I have not included, play-services-basement:8.4.0. I have included the play-services-analytics:8.4.0 and play-services_ads:8.4.0 dependencies. Could these be the source of the measurement and basement dependencies?

So, I guess my question is, can I safely remove this unwanted WAKE_LOCK permission? If so, how do I do it?

As a matter of interest, here are all my dependencies:

compile 'com.android.support:design:22.2.1'
compile 'com.adobe.creativesdk.foundation:auth:0.7.329'
compile 'com.adobe.creativesdk:image:4.0.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp:okhttp:2.0.0'
Clive Sargeant
  • 622
  • 11
  • 24
  • https://stackoverflow.com/questions/30546197/android-studio-adds-unwanted-permission-after-running-application-on-real-device – CommonsWare Mar 04 '16 at 13:13
  • 2
    "Could these be the source of the measurement and basement dependencies?" -- yes. In particular, `basement` is a transitive dependency of most, if not all, of the rest of the Play Services dependencies. "can I safely remove this unwanted WAKE_LOCK permission?" -- most likely, something will break. For example, `ads` probably updates its ad inventory during idle periods, and `analytics` probably uploads its data periodically. Both of those acts would need a `WakeLock` to ensure their transactions complete, and that requires `WAKE_LOCK`. – CommonsWare Mar 04 '16 at 13:15

1 Answers1

2

You can always add to your manifest:

<uses-permission android:name="android.permission.WAKE_LOCK" tools:node="remove" />
Jose Gómez
  • 3,110
  • 2
  • 32
  • 54