Add new ProcessScope interface

PiperOrigin-RevId: 247667125
Change-Id: I10e095a6883935c0083129886eec37381197af65
diff --git a/src/main/java/com/google/android/libraries/feed/api/client/scope/BUILD b/src/main/java/com/google/android/libraries/feed/api/client/scope/BUILD
new file mode 100644
index 0000000..8b788d5
--- /dev/null
+++ b/src/main/java/com/google/android/libraries/feed/api/client/scope/BUILD
@@ -0,0 +1,67 @@
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])  # Apache 2
+
+android_library(
+    name = "processscope",
+    srcs = ["ProcessScope.java"],
+    deps = [
+        "//src/main/java/com/google/android/libraries/feed/api/client/knowncontent",
+        "//src/main/java/com/google/android/libraries/feed/api/client/lifecycle",
+        "//src/main/java/com/google/android/libraries/feed/api/client/requestmanager",
+        "//src/main/java/com/google/android/libraries/feed/api/host/action",
+        "//src/main/java/com/google/android/libraries/feed/api/host/imageloader",
+        "//src/main/java/com/google/android/libraries/feed/api/host/offlineindicator",
+        "//src/main/java/com/google/android/libraries/feed/api/host/stream",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/actionmanager",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/protocoladapter",
+        "//src/main/java/com/google/android/libraries/feed/api/scope:feedstreamscope",
+        "//src/main/java/com/google/android/libraries/feed/api/sessionmanager",
+        "//src/main/java/com/google/android/libraries/feed/basicstream",
+        "//src/main/java/com/google/android/libraries/feed/common/concurrent",
+        "//src/main/java/com/google/android/libraries/feed/common/protoextensions",
+        "//src/main/java/com/google/android/libraries/feed/common/time",
+    ],
+)
+
+android_library(
+    name = "processscopebuilder",
+    srcs = ["ProcessScopeBuilder.java"],
+    deps = [
+        ":processscope",
+        "//src/main/java/com/google/android/libraries/feed/api/host/config",
+        "//src/main/java/com/google/android/libraries/feed/api/host/logging",
+        "//src/main/java/com/google/android/libraries/feed/api/host/network",
+        "//src/main/java/com/google/android/libraries/feed/api/host/proto",
+        "//src/main/java/com/google/android/libraries/feed/api/host/scheduler",
+        "//src/main/java/com/google/android/libraries/feed/api/host/storage",
+        "//src/main/java/com/google/android/libraries/feed/api/host/stream",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/actionmanager",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/common",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/knowncontent",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/protocoladapter",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/requestmanager",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/sessionmanager",
+        "//src/main/java/com/google/android/libraries/feed/api/requestmanager",
+        "//src/main/java/com/google/android/libraries/feed/api/scope",
+        "//src/main/java/com/google/android/libraries/feed/api/scope:feedprocessscope",
+        "//src/main/java/com/google/android/libraries/feed/basicstream",
+        "//src/main/java/com/google/android/libraries/feed/common",
+        "//src/main/java/com/google/android/libraries/feed/common/concurrent",
+        "//src/main/java/com/google/android/libraries/feed/common/protoextensions",
+        "//src/main/java/com/google/android/libraries/feed/common/time",
+        "//src/main/java/com/google/android/libraries/feed/feedactionmanager",
+        "//src/main/java/com/google/android/libraries/feed/feedactionreader",
+        "//src/main/java/com/google/android/libraries/feed/feedapplifecyclelistener",
+        "//src/main/java/com/google/android/libraries/feed/feedknowncontent",
+        "//src/main/java/com/google/android/libraries/feed/feedprotocoladapter",
+        "//src/main/java/com/google/android/libraries/feed/feedrequestmanager",
+        "//src/main/java/com/google/android/libraries/feed/feedsessionmanager",
+        "//src/main/java/com/google/android/libraries/feed/feedstore",
+        "//src/main/java/com/google/android/libraries/feed/hostimpl/network",
+        "//src/main/java/com/google/android/libraries/feed/hostimpl/scheduler",
+        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage",
+        "@com_google_code_findbugs_jsr305//jar",
+        "@maven//:com_android_support_support_annotations",
+    ],
+)
diff --git a/src/main/java/com/google/android/libraries/feed/api/client/scope/ProcessScope.java b/src/main/java/com/google/android/libraries/feed/api/client/scope/ProcessScope.java
new file mode 100644
index 0000000..b73c869
--- /dev/null
+++ b/src/main/java/com/google/android/libraries/feed/api/client/scope/ProcessScope.java
@@ -0,0 +1,76 @@
+// Copyright 2018 The Feed Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.android.libraries.feed.api.client.scope;
+
+import android.content.Context;
+import com.google.android.libraries.feed.api.client.knowncontent.KnownContent;
+import com.google.android.libraries.feed.api.client.lifecycle.AppLifecycleListener;
+import com.google.android.libraries.feed.api.client.requestmanager.RequestManager;
+import com.google.android.libraries.feed.api.host.action.ActionApi;
+import com.google.android.libraries.feed.api.host.imageloader.ImageLoaderApi;
+import com.google.android.libraries.feed.api.host.offlineindicator.OfflineIndicatorApi;
+import com.google.android.libraries.feed.api.host.stream.CardConfiguration;
+import com.google.android.libraries.feed.api.host.stream.SnackbarApi;
+import com.google.android.libraries.feed.api.host.stream.StreamConfiguration;
+import com.google.android.libraries.feed.api.host.stream.TooltipApi;
+import com.google.android.libraries.feed.api.internal.actionmanager.ActionManager;
+import com.google.android.libraries.feed.api.internal.protocoladapter.ProtocolAdapter;
+import com.google.android.libraries.feed.api.scope.FeedStreamScope;
+import com.google.android.libraries.feed.api.sessionmanager.SessionManager;
+import com.google.android.libraries.feed.common.concurrent.TaskQueue;
+import com.google.android.libraries.feed.common.protoextensions.FeedExtensionRegistry;
+import com.google.android.libraries.feed.common.time.TimingUtils;
+
+/** Allows interaction with the Feed library at the process leve. */
+public interface ProcessScope {
+
+  @Deprecated
+  ProtocolAdapter getProtocolAdapter();
+
+  /** Returns the Feed library request manager. */
+  RequestManager getRequestManager();
+
+  /** Returns the Feed library session manager. */
+  SessionManager getSessionManager();
+
+  @Deprecated
+  TimingUtils getTimingUtils();
+
+  /** Returns the Feed library task queue. */
+  TaskQueue getTaskQueue();
+
+  /** Returns the Feed library lifecycle listener. */
+  AppLifecycleListener getAppLifecycleListener();
+
+  @Deprecated
+  ActionManager getActionManager();
+
+  /** Returns the Feed library known content. */
+  KnownContent getKnownContent();
+
+  @Deprecated
+  FeedExtensionRegistry getFeedExtensionRegistry();
+
+  /** Returns a {@link FeedStreamScope.Builder}. */
+  FeedStreamScope.Builder createFeedStreamScopeBuilder(
+      Context context,
+      ImageLoaderApi imageLoaderApi,
+      ActionApi actionApi,
+      StreamConfiguration streamConfiguration,
+      CardConfiguration cardConfiguration,
+      SnackbarApi snackbarApi,
+      OfflineIndicatorApi offlineIndicatorApi,
+      TooltipApi tooltipApi);
+}
diff --git a/src/main/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilder.java b/src/main/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilder.java
new file mode 100644
index 0000000..607063d
--- /dev/null
+++ b/src/main/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilder.java
@@ -0,0 +1,311 @@
+// Copyright 2018 The Feed Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.android.libraries.feed.api.client.scope;
+
+import android.content.Context;
+import android.support.annotation.VisibleForTesting;
+import com.google.android.libraries.feed.api.host.config.ApplicationInfo;
+import com.google.android.libraries.feed.api.host.config.Configuration;
+import com.google.android.libraries.feed.api.host.config.Configuration.ConfigKey;
+import com.google.android.libraries.feed.api.host.config.DebugBehavior;
+import com.google.android.libraries.feed.api.host.logging.BasicLoggingApi;
+import com.google.android.libraries.feed.api.host.network.NetworkClient;
+import com.google.android.libraries.feed.api.host.proto.ProtoExtensionProvider;
+import com.google.android.libraries.feed.api.host.scheduler.SchedulerApi;
+import com.google.android.libraries.feed.api.host.storage.ContentStorage;
+import com.google.android.libraries.feed.api.host.storage.ContentStorageDirect;
+import com.google.android.libraries.feed.api.host.storage.JournalStorage;
+import com.google.android.libraries.feed.api.host.storage.JournalStorageDirect;
+import com.google.android.libraries.feed.api.host.stream.TooltipSupportedApi;
+import com.google.android.libraries.feed.api.internal.actionmanager.ActionManager;
+import com.google.android.libraries.feed.api.internal.actionmanager.ActionReader;
+import com.google.android.libraries.feed.api.internal.common.ThreadUtils;
+import com.google.android.libraries.feed.api.internal.knowncontent.FeedKnownContent;
+import com.google.android.libraries.feed.api.internal.protocoladapter.ProtocolAdapter;
+import com.google.android.libraries.feed.api.internal.requestmanager.FeedRequestManager;
+import com.google.android.libraries.feed.api.internal.sessionmanager.FeedSessionManager;
+import com.google.android.libraries.feed.api.requestmanager.ActionUploadRequestManager;
+import com.google.android.libraries.feed.api.scope.ClearAllListener;
+import com.google.android.libraries.feed.api.scope.FeedProcessScope;
+import com.google.android.libraries.feed.common.Validators;
+import com.google.android.libraries.feed.common.concurrent.DirectHostSupported;
+import com.google.android.libraries.feed.common.concurrent.MainThreadRunner;
+import com.google.android.libraries.feed.common.concurrent.TaskQueue;
+import com.google.android.libraries.feed.common.protoextensions.FeedExtensionRegistry;
+import com.google.android.libraries.feed.common.time.Clock;
+import com.google.android.libraries.feed.common.time.SystemClockImpl;
+import com.google.android.libraries.feed.common.time.TimingUtils;
+import com.google.android.libraries.feed.feedactionmanager.FeedActionManagerImpl;
+import com.google.android.libraries.feed.feedactionreader.FeedActionReader;
+import com.google.android.libraries.feed.feedapplifecyclelistener.FeedAppLifecycleListener;
+import com.google.android.libraries.feed.feedknowncontent.FeedKnownContentImpl;
+import com.google.android.libraries.feed.feedprotocoladapter.FeedProtocolAdapter;
+import com.google.android.libraries.feed.feedrequestmanager.FeedActionUploadRequestManager;
+import com.google.android.libraries.feed.feedrequestmanager.FeedRequestManagerImpl;
+import com.google.android.libraries.feed.feedrequestmanager.RequestManagerImpl;
+import com.google.android.libraries.feed.feedsessionmanager.FeedSessionManagerFactory;
+import com.google.android.libraries.feed.feedstore.ContentStorageDirectImpl;
+import com.google.android.libraries.feed.feedstore.FeedStore;
+import com.google.android.libraries.feed.feedstore.JournalStorageDirectImpl;
+import com.google.android.libraries.feed.hostimpl.network.NetworkClientWrapper;
+import com.google.android.libraries.feed.hostimpl.scheduler.SchedulerApiWrapper;
+import com.google.android.libraries.feed.hostimpl.storage.InMemoryContentStorage;
+import com.google.android.libraries.feed.hostimpl.storage.InMemoryJournalStorage;
+import java.util.ArrayList;
+import java.util.concurrent.Executor;
+
+/** Creates an instance of {@link ProcessScope} */
+public final class ProcessScopeBuilder {
+  // Required fields.
+  private final Configuration configuration;
+  private final Executor singleThreadExecutor;
+  private final BasicLoggingApi basicLoggingApi;
+  private final TooltipSupportedApi tooltipSupportedApi;
+  private final NetworkClient unwrappedNetworkClient;
+  private final SchedulerApi unwrappedSchedulerApi;
+  private final DebugBehavior debugBehavior;
+  private final Context context;
+  private final ApplicationInfo applicationInfo;
+
+  // Optional fields - if they are not provided, we will use default implementations.
+  /*@MonotonicNonNull*/ private ProtoExtensionProvider protoExtensionProvider = null;
+  /*@MonotonicNonNull*/ ContentStorageDirect contentStorage = null;
+  /*@MonotonicNonNull*/ JournalStorageDirect journalStorage = null;
+  /*@MonotonicNonNull*/ ContentStorage rawContentStorage = null;
+  /*@MonotonicNonNull*/ JournalStorage rawJournalStorage = null;
+  /*@MonotonicNonNull*/ private Clock clock;
+
+  // This will be overridden in tests.
+  private ThreadUtils threadUtils = new ThreadUtils();
+
+  /** The APIs are all required to construct the scope. */
+  public ProcessScopeBuilder(
+      Configuration configuration,
+      Executor singleThreadExecutor,
+      BasicLoggingApi basicLoggingApi,
+      NetworkClient networkClient,
+      SchedulerApi schedulerApi,
+      DebugBehavior debugBehavior,
+      Context context,
+      ApplicationInfo applicationInfo,
+      TooltipSupportedApi tooltipSupportedApi) {
+    this.configuration = configuration;
+    this.singleThreadExecutor = singleThreadExecutor;
+    this.basicLoggingApi = basicLoggingApi;
+    this.debugBehavior = debugBehavior;
+    this.context = context;
+    this.applicationInfo = applicationInfo;
+    this.unwrappedNetworkClient = networkClient;
+    this.unwrappedSchedulerApi = schedulerApi;
+    this.tooltipSupportedApi = tooltipSupportedApi;
+  }
+
+  public ProcessScopeBuilder setProtoExtensionProvider(
+      ProtoExtensionProvider protoExtensionProvider) {
+    this.protoExtensionProvider = protoExtensionProvider;
+    return this;
+  }
+
+  public ProcessScopeBuilder setContentStorage(ContentStorage contentStorage) {
+    rawContentStorage = contentStorage;
+    return this;
+  }
+
+  public ProcessScopeBuilder setContentStorageDirect(ContentStorageDirect contentStorage) {
+    this.contentStorage = contentStorage;
+    return this;
+  }
+
+  public ProcessScopeBuilder setJournalStorage(JournalStorage journalStorage) {
+    rawJournalStorage = journalStorage;
+    return this;
+  }
+
+  public ProcessScopeBuilder setJournalStorageDirect(JournalStorageDirect journalStorage) {
+    this.journalStorage = journalStorage;
+    return this;
+  }
+
+  // This is really exposed for tests to override the thread checking
+  ProcessScopeBuilder setThreadUtils(ThreadUtils threadUtils) {
+    this.threadUtils = threadUtils;
+    return this;
+  }
+
+  public ProcessScopeBuilder setClock(Clock clock) {
+    this.clock = clock;
+    return this;
+  }
+
+  @VisibleForTesting
+  ContentStorageDirect buildContentStorage(MainThreadRunner mainThreadRunner) {
+    if (contentStorage == null) {
+      boolean useDirect = configuration.getValueOrDefault(ConfigKey.USE_DIRECT_STORAGE, false);
+      if (useDirect
+          && rawContentStorage != null
+          && rawContentStorage instanceof ContentStorageDirect) {
+        contentStorage = (ContentStorageDirect) rawContentStorage;
+      } else if (rawContentStorage != null) {
+        contentStorage = new ContentStorageDirectImpl(rawContentStorage, mainThreadRunner);
+      } else {
+        contentStorage = new InMemoryContentStorage();
+      }
+    }
+    return contentStorage;
+  }
+
+  @VisibleForTesting
+  JournalStorageDirect buildJournalStorage(MainThreadRunner mainThreadRunner) {
+    if (journalStorage == null) {
+      boolean useDirect = configuration.getValueOrDefault(ConfigKey.USE_DIRECT_STORAGE, false);
+      if (useDirect
+          && rawJournalStorage != null
+          && rawJournalStorage instanceof JournalStorageDirect) {
+        journalStorage = (JournalStorageDirect) rawJournalStorage;
+      } else if (rawJournalStorage != null) {
+        journalStorage = new JournalStorageDirectImpl(rawJournalStorage, mainThreadRunner);
+      } else {
+        journalStorage = new InMemoryJournalStorage();
+      }
+    }
+    return journalStorage;
+  }
+
+  public ProcessScope build() {
+    MainThreadRunner mainThreadRunner = new MainThreadRunner();
+    contentStorage = buildContentStorage(mainThreadRunner);
+    journalStorage = buildJournalStorage(mainThreadRunner);
+
+    boolean directHostCallEnabled =
+        configuration.getValueOrDefault(ConfigKey.USE_DIRECT_STORAGE, false);
+    NetworkClient networkClient;
+    SchedulerApi schedulerApi;
+    if (unwrappedNetworkClient instanceof DirectHostSupported && directHostCallEnabled) {
+      networkClient = unwrappedNetworkClient;
+    } else {
+      networkClient =
+          new NetworkClientWrapper(unwrappedNetworkClient, threadUtils, mainThreadRunner);
+    }
+    if (unwrappedSchedulerApi instanceof DirectHostSupported && directHostCallEnabled) {
+      schedulerApi = unwrappedSchedulerApi;
+    } else {
+      schedulerApi = new SchedulerApiWrapper(unwrappedSchedulerApi, threadUtils, mainThreadRunner);
+    }
+
+    // Build default component instances if necessary.
+    if (protoExtensionProvider == null) {
+      // Return an empty list of extensions by default.
+      protoExtensionProvider = ArrayList::new;
+    }
+    FeedExtensionRegistry extensionRegistry = new FeedExtensionRegistry(protoExtensionProvider);
+    if (clock == null) {
+      clock = new SystemClockImpl();
+    }
+    TimingUtils timingUtils = new TimingUtils();
+    TaskQueue taskQueue =
+        new TaskQueue(basicLoggingApi, singleThreadExecutor, mainThreadRunner, clock);
+    FeedStore store =
+        new FeedStore(
+            timingUtils,
+            extensionRegistry,
+            contentStorage,
+            journalStorage,
+            threadUtils,
+            taskQueue,
+            clock,
+            basicLoggingApi,
+            mainThreadRunner);
+
+    FeedAppLifecycleListener lifecycleListener = new FeedAppLifecycleListener(threadUtils);
+    lifecycleListener.registerObserver(store);
+
+    ProtocolAdapter protocolAdapter = new FeedProtocolAdapter(timingUtils);
+    ActionReader actionReader =
+        new FeedActionReader(store, clock, protocolAdapter, taskQueue, configuration);
+    FeedRequestManager feedRequestManager =
+        new FeedRequestManagerImpl(
+            configuration,
+            networkClient,
+            protocolAdapter,
+            extensionRegistry,
+            schedulerApi,
+            taskQueue,
+            timingUtils,
+            threadUtils,
+            actionReader,
+            context,
+            applicationInfo,
+            mainThreadRunner,
+            basicLoggingApi,
+            tooltipSupportedApi);
+    ActionUploadRequestManager actionUploadRequestManager =
+        new FeedActionUploadRequestManager(
+            configuration,
+            networkClient,
+            protocolAdapter,
+            extensionRegistry,
+            taskQueue,
+            threadUtils,
+            actionReader,
+            store,
+            clock);
+    FeedSessionManagerFactory fsmFactory =
+        new FeedSessionManagerFactory(
+            taskQueue,
+            store,
+            timingUtils,
+            threadUtils,
+            protocolAdapter,
+            feedRequestManager,
+            actionUploadRequestManager,
+            schedulerApi,
+            configuration,
+            clock,
+            lifecycleListener);
+    FeedSessionManager feedSessionManager = fsmFactory.create();
+    RequestManagerImpl clientRequestManager =
+        new RequestManagerImpl(feedRequestManager, feedSessionManager);
+    ActionManager actionManager =
+        new FeedActionManagerImpl(
+            feedSessionManager, store, threadUtils, taskQueue, mainThreadRunner, clock);
+
+    FeedKnownContent feedKnownContent =
+        new FeedKnownContentImpl(feedSessionManager, mainThreadRunner, threadUtils);
+
+    ClearAllListener clearAllListener =
+        new ClearAllListener(taskQueue, feedSessionManager, store, threadUtils, lifecycleListener);
+    return new FeedProcessScope(
+        basicLoggingApi,
+        networkClient,
+        Validators.checkNotNull(protocolAdapter),
+        Validators.checkNotNull(clientRequestManager),
+        Validators.checkNotNull(feedSessionManager),
+        store,
+        timingUtils,
+        threadUtils,
+        taskQueue,
+        mainThreadRunner,
+        lifecycleListener,
+        clock,
+        debugBehavior,
+        actionManager,
+        configuration,
+        feedKnownContent,
+        extensionRegistry,
+        clearAllListener,
+        tooltipSupportedApi,
+        applicationInfo);
+  }
+}
diff --git a/src/main/java/com/google/android/libraries/feed/api/internal/modelprovider/TokenCompletedObserver.java b/src/main/java/com/google/android/libraries/feed/api/internal/modelprovider/TokenCompletedObserver.java
index f0bfdab..8a6f1b0 100644
--- a/src/main/java/com/google/android/libraries/feed/api/internal/modelprovider/TokenCompletedObserver.java
+++ b/src/main/java/com/google/android/libraries/feed/api/internal/modelprovider/TokenCompletedObserver.java
@@ -14,9 +14,7 @@
 
 package com.google.android.libraries.feed.api.internal.modelprovider;
 
-/**
- * Observes for when the Token fetch completes, producing a new cursor.
- */
+/** Observes for when the Token fetch completes, producing a new cursor. */
 public interface TokenCompletedObserver {
   /** Called when the token processing has completed. */
   void onTokenCompleted(TokenCompleted tokenCompleted);
diff --git a/src/main/java/com/google/android/libraries/feed/api/scope/BUILD b/src/main/java/com/google/android/libraries/feed/api/scope/BUILD
index bc1a65c..b3e8759 100644
--- a/src/main/java/com/google/android/libraries/feed/api/scope/BUILD
+++ b/src/main/java/com/google/android/libraries/feed/api/scope/BUILD
@@ -4,20 +4,65 @@
 
 android_library(
     name = "scope",
-    srcs = glob(["*.java"]),
+    srcs = glob(
+        ["*.java"],
+        exclude = ["*Scope.java"],
+    ),
     deps = [
+        "//src/main/java/com/google/android/libraries/feed/api/host/logging",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/common",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/sessionmanager",
+        "//src/main/java/com/google/android/libraries/feed/api/lifecycle",
+        "//src/main/java/com/google/android/libraries/feed/common/concurrent",
+        "//src/main/java/com/google/android/libraries/feed/common/feedobservable",
+        "//src/main/java/com/google/android/libraries/feed/common/logging",
+        "//src/main/java/com/google/android/libraries/feed/feedapplifecyclelistener",
+        "//src/main/proto/com/google/android/libraries/feed/api/internal/proto:client_feed_java_proto_lite",
+        "@com_google_code_findbugs_jsr305//jar",
+    ],
+)
+
+android_library(
+    name = "feedprocessscope",
+    srcs = ["FeedProcessScope.java"],
+    deps = [
+        ":feedstreamscope",
+        ":scope",
         "//src/main/java/com/google/android/libraries/feed/api/client/knowncontent",
         "//src/main/java/com/google/android/libraries/feed/api/client/lifecycle",
         "//src/main/java/com/google/android/libraries/feed/api/client/requestmanager",
+        "//src/main/java/com/google/android/libraries/feed/api/client/scope:processscope",
         "//src/main/java/com/google/android/libraries/feed/api/host/action",
         "//src/main/java/com/google/android/libraries/feed/api/host/config",
         "//src/main/java/com/google/android/libraries/feed/api/host/imageloader",
         "//src/main/java/com/google/android/libraries/feed/api/host/logging",
         "//src/main/java/com/google/android/libraries/feed/api/host/network",
         "//src/main/java/com/google/android/libraries/feed/api/host/offlineindicator",
-        "//src/main/java/com/google/android/libraries/feed/api/host/proto",
-        "//src/main/java/com/google/android/libraries/feed/api/host/scheduler",
-        "//src/main/java/com/google/android/libraries/feed/api/host/storage",
+        "//src/main/java/com/google/android/libraries/feed/api/host/stream",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/actionmanager",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/common",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/knowncontent",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/protocoladapter",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/sessionmanager",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/store",
+        "//src/main/java/com/google/android/libraries/feed/api/sessionmanager",
+        "//src/main/java/com/google/android/libraries/feed/basicstream",
+        "//src/main/java/com/google/android/libraries/feed/common/concurrent",
+        "//src/main/java/com/google/android/libraries/feed/common/logging",
+        "//src/main/java/com/google/android/libraries/feed/common/protoextensions",
+        "//src/main/java/com/google/android/libraries/feed/common/time",
+    ],
+)
+
+android_library(
+    name = "feedstreamscope",
+    srcs = ["FeedStreamScope.java"],
+    deps = [
+        "//src/main/java/com/google/android/libraries/feed/api/host/action",
+        "//src/main/java/com/google/android/libraries/feed/api/host/config",
+        "//src/main/java/com/google/android/libraries/feed/api/host/imageloader",
+        "//src/main/java/com/google/android/libraries/feed/api/host/logging",
+        "//src/main/java/com/google/android/libraries/feed/api/host/offlineindicator",
         "//src/main/java/com/google/android/libraries/feed/api/host/stream",
         "//src/main/java/com/google/android/libraries/feed/api/internal/actionmanager",
         "//src/main/java/com/google/android/libraries/feed/api/internal/actionparser",
@@ -25,37 +70,17 @@
         "//src/main/java/com/google/android/libraries/feed/api/internal/knowncontent",
         "//src/main/java/com/google/android/libraries/feed/api/internal/modelprovider",
         "//src/main/java/com/google/android/libraries/feed/api/internal/protocoladapter",
-        "//src/main/java/com/google/android/libraries/feed/api/internal/requestmanager",
         "//src/main/java/com/google/android/libraries/feed/api/internal/sessionmanager",
-        "//src/main/java/com/google/android/libraries/feed/api/internal/store",
         "//src/main/java/com/google/android/libraries/feed/api/internal/stream",
-        "//src/main/java/com/google/android/libraries/feed/api/lifecycle",
-        "//src/main/java/com/google/android/libraries/feed/api/requestmanager",
-        "//src/main/java/com/google/android/libraries/feed/api/sessionmanager",
         "//src/main/java/com/google/android/libraries/feed/api/stream",
         "//src/main/java/com/google/android/libraries/feed/basicstream",
         "//src/main/java/com/google/android/libraries/feed/common",
         "//src/main/java/com/google/android/libraries/feed/common/concurrent",
-        "//src/main/java/com/google/android/libraries/feed/common/feedobservable",
-        "//src/main/java/com/google/android/libraries/feed/common/logging",
         "//src/main/java/com/google/android/libraries/feed/common/protoextensions",
         "//src/main/java/com/google/android/libraries/feed/common/time",
-        "//src/main/java/com/google/android/libraries/feed/feedactionmanager",
         "//src/main/java/com/google/android/libraries/feed/feedactionparser",
-        "//src/main/java/com/google/android/libraries/feed/feedactionreader",
-        "//src/main/java/com/google/android/libraries/feed/feedapplifecyclelistener",
-        "//src/main/java/com/google/android/libraries/feed/feedknowncontent",
         "//src/main/java/com/google/android/libraries/feed/feedmodelprovider",
-        "//src/main/java/com/google/android/libraries/feed/feedprotocoladapter",
-        "//src/main/java/com/google/android/libraries/feed/feedrequestmanager",
-        "//src/main/java/com/google/android/libraries/feed/feedsessionmanager",
-        "//src/main/java/com/google/android/libraries/feed/feedstore",
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/network",
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/scheduler",
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage",
         "//src/main/java/com/google/android/libraries/feed/piet/host",
-        "//src/main/proto/com/google/android/libraries/feed/api/internal/proto:client_feed_java_proto_lite",
         "@com_google_code_findbugs_jsr305//jar",
-        "@maven//:com_android_support_support_annotations",
     ],
 )
diff --git a/src/main/java/com/google/android/libraries/feed/api/scope/FeedProcessScope.java b/src/main/java/com/google/android/libraries/feed/api/scope/FeedProcessScope.java
index 609ac62..745e76e 100644
--- a/src/main/java/com/google/android/libraries/feed/api/scope/FeedProcessScope.java
+++ b/src/main/java/com/google/android/libraries/feed/api/scope/FeedProcessScope.java
@@ -15,42 +15,30 @@
 package com.google.android.libraries.feed.api.scope;
 
 import android.content.Context;
-import android.support.annotation.VisibleForTesting;
 import com.google.android.libraries.feed.api.client.knowncontent.KnownContent;
 import com.google.android.libraries.feed.api.client.lifecycle.AppLifecycleListener;
 import com.google.android.libraries.feed.api.client.requestmanager.RequestManager;
+import com.google.android.libraries.feed.api.client.scope.ProcessScope;
 import com.google.android.libraries.feed.api.host.action.ActionApi;
 import com.google.android.libraries.feed.api.host.config.ApplicationInfo;
 import com.google.android.libraries.feed.api.host.config.Configuration;
-import com.google.android.libraries.feed.api.host.config.Configuration.ConfigKey;
 import com.google.android.libraries.feed.api.host.config.DebugBehavior;
 import com.google.android.libraries.feed.api.host.imageloader.ImageLoaderApi;
 import com.google.android.libraries.feed.api.host.logging.BasicLoggingApi;
 import com.google.android.libraries.feed.api.host.network.NetworkClient;
 import com.google.android.libraries.feed.api.host.offlineindicator.OfflineIndicatorApi;
-import com.google.android.libraries.feed.api.host.proto.ProtoExtensionProvider;
-import com.google.android.libraries.feed.api.host.scheduler.SchedulerApi;
-import com.google.android.libraries.feed.api.host.storage.ContentStorage;
-import com.google.android.libraries.feed.api.host.storage.ContentStorageDirect;
-import com.google.android.libraries.feed.api.host.storage.JournalStorage;
-import com.google.android.libraries.feed.api.host.storage.JournalStorageDirect;
 import com.google.android.libraries.feed.api.host.stream.CardConfiguration;
 import com.google.android.libraries.feed.api.host.stream.SnackbarApi;
 import com.google.android.libraries.feed.api.host.stream.StreamConfiguration;
 import com.google.android.libraries.feed.api.host.stream.TooltipApi;
 import com.google.android.libraries.feed.api.host.stream.TooltipSupportedApi;
 import com.google.android.libraries.feed.api.internal.actionmanager.ActionManager;
-import com.google.android.libraries.feed.api.internal.actionmanager.ActionReader;
 import com.google.android.libraries.feed.api.internal.common.ThreadUtils;
 import com.google.android.libraries.feed.api.internal.knowncontent.FeedKnownContent;
 import com.google.android.libraries.feed.api.internal.protocoladapter.ProtocolAdapter;
-import com.google.android.libraries.feed.api.internal.requestmanager.FeedRequestManager;
 import com.google.android.libraries.feed.api.internal.sessionmanager.FeedSessionManager;
 import com.google.android.libraries.feed.api.internal.store.Store;
-import com.google.android.libraries.feed.api.requestmanager.ActionUploadRequestManager;
 import com.google.android.libraries.feed.api.sessionmanager.SessionManager;
-import com.google.android.libraries.feed.common.Validators;
-import com.google.android.libraries.feed.common.concurrent.DirectHostSupported;
 import com.google.android.libraries.feed.common.concurrent.MainThreadRunner;
 import com.google.android.libraries.feed.common.concurrent.TaskQueue;
 import com.google.android.libraries.feed.common.logging.Dumpable;
@@ -58,26 +46,7 @@
 import com.google.android.libraries.feed.common.logging.Logger;
 import com.google.android.libraries.feed.common.protoextensions.FeedExtensionRegistry;
 import com.google.android.libraries.feed.common.time.Clock;
-import com.google.android.libraries.feed.common.time.SystemClockImpl;
 import com.google.android.libraries.feed.common.time.TimingUtils;
-import com.google.android.libraries.feed.feedactionmanager.FeedActionManagerImpl;
-import com.google.android.libraries.feed.feedactionreader.FeedActionReader;
-import com.google.android.libraries.feed.feedapplifecyclelistener.FeedAppLifecycleListener;
-import com.google.android.libraries.feed.feedknowncontent.FeedKnownContentImpl;
-import com.google.android.libraries.feed.feedprotocoladapter.FeedProtocolAdapter;
-import com.google.android.libraries.feed.feedrequestmanager.FeedActionUploadRequestManager;
-import com.google.android.libraries.feed.feedrequestmanager.FeedRequestManagerImpl;
-import com.google.android.libraries.feed.feedrequestmanager.RequestManagerImpl;
-import com.google.android.libraries.feed.feedsessionmanager.FeedSessionManagerFactory;
-import com.google.android.libraries.feed.feedstore.ContentStorageDirectImpl;
-import com.google.android.libraries.feed.feedstore.FeedStore;
-import com.google.android.libraries.feed.feedstore.JournalStorageDirectImpl;
-import com.google.android.libraries.feed.hostimpl.network.NetworkClientWrapper;
-import com.google.android.libraries.feed.hostimpl.scheduler.SchedulerApiWrapper;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryContentStorage;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryJournalStorage;
-import java.util.ArrayList;
-import java.util.concurrent.Executor;
 
 /**
  * Per-process instance of the feed library.
@@ -85,7 +54,7 @@
  * <p>It's the host's responsibility to make sure there's only one instance of this per process, per
  * user.
  */
-public final class FeedProcessScope implements Dumpable {
+public final class FeedProcessScope implements ProcessScope, Dumpable {
   private static final String TAG = "FeedProcessScope";
 
   private final NetworkClient networkClient;
@@ -150,7 +119,7 @@
   }
 
   /** Created through the {@link Builder}. */
-  private FeedProcessScope(
+  public FeedProcessScope(
       BasicLoggingApi basicLoggingApi,
       NetworkClient networkClient,
       ProtocolAdapter protocolAdapter,
@@ -260,250 +229,4 @@
   public FeedExtensionRegistry getFeedExtensionRegistry() {
     return feedExtensionRegistry;
   }
-
-  /** A builder that creates a {@link FeedProcessScope}. */
-  public static final class Builder {
-
-    // Required fields.
-    private final Configuration configuration;
-    final Executor singleThreadExecutor;
-    private final BasicLoggingApi basicLoggingApi;
-    private final TooltipSupportedApi tooltipSupportedApi;
-    private final NetworkClient unwrappedNetworkClient;
-    private final SchedulerApi unwrappedSchedulerApi;
-    private final DebugBehavior debugBehavior;
-    private final Context context;
-    private final ApplicationInfo applicationInfo;
-
-    // Optional fields - if they are not provided, we will use default implementations.
-    /*@MonotonicNonNull*/ private ProtoExtensionProvider protoExtensionProvider = null;
-    /*@MonotonicNonNull*/ ContentStorageDirect contentStorage = null;
-    /*@MonotonicNonNull*/ JournalStorageDirect journalStorage = null;
-    /*@MonotonicNonNull*/ ContentStorage rawContentStorage = null;
-    /*@MonotonicNonNull*/ JournalStorage rawJournalStorage = null;
-    /*@MonotonicNonNull*/ private Clock clock;
-
-    // This will be overridden in tests.
-    private ThreadUtils threadUtils = new ThreadUtils();
-
-    /** The APIs are all required to construct the scope. */
-    public Builder(
-        Configuration configuration,
-        Executor singleThreadExecutor,
-        BasicLoggingApi basicLoggingApi,
-        NetworkClient networkClient,
-        SchedulerApi schedulerApi,
-        DebugBehavior debugBehavior,
-        Context context,
-        ApplicationInfo applicationInfo,
-        TooltipSupportedApi tooltipSupportedApi) {
-      this.configuration = configuration;
-      this.singleThreadExecutor = singleThreadExecutor;
-      this.basicLoggingApi = basicLoggingApi;
-      this.debugBehavior = debugBehavior;
-      this.context = context;
-      this.applicationInfo = applicationInfo;
-      this.unwrappedNetworkClient = networkClient;
-      this.unwrappedSchedulerApi = schedulerApi;
-      this.tooltipSupportedApi = tooltipSupportedApi;
-    }
-
-    public Builder setProtoExtensionProvider(ProtoExtensionProvider protoExtensionProvider) {
-      this.protoExtensionProvider = protoExtensionProvider;
-      return this;
-    }
-
-    public Builder setContentStorage(ContentStorage contentStorage) {
-      rawContentStorage = contentStorage;
-      return this;
-    }
-
-    public Builder setContentStorageDirect(ContentStorageDirect contentStorage) {
-      this.contentStorage = contentStorage;
-      return this;
-    }
-
-    public Builder setJournalStorage(JournalStorage journalStorage) {
-      rawJournalStorage = journalStorage;
-      return this;
-    }
-
-    public Builder setJournalStorageDirect(JournalStorageDirect journalStorage) {
-      this.journalStorage = journalStorage;
-      return this;
-    }
-
-    // This is really exposed for tests to override the thread checking
-    Builder setThreadUtils(ThreadUtils threadUtils) {
-      this.threadUtils = threadUtils;
-      return this;
-    }
-
-    public Builder setClock(Clock clock) {
-      this.clock = clock;
-      return this;
-    }
-
-    @VisibleForTesting
-    ContentStorageDirect buildContentStorage(MainThreadRunner mainThreadRunner) {
-      if (contentStorage == null) {
-        boolean useDirect = configuration.getValueOrDefault(ConfigKey.USE_DIRECT_STORAGE, false);
-        if (useDirect
-            && rawContentStorage != null
-            && rawContentStorage instanceof ContentStorageDirect) {
-          contentStorage = (ContentStorageDirect) rawContentStorage;
-        } else if (rawContentStorage != null) {
-          contentStorage = new ContentStorageDirectImpl(rawContentStorage, mainThreadRunner);
-        } else {
-          contentStorage = new InMemoryContentStorage();
-        }
-      }
-      return contentStorage;
-    }
-
-    @VisibleForTesting
-    JournalStorageDirect buildJournalStorage(MainThreadRunner mainThreadRunner) {
-      if (journalStorage == null) {
-        boolean useDirect = configuration.getValueOrDefault(ConfigKey.USE_DIRECT_STORAGE, false);
-        if (useDirect
-            && rawJournalStorage != null
-            && rawJournalStorage instanceof JournalStorageDirect) {
-          journalStorage = (JournalStorageDirect) rawJournalStorage;
-        } else if (rawJournalStorage != null) {
-          journalStorage = new JournalStorageDirectImpl(rawJournalStorage, mainThreadRunner);
-        } else {
-          journalStorage = new InMemoryJournalStorage();
-        }
-      }
-      return journalStorage;
-    }
-
-    public FeedProcessScope build() {
-      MainThreadRunner mainThreadRunner = new MainThreadRunner();
-      contentStorage = buildContentStorage(mainThreadRunner);
-      journalStorage = buildJournalStorage(mainThreadRunner);
-
-      boolean directHostCallEnabled =
-          configuration.getValueOrDefault(ConfigKey.USE_DIRECT_STORAGE, false);
-      NetworkClient networkClient;
-      SchedulerApi schedulerApi;
-      if (unwrappedNetworkClient instanceof DirectHostSupported && directHostCallEnabled) {
-        networkClient = unwrappedNetworkClient;
-      } else {
-        networkClient =
-            new NetworkClientWrapper(unwrappedNetworkClient, threadUtils, mainThreadRunner);
-      }
-      if (unwrappedSchedulerApi instanceof DirectHostSupported && directHostCallEnabled) {
-        schedulerApi = unwrappedSchedulerApi;
-      } else {
-        schedulerApi =
-            new SchedulerApiWrapper(unwrappedSchedulerApi, threadUtils, mainThreadRunner);
-      }
-
-      // Build default component instances if necessary.
-      if (protoExtensionProvider == null) {
-        // Return an empty list of extensions by default.
-        protoExtensionProvider = ArrayList::new;
-      }
-      FeedExtensionRegistry extensionRegistry = new FeedExtensionRegistry(protoExtensionProvider);
-      if (clock == null) {
-        clock = new SystemClockImpl();
-      }
-      TimingUtils timingUtils = new TimingUtils();
-      TaskQueue taskQueue =
-          new TaskQueue(basicLoggingApi, singleThreadExecutor, mainThreadRunner, clock);
-      FeedStore store =
-          new FeedStore(
-              timingUtils,
-              extensionRegistry,
-              contentStorage,
-              journalStorage,
-              threadUtils,
-              taskQueue,
-              clock,
-              basicLoggingApi,
-              mainThreadRunner);
-
-      FeedAppLifecycleListener lifecycleListener = new FeedAppLifecycleListener(threadUtils);
-      lifecycleListener.registerObserver(store);
-
-      ProtocolAdapter protocolAdapter = new FeedProtocolAdapter(timingUtils);
-      ActionReader actionReader =
-          new FeedActionReader(store, clock, protocolAdapter, taskQueue, configuration);
-      FeedRequestManager feedRequestManager =
-          new FeedRequestManagerImpl(
-              configuration,
-              networkClient,
-              protocolAdapter,
-              extensionRegistry,
-              schedulerApi,
-              taskQueue,
-              timingUtils,
-              threadUtils,
-              actionReader,
-              context,
-              applicationInfo,
-              mainThreadRunner,
-              basicLoggingApi,
-              tooltipSupportedApi);
-      ActionUploadRequestManager actionUploadRequestManager =
-          new FeedActionUploadRequestManager(
-              configuration,
-              networkClient,
-              protocolAdapter,
-              extensionRegistry,
-              taskQueue,
-              threadUtils,
-              actionReader,
-              store,
-              clock);
-      FeedSessionManagerFactory fsmFactory =
-          new FeedSessionManagerFactory(
-              taskQueue,
-              store,
-              timingUtils,
-              threadUtils,
-              protocolAdapter,
-              feedRequestManager,
-              actionUploadRequestManager,
-              schedulerApi,
-              configuration,
-              clock,
-              lifecycleListener);
-      FeedSessionManager feedSessionManager = fsmFactory.create();
-      RequestManagerImpl clientRequestManager =
-          new RequestManagerImpl(feedRequestManager, feedSessionManager);
-      ActionManager actionManager =
-          new FeedActionManagerImpl(
-              feedSessionManager, store, threadUtils, taskQueue, mainThreadRunner, clock);
-
-      FeedKnownContent feedKnownContent =
-          new FeedKnownContentImpl(feedSessionManager, mainThreadRunner, threadUtils);
-
-      ClearAllListener clearAllListener =
-          new ClearAllListener(
-              taskQueue, feedSessionManager, store, threadUtils, lifecycleListener);
-      return new FeedProcessScope(
-          basicLoggingApi,
-          networkClient,
-          Validators.checkNotNull(protocolAdapter),
-          Validators.checkNotNull(clientRequestManager),
-          Validators.checkNotNull(feedSessionManager),
-          store,
-          timingUtils,
-          threadUtils,
-          taskQueue,
-          mainThreadRunner,
-          lifecycleListener,
-          clock,
-          debugBehavior,
-          actionManager,
-          configuration,
-          feedKnownContent,
-          extensionRegistry,
-          clearAllListener,
-          tooltipSupportedApi,
-          applicationInfo);
-    }
-  }
 }
diff --git a/src/main/java/com/google/android/libraries/feed/api/sessionmanager/BUILD b/src/main/java/com/google/android/libraries/feed/api/sessionmanager/BUILD
index 575c45f..91baf44 100644
--- a/src/main/java/com/google/android/libraries/feed/api/sessionmanager/BUILD
+++ b/src/main/java/com/google/android/libraries/feed/api/sessionmanager/BUILD
@@ -7,14 +7,8 @@
     srcs = glob(["*.java"]),
     deps = [
         "//src/main/java/com/google/android/libraries/feed/api/common",
-        "//src/main/java/com/google/android/libraries/feed/api/host/logging",
-        "//src/main/java/com/google/android/libraries/feed/api/internal/common",
-        "//src/main/java/com/google/android/libraries/feed/api/internal/modelprovider",
-        "//src/main/java/com/google/android/libraries/feed/api/lifecycle",
         "//src/main/java/com/google/android/libraries/feed/common",
         "//src/main/java/com/google/android/libraries/feed/common/functional",
         "//src/main/proto/com/google/android/libraries/feed/api/internal/proto:client_feed_java_proto_lite",
-        "//src/main/proto/search/now/wire/feed:feed_java_proto_lite",
-        "@com_google_code_findbugs_jsr305//jar",
     ],
 )
diff --git a/src/test/java/com/google/android/libraries/feed/api/client/scope/BUILD b/src/test/java/com/google/android/libraries/feed/api/client/scope/BUILD
new file mode 100644
index 0000000..0349d4f
--- /dev/null
+++ b/src/test/java/com/google/android/libraries/feed/api/client/scope/BUILD
@@ -0,0 +1,32 @@
+load("//src/main/java/com/google/android/libraries/feed/buildtools/testing:android_local_test.bzl", "DEFAULT_ANDROID_LOCAL_TEST_MANIFEST")
+
+licenses(["notice"])  # Apache 2
+
+android_local_test(
+    name = "ProcessScopeBuilderTest",
+    size = "small",
+    timeout = "moderate",
+    srcs = ["ProcessScopeBuilderTest.java"],
+    aapt_version = "aapt2",
+    manifest_values = DEFAULT_ANDROID_LOCAL_TEST_MANIFEST,
+    deps = [
+        "//src/main/java/com/google/android/libraries/feed/api/client/scope:processscope",
+        "//src/main/java/com/google/android/libraries/feed/api/client/scope:processscopebuilder",
+        "//src/main/java/com/google/android/libraries/feed/api/host/config",
+        "//src/main/java/com/google/android/libraries/feed/api/host/logging",
+        "//src/main/java/com/google/android/libraries/feed/api/host/network",
+        "//src/main/java/com/google/android/libraries/feed/api/host/proto",
+        "//src/main/java/com/google/android/libraries/feed/api/host/scheduler",
+        "//src/main/java/com/google/android/libraries/feed/api/host/storage",
+        "//src/main/java/com/google/android/libraries/feed/api/host/stream",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/common",
+        "//src/main/java/com/google/android/libraries/feed/common/concurrent",
+        "//src/main/java/com/google/android/libraries/feed/common/time/testing",
+        "//third_party:robolectric",
+        "@com_google_protobuf_javalite//:protobuf_java_lite",
+        "@maven//:com_google_guava_guava",
+        "@maven//:com_google_truth_truth",
+        "@maven//:org_mockito_mockito_core",
+        "@robolectric//bazel:android-all",
+    ],
+)
diff --git a/src/test/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilderTest.java b/src/test/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilderTest.java
new file mode 100644
index 0000000..b494782
--- /dev/null
+++ b/src/test/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilderTest.java
@@ -0,0 +1,191 @@
+// Copyright 2018 The Feed Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.android.libraries.feed.api.client.scope;
+
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.withSettings;
+import static org.mockito.MockitoAnnotations.initMocks;
+
+import android.app.Activity;
+import android.content.Context;
+import com.google.android.libraries.feed.api.host.config.ApplicationInfo;
+import com.google.android.libraries.feed.api.host.config.Configuration;
+import com.google.android.libraries.feed.api.host.config.Configuration.ConfigKey;
+import com.google.android.libraries.feed.api.host.config.DebugBehavior;
+import com.google.android.libraries.feed.api.host.logging.BasicLoggingApi;
+import com.google.android.libraries.feed.api.host.network.NetworkClient;
+import com.google.android.libraries.feed.api.host.proto.ProtoExtensionProvider;
+import com.google.android.libraries.feed.api.host.scheduler.SchedulerApi;
+import com.google.android.libraries.feed.api.host.storage.ContentStorage;
+import com.google.android.libraries.feed.api.host.storage.ContentStorageDirect;
+import com.google.android.libraries.feed.api.host.storage.JournalStorage;
+import com.google.android.libraries.feed.api.host.storage.JournalStorageDirect;
+import com.google.android.libraries.feed.api.host.stream.TooltipSupportedApi;
+import com.google.android.libraries.feed.api.internal.common.ThreadUtils;
+import com.google.android.libraries.feed.common.concurrent.MainThreadRunner;
+import com.google.android.libraries.feed.common.time.testing.FakeClock;
+import com.google.common.util.concurrent.MoreExecutors;
+import java.util.ArrayList;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.robolectric.Robolectric;
+import org.robolectric.RobolectricTestRunner;
+
+/** Tests for {@link ProcessScopeBuilder}. */
+@RunWith(RobolectricTestRunner.class)
+public class ProcessScopeBuilderTest {
+
+  // Mocks for required fields
+  @Mock private BasicLoggingApi basicLoggingApi;
+  @Mock private NetworkClient networkClient;
+  @Mock private SchedulerApi schedulerApi;
+  @Mock private ApplicationInfo applicationInfo;
+  @Mock private TooltipSupportedApi tooltipSupportedApi;
+
+  // Mocks for optional fields
+  @Mock private ThreadUtils threadUtils;
+
+  private final ProtoExtensionProvider protoExtensionProvider = ArrayList::new;
+  private Configuration configuration = new Configuration.Builder().build();
+  private Context context;
+
+  @Before
+  public void setUp() {
+    initMocks(this);
+    context = Robolectric.buildActivity(Activity.class).get();
+  }
+
+  @Test
+  public void testBasicBuild() {
+    // No crash should happen.
+    ProcessScope processScope =
+        new ProcessScopeBuilder(
+                configuration,
+                MoreExecutors.newDirectExecutorService(),
+                basicLoggingApi,
+                networkClient,
+                schedulerApi,
+                DebugBehavior.VERBOSE,
+                context,
+                applicationInfo,
+                tooltipSupportedApi)
+            .setThreadUtils(threadUtils)
+            .build();
+
+    assertThat(processScope.getRequestManager()).isNotNull();
+    assertThat(processScope.getSessionManager()).isNotNull();
+    assertThat(processScope.getAppLifecycleListener()).isNotNull();
+    assertThat(processScope.getKnownContent()).isNotNull();
+    assertThat(processScope.getAppLifecycleListener()).isNotNull();
+  }
+
+  @Test
+  public void testComplexBuild() {
+    FakeClock fakeClock = new FakeClock();
+    // No crash should happen.
+    ProcessScope processScope =
+        new ProcessScopeBuilder(
+                configuration,
+                MoreExecutors.newDirectExecutorService(),
+                basicLoggingApi,
+                networkClient,
+                schedulerApi,
+                DebugBehavior.VERBOSE,
+                context,
+                applicationInfo,
+                tooltipSupportedApi)
+            .setProtoExtensionProvider(protoExtensionProvider)
+            .setClock(fakeClock)
+            .build();
+
+    assertThat(processScope.getRequestManager()).isNotNull();
+    assertThat(processScope.getSessionManager()).isNotNull();
+    assertThat(processScope.getAppLifecycleListener()).isNotNull();
+    assertThat(processScope.getAppLifecycleListener()).isNotNull();
+  }
+
+  @Test
+  public void testDirectStorage() {
+    ContentStorageDirect contentStorageDirect = mock(ContentStorageDirect.class);
+    JournalStorageDirect journalStorageDirect = mock(JournalStorageDirect.class);
+    ProcessScopeBuilder builder =
+        new ProcessScopeBuilder(
+                configuration,
+                MoreExecutors.newDirectExecutorService(),
+                basicLoggingApi,
+                networkClient,
+                schedulerApi,
+                DebugBehavior.VERBOSE,
+                context,
+                applicationInfo,
+                tooltipSupportedApi)
+            .setContentStorageDirect(contentStorageDirect)
+            .setJournalStorageDirect(journalStorageDirect);
+    assertThat(builder.contentStorage).isEqualTo(contentStorageDirect);
+    assertThat(builder.journalStorage).isEqualTo(journalStorageDirect);
+  }
+
+  @Test
+  public void testStorage_direct() {
+    configuration = new Configuration.Builder().put(ConfigKey.USE_DIRECT_STORAGE, true).build();
+    ContentStorage contentStorageDirect =
+        mock(ContentStorage.class, withSettings().extraInterfaces(ContentStorageDirect.class));
+    JournalStorage journalStorageDirect =
+        mock(JournalStorage.class, withSettings().extraInterfaces(JournalStorageDirect.class));
+    ProcessScopeBuilder builder =
+        new ProcessScopeBuilder(
+                configuration,
+                MoreExecutors.newDirectExecutorService(),
+                basicLoggingApi,
+                networkClient,
+                schedulerApi,
+                DebugBehavior.VERBOSE,
+                context,
+                applicationInfo,
+                tooltipSupportedApi)
+            .setContentStorage(contentStorageDirect)
+            .setJournalStorage(journalStorageDirect);
+    MainThreadRunner mainThreadRunner = new MainThreadRunner();
+    assertThat(builder.buildContentStorage(mainThreadRunner)).isEqualTo(contentStorageDirect);
+    assertThat(builder.buildJournalStorage(mainThreadRunner)).isEqualTo(journalStorageDirect);
+  }
+
+  @Test
+  public void testStorage_wrapped() {
+    configuration = new Configuration.Builder().put(ConfigKey.USE_DIRECT_STORAGE, false).build();
+    ContentStorage contentStorageDirect =
+        mock(ContentStorage.class, withSettings().extraInterfaces(ContentStorageDirect.class));
+    JournalStorage journalStorageDirect =
+        mock(JournalStorage.class, withSettings().extraInterfaces(JournalStorageDirect.class));
+    ProcessScopeBuilder builder =
+        new ProcessScopeBuilder(
+                configuration,
+                MoreExecutors.newDirectExecutorService(),
+                basicLoggingApi,
+                networkClient,
+                schedulerApi,
+                DebugBehavior.VERBOSE,
+                context,
+                applicationInfo,
+                tooltipSupportedApi)
+            .setContentStorage(contentStorageDirect)
+            .setJournalStorage(journalStorageDirect);
+    assertThat(builder.contentStorage).isNotEqualTo(contentStorageDirect);
+    assertThat(builder.journalStorage).isNotEqualTo(journalStorageDirect);
+  }
+}
diff --git a/src/test/java/com/google/android/libraries/feed/api/internal/modelprovider/RemoveTrackingTest.java b/src/test/java/com/google/android/libraries/feed/api/internal/modelprovider/RemoveTrackingTest.java
index 88492a1..ce433e9 100644
--- a/src/test/java/com/google/android/libraries/feed/api/internal/modelprovider/RemoveTrackingTest.java
+++ b/src/test/java/com/google/android/libraries/feed/api/internal/modelprovider/RemoveTrackingTest.java
@@ -43,18 +43,14 @@
   @Test
   public void testEmpty() {
     RemoveTracking<String> removeTracking =
-        getRemoveTracking(
-            this::simpleTransform,
-            (contentIds) -> assertThat(contentIds).hasSize(0));
+        getRemoveTracking(this::simpleTransform, (contentIds) -> assertThat(contentIds).hasSize(0));
     removeTracking.triggerConsumerUpdate();
   }
 
   @Test
   public void testMatch() {
     RemoveTracking<String> removeTracking =
-        getRemoveTracking(
-            this::simpleTransform,
-            (contentIds) -> assertThat(contentIds).hasSize(1));
+        getRemoveTracking(this::simpleTransform, (contentIds) -> assertThat(contentIds).hasSize(1));
     InternalProtocolBuilder protocolBuilder = new InternalProtocolBuilder();
     protocolBuilder.addFeature(idGenerators.createFeatureContentId(0), rootContentId);
     List<PayloadWithId> payloads = protocolBuilder.buildAsPayloadWithId();
@@ -68,9 +64,7 @@
   @Test
   public void testNoMatch() {
     RemoveTracking<String> removeTracking =
-        getRemoveTracking(
-            this::nullTransform,
-            (contentIds) -> assertThat(contentIds).hasSize(0));
+        getRemoveTracking(this::nullTransform, (contentIds) -> assertThat(contentIds).hasSize(0));
     InternalProtocolBuilder protocolBuilder = new InternalProtocolBuilder();
     protocolBuilder.addFeature(idGenerators.createFeatureContentId(0), rootContentId);
     List<PayloadWithId> payloads = protocolBuilder.buildAsPayloadWithId();
@@ -82,8 +76,7 @@
   }
 
   private RemoveTracking<String> getRemoveTracking(
-      Function<StreamFeature, String> transformer,
-      Consumer<List<String>> consumer) {
+      Function<StreamFeature, String> transformer, Consumer<List<String>> consumer) {
     return new RemoveTracking<>(transformer, consumer);
   }
 
diff --git a/src/test/java/com/google/android/libraries/feed/api/scope/BUILD b/src/test/java/com/google/android/libraries/feed/api/scope/BUILD
index 7a99f85..5905731 100644
--- a/src/test/java/com/google/android/libraries/feed/api/scope/BUILD
+++ b/src/test/java/com/google/android/libraries/feed/api/scope/BUILD
@@ -34,21 +34,28 @@
     aapt_version = "aapt2",
     manifest_values = DEFAULT_ANDROID_LOCAL_TEST_MANIFEST,
     deps = [
+        "//src/main/java/com/google/android/libraries/feed/api/client/lifecycle",
+        "//src/main/java/com/google/android/libraries/feed/api/client/requestmanager",
         "//src/main/java/com/google/android/libraries/feed/api/host/config",
         "//src/main/java/com/google/android/libraries/feed/api/host/logging",
         "//src/main/java/com/google/android/libraries/feed/api/host/network",
-        "//src/main/java/com/google/android/libraries/feed/api/host/proto",
-        "//src/main/java/com/google/android/libraries/feed/api/host/scheduler",
-        "//src/main/java/com/google/android/libraries/feed/api/host/storage",
         "//src/main/java/com/google/android/libraries/feed/api/host/stream",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/actionmanager",
         "//src/main/java/com/google/android/libraries/feed/api/internal/common",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/knowncontent",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/protocoladapter",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/sessionmanager",
+        "//src/main/java/com/google/android/libraries/feed/api/internal/store",
         "//src/main/java/com/google/android/libraries/feed/api/scope",
+        "//src/main/java/com/google/android/libraries/feed/api/scope:feedprocessscope",
         "//src/main/java/com/google/android/libraries/feed/common/concurrent",
+        "//src/main/java/com/google/android/libraries/feed/common/feedobservable",
+        "//src/main/java/com/google/android/libraries/feed/common/protoextensions",
+        "//src/main/java/com/google/android/libraries/feed/common/time",
         "//src/main/java/com/google/android/libraries/feed/common/time/testing",
+        "//src/main/java/com/google/android/libraries/feed/feedapplifecyclelistener",
         "//third_party:robolectric",
         "@com_google_protobuf_javalite//:protobuf_java_lite",
-        "@maven//:com_google_guava_guava",
-        "@maven//:com_google_truth_truth",
         "@maven//:org_mockito_mockito_core",
         "@robolectric//bazel:android-all",
     ],
@@ -75,7 +82,7 @@
         "//src/main/java/com/google/android/libraries/feed/api/internal/protocoladapter",
         "//src/main/java/com/google/android/libraries/feed/api/internal/sessionmanager",
         "//src/main/java/com/google/android/libraries/feed/api/internal/stream",
-        "//src/main/java/com/google/android/libraries/feed/api/scope",
+        "//src/main/java/com/google/android/libraries/feed/api/scope:feedstreamscope",
         "//src/main/java/com/google/android/libraries/feed/api/stream",
         "//src/main/java/com/google/android/libraries/feed/common/concurrent",
         "//src/main/java/com/google/android/libraries/feed/common/protoextensions",
diff --git a/src/test/java/com/google/android/libraries/feed/api/scope/FeedProcessScopeTest.java b/src/test/java/com/google/android/libraries/feed/api/scope/FeedProcessScopeTest.java
index c107edc..9cbc925 100644
--- a/src/test/java/com/google/android/libraries/feed/api/scope/FeedProcessScopeTest.java
+++ b/src/test/java/com/google/android/libraries/feed/api/scope/FeedProcessScopeTest.java
@@ -14,197 +14,96 @@
 
 package com.google.android.libraries.feed.api.scope;
 
-import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.withSettings;
 import static org.mockito.MockitoAnnotations.initMocks;
 
-import android.app.Activity;
-import android.content.Context;
+import com.google.android.libraries.feed.api.client.lifecycle.AppLifecycleListener;
+import com.google.android.libraries.feed.api.client.requestmanager.RequestManager;
 import com.google.android.libraries.feed.api.host.config.ApplicationInfo;
 import com.google.android.libraries.feed.api.host.config.Configuration;
-import com.google.android.libraries.feed.api.host.config.Configuration.ConfigKey;
 import com.google.android.libraries.feed.api.host.config.DebugBehavior;
 import com.google.android.libraries.feed.api.host.logging.BasicLoggingApi;
 import com.google.android.libraries.feed.api.host.network.NetworkClient;
-import com.google.android.libraries.feed.api.host.proto.ProtoExtensionProvider;
-import com.google.android.libraries.feed.api.host.scheduler.SchedulerApi;
-import com.google.android.libraries.feed.api.host.storage.ContentStorage;
-import com.google.android.libraries.feed.api.host.storage.ContentStorageDirect;
-import com.google.android.libraries.feed.api.host.storage.JournalStorage;
-import com.google.android.libraries.feed.api.host.storage.JournalStorageDirect;
 import com.google.android.libraries.feed.api.host.stream.TooltipSupportedApi;
+import com.google.android.libraries.feed.api.internal.actionmanager.ActionManager;
 import com.google.android.libraries.feed.api.internal.common.ThreadUtils;
+import com.google.android.libraries.feed.api.internal.knowncontent.FeedKnownContent;
+import com.google.android.libraries.feed.api.internal.protocoladapter.ProtocolAdapter;
+import com.google.android.libraries.feed.api.internal.sessionmanager.FeedSessionManager;
+import com.google.android.libraries.feed.api.internal.store.Store;
 import com.google.android.libraries.feed.common.concurrent.MainThreadRunner;
+import com.google.android.libraries.feed.common.concurrent.TaskQueue;
+import com.google.android.libraries.feed.common.feedobservable.FeedObservable;
+import com.google.android.libraries.feed.common.protoextensions.FeedExtensionRegistry;
+import com.google.android.libraries.feed.common.time.Clock;
+import com.google.android.libraries.feed.common.time.TimingUtils;
 import com.google.android.libraries.feed.common.time.testing.FakeClock;
-import com.google.common.util.concurrent.MoreExecutors;
-import java.util.ArrayList;
+import com.google.android.libraries.feed.feedapplifecyclelistener.FeedLifecycleListener;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
-import org.robolectric.Robolectric;
 import org.robolectric.RobolectricTestRunner;
 
 /** Tests for {@link FeedProcessScope}. */
 @RunWith(RobolectricTestRunner.class)
 public class FeedProcessScopeTest {
 
-  // Mocks for required fields
   @Mock private BasicLoggingApi basicLoggingApi;
   @Mock private NetworkClient networkClient;
-  @Mock private SchedulerApi schedulerApi;
   @Mock private ApplicationInfo applicationInfo;
   @Mock private TooltipSupportedApi tooltipSupportedApi;
+  @Mock private ProtocolAdapter protocolAdapter;
+  @Mock private RequestManager requestManager;
+  @Mock private FeedSessionManager feedSessionManager;
+  @Mock private Store store;
+  @Mock private TaskQueue taskQueue;
+  @Mock private AppLifecycleListener appLifecycleListener;
+  @Mock private DebugBehavior debugBehavior;
+  @Mock private ActionManager actionManager;
+  @Mock private FeedKnownContent feedKnownContent;
+  @Mock private FeedExtensionRegistry feedExtensionRegistry;
+  @Mock private FeedObservable<FeedLifecycleListener> feedLifecycleListenerFeedObservable;
 
-  // Mocks for optional fields
-  @Mock private ThreadUtils threadUtils;
-
-  private final ProtoExtensionProvider protoExtensionProvider = ArrayList::new;
+  private final Clock clock = new FakeClock();
+  private final MainThreadRunner mainThreadRunner = new MainThreadRunner();
+  private final ThreadUtils threadUtils = new ThreadUtils();
+  private final TimingUtils timingUtils = new TimingUtils();
   private Configuration configuration = new Configuration.Builder().build();
-  private Context context;
+  private ClearAllListener clearAllListener;
 
   @Before
   public void setUp() {
     initMocks(this);
-    context = Robolectric.buildActivity(Activity.class).get();
-  }
-
-  @Test
-  public void testBasicBuild() {
-    // No crash should happen.
-    FeedProcessScope processScope =
-        new FeedProcessScope.Builder(
-                configuration,
-                MoreExecutors.newDirectExecutorService(),
-                basicLoggingApi,
-                networkClient,
-                schedulerApi,
-                DebugBehavior.VERBOSE,
-                context,
-                applicationInfo,
-                tooltipSupportedApi)
-            .setThreadUtils(threadUtils)
-            .build();
-
-    assertThat(processScope.getRequestManager()).isNotNull();
-    assertThat(processScope.getSessionManager()).isNotNull();
-    assertThat(processScope.getAppLifecycleListener()).isNotNull();
-    assertThat(processScope.getKnownContent()).isNotNull();
-    assertThat(processScope.getAppLifecycleListener()).isNotNull();
-  }
-
-  @Test
-  public void testComplexBuild() {
-    FakeClock fakeClock = new FakeClock();
-    // No crash should happen.
-    FeedProcessScope processScope =
-        new FeedProcessScope.Builder(
-                configuration,
-                MoreExecutors.newDirectExecutorService(),
-                basicLoggingApi,
-                networkClient,
-                schedulerApi,
-                DebugBehavior.VERBOSE,
-                context,
-                applicationInfo,
-                tooltipSupportedApi)
-            .setProtoExtensionProvider(protoExtensionProvider)
-            .setClock(fakeClock)
-            .build();
-
-    assertThat(processScope.getRequestManager()).isNotNull();
-    assertThat(processScope.getSessionManager()).isNotNull();
-    assertThat(processScope.getAppLifecycleListener()).isNotNull();
-    assertThat(processScope.getAppLifecycleListener()).isNotNull();
-  }
-
-  @Test
-  public void testDirectStorage() {
-    ContentStorageDirect contentStorageDirect = mock(ContentStorageDirect.class);
-    JournalStorageDirect journalStorageDirect = mock(JournalStorageDirect.class);
-    FeedProcessScope.Builder builder =
-        new FeedProcessScope.Builder(
-                configuration,
-                MoreExecutors.newDirectExecutorService(),
-                basicLoggingApi,
-                networkClient,
-                schedulerApi,
-                DebugBehavior.VERBOSE,
-                context,
-                applicationInfo,
-                tooltipSupportedApi)
-            .setContentStorageDirect(contentStorageDirect)
-            .setJournalStorageDirect(journalStorageDirect);
-    assertThat(builder.contentStorage).isEqualTo(contentStorageDirect);
-    assertThat(builder.journalStorage).isEqualTo(journalStorageDirect);
-  }
-
-  @Test
-  public void testStorage_direct() {
-    configuration = new Configuration.Builder().put(ConfigKey.USE_DIRECT_STORAGE, true).build();
-    ContentStorage contentStorageDirect =
-        mock(ContentStorage.class, withSettings().extraInterfaces(ContentStorageDirect.class));
-    JournalStorage journalStorageDirect =
-        mock(JournalStorage.class, withSettings().extraInterfaces(JournalStorageDirect.class));
-    FeedProcessScope.Builder builder =
-        new FeedProcessScope.Builder(
-                configuration,
-                MoreExecutors.newDirectExecutorService(),
-                basicLoggingApi,
-                networkClient,
-                schedulerApi,
-                DebugBehavior.VERBOSE,
-                context,
-                applicationInfo,
-                tooltipSupportedApi)
-            .setContentStorage(contentStorageDirect)
-            .setJournalStorage(journalStorageDirect);
-    MainThreadRunner mainThreadRunner = new MainThreadRunner();
-    assertThat(builder.buildContentStorage(mainThreadRunner)).isEqualTo(contentStorageDirect);
-    assertThat(builder.buildJournalStorage(mainThreadRunner)).isEqualTo(journalStorageDirect);
-  }
-
-  @Test
-  public void testStorage_wrapped() {
-    configuration = new Configuration.Builder().put(ConfigKey.USE_DIRECT_STORAGE, false).build();
-    ContentStorage contentStorageDirect =
-        mock(ContentStorage.class, withSettings().extraInterfaces(ContentStorageDirect.class));
-    JournalStorage journalStorageDirect =
-        mock(JournalStorage.class, withSettings().extraInterfaces(JournalStorageDirect.class));
-    FeedProcessScope.Builder builder =
-        new FeedProcessScope.Builder(
-                configuration,
-                MoreExecutors.newDirectExecutorService(),
-                basicLoggingApi,
-                networkClient,
-                schedulerApi,
-                DebugBehavior.VERBOSE,
-                context,
-                applicationInfo,
-                tooltipSupportedApi)
-            .setContentStorage(contentStorageDirect)
-            .setJournalStorage(journalStorageDirect);
-    assertThat(builder.contentStorage).isNotEqualTo(contentStorageDirect);
-    assertThat(builder.journalStorage).isNotEqualTo(journalStorageDirect);
+    clearAllListener =
+        new ClearAllListener(
+            taskQueue, feedSessionManager, null, threadUtils, feedLifecycleListenerFeedObservable);
   }
 
   @Test
   public void testDestroy() throws Exception {
     FeedProcessScope processScope =
-        new FeedProcessScope.Builder(
-                configuration,
-                MoreExecutors.newDirectExecutorService(),
-                basicLoggingApi,
-                networkClient,
-                schedulerApi,
-                DebugBehavior.VERBOSE,
-                context,
-                applicationInfo,
-                tooltipSupportedApi)
-            .setThreadUtils(threadUtils)
-            .build();
+        new FeedProcessScope(
+            basicLoggingApi,
+            networkClient,
+            protocolAdapter,
+            requestManager,
+            feedSessionManager,
+            store,
+            timingUtils,
+            threadUtils,
+            taskQueue,
+            mainThreadRunner,
+            appLifecycleListener,
+            clock,
+            debugBehavior,
+            actionManager,
+            configuration,
+            feedKnownContent,
+            feedExtensionRegistry,
+            clearAllListener,
+            tooltipSupportedApi,
+            applicationInfo);
     processScope.onDestroy();
     verify(networkClient).close();
   }
diff --git a/src/test/java/com/google/android/libraries/feed/feedactionmanager/BUILD b/src/test/java/com/google/android/libraries/feed/feedactionmanager/BUILD
index 32773a9..c446c4a 100644
--- a/src/test/java/com/google/android/libraries/feed/feedactionmanager/BUILD
+++ b/src/test/java/com/google/android/libraries/feed/feedactionmanager/BUILD
@@ -14,7 +14,6 @@
         "//src/main/java/com/google/android/libraries/feed/api/internal/actionmanager",
         "//src/main/java/com/google/android/libraries/feed/api/internal/sessionmanager",
         "//src/main/java/com/google/android/libraries/feed/api/internal/store",
-        "//src/main/java/com/google/android/libraries/feed/api/sessionmanager",
         "//src/main/java/com/google/android/libraries/feed/common",
         "//src/main/java/com/google/android/libraries/feed/common/concurrent/testing",
         "//src/main/java/com/google/android/libraries/feed/common/functional",
diff --git a/src/test/java/com/google/android/libraries/feed/feedknowncontent/BUILD b/src/test/java/com/google/android/libraries/feed/feedknowncontent/BUILD
index 2f95b2d..847f307 100644
--- a/src/test/java/com/google/android/libraries/feed/feedknowncontent/BUILD
+++ b/src/test/java/com/google/android/libraries/feed/feedknowncontent/BUILD
@@ -13,7 +13,6 @@
         "//src/main/java/com/google/android/libraries/feed/api/client/knowncontent",
         "//src/main/java/com/google/android/libraries/feed/api/internal/common",
         "//src/main/java/com/google/android/libraries/feed/api/internal/sessionmanager",
-        "//src/main/java/com/google/android/libraries/feed/api/sessionmanager",
         "//src/main/java/com/google/android/libraries/feed/common",
         "//src/main/java/com/google/android/libraries/feed/common/concurrent/testing",
         "//src/main/java/com/google/android/libraries/feed/common/functional",