Fix uninstalled app original uid should not be 0
Context: some special packages have uid but 0. Those packages should not be part of uninstalled apps. Test: manual Bug: 264339271 Fix: 264339271 Change-Id: I86874691b0a837335c2e5352d1d0c6be8df8a2e4
This commit is contained in:
@@ -74,6 +74,7 @@ import java.util.List;
|
||||
* Utils for battery operation
|
||||
*/
|
||||
public class BatteryUtils {
|
||||
public static final int UID_ZERO = 0;
|
||||
public static final int UID_NULL = -1;
|
||||
public static final int SDK_NULL = -1;
|
||||
/** Special UID value for data usage by removed apps. */
|
||||
|
||||
@@ -283,7 +283,9 @@ public class BatteryDiffEntry {
|
||||
/** Whether the current BatteryDiffEntry is uninstalled app or not. */
|
||||
public boolean isUninstalledEntry() {
|
||||
final String packageName = getPackageName();
|
||||
if (TextUtils.isEmpty(packageName) || isSystemEntry()) {
|
||||
if (TextUtils.isEmpty(packageName) || isSystemEntry()
|
||||
// Some special package UIDs could be 0. Those packages are not installed by users.
|
||||
|| mUid == BatteryUtils.UID_ZERO) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user