Update the weave state after changing the tracking channel.

The tracking channel is reported to weave as part of the state, so we
need to force an update of the weave state when the tracking channel
is changed.

Bug: 24386758
TEST=deployed on edison.

Change-Id: I11705603f893a046bda3907459701d31db83a3c5
diff --git a/dbus_service.cc b/dbus_service.cc
index 6ed31d4..062c17d 100644
--- a/dbus_service.cc
+++ b/dbus_service.cc
@@ -176,6 +176,9 @@
     LogAndSetError(error, FROM_HERE, error_message);
     return false;
   }
+  // Update the weave state because updated the target channel.
+  if (system_state_->weave_service())
+    system_state_->weave_service()->UpdateWeaveState();
   return true;
 }
 
diff --git a/update_attempter.cc b/update_attempter.cc
index dd7c1be..da135e4 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -405,6 +405,9 @@
                                                  &error_message)) {
       LOG(ERROR) << "Setting the channel failed: " << error_message;
     }
+    // Update the weave state because updated the target channel.
+    if (system_state_->weave_service())
+      system_state_->weave_service()->UpdateWeaveState();
 
     // Since this is the beginning of a new attempt, update the download
     // channel. The download channel won't be updated until the next attempt,
@@ -1102,6 +1105,9 @@
                          error_message);
     return false;
   }
+  // Update the weave state because updated the target channel.
+  if (system_state_->weave_service())
+    system_state_->weave_service()->UpdateWeaveState();
   return true;
 }