Update fuelguage to use uid in AppInfo
The uid is needed to distinguish the same app used by different users(even work profile user). So we need to store the correct uid in AppInfo and use it across the settings app. Bug: 74022362 Test: RunSettingsRoboTests Change-Id: Iaa0ea1ac1fbd3a3a1251e0cd1096d6a8c75c4ed8
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.settings.fuelgauge.batterytip;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.support.annotation.VisibleForTesting;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.settings.fuelgauge.anomaly.Anomaly;
|
||||
|
||||
@@ -74,6 +75,22 @@ public class AppInfo implements Comparable<AppInfo>, Parcelable {
|
||||
+ screenOnTimeMs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof AppInfo)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AppInfo other = (AppInfo) obj;
|
||||
return anomalyType == other.anomalyType
|
||||
&& uid == other.uid
|
||||
&& screenOnTimeMs == other.screenOnTimeMs
|
||||
&& TextUtils.equals(packageName, other.packageName);
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
|
||||
public AppInfo createFromParcel(Parcel in) {
|
||||
return new AppInfo(in);
|
||||
|
Reference in New Issue
Block a user