public static class BatteryStatsImpl.Uid.Pkg.Serv extends BatteryStats.Uid.Pkg.Serv implements BatteryStatsImpl.TimeBaseObs
Modifier and Type | Field and Description |
---|---|
protected BatteryStatsImpl |
mBsi
BatteryStatsImpl that we are associated with.
|
protected int |
mLastLaunches
The number of launches as of the last run.
|
protected int |
mLastStarts
The number of starts as of the last run.
|
protected long |
mLastStartTime
The amount of time spent started as of the last run (ms
in battery uptime).
|
protected boolean |
mLaunched
True if we are currently launched.
|
protected long |
mLaunchedSince
If service has been launched and not yet exited, this is
when it was launched (ms in battery uptime).
|
protected long |
mLaunchedTime
Total time (ms in battery uptime) the service has been left launched.
|
protected int |
mLaunches
Total number times the service has been launched.
|
protected int |
mLoadedLaunches
The number of launches loaded from a previous save.
|
protected int |
mLoadedStarts
The number of starts loaded from a previous save.
|
protected long |
mLoadedStartTime
The amount of time spent started loaded from a previous save
(ms in battery uptime).
|
protected BatteryStatsImpl.Uid.Pkg |
mPkg
The android package in which this service resides.
|
protected boolean |
mRunning
True if we are currently running.
|
protected long |
mRunningSince
If service has been started and not yet stopped, this is
when it was started.
|
protected int |
mStarts
Total number of times startService() has been called.
|
protected long |
mStartTime
Total time (ms in battery uptime) the service has been left started.
|
protected int |
mUnpluggedLaunches
The number of launches when last unplugged.
|
protected int |
mUnpluggedStarts
The number of starts when last unplugged.
|
protected long |
mUnpluggedStartTime
The amount of time spent started when last unplugged (ms
in battery uptime).
|
Constructor and Description |
---|
Serv(BatteryStatsImpl bsi)
Construct a Serv.
|
Modifier and Type | Method and Description |
---|---|
void |
detach()
Remove this Serv as a listener from the time base.
|
BatteryStatsImpl |
getBatteryStats() |
int |
getLaunches(int which)
Returns the total number times the service has been launched.
|
long |
getLaunchTimeToNowLocked(long batteryUptime) |
int |
getStarts(int which)
Returns the total number of times startService() has been called.
|
long |
getStartTime(long now,
int which)
Returns the amount of time spent started.
|
long |
getStartTimeToNowLocked(long batteryUptime) |
void |
onTimeStarted(long elapsedRealtime,
long baseUptime,
long baseRealtime) |
void |
onTimeStopped(long elapsedRealtime,
long baseUptime,
long baseRealtime) |
void |
readFromParcelLocked(Parcel in) |
void |
startLaunchedLocked() |
void |
startRunningLocked() |
void |
stopLaunchedLocked() |
void |
stopRunningLocked() |
void |
writeToParcelLocked(Parcel out) |
protected BatteryStatsImpl mBsi
protected BatteryStatsImpl.Uid.Pkg mPkg
protected long mStartTime
protected long mRunningSince
protected boolean mRunning
protected int mStarts
protected long mLaunchedTime
protected long mLaunchedSince
protected boolean mLaunched
protected int mLaunches
protected long mLoadedStartTime
protected int mLoadedStarts
protected int mLoadedLaunches
protected long mLastStartTime
protected int mLastStarts
protected int mLastLaunches
protected long mUnpluggedStartTime
protected int mUnpluggedStarts
protected int mUnpluggedLaunches
public Serv(BatteryStatsImpl bsi)
public void onTimeStarted(long elapsedRealtime, long baseUptime, long baseRealtime)
onTimeStarted
in interface BatteryStatsImpl.TimeBaseObs
public void onTimeStopped(long elapsedRealtime, long baseUptime, long baseRealtime)
onTimeStopped
in interface BatteryStatsImpl.TimeBaseObs
public void detach()
public void readFromParcelLocked(Parcel in)
public void writeToParcelLocked(Parcel out)
public long getLaunchTimeToNowLocked(long batteryUptime)
public long getStartTimeToNowLocked(long batteryUptime)
public void startLaunchedLocked()
public void stopLaunchedLocked()
public void startRunningLocked()
public void stopRunningLocked()
public BatteryStatsImpl getBatteryStats()
public int getLaunches(int which)
BatteryStats.Uid.Pkg.Serv
getLaunches
in class BatteryStats.Uid.Pkg.Serv
which
- one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT.public long getStartTime(long now, int which)
BatteryStats.Uid.Pkg.Serv
getStartTime
in class BatteryStats.Uid.Pkg.Serv
now
- elapsed uptime on battery in microseconds.which
- one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT.public int getStarts(int which)
BatteryStats.Uid.Pkg.Serv
getStarts
in class BatteryStats.Uid.Pkg.Serv
which
- one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT.