diff --git a/hostsidetests/backup/OWNERS b/hostsidetests/backup/OWNERS
index 3637e32..c28c4d8 100644
--- a/hostsidetests/backup/OWNERS
+++ b/hostsidetests/backup/OWNERS
@@ -1,3 +1,4 @@
+# Bug component: 41666
 # Use this reviewer by default.
 br-framework-team+reviews@google.com
 
diff --git a/hostsidetests/backup/RestoreSessionTest/Android.bp b/hostsidetests/backup/RestoreSessionTest/Android.bp
new file mode 100644
index 0000000..29f6e59
--- /dev/null
+++ b/hostsidetests/backup/RestoreSessionTest/Android.bp
@@ -0,0 +1,27 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// 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.
+
+java_library {
+    name: "CtsRestoreSessionApp",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "platform-test-annotations",
+        "truth-prebuilt",
+    ],
+    srcs: [
+        "src/**/*.java",
+    ],
+    sdk_version: "system_current",
+}
diff --git a/hostsidetests/backup/RestoreSessionTest/AndroidManifest.xml b/hostsidetests/backup/RestoreSessionTest/AndroidManifest.xml
new file mode 100644
index 0000000..130e3aa
--- /dev/null
+++ b/hostsidetests/backup/RestoreSessionTest/AndroidManifest.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2018 Google Inc.
+ *
+ * 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 Licensea
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="android.cts.backup.restoresessionapp">
+
+    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="26"/>
+
+    <application
+        android:label="RestoreSessionApp"
+        android:allowBackup="true">
+
+        <uses-library android:name="android.test.runner" />
+
+    </application>
+
+    <instrumentation
+        android:name="androidx.test.runner.AndroidJUnitRunner"
+        android:targetPackage="android.cts.backup.restoresessionapp" />
+</manifest>
diff --git a/hostsidetests/backup/RestoreSessionTest/src/android/cts/backup/restoresessionapp/BaseRestoreSessionAppTest.java b/hostsidetests/backup/RestoreSessionTest/src/android/cts/backup/restoresessionapp/BaseRestoreSessionAppTest.java
new file mode 100644
index 0000000..85b05d3
--- /dev/null
+++ b/hostsidetests/backup/RestoreSessionTest/src/android/cts/backup/restoresessionapp/BaseRestoreSessionAppTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2019 Google Inc.
+ *
+ * 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 android.cts.backup.restoresessionapp;
+
+import static androidx.test.InstrumentationRegistry.getTargetContext;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+public class BaseRestoreSessionAppTest {
+    private static final String SHARED_PREFERENCES_FILE = "restore_session_app_prefs";
+
+    private SharedPreferences mPreferences;
+
+    @Before
+    public void setUp() {
+        mPreferences =
+                getTargetContext()
+                        .getSharedPreferences(SHARED_PREFERENCES_FILE, Context.MODE_PRIVATE);
+    }
+
+    protected void clearSharedPrefs() {
+        mPreferences.edit().clear().commit();
+    }
+
+    protected void checkSharedPrefsDontExist(String prefKey) {
+        assertThat(mPreferences.getInt(prefKey, 0)).isEqualTo(0);
+    }
+
+    protected void saveValuesToSharedPrefs(String prefKey, int prefValue) {
+        mPreferences.edit().putInt(prefKey, prefValue).commit();
+    }
+
+    protected void checkSharedPrefsExist(String prefKey, int prefValue) {
+        assertThat(mPreferences.getInt(prefKey, 0)).isEqualTo(prefValue);
+    }
+}
diff --git a/hostsidetests/backup/RestoreSessionTest/src/android/cts/backup/restoresessionapp/RestoreSessionTest.java b/hostsidetests/backup/RestoreSessionTest/src/android/cts/backup/restoresessionapp/RestoreSessionTest.java
new file mode 100644
index 0000000..06b9ae0
--- /dev/null
+++ b/hostsidetests/backup/RestoreSessionTest/src/android/cts/backup/restoresessionapp/RestoreSessionTest.java
@@ -0,0 +1,237 @@
+/*
+ * Copyright (C) 2019 Google Inc.
+ *
+ * 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 android.cts.backup.restoresessionapp;
+
+import static androidx.test.InstrumentationRegistry.getTargetContext;
+import static androidx.test.InstrumentationRegistry.getInstrumentation;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+import static org.junit.Assert.assertNotEquals;
+
+import android.app.Instrumentation;
+import android.app.UiAutomation;
+import android.app.backup.BackupManager;
+import android.app.backup.BackupManagerMonitor;
+import android.app.backup.RestoreObserver;
+import android.app.backup.RestoreSession;
+import android.app.backup.RestoreSet;
+import android.content.Context;
+import android.os.Bundle;
+
+import android.platform.test.annotations.AppModeFull;
+import androidx.test.runner.AndroidJUnit4;
+
+// import com.android.compatibility.common.util.SystemUtil;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Device side routines to be invoked by the host side RestoreSessionHostSideTest. These are not
+ * designed to be called in any other way, as they rely on state set up by the host side test.
+ */
+@RunWith(AndroidJUnit4.class)
+@AppModeFull
+public class RestoreSessionTest {
+    private static final String PACKAGE_1 = "android.cts.backup.restoresessionapp1";
+    private static final String PACKAGE_2 = "android.cts.backup.restoresessionapp2";
+    private static final String PACKAGE_3 = "android.cts.backup.restoresessionapp3";
+
+    private static final int RESTORE_TIMEOUT_SECONDS = 10;
+
+    private BackupManager mBackupManager;
+    private Set<String> mRestorePackages;
+    private Set<String> mNonRestorePackages;
+    private CountDownLatch mRestoreObserverLatch;
+    private RestoreSession mRestoreSession;
+    private UiAutomation mUiAutomation;
+    private long mRestoreToken;
+
+    private final RestoreObserver mRestoreObserver =
+            new RestoreObserver() {
+                @Override
+                public void restoreSetsAvailable(RestoreSet[] result) {
+                    super.restoreSetsAvailable(result);
+
+                    long token = 0L;
+
+                    for (RestoreSet restoreSet : result) {
+                        long restoreToken = restoreSet.token;
+                        if (doesRestoreSetContainAllPackages(restoreToken, mRestorePackages)
+                                && doesRestoreSetContainAllPackages(
+                                        restoreToken, mNonRestorePackages)) {
+                            token = restoreSet.token;
+                            break;
+                        }
+                    }
+
+                    mRestoreToken = token;
+
+                    mRestoreObserverLatch.countDown();
+                }
+
+                @Override
+                public void restoreStarting(int numPackages) {
+                    super.restoreStarting(numPackages);
+
+                    assertEquals(
+                            "Wrong number of packages in the restore set",
+                            mRestorePackages.size(),
+                            numPackages);
+                    mRestoreObserverLatch.countDown();
+                }
+
+                @Override
+                public void onUpdate(int nowBeingRestored, String currentPackage) {
+                    super.onUpdate(nowBeingRestored, currentPackage);
+
+                    assertTrue(
+                            "Restoring package that is not in mRestorePackages",
+                            mRestorePackages.contains(currentPackage));
+                    mRestoreObserverLatch.countDown();
+                }
+
+                @Override
+                public void restoreFinished(int error) {
+                    super.restoreFinished(error);
+
+                    assertEquals(
+                            "Restore finished with error: " + error, BackupManager.SUCCESS, error);
+                    mRestoreSession.endRestoreSession();
+                    mRestoreObserverLatch.countDown();
+                }
+            };
+
+    @Before
+    public void setUp() throws InterruptedException {
+        Context context = getTargetContext();
+        mBackupManager = new BackupManager(context);
+
+        mRestorePackages = new HashSet<>();
+        mRestorePackages.add(PACKAGE_1);
+        mRestorePackages.add(PACKAGE_2);
+
+        mNonRestorePackages = new HashSet<>();
+        mNonRestorePackages.add(PACKAGE_3);
+
+        mRestoreToken = 0L;
+
+        mUiAutomation = getInstrumentation().getUiAutomation();
+        mUiAutomation.adoptShellPermissionIdentity();
+
+        loadAvailableRestoreSets();
+    }
+
+    @After
+    public void tearDown() {
+        mUiAutomation.dropShellPermissionIdentity();
+    }
+
+    /**
+     * Restore packages added to mRestorePackages and verify only those packages are restored. Use
+     * {@link RestoreSession#restorePackages(long, RestoreObserver, Set)}
+     */
+    @Test
+    public void testRestorePackages() throws InterruptedException {
+        testRestorePackagesInternal(false);
+    }
+
+    /**
+     * Restore packages added to mRestorePackages and verify only those packages are restored. Use
+     * {@link RestoreSession#restorePackages(long, RestoreObserver, Set, BackupManagerMonitor)}
+     */
+    @Test
+    public void testRestorePackagesWithMonitorParam() throws InterruptedException {
+        testRestorePackagesInternal(true);
+    }
+
+    private void testRestorePackagesInternal(boolean useMonitorParam) throws InterruptedException {
+        // Wait for the callbacks from RestoreObserver: one for each package from
+        // mRestorePackages plus restoreStarting and restoreFinished.
+        mRestoreObserverLatch = new CountDownLatch(mRestorePackages.size() + 2);
+        CountDownLatch backupMonitorLatch = null;
+        if (useMonitorParam) {
+            // Wait for the callbacks from BackupManagerMonitor: one for each package.
+            backupMonitorLatch = new CountDownLatch(mRestorePackages.size());
+            mRestoreSession.restorePackages(
+                    mRestoreToken,
+                    mRestoreObserver,
+                    mRestorePackages,
+                    new TestBackupMonitor(backupMonitorLatch));
+        } else {
+            mRestoreSession.restorePackages(mRestoreToken, mRestoreObserver, mRestorePackages);
+        }
+
+        awaitResultAndAssertSuccess(mRestoreObserverLatch);
+        if (backupMonitorLatch != null) {
+            awaitResultAndAssertSuccess(backupMonitorLatch);
+        }
+    }
+
+    private void loadAvailableRestoreSets() throws InterruptedException {
+        // Wait for getAvailableRestoreSets to finish and the callback to be fired.
+        mRestoreObserverLatch = new CountDownLatch(1);
+        mRestoreSession = mBackupManager.beginRestoreSession();
+        assertEquals(
+                BackupManager.SUCCESS, mRestoreSession.getAvailableRestoreSets(mRestoreObserver));
+        awaitResultAndAssertSuccess(mRestoreObserverLatch);
+
+        assertNotEquals("Restore set not found", 0L, mRestoreToken);
+    }
+
+    private boolean doesRestoreSetContainAllPackages(long restoreToken, Set<String> packages) {
+        for (String restorePackage : packages) {
+            if (mBackupManager.getAvailableRestoreToken(restorePackage) != restoreToken) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    private void awaitResultAndAssertSuccess(CountDownLatch latch) throws InterruptedException {
+        boolean waitResult = latch.await(RESTORE_TIMEOUT_SECONDS, TimeUnit.SECONDS);
+        assertTrue("Restore timed out", waitResult);
+    }
+
+    private static class TestBackupMonitor extends BackupManagerMonitor {
+        private final CountDownLatch mLatch;
+
+        TestBackupMonitor(CountDownLatch latch) {
+            mLatch = latch;
+        }
+
+        @Override
+        public void onEvent(Bundle event) {
+            super.onEvent(event);
+
+            int eventType = event.getInt(BackupManagerMonitor.EXTRA_LOG_EVENT_ID);
+            assertEquals(
+                    "Unexpected event from BackupManagerMonitor: " + eventType,
+                    BackupManagerMonitor.LOG_EVENT_ID_VERSIONS_MATCH,
+                    eventType);
+            mLatch.countDown();
+        }
+    }
+}
diff --git a/hostsidetests/backup/restoresessionapp1/Android.bp b/hostsidetests/backup/restoresessionapp1/Android.bp
new file mode 100644
index 0000000..2eb5d0e
--- /dev/null
+++ b/hostsidetests/backup/restoresessionapp1/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// 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.
+
+android_test_helper_app {
+    name: "CtsRestoreSessionApp1",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "truth-prebuilt",
+        "CtsRestoreSessionApp",
+    ],
+    srcs: [
+        "src/**/*.java"
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+    ],
+    sdk_version: "system_current",
+}
diff --git a/hostsidetests/backup/restoresessionapp1/AndroidManifest.xml b/hostsidetests/backup/restoresessionapp1/AndroidManifest.xml
new file mode 100644
index 0000000..ae6b205
--- /dev/null
+++ b/hostsidetests/backup/restoresessionapp1/AndroidManifest.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2018 Google Inc.
+ *
+ * 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 Licensea
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="android.cts.backup.restoresessionapp1">
+
+    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="26"/>
+
+    <application
+        android:label="RestoreSessionApp"
+        android:allowBackup="true">
+
+        <uses-library android:name="android.test.runner" />
+
+    </application>
+
+    <instrumentation
+        android:name="androidx.test.runner.AndroidJUnitRunner"
+        android:targetPackage="android.cts.backup.restoresessionapp1" />
+</manifest>
diff --git a/hostsidetests/backup/restoresessionapp1/src/android/cts/backup/restoresessionapp1/RestoreSessionAppTest.java b/hostsidetests/backup/restoresessionapp1/src/android/cts/backup/restoresessionapp1/RestoreSessionAppTest.java
new file mode 100644
index 0000000..f82d058
--- /dev/null
+++ b/hostsidetests/backup/restoresessionapp1/src/android/cts/backup/restoresessionapp1/RestoreSessionAppTest.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2019 Google Inc.
+ *
+ * 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 android.cts.backup.restoresessionapp1;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import android.cts.backup.restoresessionapp.BaseRestoreSessionAppTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Device side routines to be invoked by the host side RestoreSessionHostSideTest. These are not
+ * designed to be called in any other way, as they rely on state set up by the host side test.
+ */
+@RunWith(AndroidJUnit4.class)
+public class RestoreSessionAppTest extends BaseRestoreSessionAppTest {
+    private static final String SHARED_PREFERENCES_KEY = "test_key_1";
+    private static final int SHARED_PREFERENCES_VALUE = 123;
+
+    @Test
+    public void testClearSharedPrefs() {
+        clearSharedPrefs();
+    }
+
+    @Test
+    public void testCheckSharedPrefsDontExist() {
+        checkSharedPrefsDontExist(SHARED_PREFERENCES_KEY);
+    }
+
+    @Test
+    public void testSaveValuesToSharedPrefs() {
+        saveValuesToSharedPrefs(SHARED_PREFERENCES_KEY, SHARED_PREFERENCES_VALUE);
+    }
+
+    @Test
+    public void testCheckSharedPrefsExist() {
+        checkSharedPrefsExist(SHARED_PREFERENCES_KEY, SHARED_PREFERENCES_VALUE);
+    }
+}
diff --git a/hostsidetests/backup/restoresessionapp2/Android.bp b/hostsidetests/backup/restoresessionapp2/Android.bp
new file mode 100644
index 0000000..e389054
--- /dev/null
+++ b/hostsidetests/backup/restoresessionapp2/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// 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.
+
+android_test_helper_app {
+    name: "CtsRestoreSessionApp2",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "truth-prebuilt",
+        "CtsRestoreSessionApp",
+    ],
+    srcs: [
+        "src/**/*.java"
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+    ],
+    sdk_version: "system_current",
+}
diff --git a/hostsidetests/backup/restoresessionapp2/AndroidManifest.xml b/hostsidetests/backup/restoresessionapp2/AndroidManifest.xml
new file mode 100644
index 0000000..757c801
--- /dev/null
+++ b/hostsidetests/backup/restoresessionapp2/AndroidManifest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2018 Google Inc.
+ *
+ * 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 Licensea
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="android.cts.backup.restoresessionapp2">
+
+    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="26"/>
+
+    <application
+        android:label="RestoreSessionApp"
+        android:allowBackup="true"/>
+
+    <instrumentation
+        android:name="androidx.test.runner.AndroidJUnitRunner"
+        android:targetPackage="android.cts.backup.restoresessionapp2" />
+</manifest>
diff --git a/hostsidetests/backup/restoresessionapp2/src/android/cts/backup/restoresessionapp2/RestoreSessionAppTest.java b/hostsidetests/backup/restoresessionapp2/src/android/cts/backup/restoresessionapp2/RestoreSessionAppTest.java
new file mode 100644
index 0000000..458103b
--- /dev/null
+++ b/hostsidetests/backup/restoresessionapp2/src/android/cts/backup/restoresessionapp2/RestoreSessionAppTest.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2019 Google Inc.
+ *
+ * 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 android.cts.backup.restoresessionapp2;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import android.cts.backup.restoresessionapp.BaseRestoreSessionAppTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Device side routines to be invoked by the host side RestoreSessionHostSideTest. These are not
+ * designed to be called in any other way, as they rely on state set up by the host side test.
+ */
+@RunWith(AndroidJUnit4.class)
+public class RestoreSessionAppTest extends BaseRestoreSessionAppTest {
+    private static final String SHARED_PREFERENCES_KEY = "test_key_2";
+    private static final int SHARED_PREFERENCES_VALUE = 124;
+
+    @Test
+    public void testClearSharedPrefs() {
+        clearSharedPrefs();
+    }
+
+    @Test
+    public void testCheckSharedPrefsDontExist() {
+        checkSharedPrefsDontExist(SHARED_PREFERENCES_KEY);
+    }
+
+    @Test
+    public void testSaveValuesToSharedPrefs() {
+        saveValuesToSharedPrefs(SHARED_PREFERENCES_KEY, SHARED_PREFERENCES_VALUE);
+    }
+
+    @Test
+    public void testCheckSharedPrefsExist() {
+        checkSharedPrefsExist(SHARED_PREFERENCES_KEY, SHARED_PREFERENCES_VALUE);
+    }
+}
diff --git a/hostsidetests/backup/restoresessionapp3/Android.bp b/hostsidetests/backup/restoresessionapp3/Android.bp
new file mode 100644
index 0000000..1451823
--- /dev/null
+++ b/hostsidetests/backup/restoresessionapp3/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// 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.
+
+android_test_helper_app {
+    name: "CtsRestoreSessionApp3",
+    defaults: ["cts_defaults"],
+    static_libs: [
+        "androidx.test.rules",
+        "truth-prebuilt",
+        "CtsRestoreSessionApp",
+    ],
+    srcs: [
+        "src/**/*.java"
+    ],
+    // tag this module as a cts test artifact
+    test_suites: [
+        "cts",
+        "vts",
+    ],
+    sdk_version: "system_current",
+}
diff --git a/hostsidetests/backup/restoresessionapp3/AndroidManifest.xml b/hostsidetests/backup/restoresessionapp3/AndroidManifest.xml
new file mode 100644
index 0000000..027cf68
--- /dev/null
+++ b/hostsidetests/backup/restoresessionapp3/AndroidManifest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2018 Google Inc.
+ *
+ * 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 Licensea
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="android.cts.backup.restoresessionapp3">
+
+    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="26"/>
+
+    <application
+        android:label="RestoreSessionApp"
+        android:allowBackup="true"/>
+
+    <instrumentation
+        android:name="androidx.test.runner.AndroidJUnitRunner"
+        android:targetPackage="android.cts.backup.restoresessionapp3" />
+</manifest>
diff --git a/hostsidetests/backup/restoresessionapp3/src/android/cts/backup/restoresessionapp3/RestoreSessionAppTest.java b/hostsidetests/backup/restoresessionapp3/src/android/cts/backup/restoresessionapp3/RestoreSessionAppTest.java
new file mode 100644
index 0000000..b034e1a
--- /dev/null
+++ b/hostsidetests/backup/restoresessionapp3/src/android/cts/backup/restoresessionapp3/RestoreSessionAppTest.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2019 Google Inc.
+ *
+ * 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 android.cts.backup.restoresessionapp3;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import android.cts.backup.restoresessionapp.BaseRestoreSessionAppTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Device side routines to be invoked by the host side RestoreSessionHostSideTest. These are not
+ * designed to be called in any other way, as they rely on state set up by the host side test.
+ */
+@RunWith(AndroidJUnit4.class)
+public class RestoreSessionAppTest extends BaseRestoreSessionAppTest {
+    private static final String SHARED_PREFERENCES_KEY = "test_key_3";
+    private static final int SHARED_PREFERENCES_VALUE = 125;
+
+    @Test
+    public void testClearSharedPrefs() {
+        clearSharedPrefs();
+    }
+
+    @Test
+    public void testCheckSharedPrefsDontExist() {
+        checkSharedPrefsDontExist(SHARED_PREFERENCES_KEY);
+    }
+
+    @Test
+    public void testSaveValuesToSharedPrefs() {
+        saveValuesToSharedPrefs(SHARED_PREFERENCES_KEY, SHARED_PREFERENCES_VALUE);
+    }
+
+    @Test
+    public void testCheckSharedPrefsExist() {
+        checkSharedPrefsExist(SHARED_PREFERENCES_KEY, SHARED_PREFERENCES_VALUE);
+    }
+}
diff --git a/hostsidetests/backup/src/android/cts/backup/RestoreSessionHostSideTest.java b/hostsidetests/backup/src/android/cts/backup/RestoreSessionHostSideTest.java
new file mode 100644
index 0000000..9c5d890
--- /dev/null
+++ b/hostsidetests/backup/src/android/cts/backup/RestoreSessionHostSideTest.java
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * 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 android.cts.backup;
+
+import static org.junit.Assert.assertTrue;
+
+import android.platform.test.annotations.AppModeFull;
+
+import com.android.compatibility.common.util.BackupUtils;
+import com.android.tradefed.device.DeviceNotAvailableException;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+
+import java.io.IOException;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.Optional;
+
+/**
+ * Tests for system APIs in {@link RestoreSession}
+ *
+ * <p>These tests use the local transport.
+ */
+@RunWith(DeviceJUnit4ClassRunner.class)
+@AppModeFull
+public class RestoreSessionHostSideTest extends BaseBackupHostSideTest {
+    private static final int USER_SYSTEM = 0;
+    private static final String MAIN_TEST_APP_PKG = "android.cts.backup.restoresessionapp";
+    private static final String DEVICE_MAIN_TEST_CLASS_NAME =
+            MAIN_TEST_APP_PKG + ".RestoreSessionTest";
+    private static final String MAIN_TEST_APK = "CtsRestoreSessionApp.apk";
+
+    private static final String TEST_APP_PKG_PREFIX = "android.cts.backup.restoresessionapp";
+    private static final String TEST_APP_APK_PREFIX = "CtsRestoreSessionApp";
+    private static final int TEST_APPS_COUNT = 3;
+
+    private Optional<String> mOldTransport = Optional.empty();
+    private BackupUtils mBackupUtils;
+
+    /** Switch to local transport. */
+    @Before
+    public void setUp() throws Exception {
+        mBackupUtils = getBackupUtils();
+        mOldTransport = Optional.of(setBackupTransport(mBackupUtils.getLocalTransportName()));
+        installPackage(MAIN_TEST_APK);
+    }
+
+    /** Restore transport settings to original values. */
+    @After
+    public void tearDown() throws Exception {
+        if (mOldTransport.isPresent()) {
+            setBackupTransport(mOldTransport.get());
+            mOldTransport = Optional.empty();
+
+            uninstallPackage(MAIN_TEST_APK);
+        }
+    }
+
+    /** Test {@link RestoreSession#restorePackages(long, RestoreObserver, Set)} */
+    @Test
+    public void testRestorePackages() throws Exception {
+        testRestorePackagesInternal("testRestorePackages");
+    }
+
+    /**
+     * Test {@link RestoreSession#restorePackages(long, RestoreObserver, Set, BackupManagerMonitor)}
+     */
+    @Test
+    public void testRestorePackagesWithMonitorParam() throws Exception {
+        testRestorePackagesInternal("testRestorePackagesWithMonitorParam");
+    }
+
+    /**
+     *
+     *
+     * <ol>
+     *   <li>Install 3 test packages on the device
+     *   <li>Write dummy values to shared preferences for each package
+     *   <li>Backup each package (adb shell bmgr backupnow)
+     *   <li>Clear shared preferences for each package
+     *   <li>Run restore for 2 of the packages and verify that only they were restored
+     *   <li>Verify that shared preferences for the 2 packages are restored correctly
+     * </ol>
+     */
+    private void testRestorePackagesInternal(String deviceTestName) throws Exception {
+        installPackage(getApkNameForTestApp(1));
+        installPackage(getApkNameForTestApp(2));
+        installPackage(getApkNameForTestApp(3));
+        //
+        // Write dummy value to shared preferences for all test packages.
+        checkRestoreSessionDeviceTestForAllApps("testSaveValuesToSharedPrefs");
+        checkRestoreSessionDeviceTestForAllApps("testCheckSharedPrefsExist");
+
+        // Backup all test packages.
+        mBackupUtils.backupNowAndAssertSuccess(getPackageNameForTestApp(1));
+        mBackupUtils.backupNowAndAssertSuccess(getPackageNameForTestApp(2));
+        mBackupUtils.backupNowAndAssertSuccess(getPackageNameForTestApp(3));
+
+        // Clear shared preferences for all test packages.
+        checkRestoreSessionDeviceTestForAllApps("testClearSharedPrefs");
+        checkRestoreSessionDeviceTestForAllApps("testCheckSharedPrefsDontExist");
+
+        runRestoreSessionDeviceTestAndAssertSuccess(
+                MAIN_TEST_APP_PKG, DEVICE_MAIN_TEST_CLASS_NAME, deviceTestName);
+
+        // Check that shared prefs are only restored (and restored correctly) for the first 2
+        // packages.
+        checkRestoreSessionDeviceTest(1, "testCheckSharedPrefsExist");
+        checkRestoreSessionDeviceTest(2, "testCheckSharedPrefsExist");
+        checkRestoreSessionDeviceTest(3, "testCheckSharedPrefsDontExist");
+
+        uninstallPackage(getPackageNameForTestApp(1));
+        uninstallPackage(getPackageNameForTestApp(2));
+        uninstallPackage(getPackageNameForTestApp(3));
+    }
+
+    /** Run the given device test for all test apps. */
+    private void checkRestoreSessionDeviceTestForAllApps(String testName)
+            throws DeviceNotAvailableException {
+        for (int appNumber = 1; appNumber <= TEST_APPS_COUNT; appNumber++) {
+            checkRestoreSessionDeviceTest(appNumber, testName);
+        }
+    }
+
+    /** Run device test with the given test name and test app number. */
+    private void checkRestoreSessionDeviceTest(int testAppNumber, String testName)
+            throws DeviceNotAvailableException {
+        String packageName = getPackageNameForTestApp(testAppNumber);
+        runRestoreSessionDeviceTestAndAssertSuccess(
+                packageName, packageName + ".RestoreSessionAppTest", testName);
+    }
+
+    private void runRestoreSessionDeviceTestAndAssertSuccess(
+            String packageName, String fullClassName, String testName)
+            throws DeviceNotAvailableException {
+        boolean result = runDeviceTests(packageName, fullClassName, testName);
+        assertTrue("Device test failed: " + testName, result);
+    }
+
+    private String getPackageNameForTestApp(int appNumber) {
+        return TEST_APP_PKG_PREFIX + appNumber;
+    }
+
+    private String getApkNameForTestApp(int appNumber) {
+        return TEST_APP_APK_PREFIX + appNumber + ".apk";
+    }
+
+    private String setBackupTransport(String transport) throws IOException {
+        return mBackupUtils.setBackupTransportForUser(transport, USER_SYSTEM);
+    }
+}
