diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-05-31 07:14:54 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-05-31 07:14:54 +0000 |
commit | b836d4395c865b7bd6b724ed47ac53396964197f (patch) | |
tree | 255b891c897a7dc584de678981f8cec93c1f4537 | |
parent | dfb406e313a4f4b3d396bf59ae2ed3d8f3788857 (diff) | |
parent | 222dd4e8d7c008a874a43802515f04e8914ef114 (diff) | |
download | robolectric-shadows-r_aml_301500702.tar.gz |
Snap for 6545159 from 222dd4e8d7c008a874a43802515f04e8914ef114 to mainline-releaser_aml_301500702android-mainline-12.0.0_r55android-mainline-11.0.0_r9android-mainline-11.0.0_r8android-mainline-11.0.0_r7android-mainline-11.0.0_r6android-mainline-11.0.0_r5android-mainline-11.0.0_r45android-mainline-11.0.0_r4android-mainline-11.0.0_r33android-mainline-11.0.0_r3android-mainline-11.0.0_r29android-mainline-11.0.0_r2android-mainline-11.0.0_r19android-mainline-11.0.0_r10android-mainline-11.0.0_r1android11-mainline-sparse-2021-jan-releaseandroid11-mainline-sparse-2020-dec-releaseandroid11-mainline-release
Change-Id: I5f452829b55b2e3295bc1aa252ac56a44f58ee5f
-rw-r--r-- | shadows/framework/src/main/java/org/robolectric/shadows/ShadowPersistentDataBlockManager.java | 42 | ||||
-rw-r--r-- | shadows/framework/src/main/java/org/robolectric/shadows/ShadowServiceManager.java | 6 |
2 files changed, 48 insertions, 0 deletions
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 000000000..a48480df1 --- /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 41b3f9cb0..d7dae9b36 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.IUserManager; 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 @@ public class ShadowServiceManager { 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( |