Use cpu freq times to calculate power consumed by an uid.

Initially we used to approximate times spent by an uid at a particular
freq using total time spent by the uid but since now the freq times
are directly available from the proc file, we can use these to
calculate power.

Bug: 62240247
Test: bit FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Test: cts-tradefed run singleCommand cts-dev -m CtsIncidentHostTestCases -t \
      com.android.server.cts.BatteryStatsValidationTest
Test: Used some apps and verified that battery usage is attributed to
      those apps in Battery settings.
Change-Id: Ia8e2eb07fd778b8a8c83a6acec711e7b97aefdc0
6 files changed