diff --git a/vibrator/aidl/default/main.cpp b/vibrator/aidl/default/main.cpp index feba2c7062..73758895eb 100644 --- a/vibrator/aidl/default/main.cpp +++ b/vibrator/aidl/default/main.cpp @@ -29,15 +29,15 @@ int main() { // make a default vibrator service auto vib = ndk::SharedRefBase::make(); - const std::string vibName = std::string() + Vibrator::descriptor + "/default"; - binder_status_t status = AServiceManager_addService(vib->asBinder().get(), vibName.c_str()); + binder_status_t status = AServiceManager_addService( + vib->asBinder().get(), Vibrator::makeServiceName("default").c_str()); CHECK_EQ(status, STATUS_OK); // make the vibrator manager service with a different vibrator auto managedVib = ndk::SharedRefBase::make(); auto vibManager = ndk::SharedRefBase::make(std::move(managedVib)); - const std::string vibManagerName = std::string() + VibratorManager::descriptor + "/default"; - status = AServiceManager_addService(vibManager->asBinder().get(), vibManagerName.c_str()); + status = AServiceManager_addService(vibManager->asBinder().get(), + VibratorManager::makeServiceName("default").c_str()); CHECK_EQ(status, STATUS_OK); ABinderProcess_joinThreadPool();