Code example for PermissionInfo

Methods: loadLabel

        PermissionInfoComparator(PackageManager pm) {
            mPm = pm;
        public final int compare(PermissionInfo a, PermissionInfo b) {
            CharSequence sa = a.loadLabel(mPm);
            CharSequence sb = b.loadLabel(mPm);
            return, sb);
    private void setPermissions(List<PermissionInfo> permList) {
        mGroupLabelCache = new HashMap<String, CharSequence>();
        //add the default label so that uncategorized permissions can go here 
        mGroupLabelCache.put(mDefaultGrpName, mDefaultGrpLabel);
        // Additional structures needed to ensure that permissions are unique under  
        // each group 
        mDangerousMap = new HashMap<String,  List<PermissionInfo>>();
        mNormalMap = new HashMap<String,  List<PermissionInfo>>();
        PermissionInfoComparator permComparator = new PermissionInfoComparator(mPm);