Merge "Remove uses of deprecated class BatterySipper also, remove the obsolete class FakeUid"
This commit is contained in:
committed by
Android (Google) Code Review
commit
99ec71728f
@@ -23,7 +23,6 @@ import android.net.Uri;
|
||||
import android.os.Process;
|
||||
import android.util.SparseIntArray;
|
||||
|
||||
import com.android.internal.os.BatterySipper;
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
import com.android.settingslib.fuelgauge.Estimate;
|
||||
|
||||
@@ -48,25 +47,7 @@ public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTypeService(BatterySipper sipper) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTypeSystem(BatterySipper sipper) {
|
||||
final int uid = sipper.uidObj == null ? -1 : sipper.getUid();
|
||||
sipper.mPackages = mPackageManager.getPackagesForUid(uid);
|
||||
// Classify all the sippers to type system if the range of uid is 0...FIRST_APPLICATION_UID
|
||||
if (uid >= Process.ROOT_UID && uid < Process.FIRST_APPLICATION_UID) {
|
||||
return true;
|
||||
} else if (sipper.mPackages != null) {
|
||||
for (final String packageName : sipper.mPackages) {
|
||||
if (ArrayUtils.contains(PACKAGES_SYSTEM, packageName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isTypeService(int uid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user