Merge "power.stats: Use PowerStats HAL v1.0 in cuttlefish"

This commit is contained in:
Treehugger Robot
2019-01-28 21:03:26 +00:00
committed by Gerrit Code Review
5 changed files with 19 additions and 4 deletions

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
cc_binary {
name: "android.hardware.power.stats@1.0-service",
name: "android.hardware.power.stats@1.0-service.mock",
relative_install_path: "hw",
init_rc: ["android.hardware.power.stats@1.0-service.rc"],
srcs: ["service.cpp", "PowerStats.cpp"],
@@ -31,4 +31,5 @@ cc_binary {
"android.hardware.power.stats@1.0",
],
vendor: true,
vintf_fragments: ["android.hardware.power.stats@1.0-service-mock.xml"],
}

View File

@@ -14,6 +14,8 @@
* limitations under the License.
*/
#define LOG_TAG "android.hardware.power.stats@1.0-service-mock"
#include "PowerStats.h"
#include <android-base/file.h>
#include <android-base/logging.h>

View File

@@ -0,0 +1,11 @@
<manifest version="1.0" type="device">
<hal format="hidl">
<name>android.hardware.power.stats</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IPowerStats</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@@ -1,4 +1,5 @@
service vendor.power.stats-hal-1-0 /vendor/bin/hw/android.hardware.power.stats@1.0-service
service vendor.power.stats-hal-1-0-mock /vendor/bin/hw/android.hardware.power.stats@1.0-service.mock
interface android.hardware.power.stats@1.0::IPowerStats default
class hal
user system
group system

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
#define LOG_TAG "android.hardware.power.stats@1.0-service"
#define LOG_TAG "android.hardware.power.stats@1.0-service-mock"
#include <android/log.h>
#include <hidl/HidlTransportSupport.h>
@@ -82,7 +82,7 @@ class DefaultStateResidencyDataProvider : public IStateResidencyDataProvider {
};
int main(int /* argc */, char** /* argv */) {
ALOGI("power.stats service 1.0 is starting.");
ALOGI("power.stats service 1.0 mock is starting.");
PowerStats* service = new PowerStats();
if (service == nullptr) {