1/* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.internal.os; 18 19import java.io.PrintWriter; 20import java.io.StringWriter; 21import java.util.ArrayList; 22 23import android.os.BatteryStats; 24import android.os.Parcel; 25import android.test.suitebuilder.annotation.SmallTest; 26import android.util.Log; 27 28import junit.framework.Assert; 29import junit.framework.TestCase; 30 31import com.android.internal.os.BatteryStatsImpl; 32 33import org.mockito.Mockito; 34 35/** 36 * Mocks a BatteryStatsImpl object. 37 */ 38public class MockBatteryStatsImpl extends BatteryStatsImpl { 39 public BatteryStatsImpl.Clocks clocks; 40 41 MockBatteryStatsImpl() { 42 super(new MockClocks()); 43 this.clocks = mClocks; 44 } 45 46 public TimeBase getOnBatteryTimeBase() { 47 return mOnBatteryTimeBase; 48 } 49 50} 51 52