summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThecrazyskull <anaskarbila@gmail.com>2017-02-26 22:03:46 (GMT)
committerArne Coucheron <arco68@gmail.com>2017-07-15 04:51:07 (GMT)
commit74e102d5eebd18a8a1e65c21cf91671bc92a9ec7 (patch)
tree50577ecff233e9d9e8933350c2bc7c07d64cd848
parent6d6d171c4a889f56e8b3ed7bd7f60dc151e22137 (diff)
downloadandroid_packages_apps_Trebuchet-74e102d5eebd18a8a1e65c21cf91671bc92a9ec7.zip
android_packages_apps_Trebuchet-74e102d5eebd18a8a1e65c21cf91671bc92a9ec7.tar.gz
android_packages_apps_Trebuchet-74e102d5eebd18a8a1e65c21cf91671bc92a9ec7.tar.bz2
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 44acba0..26a739d 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);
+ });
}
}