aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2016-02-23 04:25:07 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-02-23 04:25:07 +0000
commit9f1498ca138c69cefb241fe41510452924173b32 (patch)
tree415e84429d8a712a91d9b53ea73b56b47d5bb749 /java/src
parent436b68dd7383214d90153df5a71d630242a64478 (diff)
parent60b59042d1f5a1449de049a7f7adb3d6e40b8b06 (diff)
downloadlatinime-9f1498ca138c69cefb241fe41510452924173b32.tar.gz
latinime-9f1498ca138c69cefb241fe41510452924173b32.tar.xz
latinime-9f1498ca138c69cefb241fe41510452924173b32.zip
Fix runtime crash on KitKat and prior.
am: 60b59042d1 * commit '60b59042d1f5a1449de049a7f7adb3d6e40b8b06': Fix runtime crash on KitKat and prior.
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index c2d9f965f..f938b6078 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -33,6 +33,7 @@ import android.content.res.Resources;
import android.graphics.Color;
import android.inputmethodservice.InputMethodService;
import android.media.AudioManager;
+import android.os.Build;
import android.os.Debug;
import android.os.IBinder;
import android.os.Message;
@@ -54,6 +55,7 @@ import android.view.inputmethod.InputMethodSubtype;
import com.android.inputmethod.accessibility.AccessibilityUtils;
import com.android.inputmethod.annotations.UsedForTesting;
+import com.android.inputmethod.compat.BuildCompatUtils;
import com.android.inputmethod.compat.EditorInfoCompatUtils;
import com.android.inputmethod.compat.InputMethodServiceCompatUtils;
import com.android.inputmethod.compat.InputMethodSubtypeCompatUtils;
@@ -1908,7 +1910,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
private void setNavigationBarVisibility(final boolean visible) {
- // Color.BLACK is ignored and default IME navigation bar color is used.
- getWindow().getWindow().setNavigationBarColor(visible ? Color.BLACK : Color.TRANSPARENT);
+ if (BuildCompatUtils.EFFECTIVE_SDK_INT > Build.VERSION_CODES.M) {
+ // For N and later, IMEs can specify Color.TRANSPARENT to make the navigation bar
+ // transparent. For other colors the system uses the default color.
+ getWindow().getWindow().setNavigationBarColor(
+ visible ? Color.BLACK : Color.TRANSPARENT);
+ }
}
}