zoukankan      html  css  js  c++  java
  • Android permission and uses-permission

    In Android,we almost have less chance to define our own permission,and sometimes we need,so as in a contentprovider

    here is how to define our own permission  https://developer.android.com/guide/topics/manifest/permission-element.html

    <permission android:description="string resource"
                android:icon="drawable resource"
                android:label="string resource"
                android:name="string"
                android:permissionGroup="string"
                android:protectionLevel=["normal" | "dangerous" |
                                         "signature" | "signatureOrSystem"] />

    when we write our own contentprovider,we may use the field  android:protectionLevel,for example "signature".

    android:protectionLevelCharacterizes the potential risk implied in the permission and indicates the procedure the system should follow when determining whether or not to grant the permission to an application requesting it. The value can be set to one of the following strings:

    ValueMeaning
    "normal" The default value. A lower-risk permission that gives requesting applications access to isolated application-level features, with minimal risk to other applications, the system, or the user. The system automatically grants this type of permission to a requesting application at installation, without asking for the user's explicit approval (though the user always has the option to review these permissions before installing).
    "dangerous" A higher-risk permission that would give a requesting application access to private user data or control over the device that can negatively impact the user. Because this type of permission introduces potential risk, the system may not automatically grant it to the requesting application. For example, any dangerous permissions requested by an application may be displayed to the user and require confirmation before proceeding, or some other approach may be taken to avoid the user automatically allowing the use of such facilities.
    "signature" A permission that the system grants only if the requesting application is signed with the same certificate as the application that declared the permission. If the certificates match, the system automatically grants the permission without notifying the user or asking for the user's explicit approval.
    "signatureOrSystem" A permission that the system grants only to applications that are in the Android system image or that are signed with the same certificate as the application that declared the permission. Please avoid using this option, as the signature protection level should be sufficient for most needs and works regardless of exactly where applications are installed. The "signatureOrSystem" permission is used for certain special situations where multiple vendors have applications built into a system image and need to share specific features explicitly because they are being built together.
  • 相关阅读:
    celery的使用和原理
    内核通知链
    数据流中的中位数
    二叉搜索树的后序遍历序列
    Javascript设计模式系统讲解与应用,JS设计模式详解
    微服务系列之ZooKeeper注册中心和Nacos注册中心
    微信小程序开发详解:小程序入门与实战-纯正商业级应用技术
    Java零基础该怎么去学习Java?学好Java应该如何去做?
    Flutter从入门到进阶实战携程网App项目详解
    Python升级3.6强力Django+杀手级Xadmin打造在线教育平台
  • 原文地址:https://www.cnblogs.com/jianglijs/p/7490923.html
Copyright © 2011-2022 走看看