diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp index 9957a71..95be7cc 100644 --- a/libhwcomposer/hwc.cpp +++ b/libhwcomposer/hwc.cpp @@ -85,6 +85,11 @@ static int hwc_prepare(hwc_composer_device_t *dev, hwc_layer_list_t* list) hwc_context_t* ctx = (hwc_context_t*)(dev); ctx->overlayInUse = false; + if(ctx->mSecureConfig == true) { + // This will tear down External Display Device. + return 0; + } + if(ctx->mExtDisplay->getExternalDisplay()) ovutils::setExtType(ctx->mExtDisplay->getExternalDisplay()); diff --git a/libhwcomposer/hwc_service.cpp b/libhwcomposer/hwc_service.cpp index be44069..d0e29df 100644 --- a/libhwcomposer/hwc_service.cpp +++ b/libhwcomposer/hwc_service.cpp @@ -1,133 +1,190 @@ -/* - * Copyright (c) 2012, Code Aurora Forum. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Code Aurora Forum, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include - -#define HWC_SERVICE_DEBUG 0 - -using namespace android; - -namespace hwcService { - -HWComposerService* HWComposerService::sHwcService = NULL; -// ---------------------------------------------------------------------------- -HWComposerService::HWComposerService():mHwcContext(0) -{ - ALOGD_IF(HWC_SERVICE_DEBUG, "HWComposerService Constructor invoked"); -} - -HWComposerService::~HWComposerService() -{ - ALOGD_IF(HWC_SERVICE_DEBUG,"HWComposerService Destructor invoked"); -} - -status_t HWComposerService::setHPDStatus(int hpdStatus) { - ALOGD_IF(HWC_SERVICE_DEBUG, "hpdStatus=%d", hpdStatus); - qhwc::ExternalDisplay *externalDisplay = mHwcContext->mExtDisplay; - externalDisplay->setHPDStatus(hpdStatus); - return NO_ERROR; -} - -status_t HWComposerService::setResolutionMode(int resMode) { - ALOGD_IF(HWC_SERVICE_DEBUG, "resMode=%d", resMode); - qhwc::ExternalDisplay *externalDisplay = mHwcContext->mExtDisplay; - if(externalDisplay->getExternalDisplay()) { - externalDisplay->setEDIDMode(resMode); - } else { - ALOGE("External Display not connected"); - } - return NO_ERROR; -} - -status_t HWComposerService::setActionSafeDimension(int w, int h) { - ALOGD_IF(HWC_SERVICE_DEBUG, "w=%d h=%d", w, h); - qhwc::ExternalDisplay *externalDisplay = mHwcContext->mExtDisplay; - if((w > MAX_ACTIONSAFE_WIDTH) && (h > MAX_ACTIONSAFE_HEIGHT)) { - ALOGE_IF(HWC_SERVICE_DEBUG, - "ActionSafe Width and Height exceeded the limit! w=%d h=%d", w, h); - return NO_ERROR; - } - if(externalDisplay->getExternalDisplay()) { - externalDisplay->setActionSafeDimension(w, h); - } else { - ALOGE("External Display not connected"); - } - return NO_ERROR; -} - -status_t HWComposerService::getResolutionModeCount(int *resModeCount) { - qhwc::ExternalDisplay *externalDisplay = mHwcContext->mExtDisplay; - if(externalDisplay->getExternalDisplay()) { - *resModeCount = externalDisplay->getModeCount(); - } else { - ALOGE("External Display not connected"); - } - ALOGD_IF(HWC_SERVICE_DEBUG, "resModeCount=%d", *resModeCount); - return NO_ERROR; -} - -status_t HWComposerService::getResolutionModes(int *resModes, int count) { - qhwc::ExternalDisplay *externalDisplay = mHwcContext->mExtDisplay; - if(externalDisplay->getExternalDisplay()) { - externalDisplay->getEDIDModes(resModes); - } else { - ALOGE("External Display not connected"); - } - return NO_ERROR; -} - -status_t HWComposerService::getExternalDisplay(int *dispType) { - qhwc::ExternalDisplay *externalDisplay = mHwcContext->mExtDisplay; - *dispType = externalDisplay->getExternalDisplay(); - ALOGD_IF(HWC_SERVICE_DEBUG, "dispType=%d", *dispType); - return NO_ERROR; -} - -HWComposerService* HWComposerService::getInstance() -{ - if(!sHwcService) { - sHwcService = new HWComposerService(); - sp sm = defaultServiceManager(); - sm->addService(String16("display.hwcservice"), sHwcService); - if(sm->checkService(String16("display.hwcservice")) != NULL) - ALOGD_IF(HWC_SERVICE_DEBUG, "adding display.hwcservice succeeded"); - else - ALOGD_IF(HWC_SERVICE_DEBUG, "adding display.hwcservice failed"); - } - return sHwcService; -} - -void HWComposerService::setHwcContext(hwc_context_t *hwcCtx) { - ALOGD_IF(HWC_SERVICE_DEBUG, "hwcCtx=0x%x", (int)hwcCtx); - if(hwcCtx) { - mHwcContext = hwcCtx; - } -} -} +/* + * Copyright (c) 2012, Code Aurora Forum. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Code Aurora Forum, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +#define HWC_SERVICE_DEBUG 0 + +using namespace android; + +namespace hwcService { + +HWComposerService* HWComposerService::sHwcService = NULL; +// ---------------------------------------------------------------------------- +HWComposerService::HWComposerService():mHwcContext(0) +{ + ALOGD_IF(HWC_SERVICE_DEBUG, "HWComposerService Constructor invoked"); +} + +HWComposerService::~HWComposerService() +{ + ALOGD_IF(HWC_SERVICE_DEBUG,"HWComposerService Destructor invoked"); +} + +status_t HWComposerService::setHPDStatus(int hpdStatus) { + ALOGD_IF(HWC_SERVICE_DEBUG, "hpdStatus=%d", hpdStatus); + qhwc::ExternalDisplay *externalDisplay = mHwcContext->mExtDisplay; + externalDisplay->setHPDStatus(hpdStatus); + return NO_ERROR; +} + +status_t HWComposerService::setResolutionMode(int resMode) { + ALOGD_IF(HWC_SERVICE_DEBUG, "resMode=%d", resMode); + qhwc::ExternalDisplay *externalDisplay = mHwcContext->mExtDisplay; + if(externalDisplay->getExternalDisplay()) { + externalDisplay->setEDIDMode(resMode); + } else { + ALOGE("External Display not connected"); + } + return NO_ERROR; +} + +status_t HWComposerService::setActionSafeDimension(int w, int h) { + ALOGD_IF(HWC_SERVICE_DEBUG, "w=%d h=%d", w, h); + qhwc::ExternalDisplay *externalDisplay = mHwcContext->mExtDisplay; + if((w > MAX_ACTIONSAFE_WIDTH) && (h > MAX_ACTIONSAFE_HEIGHT)) { + ALOGE_IF(HWC_SERVICE_DEBUG, + "ActionSafe Width and Height exceeded the limit! w=%d h=%d", w, h); + return NO_ERROR; + } + if(externalDisplay->getExternalDisplay()) { + externalDisplay->setActionSafeDimension(w, h); + } else { + ALOGE("External Display not connected"); + } + return NO_ERROR; +} +status_t HWComposerService::setOpenSecureStart( ) { + mHwcContext->mSecureConfig = true; + //Invalidate + hwc_procs* proc = (hwc_procs*)mHwcContext->device.reserved_proc[0]; + if(!proc) { + ALOGE("%s: HWC proc not registered", __FUNCTION__); + } else { + /* Trigger redraw */ + ALOGD_IF(HWC_SERVICE_DEBUG, "%s: Invalidate !!", __FUNCTION__); + proc->invalidate(proc); + } + return NO_ERROR; +} + +status_t HWComposerService::setOpenSecureEnd( ) { + mHwcContext->mSecure = true; + mHwcContext->mSecureConfig = false; + //Invalidate + hwc_procs* proc = (hwc_procs*)mHwcContext->device.reserved_proc[0]; + if(!proc) { + ALOGE("%s: HWC proc not registered", __FUNCTION__); + } else { + /* Trigger redraw */ + ALOGD_IF(HWC_SERVICE_DEBUG, "%s: Invalidate !!", __FUNCTION__); + proc->invalidate(proc); + } + return NO_ERROR; +} + +status_t HWComposerService::setCloseSecureStart( ) { + mHwcContext->mSecureConfig = true; + //Invalidate + hwc_procs* proc = (hwc_procs*)mHwcContext->device.reserved_proc[0]; + if(!proc) { + ALOGE("%s: HWC proc not registered", __FUNCTION__); + } else { + /* Trigger redraw */ + ALOGD_IF(HWC_SERVICE_DEBUG, "%s: Invalidate !!", __FUNCTION__); + proc->invalidate(proc); + } + return NO_ERROR; +} + +status_t HWComposerService::setCloseSecureEnd( ) { + mHwcContext->mSecure = false; + mHwcContext->mSecureConfig = false; + //Invalidate + hwc_procs* proc = (hwc_procs*)mHwcContext->device.reserved_proc[0]; + if(!proc) { + ALOGE("%s: HWC proc not registered", __FUNCTION__); + } else { + /* Trigger redraw */ + ALOGD_IF(HWC_SERVICE_DEBUG, "%s: Invalidate !!", __FUNCTION__); + proc->invalidate(proc); + } + return NO_ERROR; +} + +status_t HWComposerService::getResolutionModeCount(int *resModeCount) { + qhwc::ExternalDisplay *externalDisplay = mHwcContext->mExtDisplay; + if(externalDisplay->getExternalDisplay()) { + *resModeCount = externalDisplay->getModeCount(); + } else { + ALOGE("External Display not connected"); + } + ALOGD_IF(HWC_SERVICE_DEBUG, "resModeCount=%d", *resModeCount); + return NO_ERROR; +} + +status_t HWComposerService::getResolutionModes(int *resModes, int count) { + qhwc::ExternalDisplay *externalDisplay = mHwcContext->mExtDisplay; + if(externalDisplay->getExternalDisplay()) { + externalDisplay->getEDIDModes(resModes); + } else { + ALOGE("External Display not connected"); + } + return NO_ERROR; +} + +status_t HWComposerService::getExternalDisplay(int *dispType) { + qhwc::ExternalDisplay *externalDisplay = mHwcContext->mExtDisplay; + *dispType = externalDisplay->getExternalDisplay(); + ALOGD_IF(HWC_SERVICE_DEBUG, "dispType=%d", *dispType); + return NO_ERROR; +} + +HWComposerService* HWComposerService::getInstance() +{ + if(!sHwcService) { + sHwcService = new HWComposerService(); + sp sm = defaultServiceManager(); + sm->addService(String16("display.hwcservice"), sHwcService); + if(sm->checkService(String16("display.hwcservice")) != NULL) + ALOGD_IF(HWC_SERVICE_DEBUG, "adding display.hwcservice succeeded"); + else + ALOGD_IF(HWC_SERVICE_DEBUG, "adding display.hwcservice failed"); + } + return sHwcService; +} + +void HWComposerService::setHwcContext(hwc_context_t *hwcCtx) { + ALOGD_IF(HWC_SERVICE_DEBUG, "hwcCtx=0x%x", (int)hwcCtx); + if(hwcCtx) { + mHwcContext = hwcCtx; + } +} +} diff --git a/libhwcomposer/hwc_service.h b/libhwcomposer/hwc_service.h index 02af2f7..63b06c1 100644 --- a/libhwcomposer/hwc_service.h +++ b/libhwcomposer/hwc_service.h @@ -1,70 +1,75 @@ -/* - * Copyright (c) 2012, Code Aurora Forum. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Code Aurora Forum, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef ANDROID_HWCOMPOSER_SERVICE_H -#define ANDROID_HWCOMPOSER_SERVICE_H - -#include -#include -#include -#include -#include -#include - - -namespace hwcService { -// ---------------------------------------------------------------------------- - -class HWComposerService : public BnHWComposer { -enum { - MAX_ACTIONSAFE_WIDTH = 10, - MAX_ACTIONSAFE_HEIGHT = MAX_ACTIONSAFE_WIDTH, -}; -private: - HWComposerService(); -public: - ~HWComposerService(); - - static HWComposerService* getInstance(); - virtual android::status_t getResolutionModeCount(int *modeCount); - virtual android::status_t getResolutionModes(int *EDIDModes, int count = 1); - virtual android::status_t getExternalDisplay(int *extDisp); - - virtual android::status_t setHPDStatus(int enable); - virtual android::status_t setResolutionMode(int resMode); - virtual android::status_t setActionSafeDimension(int w, int h); - void setHwcContext(hwc_context_t *hwcCtx); - -private: - static HWComposerService *sHwcService; - hwc_context_t *mHwcContext; -}; - -}; // namespace hwcService -#endif // ANDROID_HWCOMPOSER_SERVICE_H +/* + * Copyright (c) 2012, Code Aurora Forum. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Code Aurora Forum, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ANDROID_HWCOMPOSER_SERVICE_H +#define ANDROID_HWCOMPOSER_SERVICE_H + +#include +#include +#include +#include +#include +#include + + +namespace hwcService { +// ---------------------------------------------------------------------------- + +class HWComposerService : public BnHWComposer { +enum { + MAX_ACTIONSAFE_WIDTH = 10, + MAX_ACTIONSAFE_HEIGHT = MAX_ACTIONSAFE_WIDTH, +}; +private: + HWComposerService(); +public: + ~HWComposerService(); + + static HWComposerService* getInstance(); + virtual android::status_t getResolutionModeCount(int *modeCount); + virtual android::status_t getResolutionModes(int *EDIDModes, int count = 1); + virtual android::status_t getExternalDisplay(int *extDisp); + + virtual android::status_t setHPDStatus(int enable); + virtual android::status_t setResolutionMode(int resMode); + virtual android::status_t setActionSafeDimension(int w, int h); + + // Secure Intent Hooks + virtual android::status_t setOpenSecureStart(); + virtual android::status_t setOpenSecureEnd(); + virtual android::status_t setCloseSecureStart(); + virtual android::status_t setCloseSecureEnd(); + void setHwcContext(hwc_context_t *hwcCtx); +private: + static HWComposerService *sHwcService; + hwc_context_t *mHwcContext; +}; + +}; // namespace hwcService +#endif // ANDROID_HWCOMPOSER_SERVICE_H diff --git a/libhwcomposer/hwc_uimirror.cpp b/libhwcomposer/hwc_uimirror.cpp index 6c37c42..0783775 100644 --- a/libhwcomposer/hwc_uimirror.cpp +++ b/libhwcomposer/hwc_uimirror.cpp @@ -78,12 +78,10 @@ bool UIMirrorOverlay::configure(hwc_context_t *ctx, hwc_layer_list_t *list) } ovutils::eMdpFlags mdpFlags = ovutils::OV_MDP_FLAGS_NONE; - /* - TODO: Secure content - if (hnd->flags & private_handle_t::PRIV_FLAGS_SECURE_BUFFER) { - ovutils::setMdpFlags(mdpFlags, - ovutils::OV_MDP_SECURE_OVERLAY_SESSION); - } - */ + if (ctx->mSecure == true) { + ovutils::setMdpFlags(mdpFlags, + ovutils::OV_MDP_SECURE_OVERLAY_SESSION); + } ovutils::PipeArgs parg(mdpFlags, info, diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h index fa1cdf0..f0b0f02 100644 --- a/libhwcomposer/hwc_utils.h +++ b/libhwcomposer/hwc_utils.h @@ -173,6 +173,11 @@ struct hwc_context_t { //Vsync struct vsync_state vstate; + // flag that indicate secure session status + bool mSecure; + + // flag that indicate whether secure/desecure session in progress + bool mSecureConfig; }; #endif //HWC_UTILS_H diff --git a/libhwcomposer/ihwc.cpp b/libhwcomposer/ihwc.cpp index 01703fb..110ff99 100644 --- a/libhwcomposer/ihwc.cpp +++ b/libhwcomposer/ihwc.cpp @@ -72,6 +72,40 @@ public: result = reply.readInt32(); return result; } + virtual status_t setOpenSecureStart() { + Parcel data, reply; + data.writeInterfaceToken(IHWComposer::getInterfaceDescriptor()); + status_t result = remote()->transact(SET_OPEN_SECURE_START, + data, &reply); + result = reply.readInt32(); + return result; + } + + virtual status_t setOpenSecureEnd() { + Parcel data, reply; + data.writeInterfaceToken(IHWComposer::getInterfaceDescriptor()); + status_t result = remote()->transact(SET_OPEN_SECURE_END, + data, &reply); + result = reply.readInt32(); + return result; + } + + virtual status_t setCloseSecureStart() { + Parcel data, reply; + data.writeInterfaceToken(IHWComposer::getInterfaceDescriptor()); + status_t result = remote()->transact(SET_CLOSE_SECURE_START, + data, &reply); + result = reply.readInt32(); + return result; + } + virtual status_t setCloseSecureEnd() { + Parcel data, reply; + data.writeInterfaceToken(IHWComposer::getInterfaceDescriptor()); + status_t result = remote()->transact(SET_CLOSE_SECURE_END, + data, &reply); + result = reply.readInt32(); + return result; + } virtual status_t getExternalDisplay(int *extDispType) { Parcel data, reply; @@ -138,6 +172,30 @@ status_t BnHWComposer::onTransact( reply->writeInt32(res); return NO_ERROR; } break; + case SET_OPEN_SECURE_START: { + CHECK_INTERFACE(IHWComposer, data, reply); + status_t res = setOpenSecureStart(); + reply->writeInt32(res); + return NO_ERROR; + }break; + case SET_OPEN_SECURE_END: { + CHECK_INTERFACE(IHWComposer, data, reply); + status_t res = setOpenSecureEnd(); + reply->writeInt32(res); + return NO_ERROR; + }break; + case SET_CLOSE_SECURE_START: { + CHECK_INTERFACE(IHWComposer, data, reply); + status_t res = setCloseSecureStart(); + reply->writeInt32(res); + return NO_ERROR; + }break; + case SET_CLOSE_SECURE_END: { + CHECK_INTERFACE(IHWComposer, data, reply); + status_t res = setCloseSecureEnd(); + reply->writeInt32(res); + return NO_ERROR; + }break; case GET_EXT_DISPLAY_TYPE: { CHECK_INTERFACE(IHWComposer, data, reply); int extDispType; diff --git a/libhwcomposer/ihwc.h b/libhwcomposer/ihwc.h index 79bd5d4..70b96ef 100644 --- a/libhwcomposer/ihwc.h +++ b/libhwcomposer/ihwc.h @@ -36,6 +36,10 @@ enum { SET_EXT_HPD_ENABLE = 0, SET_EXT_DISPLAY_RESOLUTION_MODE, SET_EXT_DISPLAY_ACTIONSAFE_DIMENSIONS, + SET_OPEN_SECURE_START, + SET_OPEN_SECURE_END, + SET_CLOSE_SECURE_START, + SET_CLOSE_SECURE_END, GET_EXT_DISPLAY_TYPE, GET_EXT_DISPLAY_RESOLUTION_MODES, GET_EXT_DISPLAY_RESOLUTION_MODE_COUNT, @@ -54,6 +58,11 @@ public: virtual android::status_t setHPDStatus(int enable) = 0; virtual android::status_t setResolutionMode(int resMode) = 0; virtual android::status_t setActionSafeDimension(int w, int h) = 0; + // Secure Intent Hooks + virtual android::status_t setOpenSecureStart() = 0; + virtual android::status_t setOpenSecureEnd() = 0; + virtual android::status_t setCloseSecureStart() = 0; + virtual android::status_t setCloseSecureEnd() = 0; }; // ----------------------------------------------------------------------------