From 2ab27a5e1e004359897555c45bd0b7bafdd216b1 Mon Sep 17 00:00:00 2001 From: Michael Sun Date: Thu, 29 Oct 2020 20:18:48 +0000 Subject: [PATCH] Update to use new android.system.suspend.control AIDL interface The suspend_control_aidl_interface is updated, renamed, and splitted into android.system.suspend.control and android.system.suspend.control.internal. Update to use the correct interfaces. Test: atest libpower_test Bug: 171598743 Change-Id: I707f5cb868e6756147587e0e097e77ec50995bd4 --- Android.bp | 2 +- power_test.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Android.bp b/Android.bp index d196ee6..4ddf7e6 100644 --- a/Android.bp +++ b/Android.bp @@ -36,8 +36,8 @@ cc_test { srcs: ["power_test.cpp"], static_libs: ["libpower"], shared_libs: [ + "android.system.suspend.control.internal-cpp", "android.system.suspend@1.0", - "suspend_control_aidl_interface-cpp", ], test_suites: ["device-tests"], require_root: true, diff --git a/power_test.cpp b/power_test.cpp index d6e414d..32cff70 100644 --- a/power_test.cpp +++ b/power_test.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include +#include #include #include #include @@ -27,8 +27,8 @@ #include using android::sp; -using android::system::suspend::ISuspendControlService; -using android::system::suspend::WakeLockInfo; +using android::system::suspend::internal::ISuspendControlServiceInternal; +using android::system::suspend::internal::WakeLockInfo; using namespace std::chrono_literals; namespace android { @@ -94,13 +94,13 @@ class WakeLockTest : public ::testing::Test { public: virtual void SetUp() override { sp control = - android::defaultServiceManager()->getService(android::String16("suspend_control")); - ASSERT_NE(control, nullptr) << "failed to get the suspend control service"; - controlService = interface_cast(control); + android::defaultServiceManager()->getService(android::String16("suspend_control_internal")); + ASSERT_NE(control, nullptr) << "failed to get the internal suspend control service"; + controlService = interface_cast(control); } // Returns true iff found. - bool findWakeLockInfoByName(const sp& service, const std::string& name, + bool findWakeLockInfoByName(const sp& service, const std::string& name, WakeLockInfo* info) { std::vector wlStats; service->getWakeLockStats(&wlStats); @@ -114,7 +114,7 @@ class WakeLockTest : public ::testing::Test { } // All userspace wake locks are registered with system suspend. - sp controlService; + sp controlService; }; // Test RAII properties of WakeLock destructor.