Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why my app is requesting "prevent phone from sleeping" permission?

When I install my app it is asking for this permission:

prevent phone from sleeping

I assume that comes from the WAKE_LOCK permission but my app doesn't specify that. Here is the permission list from my manifest:

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

I am linking with ACRA and Google Analytics but don't see how the permission could be coming from those.

UPDATE: here is my build.gradle for my main module. it does include google play analytics:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile project(':acra-4.7.0')
    compile 'com.google.android.gms:play-services-analytics:8.4.0'
}

apply plugin: 'com.google.gms.google-services'

UPDATE: As suggested by CommonsWare found the culprit in the manifest:

ADDED from [com.google.android.gms:play-services-basement:8.4.0] 
C:\Users\Bill\Workspace\NetworkExplorer\app\build\intermediates\exploded-
    aar\com.google.android.gms\play-services-basement\
8.4.0\AndroidManifest.xml:23:13-66
uses-permission#android.permission.WAKE_LOCK

Seems like I should not need WAKE_LOCK for simple Google Analytics reporting.

like image 706
Bill Avatar asked Feb 04 '16 18:02

Bill


People also ask

What is prevent phone from sleeping Android permission?

Allows the app to prevent the phone from going to sleep.

How do I get apps to stop asking for permission Android?

Open Settings and choose Apps & notifications. Find and select the app you want to check permissions for. Tap Permissions. Now you can see all the app's permissions.

What does it mean when an app asks for permission?

You can allow some apps to use various features on your phone, such as your camera or contacts list. An app will send a notification to ask for permission to use features on your phone, which you can Allow or Deny. You can also change permissions for a single app or by permission type in your phone's Settings.


1 Answers

<uses-permission android:name="android.permission.WAKE_LOCK" tools:node="remove" />

it'll do the job.

I hope it helps.

like image 179
your friend Avatar answered Oct 19 '22 23:10

your friend