aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-04-09 15:34:35 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-04-09 15:34:35 +0000
commit287affdc5739c47077aab122c623606ec4f1aca8 (patch)
tree9cfffdffda06f5c12b6b6c63249b01f34935f08f
parent78aaafe5bb44a53407bce1195d117d3826af709a (diff)
parent2873787c6a82e58b3d67a3bc4c82fe1ba5635f9a (diff)
downloadgamesdk-android-games-sdk-game-activity-release.tar.gz
Merge cherrypicks of ['android-review.googlesource.com/3022184', 'android-review.googlesource.com/3034012'] into android-games-sdk-game-activity-release.android-games-sdk-game-activity-release
Change-Id: Ieb5d2e94453e3535ac65ea7a02175cc8e9b24be1
-rw-r--r--VERSIONS4
-rw-r--r--game-activity/prefab-src/modules/game-activity/include/game-activity/GameActivity.h2
-rw-r--r--game-text-input/prefab-src/modules/game-text-input/include/game-text-input/gametextinput.h2
-rw-r--r--game-text-input/src/main/java/com/google/androidgamesdk/gametextinput/InputConnection.java18
4 files changed, 22 insertions, 4 deletions
diff --git a/VERSIONS b/VERSIONS
index aa8c6442..fcb1e726 100644
--- a/VERSIONS
+++ b/VERSIONS
@@ -9,7 +9,7 @@ AGDK NA NA 2022.1.1 alpha01
swappy games-frame-pacing games-frame-pacing 2.2.0 alpha01
tuningfork games-performance-tuner games-performance-tuner 2.0.0 beta01
oboe oboe None 1.0.1 alpha01
-game_activity games-activity game-activity 3.0.2
-game_text_input games-text-input game-text-input 3.0.2
+game_activity games-activity game-activity 3.0.3
+game_text_input games-text-input game-text-input 3.0.3
paddleboat games-controller games-controller 2.1.0 alpha01
memory_advice games-memory-advice games-memory-advice 2.1.0 beta01
diff --git a/game-activity/prefab-src/modules/game-activity/include/game-activity/GameActivity.h b/game-activity/prefab-src/modules/game-activity/include/game-activity/GameActivity.h
index 6e0a98b8..d91126c7 100644
--- a/game-activity/prefab-src/modules/game-activity/include/game-activity/GameActivity.h
+++ b/game-activity/prefab-src/modules/game-activity/include/game-activity/GameActivity.h
@@ -46,7 +46,7 @@ extern "C" {
#define GAMEACTIVITY_MAJOR_VERSION 3
#define GAMEACTIVITY_MINOR_VERSION 0
-#define GAMEACTIVITY_BUGFIX_VERSION 2
+#define GAMEACTIVITY_BUGFIX_VERSION 3
#define GAMEACTIVITY_PACKED_VERSION \
ANDROID_GAMESDK_PACKED_VERSION(GAMEACTIVITY_MAJOR_VERSION, \
GAMEACTIVITY_MINOR_VERSION, \
diff --git a/game-text-input/prefab-src/modules/game-text-input/include/game-text-input/gametextinput.h b/game-text-input/prefab-src/modules/game-text-input/include/game-text-input/gametextinput.h
index 47c95a4b..1a3136b8 100644
--- a/game-text-input/prefab-src/modules/game-text-input/include/game-text-input/gametextinput.h
+++ b/game-text-input/prefab-src/modules/game-text-input/include/game-text-input/gametextinput.h
@@ -35,7 +35,7 @@ extern "C" {
#define GAMETEXTINPUT_MAJOR_VERSION 3
#define GAMETEXTINPUT_MINOR_VERSION 0
-#define GAMETEXTINPUT_BUGFIX_VERSION 2
+#define GAMETEXTINPUT_BUGFIX_VERSION 3
#define GAMETEXTINPUT_PACKED_VERSION \
ANDROID_GAMESDK_PACKED_VERSION(GAMETEXTINPUT_MAJOR_VERSION, \
GAMETEXTINPUT_MINOR_VERSION, \
diff --git a/game-text-input/src/main/java/com/google/androidgamesdk/gametextinput/InputConnection.java b/game-text-input/src/main/java/com/google/androidgamesdk/gametextinput/InputConnection.java
index 70527626..2de0f9d5 100644
--- a/game-text-input/src/main/java/com/google/androidgamesdk/gametextinput/InputConnection.java
+++ b/game-text-input/src/main/java/com/google/androidgamesdk/gametextinput/InputConnection.java
@@ -601,7 +601,16 @@ public class InputConnection
* @return The current IME insets
*/
public Insets getImeInsets() {
+ if (this.targetView == null) {
+ return Insets.NONE;
+ }
+
WindowInsetsCompat insets = ViewCompat.getRootWindowInsets(this.targetView);
+
+ if (insets == null) {
+ return Insets.NONE;
+ }
+
return insets.getInsets(WindowInsetsCompat.Type.ime());
}
@@ -611,7 +620,16 @@ public class InputConnection
* @return whether software IME is visible or not.
*/
public boolean isSoftwareKeyboardVisible() {
+ if (this.targetView == null) {
+ return false;
+ }
+
WindowInsetsCompat insets = ViewCompat.getRootWindowInsets(this.targetView);
+
+ if (insets == null) {
+ return false;
+ }
+
return insets.isVisible(WindowInsetsCompat.Type.ime());
}