Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31d259d3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove BatteryStats parcelability and some unused code"

parents dc3788b5 d9fd8fc2
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ import java.util.Map;
 * except where indicated otherwise.
 * @hide
 */
public abstract class BatteryStats implements Parcelable {
public abstract class BatteryStats {

    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
    public BatteryStats() {}
@@ -3516,8 +3516,6 @@ public abstract class BatteryStats implements Parcelable {

    public abstract LongSparseArray<? extends Timer> getKernelMemoryStats();

    public abstract void writeToParcelWithoutUids(Parcel out, int flags);

    private final static void formatTimeRaw(StringBuilder out, long seconds) {
        long days = seconds / (60 * 60 * 24);
        if (days != 0) {
+0 −5
Original line number Diff line number Diff line
@@ -256,11 +256,6 @@ public class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStat
        return scheduleSyncLocked("remove-uid", UPDATE_CPU);
    }

    @Override
    public synchronized Future<?> scheduleCpuSyncDueToSettingChange() {
        return scheduleSyncLocked("setting-change", UPDATE_CPU);
    }

    @Override
    public Future<?> scheduleSyncDueToScreenStateChange(int flags, boolean onBattery,
            boolean onBatteryScreenOff, int screenState, int[] perDisplayScreenStates) {
+31 −1747

File changed.

Preview size limit exceeded, changes collapsed.

+2 −47
Original line number Diff line number Diff line
@@ -171,11 +171,6 @@ public class BatteryStatsServTest extends TestCase {
    @SmallTest
    public void testStartLaunchedLockedWhileLaunched() throws Exception  {
        MockBatteryStatsImpl bsi = new MockBatteryStatsImpl() {
            @Override
            public long getBatteryUptimeLocked() {
                return 777777L * 1000; // microseconds
            }

            @Override
            public long getBatteryUptimeLocked(long uptimeMs) {
                return 777777L * 1000; // microseconds
@@ -205,11 +200,6 @@ public class BatteryStatsServTest extends TestCase {
    @SmallTest
    public void testStartLaunchedLockedWhileNotLaunched() throws Exception  {
        MockBatteryStatsImpl bsi = new MockBatteryStatsImpl() {
            @Override
            public long getBatteryUptimeLocked() {
                return 777777L * 1000; // microseconds
            }

            @Override
            public long getBatteryUptimeLocked(long uptimeMs) {
                return 777777L * 1000; // microseconds
@@ -237,11 +227,6 @@ public class BatteryStatsServTest extends TestCase {
    @SmallTest
    public void testStopLaunchedLockedWhileNotLaunched() throws Exception  {
        MockBatteryStatsImpl bsi = new MockBatteryStatsImpl() {
            @Override
            public long getBatteryUptimeLocked() {
                return 777777L * 1000; // microseconds
            }

            @Override
            public long getBatteryUptimeLocked(long uptimeMs) {
                return 777777L * 1000; // microseconds
@@ -272,11 +257,6 @@ public class BatteryStatsServTest extends TestCase {
    @SmallTest
    public void testStopLaunchedLockedWhileLaunchedNormal() throws Exception  {
        MockBatteryStatsImpl bsi = new MockBatteryStatsImpl() {
            @Override
            public long getBatteryUptimeLocked() {
                return 777777L * 1000; // microseconds
            }

            @Override
            public long getBatteryUptimeLocked(long uptimeMs) {
                return 777777L * 1000; // microseconds
@@ -305,12 +285,7 @@ public class BatteryStatsServTest extends TestCase {
     */
    @SmallTest
    public void testStopLaunchedLockedWhileLaunchedTooQuick() throws Exception  {
        MockBatteryStatsImpl bsi = new MockBatteryStatsImpl() {
            @Override
            public long getBatteryUptimeLocked() {
                return 6064L;
            }
        };
        MockBatteryStatsImpl bsi = new MockBatteryStatsImpl();
        TestServ serv = new TestServ(bsi);

        serv.populate();
@@ -334,11 +309,6 @@ public class BatteryStatsServTest extends TestCase {
    @SmallTest
    public void testStartRunningLockedWhileRunning() throws Exception  {
        MockBatteryStatsImpl bsi = new MockBatteryStatsImpl() {
            @Override
            public long getBatteryUptimeLocked() {
                return 777777L * 1000; // microseconds
            }

            @Override
            public long getBatteryUptimeLocked(long uptimeMs) {
                return 777777L * 1000; // microseconds
@@ -368,11 +338,6 @@ public class BatteryStatsServTest extends TestCase {
    @SmallTest
    public void testStartRunningLockedWhileNotRunning() throws Exception  {
        MockBatteryStatsImpl bsi = new MockBatteryStatsImpl() {
            @Override
            public long getBatteryUptimeLocked() {
                return 777777L * 1000; // microseconds
            }

            @Override
            public long getBatteryUptimeLocked(long uptimeMs) {
                return 777777L * 1000; // microseconds
@@ -402,11 +367,6 @@ public class BatteryStatsServTest extends TestCase {
    @SmallTest
    public void testStopRunningLockedWhileRunningNormal() throws Exception  {
        MockBatteryStatsImpl bsi = new MockBatteryStatsImpl() {
            @Override
            public long getBatteryUptimeLocked() {
                return 777777L * 1000; // microseconds
            }

            @Override
            public long getBatteryUptimeLocked(long uptimeMs) {
                return 777777L * 1000; // microseconds
@@ -435,12 +395,7 @@ public class BatteryStatsServTest extends TestCase {
     */
    @SmallTest
    public void testStopRunningLockedWhileRunningTooQuick() throws Exception  {
        MockBatteryStatsImpl bsi = new MockBatteryStatsImpl() {
            @Override
            public long getBatteryUptimeLocked() {
                return 2021;
            }
        };
        MockBatteryStatsImpl bsi = new MockBatteryStatsImpl();
        TestServ serv = new TestServ(bsi);

        serv.populate();
+0 −5
Original line number Diff line number Diff line
@@ -239,11 +239,6 @@ public class MockBatteryStatsImpl extends BatteryStatsImpl {
            return null;
        }

        @Override
        public Future<?> scheduleCpuSyncDueToSettingChange() {
            return null;
        }

        @Override
        public Future<?> scheduleSyncDueToScreenStateChange(int flag, boolean onBattery,
                boolean onBatteryScreenOff, int screenState, int[] perDisplayScreenStates) {