Trivial cleanup.
Now that mType is available, we don't need a separate flag for whether
the display is virtual. The remaining effect of setVirtual was to set
the display connected, so just use setConnected.
Bug: b/
36597125
Test: build
Change-Id: Ia1fa4a324cc07b0d6c124f4f50966c8b0cbe4827
ALOGE("Failed to get display by id");
return Error::BadDisplay;
}
- (*outDisplay)->setVirtual();
+ (*outDisplay)->setConnected(true);
return Error::None;
}
: mDevice(device),
mId(id),
mIsConnected(false),
- mIsVirtual(false),
mType(DisplayType::Invalid)
{
ALOGV("Created display %" PRIu64, id);
Display::~Display()
{
ALOGV("Destroyed display %" PRIu64, mId);
- if (mIsVirtual) {
+ if (mType == DisplayType::Virtual) {
mDevice.destroyVirtualDisplay(mId);
}
}
private:
// For use by Device
- // Virtual displays are always connected
- void setVirtual() {
- mIsVirtual = true;
- mIsConnected = true;
- }
-
void setConnected(bool connected) { mIsConnected = connected; }
int32_t getAttribute(hwc2_config_t configId, Attribute attribute);
void loadConfig(hwc2_config_t configId);
Device& mDevice;
hwc2_display_t mId;
bool mIsConnected;
- bool mIsVirtual;
DisplayType mType;
std::unordered_map<hwc2_layer_t, std::weak_ptr<Layer>> mLayers;
std::unordered_map<hwc2_config_t, std::shared_ptr<const Config>> mConfigs;