本文介绍了安卓M:结算和GCM权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序使用GCM和计费。为了使机器人M-准备我试图实施新的权限模型

I have an app which use GCM and Billing. In order to make it Android M-ready i'm trying to implement the new permission model.

不幸的是我无法找到有关GCM和计费权限的任何信息。它们不会出现在正常的权限列表和显然不可用与 Manifest.permission。* ,因为他们不是在 android.permission 命名空间。

Unfortunately i can't find any informations about GCM and Billing permissions.They don't appear in the normal permission list and are obviously not available with Manifest.permission.* because they are not under android.permission namespace.

尽管如此,我们还是要声明它们在清单

Nevertheless , we still have to declare them in the manifest

<uses-permission android:name="com.android.vending.BILLING">
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE">

那么如何将这些权限,应该如何处理?难道他们自动获得?

So how those permissions should be handled ? Are they automatically granted ?

推荐答案

这些权限被自动授予在安装时:

Those permissions are granted automatically at install time:

checkSelfPermission(com.android.vending.BILLING)返回 PERMISSION_GRANTED 而没有询问用户。

checkSelfPermission("com.android.vending.BILLING") returns PERMISSION_GRANTED without ever asking the user.

据我了解的文件和最近期的并购preVIEW的行为,有在运行时所要求的唯一权限是那些有permission组,因为系统会提示用户该弹出窗口只提权限组。

As far as I understood the documentation and the behaviour of the most recent M preview, the only permissions that have to be requested at runtime are the ones that have a permission group, since the popups that are prompted to the user only mention permission groups.

这篇关于安卓M:结算和GCM权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 19:07