Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84b85487 authored by Marin Shalamanov's avatar Marin Shalamanov
Browse files

SF: Check the active mode for nullptr in dumpsys

We alredy have the check for mSupportedModes.size()==0 which
is supposed to be equivalent to getActiveMode()==nullptr.
However it's better to directly null check getActiveMode()
in case the logic changes in the future.

Fixes: 183381694
Test: dumpsys surfaceflinger
Change-Id: I49bdcb9636e3699bb720a84b6f789790c636b9b5
parent 7eba108a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -268,8 +268,9 @@ void DisplayDevice::dump(std::string& result) const {
    StringAppendF(&result, "+ %s\n", getDebugName().c_str());
    StringAppendF(&result, "   powerMode=%s (%d)\n", to_string(mPowerMode).c_str(),
                  static_cast<int32_t>(mPowerMode));
    const auto activeMode = getActiveMode();
    StringAppendF(&result, "   activeMode=%s\n",
                  mSupportedModes.size() ? to_string(*getActiveMode()).c_str() : "none");
                  activeMode ? to_string(*activeMode).c_str() : "none");

    result.append("   supportedModes=\n");