如果我只在 Google Play 商店中发布,我是否需要 android.permission.WAKE_LOCK 才能使用 Google Play 服务? [英] Do I need android.permission.WAKE_LOCK for Google Play Services if I only release in Google Play Store?

本文介绍了如果我只在 Google Play 商店中发布,我是否需要 android.permission.WAKE_LOCK 才能使用 Google Play 服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为 Android 集成 Google Analytics.根据此处的文档,它要求添加android.permission.WAKE_LOCK(提供下面的注释说明).我不是很清楚.如果我只在 Google Play 商店中发布应用,我还需要这个吗?

I am trying to integrate Google Analytics for Android. As per the documentation here, it asks to add android.permission.WAKE_LOCK (provides the comment note below). I dont understand it clearly. If I am releasing the app ONLY in the Google Play Store, do I still need this?

如果这不是绝对必要的,我真的不想要求用户获得额外的许可.

I really do not want to ask users for an additional permission if this is not absolutely necessary.

<!-- Optional permission for reliable local dispatching on non-Google Play devices -->
<uses-permission android:name="android.permission.WAKE_LOCK" />

特别是,我不明白这个注释的实际含义 这里:

In particular, I do not understand what this note actually means here:

可以选择请求 WAKE_LOCK 权限以改进非 Google Play 设备上的调度.

Optionally a WAKE_LOCK permission can be requested to improve dispatching on non-Google Play devices.

推荐答案

WAKE_LOCK

允许使用 PowerManager WakeLocks 来防止处理器休眠或屏幕变暗.

Allows using PowerManager WakeLocks to keep processor from sleeping or screen from dimming.

在 Google Play 设备上,后台服务几乎总是作为Google Play 服务"运行,因此不需要 WAKE_LOCK.

On Google Play devices, a background service is almost always running as "Google Play Services", so WAKE_LOCK is not required.

在非 Google Play 设备上,WAKE_LOCK 有助于保持 Google Analytics 的调度流程/服务处于活动状态,从而有更多机会报告/上传数据.

On non-Google Play devices, WAKE_LOCK helps keeping the dispatching process / service of Google Analytics alive so it has more chances to report / upload data.

编辑

此外,不清楚用户无法通过设置控制的权限组中的危险权限会发生什么情况,例如 SYSTEM_TOOLS.

Also, it is unclear what happens to dangerous permissions in permission groups that are not ones that the user can control via Settings, such as SYSTEM_TOOLS.

https://commonsware.com/blog/2015/06/02/random-musings-m-developer-preview-bad.html

这篇关于如果我只在 Google Play 商店中发布,我是否需要 android.permission.WAKE_LOCK 才能使用 Google Play 服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆