mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Fix stack-pointer constructed sp<>.
Seems like the hidl derived objects must be heap allocated. Bug: 145662746 Test: Does not boot loop. Change-Id: I55ff94c12d4eb5fcfd680370736db979ddd0b67c
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "BroadcastRadioFactory.h"
|
||||
|
||||
using android::sp;
|
||||
using android::hardware::configureRpcThreadpool;
|
||||
using android::hardware::joinRpcThreadpool;
|
||||
using android::hardware::broadcastradio::V1_1::implementation::BroadcastRadioFactory;
|
||||
@@ -27,8 +28,8 @@ using android::hardware::broadcastradio::V1_1::implementation::BroadcastRadioFac
|
||||
int main(int /* argc */, char** /* argv */) {
|
||||
configureRpcThreadpool(4, true);
|
||||
|
||||
BroadcastRadioFactory broadcastRadioFactory;
|
||||
auto status = broadcastRadioFactory.registerAsService();
|
||||
sp<BroadcastRadioFactory> broadcastRadioFactory(new BroadcastRadioFactory());
|
||||
auto status = broadcastRadioFactory->registerAsService();
|
||||
CHECK_EQ(status, android::OK) << "Failed to register Broadcast Radio HAL implementation";
|
||||
|
||||
joinRpcThreadpool();
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "BroadcastRadio.h"
|
||||
#include "VirtualRadio.h"
|
||||
|
||||
using android::sp;
|
||||
using android::hardware::configureRpcThreadpool;
|
||||
using android::hardware::joinRpcThreadpool;
|
||||
using android::hardware::broadcastradio::V2_0::implementation::BroadcastRadio;
|
||||
@@ -30,13 +31,13 @@ int main() {
|
||||
android::base::SetMinimumLogSeverity(android::base::VERBOSE);
|
||||
configureRpcThreadpool(4, true);
|
||||
|
||||
BroadcastRadio broadcastRadio(gAmFmRadio);
|
||||
auto amFmStatus = broadcastRadio.registerAsService("amfm");
|
||||
sp<BroadcastRadio> broadcastRadio(new BroadcastRadio(gAmFmRadio));
|
||||
auto amFmStatus = broadcastRadio->registerAsService("amfm");
|
||||
CHECK_EQ(amFmStatus, android::OK)
|
||||
<< "Failed to register Broadcast Radio AM/FM HAL implementation";
|
||||
|
||||
BroadcastRadio dabRadio(gDabRadio);
|
||||
auto dabStatus = dabRadio.registerAsService("dab");
|
||||
sp<BroadcastRadio> dabRadio(new BroadcastRadio(gDabRadio));
|
||||
auto dabStatus = dabRadio->registerAsService("dab");
|
||||
CHECK_EQ(dabStatus, android::OK) << "Failed to register Broadcast Radio DAB HAL implementation";
|
||||
|
||||
joinRpcThreadpool();
|
||||
|
||||
Reference in New Issue
Block a user