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.
  • 相关阅读:
    VS中,如何将存在于解决方案里,但是没有显示出来的文件(或文件夹)显示到项目中。
    (转)分布式系统编程,你到哪一级了?
    领域驱动架构学习总结
    Java多线程总结
    MySQL更新优化
    MySQL查询优化
    MySQL索引
    MySQL优化
    MySQL联接操作
    MySQL架构
  • 原文地址:https://www.cnblogs.com/jianglijs/p/7490923.html
Copyright © 2011-2022 走看看