summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThecrazyskull <anaskarbila@gmail.com>2017-02-26 17:03:46 -0500
committerArne Coucheron <arco68@gmail.com>2017-07-15 06:51:07 +0200
commit74e102d5eebd18a8a1e65c21cf91671bc92a9ec7 (patch)
tree50577ecff233e9d9e8933350c2bc7c07d64cd848
parent6d6d171c4a889f56e8b3ed7bd7f60dc151e22137 (diff)
downloadandroid_packages_apps_Trebuchet-74e102d5eebd18a8a1e65c21cf91671bc92a9ec7.tar.gz
android_packages_apps_Trebuchet-74e102d5eebd18a8a1e65c21cf91671bc92a9ec7.tar.bz2
android_packages_apps_Trebuchet-74e102d5eebd18a8a1e65c21cf91671bc92a9ec7.zip
Prevent crash
We can only set SystemUI visibility from the UI thread Change-Id: I1ecf1fcddef037da5ecd2e0f53989da82bdf7ef0
-rw-r--r--src/com/android/launcher3/Launcher.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 44acba0a6..26a739dca 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -507,7 +507,10 @@ public class Launcher extends Activity
newSystemUiFlags &= ~(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
if (newSystemUiFlags != oldSystemUiFlags) {
- getWindow().getDecorView().setSystemUiVisibility(newSystemUiFlags);
+ final int systemUiFlags = newSystemUiFlags;
+ runOnUiThread(() -> {
+ getWindow().getDecorView().setSystemUiVisibility(systemUiFlags);
+ });
}
}