[SurfaceFlinger] Avoid querying Power HAL until switching color mode.

Previously, SurfaceFlinger would query Power HAL speculatively at the first
time color mode is set when device is booted. Howerver, Power HAL is not
necessary started before SurfaceFlinger and it's not necessary to query Power
HAL when color mode is not switched. As a result, the boot time is very long
because SurfaceFlinger needs to wait for Power HAL to start. Thus, in this
patch, we avoid querying Power HAL until color mode is switched, which won't
happen until we enter wide-color-gamut Apps.

BUG: 110112323
BUG: 111009852
Test: Build, flash and boot device, check hardware.power output with adb logcat
Change-Id: Ia581461ba7861784bff35cac6fbeca9bac92b8fa
diff --git a/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp b/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp
index 0e4ad91..12bbae2 100644
--- a/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp
+++ b/services/surfaceflinger/DisplayHardware/PowerAdvisor.cpp
@@ -45,13 +45,12 @@
         mExpensiveDisplays.erase(displayId);
     }
 
-    const sp<V1_3::IPower> powerHal = getPowerHal();
-    if (powerHal == nullptr) {
-        return;
-    }
-
     const bool expectsExpensiveRendering = !mExpensiveDisplays.empty();
     if (mNotifiedExpensiveRendering != expectsExpensiveRendering) {
+        const sp<V1_3::IPower> powerHal = getPowerHal();
+        if (powerHal == nullptr) {
+            return;
+        }
         auto ret = powerHal->powerHintAsync_1_3(PowerHint::EXPENSIVE_RENDERING,
                                                 expectsExpensiveRendering);
         // If Power HAL 1.3 was available previously but now fails,