当前位置: 首页>>代码示例>>Java>>正文


Java PermissionGroupInfo.FLAG_PERSONAL_INFO属性代码示例

本文整理汇总了Java中android.content.pm.PermissionGroupInfo.FLAG_PERSONAL_INFO属性的典型用法代码示例。如果您正苦于以下问题:Java PermissionGroupInfo.FLAG_PERSONAL_INFO属性的具体用法?Java PermissionGroupInfo.FLAG_PERSONAL_INFO怎么用?Java PermissionGroupInfo.FLAG_PERSONAL_INFO使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.content.pm.PermissionGroupInfo的用法示例。


在下文中一共展示了PermissionGroupInfo.FLAG_PERSONAL_INFO属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compare

public final int compare(MyPermissionGroupInfo a, MyPermissionGroupInfo b) {
    if (((a.flags() ^ b.flags()) & PermissionGroupInfo.FLAG_PERSONAL_INFO) != 0) {
        return ((a.flags() & PermissionGroupInfo.FLAG_PERSONAL_INFO) != 0) ? -1 : 1;
    }
    if (a.priority() != b.priority()) {
        return a.priority() > b.priority() ? -1 : 1;
    }
    return sCollator.compare(a.mLabel, b.mLabel);
}
 
开发者ID:CmDnoEdition,项目名称:fdroid,代码行数:9,代码来源:AppSecurityPermissions.java

示例2: setPermissions

private void setPermissions(List<MyPermissionInfo> permList) {
    if (permList != null) {
        // First pass to group permissions
        for (MyPermissionInfo pInfo : permList) {
            if (!isDisplayablePermission(pInfo, pInfo.mExistingReqFlags)) {
                continue;
            }
            MyPermissionGroupInfo group = mPermGroups.get(pInfo.group);
            if (group != null) {
                pInfo.mLabel = pInfo.loadLabel(mPm);
                addPermToList(group.mAllPermissions, pInfo);
                if (pInfo.mNew) {
                    addPermToList(group.mNewPermissions, pInfo);
                }
                if ((group.flags() & PermissionGroupInfo.FLAG_PERSONAL_INFO) != 0) {
                    addPermToList(group.mPersonalPermissions, pInfo);
                } else {
                    addPermToList(group.mDevicePermissions, pInfo);
                }
            }
        }
    }

    for (MyPermissionGroupInfo pgrp : mPermGroups.values()) {
        if (pgrp.labelRes != 0 || pgrp.nonLocalizedLabel != null) {
            pgrp.mLabel = pgrp.loadLabel(mPm);
        } else {
            try {
                ApplicationInfo app = mPm.getApplicationInfo(pgrp.packageName, 0);
                pgrp.mLabel = app.loadLabel(mPm);
            } catch (NameNotFoundException e) {
                pgrp.mLabel = pgrp.loadLabel(mPm);
            }
        }
        mPermGroupsList.add(pgrp);
    }
    Collections.sort(mPermGroupsList, mPermGroupComparator);
}
 
开发者ID:CmDnoEdition,项目名称:fdroid,代码行数:38,代码来源:AppSecurityPermissions.java

示例3: setPermissions

private void setPermissions(List<MyPermissionInfo> permList) {
    if (permList != null) {
        // First pass to group permissions
        for (MyPermissionInfo pInfo : permList) {
            if (!isDisplayablePermission(pInfo, pInfo.mNewReqFlags, pInfo.mExistingReqFlags)) {
                continue;
            }
            MyPermissionGroupInfo group = mPermGroups.get(pInfo.group);
            if (group != null) {
                pInfo.mLabel = pInfo.loadLabel(mPm);
                addPermToList(group.mAllPermissions, pInfo);
                if (pInfo.mNew) {
                    addPermToList(group.mNewPermissions, pInfo);
                }
                if ((group.flags() & PermissionGroupInfo.FLAG_PERSONAL_INFO) != 0) {
                    addPermToList(group.mPersonalPermissions, pInfo);
                } else {
                    addPermToList(group.mDevicePermissions, pInfo);
                }
            }
        }
    }

    for (MyPermissionGroupInfo pgrp : mPermGroups.values()) {
        if (pgrp.labelRes != 0 || pgrp.nonLocalizedLabel != null) {
            pgrp.mLabel = pgrp.loadLabel(mPm);
        } else {
            try {
                ApplicationInfo app = mPm.getApplicationInfo(pgrp.packageName, 0);
                pgrp.mLabel = app.loadLabel(mPm);
            } catch (NameNotFoundException e) {
                pgrp.mLabel = pgrp.loadLabel(mPm);
            }
        }
        mPermGroupsList.add(pgrp);
    }
    Collections.sort(mPermGroupsList, mPermGroupComparator);
}
 
开发者ID:nutellarlz,项目名称:AppHub,代码行数:38,代码来源:AppSecurityPermissions.java

示例4: compare

public final int compare(MyPermissionGroupInfo a, MyPermissionGroupInfo b) {
    if (((a.flags ^ b.flags) & PermissionGroupInfo.FLAG_PERSONAL_INFO) != 0) {
        return ((a.flags & PermissionGroupInfo.FLAG_PERSONAL_INFO) != 0) ? -1 : 1;
    }
    if (a.priority != b.priority) {
        return a.priority > b.priority ? -1 : 1;
    }
    return sCollator.compare(a.mLabel, b.mLabel);
}
 
开发者ID:amartinz,项目名称:DeviceControl,代码行数:9,代码来源:AppSecurityPermissions.java

示例5: setPermissions

private void setPermissions(List<MyPermissionInfo> permList) {
    if (permList != null) {
        // First pass to group permissions
        for (MyPermissionInfo pInfo : permList) {
            if (!isDisplayablePermission(pInfo, pInfo.mNewReqFlags, pInfo.mExistingReqFlags)) {
                continue;
            }
            MyPermissionGroupInfo group = mPermGroups.get(pInfo.group);
            if (group != null) {
                pInfo.mLabel = pInfo.loadLabel(mPm);
                addPermToList(group.mAllPermissions, pInfo);
                if (pInfo.mNew) {
                    addPermToList(group.mNewPermissions, pInfo);
                }
                if ((group.flags & PermissionGroupInfo.FLAG_PERSONAL_INFO) != 0) {
                    addPermToList(group.mPersonalPermissions, pInfo);
                } else {
                    addPermToList(group.mDevicePermissions, pInfo);
                }
            }
        }
    }

    for (MyPermissionGroupInfo pgrp : mPermGroups.values()) {
        if (pgrp.labelRes != 0 || pgrp.nonLocalizedLabel != null) {
            pgrp.mLabel = pgrp.loadLabel(mPm);
        } else {
            ApplicationInfo app;
            try {
                app = mPm.getApplicationInfo(pgrp.packageName, 0);
                pgrp.mLabel = app.loadLabel(mPm);
                if (pgrp.mLabel == null) {
                    throw new Exception("app.loadLabel returned null!");
                }
            } catch (Exception e) {
                pgrp.mLabel = pgrp.loadLabel(mPm);
            }
        }
        if (pgrp.mLabel == null) {
            continue;
        }
        mPermGroupsList.add(pgrp);
    }
    Collections.sort(mPermGroupsList, mPermGroupComparator);
}
 
开发者ID:amartinz,项目名称:DeviceControl,代码行数:45,代码来源:AppSecurityPermissions.java


注:本文中的android.content.pm.PermissionGroupInfo.FLAG_PERSONAL_INFO属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。