Merge "hwc: Fix null dereference"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
a48820e6c2
@@ -273,9 +273,15 @@ void initContext(hwc_context_t *ctx)
|
|||||||
//independent process as well.
|
//independent process as well.
|
||||||
QService::init();
|
QService::init();
|
||||||
sp<IQClient> client = new QClient(ctx);
|
sp<IQClient> client = new QClient(ctx);
|
||||||
interface_cast<IQService>(
|
android::sp<qService::IQService> qservice_sp = interface_cast<IQService>(
|
||||||
defaultServiceManager()->getService(
|
defaultServiceManager()->getService(
|
||||||
String16("display.qservice")))->connect(client);
|
String16("display.qservice")));
|
||||||
|
if (qservice_sp.get()) {
|
||||||
|
qservice_sp->connect(client);
|
||||||
|
} else {
|
||||||
|
ALOGE("%s: Failed to acquire service pointer", __FUNCTION__);
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize device orientation to its default orientation
|
// Initialize device orientation to its default orientation
|
||||||
ctx->deviceOrientation = 0;
|
ctx->deviceOrientation = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user