Mutex::Autolock _l(mDisplayLock);
auto displayId = displayDevice.getHwcDisplayId();
+ if (displayId == DisplayDevice::DISPLAY_ID_INVALID) {
+ ALOGV("Skipping HWComposer prepare for non-HWC display");
+ return NO_ERROR;
+ }
if (!isValidDisplay(displayId)) {
return BAD_INDEX;
}
}
bool HWComposer::hasDeviceComposition(int32_t displayId) const {
+ if (displayId == DisplayDevice::DISPLAY_ID_INVALID) {
+ // Displays without a corresponding HWC display are never composed by
+ // the device
+ return false;
+ }
if (!isValidDisplay(displayId)) {
ALOGE("hasDeviceComposition: Invalid display %d", displayId);
return false;
}
bool HWComposer::hasClientComposition(int32_t displayId) const {
+ if (displayId == DisplayDevice::DISPLAY_ID_INVALID) {
+ // Displays without a corresponding HWC display are always composed by
+ // the client
+ return true;
+ }
if (!isValidDisplay(displayId)) {
ALOGE("hasClientComposition: Invalid display %d", displayId);
return true;
}
HWC2::Composition Layer::getCompositionType(int32_t hwcId) const {
+ if (hwcId == DisplayDevice::DISPLAY_ID_INVALID) {
+ // If we're querying the composition type for a display that does not
+ // have a HWC counterpart, then it will always be Client
+ return HWC2::Composition::Client;
+ }
if (mHwcLayers.count(hwcId) == 0) {
- ALOGE("getCompositionType called without a valid HWC layer");
+ ALOGE("getCompositionType called with an invalid HWC layer");
return HWC2::Composition::Invalid;
}
return mHwcLayers.at(hwcId).compositionType;