Merge "Fix uninstalled app original uid should not be 0" into main
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