Skip to content

Commit

Permalink
Adjust to AssetManager#nativeSetConfiguration signature change in SDK…
Browse files Browse the repository at this point in the history
…s > T.

Mark the old shadow methods as maxSdk T to ensure annotation validator passes.

PiperOrigin-RevId: 516988191
  • Loading branch information
brettchabot authored and Copybara-Service committed Mar 16, 2023
1 parent 5830f98 commit 2ff5f86
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static android.os.Build.VERSION_CODES.Q;
import static android.os.Build.VERSION_CODES.R;
import static android.os.Build.VERSION_CODES.S;
import static android.os.Build.VERSION_CODES.TIRAMISU;
import static org.robolectric.res.android.ApkAssetsCookie.K_INVALID_COOKIE;
import static org.robolectric.res.android.ApkAssetsCookie.kInvalidCookie;
import static org.robolectric.res.android.Asset.SEEK_CUR;
Expand Down Expand Up @@ -584,7 +585,7 @@ protected static void nativeSetApkAssets(
// jint smallest_screen_width_dp, jint screen_width_dp,
// jint screen_height_dp, jint screen_layout, jint ui_mode,
// jint color_mode, jint major_version) {
@Implementation(minSdk = P)
@Implementation(minSdk = P, maxSdk = TIRAMISU)
protected static void nativeSetConfiguration(
long ptr,
int mcc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static android.os.Build.VERSION_CODES.P;
import static android.os.Build.VERSION_CODES.Q;
import static android.os.Build.VERSION_CODES.R;
import static android.os.Build.VERSION_CODES.TIRAMISU;
import static org.robolectric.res.android.ApkAssetsCookie.K_INVALID_COOKIE;
import static org.robolectric.res.android.ApkAssetsCookie.kInvalidCookie;
import static org.robolectric.res.android.Asset.SEEK_CUR;
Expand Down Expand Up @@ -578,7 +579,7 @@ protected static void nativeSetApkAssets(
// jint smallest_screen_width_dp, jint screen_width_dp,
// jint screen_height_dp, jint screen_layout, jint ui_mode,
// jint color_mode, jint major_version) {
@Implementation(minSdk = P)
@Implementation(minSdk = P, maxSdk = TIRAMISU)
protected static void nativeSetConfiguration(
long ptr,
int mcc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import static android.os.Build.VERSION_CODES.O;
import static android.os.Build.VERSION_CODES.O_MR1;
import static android.os.Build.VERSION_CODES.P;
import static android.os.Build.VERSION_CODES.TIRAMISU;
import static org.robolectric.RuntimeEnvironment.castNativePtr;
import static org.robolectric.shadow.api.Shadow.invokeConstructor;
import static org.robolectric.util.ReflectionHelpers.ClassParameter.from;
Expand Down Expand Up @@ -697,7 +698,7 @@ public final void setConfiguration(
}

@HiddenApi
@Implementation(minSdk = VERSION_CODES.O)
@Implementation(minSdk = VERSION_CODES.O, maxSdk = TIRAMISU)
public void setConfiguration(
int mcc,
int mnc,
Expand Down

0 comments on commit 2ff5f86

Please sign in to comment.