Code example for PermissionInfo

Methods: loadLabel

0
        private final Collator sCollator = Collator.getInstance();
        PermissionInfoComparator(PackageManager pm) {
            mPm = pm;
        } 
        public final int compare(PermissionInfo a, PermissionInfo b) {
            CharSequence sa = a.loadLabel(mPm);
            CharSequence sb = b.loadLabel(mPm);
            return sCollator.compare(sa, 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);
         
        // Map containing group names and a list of permissions under that group 
        // categorized as dangerous 
        mDangerousMap = new HashMap<String, String>();
        // Map containing group names and a list of permissions under that group 
        // categorized as normal