Wake_Lock and Received_boot_completed Android permissions - Unity

156 views
Skip to first unread message

FreeLearning

unread,
Dec 16, 2021, 12:24:38 PM12/16/21
to Google Mobile Ads SDK Developers
Hi,

When I use your sdk on Unity (v. 6.1.2 of the GMA Unity Plugin), the requests for permissions are automatically added to my manifest: Wake_lock and Received_boot_completed. I have read on the website what they mean. (https://developer.android.com/reference/android/Manifest.permission) My questions are:
What do you need them for?
Are they really useful?
Is this an expected behavior?

Thanks

Mobile Ads SDK Forum Advisor

unread,
Dec 17, 2021, 5:04:18 AM12/17/21
to freelearni...@gmail.com, google-adm...@googlegroups.com
Hi FreeLearning,

Thank you for reporting this to us.

I tried to build our sample app with the latest unity plugin, then exported it to Android project. As per checking, I didn't see the Wake_lock generated on permissions. Could you confirm if your app contains other plugins aside from Mobile Ads SDK? If so, we would recommend to review those plugins as well.

Regards,
Google Logo
Teejay Wennie Pimentel
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2TLto7:ref

FreeLearning

unread,
Dec 17, 2021, 4:16:35 PM12/17/21
to Google Mobile Ads SDK Developers
I repeated the test Test 1. I created a new project and created the apk (without adding anything). Zero permits required. Test 2. I added GMA Unity Plugin v. 6.1.2, and I have built. I brought the apk to Android Studio and I see the two permissions I mentioned. I attach image. From my explanation I think it is understood, but I specify, I have no other plugins and I have not added anything else. I am getting requests for both permissions from an empty project with the GMA Unity Plugin.
Immagine 2021-12-17 221450.png

Mobile Ads SDK Forum Advisor

unread,
Dec 20, 2021, 2:57:48 AM12/20/21
to freelearni...@gmail.com, google-adm...@googlegroups.com

Hi Freelearning,

Thank you for your response.

I work with Teejay and will be assisting you today as Teejay is currently on leave. I've created a new unity project and imported the unit plugin 6.12 in the newly created project. After that, I exported the project for android to check the manifest file in android studio. Upon checking, I wasn't able to see any Wake_locks permission on the manifest. Can you check if we tested it the same as your testing?

Regards,

Google Logo
Princess Pamela Pineda
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2TLto7:ref
Screen Shot 2021-12-20 at 3.21.13 PM.png

FreeLearning

unread,
Dec 20, 2021, 8:07:32 AM12/20/21
to Google Mobile Ads SDK Developers
Hi, no, you did not like me. I built from Unity and then analyzed the apk on Android Studio. If I create an apk from an empty project and analyze it with Android Studio, I don't have permission requests. If I create an apk from an empty project with the GMA Unity Plugin, and then analyze the apk in Android Studio, in the manifest I have the permission requests for: - Wake_lock - Received_boot_completed

Mobile Ads SDK Forum Advisor

unread,
Dec 20, 2021, 10:51:21 PM12/20/21
to freelearni...@gmail.com, google-adm...@googlegroups.com

Hi Freelearning,

Thank you for clarifying this.

Upon checking it again using the steps you made, I was able to see the permission you mentioned. As per further checking, the team mentioned that, it turns out that the GMA SDK is not adding this but Play Services is: https://medium.com/glucosio-project/how-libraries-can-silently-add-permissions-to-your-android-app-620911d7de6c and the permission is being added by the androidx.work library, and androidx.work is a dependency of the Google Mobile Ads SDK.

FreeLearning

unread,
Dec 21, 2021, 7:46:05 AM12/21/21
to Google Mobile Ads SDK Developers
Got it, so you're not causing the problem yourself. But the problem lands on you anyway, because to use your package you have to resolve the dependencies in the project. So, unless you need them for a reason, it's a problem that needs to be solved, either by you or by your addiction practitioner, no?

Mobile Ads SDK Forum Advisor

unread,
Dec 22, 2021, 3:05:50 AM12/22/21
to freelearni...@gmail.com, google-adm...@googlegroups.com

Hi Freelearning,

Thank you for your response.

Let me bring this to the rest of the team to provide you proper context on this. Rest assured that one of our team will reach out to you.

Mobile Ads SDK Forum Advisor

unread,
Dec 23, 2021, 2:28:23 PM12/23/21
to google-adm...@googlegroups.com, freelearni...@gmail.com

Hi FreeLearning,

 

My name is Nick, and I will be helping you today with the Wakelock permission issue. As Princess pointed out, the permission is added indirectly by the androidx.work library. Admob requires this library as a dependency and can not remove it. 

Wakelock is routinely used by applications to prevent the phone from sleeping during long running processes with minimal user input. For instance while watching a video or during a phone call. If there is a specific problem this permission is causing, we will be happy to help.

Thanks, Nick.



ref:_00D1U1174p._5004Q2TLto7:ref

FreeLearning

unread,
Dec 23, 2021, 3:19:10 PM12/23/21
to Google Mobile Ads SDK Developers
There is no specific problem.

But users don't like being asked for such permissions without understanding why, and to me as a developer, I don't like asking for them without knowing why.

I understand what WakeLock does, but I don't understand what it is for. What do you need to keep your phone on for long sessions? Do you need to keep your phone on for video ads? For what on a technical level?
I understand the "we need it and we ask it", but my question is: what need do you have? what do you need it for? So that it is able to give an explanation to users who request it.
Same thing for Received_boot_completed, you ask for it and say you need it, ok alright. But if you need it then you are able to answer the question: what do you need it for? what do you need to know that the system has been started? what do you want to do? what do you do?

These are all questions that users ask themselves. I just want to know what you use permissions for, to understand and explain to users.

Mobile Ads SDK Forum Advisor

unread,
Dec 28, 2021, 1:16:43 PM12/28/21
to freelearni...@gmail.com, google-adm...@googlegroups.com

Hi FreeLearning,

 

I understand the concern of having excess permissions. In this case the permission is required by a third party dependency outside of the Admob domain.

You may want to take your question to the android development team which is responsible for managing the androidx.work. Looking online I found this resource which might help.

Thanks,

Nick



ref:_00D1U1174p._5004Q2TLto7:ref
Reply all
Reply to author
Forward
0 new messages