power: add check for shared pointer
Add check for shared pointer Change-Id: I984988e49b3e59f3a674fb6dbfc8c19d3adb6d74
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
b4b7dada81
commit
916a21ef58
10
main.cpp
10
main.cpp
@@ -40,10 +40,12 @@ int main() {
|
||||
std::shared_ptr<Power> vib = ndk::SharedRefBase::make<Power>();
|
||||
const std::string instance = std::string() + Power::descriptor + "/default";
|
||||
LOG(INFO) << "Instance " << instance;
|
||||
binder_status_t status = AServiceManager_addService(vib->asBinder().get(), instance.c_str());
|
||||
LOG(INFO) << "Status " << status;
|
||||
if(status != STATUS_OK){
|
||||
LOG(ERROR) << "Could not register" << instance;
|
||||
if(vib){
|
||||
binder_status_t status = AServiceManager_addService(vib->asBinder().get(), instance.c_str());
|
||||
LOG(INFO) << "Status " << status;
|
||||
if(status != STATUS_OK){
|
||||
LOG(ERROR) << "Could not register" << instance;
|
||||
}
|
||||
}
|
||||
|
||||
ABinderProcess_joinThreadPool();
|
||||
|
||||
Reference in New Issue
Block a user