Search in sources :

Example 1 with DrainType

use of com.android.internal.os.BatterySipper.DrainType in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class PowerUsageSummary method getFakeStats.

private static List<BatterySipper> getFakeStats() {
    ArrayList<BatterySipper> stats = new ArrayList<>();
    float use = 5;
    for (DrainType type : DrainType.values()) {
        if (type == DrainType.APP) {
            continue;
        }
        stats.add(new BatterySipper(type, null, use));
        use += 5;
    }
    for (int i = 0; i < 100; i++) {
        stats.add(new BatterySipper(DrainType.APP, new FakeUid(Process.FIRST_APPLICATION_UID + i), use));
    }
    stats.add(new BatterySipper(DrainType.APP, new FakeUid(0), use));
    // Simulate dex2oat process.
    BatterySipper sipper = new BatterySipper(DrainType.APP, new FakeUid(UserHandle.getSharedAppGid(Process.FIRST_APPLICATION_UID)), 10.0f);
    sipper.packageWithHighestDrain = "dex2oat";
    stats.add(sipper);
    sipper = new BatterySipper(DrainType.APP, new FakeUid(UserHandle.getSharedAppGid(Process.FIRST_APPLICATION_UID + 1)), 10.0f);
    sipper.packageWithHighestDrain = "dex2oat";
    stats.add(sipper);
    sipper = new BatterySipper(DrainType.APP, new FakeUid(UserHandle.getSharedAppGid(Process.LOG_UID)), 9.0f);
    stats.add(sipper);
    return stats;
}
Also used : DrainType(com.android.internal.os.BatterySipper.DrainType) BatterySipper(com.android.internal.os.BatterySipper) ArrayList(java.util.ArrayList)

Aggregations

BatterySipper (com.android.internal.os.BatterySipper)1 DrainType (com.android.internal.os.BatterySipper.DrainType)1 ArrayList (java.util.ArrayList)1