mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge "vibrator extension: use checked_interface_cast"
am: 741347b49d
Change-Id: I3c21e5fd872a974b04d6f283256971a61d0778f3
This commit is contained in:
@@ -20,9 +20,9 @@
|
||||
#include <binder/IServiceManager.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
using android::checked_interface_cast;
|
||||
using android::IBinder;
|
||||
using android::IInterface;
|
||||
using android::interface_cast;
|
||||
using android::OK;
|
||||
using android::sp;
|
||||
using android::waitForVintfService;
|
||||
@@ -44,7 +44,7 @@ TEST(Cpp, CallExtMethod) {
|
||||
// getting the extension
|
||||
sp<IBinder> ext;
|
||||
ASSERT_EQ(OK, IInterface::asBinder(vib)->getExtension(&ext));
|
||||
sp<ICustomVibrator> cvib = interface_cast<ICustomVibrator>(ext);
|
||||
sp<ICustomVibrator> cvib = checked_interface_cast<ICustomVibrator>(ext);
|
||||
ASSERT_NE(nullptr, cvib.get());
|
||||
|
||||
// calling extension method
|
||||
|
||||
Reference in New Issue
Block a user