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.
  • 相关阅读:
    python 修改文件内容3种方法
    cv2---imread---error
    when i import skimage,it occurred --"cannot import name '_validate_lengths'"
    centos7 安装jdk8和maven3
    docker pull 速度慢的问题
    jedis.zrangeWithScores 打印值为ASCII码
    git配置多个公钥秘钥问题
    maven 启动tomcat报错:org.apache.jasper.JasperException: Unable to compile class for JSP:
    Yaconf – 一个高性能的配置管理扩展
    java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
  • 原文地址:https://www.cnblogs.com/jianglijs/p/7490923.html
Copyright © 2011-2022 走看看