diff options
author | Jeff Sharkey <jsharkey@android.com> | 2020-04-22 12:06:56 -0600 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2020-04-22 12:16:56 -0600 |
commit | 05ca36346eac5a5cc25ae909e1c6a3a51a58965a (patch) | |
tree | 4677204cc83ac5684b84243361afc7443c0c413e | |
parent | 36213bd738a9f63dd79f8ae5f65eef69ccc72b29 (diff) | |
download | platform_external_robolectric-shadows-05ca36346eac5a5cc25ae909e1c6a3a51a58965a.tar.gz platform_external_robolectric-shadows-05ca36346eac5a5cc25ae909e1c6a3a51a58965a.tar.bz2 platform_external_robolectric-shadows-05ca36346eac5a5cc25ae909e1c6a3a51a58965a.zip |
Update Robolectric to reflect hidden API changes.
As part of an optimization in Android R, there are two new String
variants to support both UTF-8 and UTF-16 strings.
This change adds those hidden API overloads to keep tests happy.
Bug: 154727109
Test: make RunSettingsRoboTests
Change-Id: I657fd9a814a35ae89b10aa1b8f572c45d841bed9
-rw-r--r-- | shadows/framework/src/main/java/org/robolectric/shadows/ShadowParcel.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowParcel.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowParcel.java index dcb9719b3..e358fc19b 100644 --- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowParcel.java +++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowParcel.java @@ -7,6 +7,7 @@ import static android.os.Build.VERSION_CODES.LOLLIPOP; import static android.os.Build.VERSION_CODES.M; import static android.os.Build.VERSION_CODES.O_MR1; import static android.os.Build.VERSION_CODES.P; +import static android.os.Build.VERSION_CODES.R; import static org.robolectric.RuntimeEnvironment.castNativePtr; import android.os.BadParcelableException; @@ -311,6 +312,16 @@ public class ShadowParcel { NATIVE_PTR_TO_PARCEL.get(nativePtr).writeString(val); } + @Implementation(minSdk = R) + protected static void nativeWriteString8(long nativePtr, String val) { + nativeWriteString(nativePtr, val); + } + + @Implementation(minSdk = R) + protected static void nativeWriteString16(long nativePtr, String val) { + nativeWriteString(nativePtr, val); + } + @HiddenApi @Implementation(maxSdk = KITKAT_WATCH) protected static void nativeWriteStrongBinder(int nativePtr, IBinder val) { @@ -399,6 +410,16 @@ public class ShadowParcel { return NATIVE_PTR_TO_PARCEL.get(nativePtr).readString(); } + @Implementation(minSdk = R) + protected static String nativeReadString8(long nativePtr) { + return nativeReadString(nativePtr); + } + + @Implementation(minSdk = R) + protected static String nativeReadString16(long nativePtr) { + return nativeReadString(nativePtr); + } + @HiddenApi @Implementation(maxSdk = KITKAT_WATCH) protected static IBinder nativeReadStrongBinder(int nativePtr) { |