From 74e102d5eebd18a8a1e65c21cf91671bc92a9ec7 Mon Sep 17 00:00:00 2001 From: Thecrazyskull Date: Sun, 26 Feb 2017 17:03:46 -0500 Subject: Prevent crash We can only set SystemUI visibility from the UI thread Change-Id: I1ecf1fcddef037da5ecd2e0f53989da82bdf7ef0 --- src/com/android/launcher3/Launcher.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); + }); } } -- cgit v1.2.3