Snap for 6545159 from 222dd4e8d7c008a874a43802515f04e8914ef114 to mainline-release

Change-Id: I5f452829b55b2e3295bc1aa252ac56a44f58ee5f
diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowPersistentDataBlockManager.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowPersistentDataBlockManager.java
new file mode 100644
index 0000000..a48480d
--- /dev/null
+++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowPersistentDataBlockManager.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2020 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 org.robolectric.shadows;
+
+import android.service.persistentdata.PersistentDataBlockManager;
+
+import org.robolectric.annotation.Implementation;
+import org.robolectric.annotation.Implements;
+import org.robolectric.annotation.Resetter;
+
+@Implements(PersistentDataBlockManager.class)
+public class ShadowPersistentDataBlockManager {
+    private static int sDataBlockSize = 0;
+
+    @Resetter
+    public static void reset() {
+        sDataBlockSize = 0;
+    }
+
+    @Implementation
+    protected int getDataBlockSize() {
+        return sDataBlockSize;
+    }
+
+    public static void setDataBlockSize(int dataBlockSize) {
+        sDataBlockSize = dataBlockSize;
+    }
+}
diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowServiceManager.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowServiceManager.java
index 41b3f9c..d7dae9b 100644
--- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowServiceManager.java
+++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowServiceManager.java
@@ -52,6 +52,8 @@
 import android.os.RemoteException;
 import android.os.ServiceManager;
 import android.os.storage.IStorageManager;
+import android.service.persistentdata.IPersistentDataBlockService;
+
 import com.android.internal.app.IAppOpsService;
 import com.android.internal.app.IBatteryStats;
 import com.android.internal.appwidget.IAppWidgetService;
@@ -166,6 +168,10 @@
       map.put(
           Context.MEDIA_SESSION_SERVICE,
           createDeepBinder(ISessionManager.class, "android.media.session.ISessionManager"));
+      map.put(
+          Context.PERSISTENT_DATA_BLOCK_SERVICE,
+          createBinder(IPersistentDataBlockService.class,
+                  "android.service.persistentdata.IPersistentDataBlockService"));
     }
     if (RuntimeEnvironment.getApiLevel() >= M) {
       map.put(