AppSecurityPermissions: cleanup
Mostly removing obsolete comment from the original source. Also removing some unnecessary C-style for loops.
This commit is contained in:
		
							parent
							
								
									e085e0392b
								
							
						
					
					
						commit
						42b6176cff
					
				@ -1,5 +1,4 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
**
 | 
					 | 
				
			||||||
** Copyright 2007, The Android Open Source Project
 | 
					** Copyright 2007, The Android Open Source Project
 | 
				
			||||||
** Copyright 2015 Daniel Martí <mvdan@mvdan.cc>
 | 
					** Copyright 2015 Daniel Martí <mvdan@mvdan.cc>
 | 
				
			||||||
**
 | 
					**
 | 
				
			||||||
@ -99,13 +98,10 @@ public class AppSecurityPermissions {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        public Drawable loadGroupIcon(PackageManager pm) {
 | 
					        public Drawable loadGroupIcon(PackageManager pm) {
 | 
				
			||||||
            if (icon != 0) {
 | 
					            if (icon != 0) {
 | 
				
			||||||
                // return loadUnbadgedIcon(pm);
 | 
					 | 
				
			||||||
                return loadIcon(pm);
 | 
					                return loadIcon(pm);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            ApplicationInfo appInfo;
 | 
					 | 
				
			||||||
            try {
 | 
					            try {
 | 
				
			||||||
                appInfo = pm.getApplicationInfo(packageName, 0);
 | 
					                ApplicationInfo appInfo = pm.getApplicationInfo(packageName, 0);
 | 
				
			||||||
                // return appInfo.loadUnbadgedIcon(pm);
 | 
					 | 
				
			||||||
                return appInfo.loadIcon(pm);
 | 
					                return appInfo.loadIcon(pm);
 | 
				
			||||||
            } catch (NameNotFoundException e) {
 | 
					            } catch (NameNotFoundException e) {
 | 
				
			||||||
                // ignore
 | 
					                // ignore
 | 
				
			||||||
@ -214,7 +210,6 @@ public class AppSecurityPermissions {
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                builder.setCancelable(true);
 | 
					                builder.setCancelable(true);
 | 
				
			||||||
                builder.setIcon(mGroup.loadGroupIcon(pm));
 | 
					                builder.setIcon(mGroup.loadGroupIcon(pm));
 | 
				
			||||||
                //addRevokeUIIfNecessary(builder);
 | 
					 | 
				
			||||||
                mDialog = builder.show();
 | 
					                mDialog = builder.show();
 | 
				
			||||||
                mDialog.setCanceledOnTouchOutside(true);
 | 
					                mDialog.setCanceledOnTouchOutside(true);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -366,8 +361,8 @@ public class AppSecurityPermissions {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    public int getPermissionCount(int which) {
 | 
					    public int getPermissionCount(int which) {
 | 
				
			||||||
        int n = 0;
 | 
					        int n = 0;
 | 
				
			||||||
        for (int i = 0; i < mPermGroupsList.size(); i++) {
 | 
					        for (MyPermissionGroupInfo grp : mPermGroupsList) {
 | 
				
			||||||
            n += getPermissionList(mPermGroupsList.get(i), which).size();
 | 
					            n += getPermissionList(grp, which).size();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return n;
 | 
					        return n;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -395,8 +390,7 @@ public class AppSecurityPermissions {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        int spacing = (int) (8 * mContext.getResources().getDisplayMetrics().density);
 | 
					        int spacing = (int) (8 * mContext.getResources().getDisplayMetrics().density);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (int i = 0; i < groups.size(); i++) {
 | 
					        for (MyPermissionGroupInfo grp : groups) {
 | 
				
			||||||
            MyPermissionGroupInfo grp = groups.get(i);
 | 
					 | 
				
			||||||
            final List<MyPermissionInfo> perms = getPermissionList(grp, which);
 | 
					            final List<MyPermissionInfo> perms = getPermissionList(grp, which);
 | 
				
			||||||
            for (int j = 0; j < perms.size(); j++) {
 | 
					            for (int j = 0; j < perms.size(); j++) {
 | 
				
			||||||
                MyPermissionInfo perm = perms.get(j);
 | 
					                MyPermissionInfo perm = perms.get(j);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user