Static layout: Do not update PNOR when host is on

Static layout only has 1 active and functional PNOR. When host is
running, do not update PNOR.
This is done by checking the return value of freeSpace(), and if it
returns false, it means there is no space for PNOR because the host is
running and erase() returns false.

Tested: Verify the status becomes Failed when trying to activate a PNOR
        while host is running.

Change-Id: Ie2986b0c6fd29557685f67eb77ccc29709e1669a
Signed-off-by: Lei YU <mine260309@gmail.com>
diff --git a/static/activation_static.cpp b/static/activation_static.cpp
index 9768d41..193d6b3 100644
--- a/static/activation_static.cpp
+++ b/static/activation_static.cpp
@@ -19,6 +19,7 @@
 auto ActivationStatic::activation(Activations value) -> Activations
 {
 
+    auto ret = value;
     if (value != softwareServer::Activation::Activations::Active)
     {
         redundancyPriority.reset(nullptr);
@@ -26,9 +27,14 @@
 
     if (value == softwareServer::Activation::Activations::Activating)
     {
-        parent.freeSpace();
-        startActivation();
-        return softwareServer::Activation::activation(value);
+        if (parent.freeSpace())
+        {
+            startActivation();
+        }
+        else
+        {
+            ret = softwareServer::Activation::Activations::Failed;
+        }
     }
     else
     {
@@ -36,7 +42,7 @@
         activationProgress.reset(nullptr);
     }
 
-    return softwareServer::Activation::activation(value);
+    return softwareServer::Activation::activation(ret);
 }
 
 void ActivationStatic::startActivation()