Bug 1392505 - Pre: remove unused delegate interface r=rnewman draft
authorGrigory Kruglov <gkruglov@mozilla.com>
Fri, 25 Aug 2017 21:44:37 -0400
changeset 656294 9f8927d4298759ca7f9b862e51932a54ed7cb590
parent 655774 ab2d700fda2b4934d24227216972dce9fac19b74
child 656295 21b02d4164abf75422920225749ffcfd3fc71e91
push id77153
push userbmo:gkruglov@mozilla.com
push dateWed, 30 Aug 2017 23:49:05 +0000
reviewersrnewman
bugs1392505
milestone57.0a1
Bug 1392505 - Pre: remove unused delegate interface r=rnewman MozReview-Commit-ID: K93rK1pILky
mobile/android/services/src/main/java/org/mozilla/gecko/sync/synchronizer/RecordsChannelDelegate.java
mobile/android/services/src/main/java/org/mozilla/gecko/sync/synchronizer/SynchronizerSession.java
mobile/android/tests/background/junit4/src/org/mozilla/android/sync/test/TestRecordsChannel.java
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/synchronizer/RecordsChannelDelegate.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/sync/synchronizer/RecordsChannelDelegate.java
@@ -4,10 +4,9 @@
 
 package org.mozilla.gecko.sync.synchronizer;
 
 public interface RecordsChannelDelegate {
   public void onFlowCompleted(RecordsChannel recordsChannel, long fetchEnd, long storeEnd);
   public void onFlowBeginFailed(RecordsChannel recordsChannel, Exception ex);
   public void onFlowFetchFailed(RecordsChannel recordsChannel, Exception ex);
   public void onFlowStoreFailed(RecordsChannel recordsChannel, Exception ex, String recordGuid);
-  public void onFlowFinishFailed(RecordsChannel recordsChannel, Exception ex);
 }
\ No newline at end of file
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/synchronizer/SynchronizerSession.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/sync/synchronizer/SynchronizerSession.java
@@ -219,22 +219,16 @@ implements RecordsChannelDelegate,
       @Override
       public void onFlowStoreFailed(RecordsChannel recordsChannel, Exception ex, String recordGuid) {
         Logger.warn(LOG_TAG, "First RecordsChannel onFlowStoreFailed. Logging local store error.", ex);
         // Currently we're just recording the very last exception which occurred. This is a reasonable
         // approach, but ideally we'd want to categorize the exceptions and count them for the purposes
         // of better telemetry. See Bug 1362208.
         storeFailedCauseException = ex;
       }
-
-      @Override
-      public void onFlowFinishFailed(RecordsChannel recordsChannel, Exception ex) {
-        Logger.warn(LOG_TAG, "First RecordsChannel onFlowFinishedFailed. Logging session error.", ex);
-        session.delegate.onSynchronizeFailed(session, ex, "Failed to finish first flow.");
-      }
     };
 
     // This is the *first* channel to flow.
     channelAToB = new RecordsChannel(this.sessionA, this.sessionB, channelAToBDelegate);
 
     Logger.trace(LOG_TAG, "Starting A to B flow. Channel is " + channelAToB);
     try {
       channelAToB.beginAndFlow();
@@ -308,22 +302,16 @@ implements RecordsChannelDelegate,
     Logger.warn(LOG_TAG, "Second RecordsChannel onFlowFetchFailed. Logging local fetch error.", ex);
   }
 
   @Override
   public void onFlowStoreFailed(RecordsChannel recordsChannel, Exception ex, String recordGuid) {
     Logger.warn(LOG_TAG, "Second RecordsChannel onFlowStoreFailed. Logging remote store error.", ex);
   }
 
-  @Override
-  public void onFlowFinishFailed(RecordsChannel recordsChannel, Exception ex) {
-    Logger.warn(LOG_TAG, "Second RecordsChannel onFlowFinishedFailed. Logging session error.", ex);
-    this.delegate.onSynchronizeFailed(this, ex, "Failed to finish second flow.");
-  }
-
   /*
    * RepositorySessionCreationDelegate methods.
    */
 
   /**
    * I could be called twice: once for sessionA and once for sessionB.
    *
    * I try to clean up sessionA if it is not null, since the creation of
--- a/mobile/android/tests/background/junit4/src/org/mozilla/android/sync/test/TestRecordsChannel.java
+++ b/mobile/android/tests/background/junit4/src/org/mozilla/android/sync/test/TestRecordsChannel.java
@@ -72,21 +72,16 @@ public class TestRecordsChannel {
 
       @Override
       public void onFlowStoreFailed(RecordsChannel recordsChannel, Exception ex, String recordGuid) {
         numFlowStoreFailed.incrementAndGet();
         storeException = ex;
       }
 
       @Override
-      public void onFlowFinishFailed(RecordsChannel recordsChannel, Exception ex) {
-        flowFinishFailed.set(true);
-        WaitHelper.getTestWaiter().performNotify();
-      }
-
       @Override
       public void onFlowCompleted(RecordsChannel recordsChannel, long fetchEnd, long storeEnd) {
         numFlowCompleted.incrementAndGet();
         try {
           sinkSession.finish(new ExpectSuccessRepositorySessionFinishDelegate(WaitHelper.getTestWaiter()) {
             @Override
             public void onFinishSucceeded(RepositorySession session, RepositorySessionBundle bundle) {
               try {