Only skip operation on snapshot partitions

On Virtual A/B devices, don't skip SOURCE_COPY on
static partitions.

Test: update_engine_unittest
Test: incremental update to self
Change-Id: I5c93b501e09f50f559151eb77d83052373c90d0d
diff --git a/common/dynamic_partition_control_interface.h b/common/dynamic_partition_control_interface.h
index 39daf75..c17bafb 100644
--- a/common/dynamic_partition_control_interface.h
+++ b/common/dynamic_partition_control_interface.h
@@ -50,8 +50,12 @@
   // Return the feature flags of Virtual A/B on this device.
   virtual FeatureFlag GetVirtualAbFeatureFlag() = 0;
 
-  // Checks if the provided InstallOperation can be skipped on this device.
-  virtual bool ShouldSkipOperation(const InstallOperation& operation) = 0;
+  // Checks if |operation| can be skipped on the given partition.
+  // |partition_name| should not have the slot suffix; implementation of
+  // DynamicPartitionControlInterface checks partition at the target slot
+  // previously set with PreparePartitionsForUpdate().
+  virtual bool ShouldSkipOperation(const std::string& partition_name,
+                                   const InstallOperation& operation) = 0;
 
   // Do necessary cleanups before destroying the object.
   virtual void Cleanup() = 0;
diff --git a/common/dynamic_partition_control_stub.cc b/common/dynamic_partition_control_stub.cc
index 06f6b3c..bc792c8 100644
--- a/common/dynamic_partition_control_stub.cc
+++ b/common/dynamic_partition_control_stub.cc
@@ -33,7 +33,7 @@
 }
 
 bool DynamicPartitionControlStub::ShouldSkipOperation(
-    const InstallOperation& operation) {
+    const std::string& partition_name, const InstallOperation& operation) {
   return false;
 }
 
diff --git a/common/dynamic_partition_control_stub.h b/common/dynamic_partition_control_stub.h
index c62758b..1704f05 100644
--- a/common/dynamic_partition_control_stub.h
+++ b/common/dynamic_partition_control_stub.h
@@ -29,7 +29,8 @@
  public:
   FeatureFlag GetDynamicPartitionsFeatureFlag() override;
   FeatureFlag GetVirtualAbFeatureFlag() override;
-  bool ShouldSkipOperation(const InstallOperation& operation) override;
+  bool ShouldSkipOperation(const std::string& partition_name,
+                           const InstallOperation& operation) override;
   void Cleanup() override;
   bool PreparePartitionsForUpdate(uint32_t source_slot,
                                   uint32_t target_slot,