Remove uses of deprecated class BatterySipper

also, remove the obsolete class FakeUid

Test: make RunSettingsRoboTests
Test: make RunSettingsGoogleRoboTests
Change-Id: I2f235a18dcca3b5b3a2839408b76553bbc4f655a
This commit is contained in:
Dmitri Plotnikov
2021-08-27 18:18:19 -07:00
parent b2f80a7105
commit ad0bb5b7fe
5 changed files with 13 additions and 506 deletions

View File

@@ -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;
@@ -46,25 +45,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;
}