Do not look at self when comparing for duplicate usage
When looking for duplicate usages, do not compare to self Fixes: 178088373 Test: manual Change-Id: I5e7316caff5ff33017cd868324c066a3f3e99bd6
This commit is contained in:
@@ -662,6 +662,11 @@ public class PermissionUsageHelper {
|
||||
// usage for that uid, keep it. Otherwise, remove it
|
||||
boolean isMostRecentForUid = true;
|
||||
for (int otherUsageNum = 0; otherUsageNum < rawUsages.size(); otherUsageNum++) {
|
||||
// Do not compare this usage to itself
|
||||
if (otherUsageNum == usageNum) {
|
||||
continue;
|
||||
}
|
||||
|
||||
OpUsage otherUsage = rawUsages.get(otherUsageNum);
|
||||
if (otherUsage.uid == usage.uid) {
|
||||
if (otherUsage.isRunning && !usage.isRunning) {
|
||||
|
||||
Reference in New Issue
Block a user