From 831c25e7dff2656172662af1ec42983276e84442 Mon Sep 17 00:00:00 2001 From: Jens Ole Lauridsen Date: Thu, 4 May 2023 14:51:19 -0700 Subject: Fix grammaticalGender handling in the Layout Inspector A field named grammaticalGender was in fake-android. The real android has a Java "getGrammaticalGender" function. The byte code for calling that method is different from accessing a field with the same name. This caused Android U apps to crash when using the Layout Inspector. Fix this. Fixes: 280847078 Test: N/A Change-Id: Ibb9fd1fb2230e1a1b1c0cfc633d26813a7683ca9 (cherry picked from commit 1ec5103d4ddeeee4f5311a5c5f237c1eefa828b6) --- .../fake-android/src/android/content/res/Configuration.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dynamic-layout-inspector/agent/appinspection/fake-android/src/android/content/res/Configuration.java b/dynamic-layout-inspector/agent/appinspection/fake-android/src/android/content/res/Configuration.java index 8c4513cf55..31a9f4f28d 100644 --- a/dynamic-layout-inspector/agent/appinspection/fake-android/src/android/content/res/Configuration.java +++ b/dynamic-layout-inspector/agent/appinspection/fake-android/src/android/content/res/Configuration.java @@ -38,7 +38,11 @@ public final class Configuration { public int orientation = 0; public int screenWidthDp = 0; public int screenHeightDp = 0; - public int grammaticalGender = 0; + public int grammaticalGenderField = 0; + + public int getGrammaticalGender() { + return grammaticalGenderField; + } public final LocaleList getLocales() { return mLocales; -- cgit v1.2.3