OSDN Git Service

Always bind slice on background
authorLucas Dupin <dupin@google.com>
Thu, 4 Jan 2018 19:10:16 +0000 (11:10 -0800)
committerLucas Dupin <dupin@google.com>
Thu, 4 Jan 2018 19:11:32 +0000 (11:11 -0800)
Doing on the main thread will increase jank
when unlocking or waking up.

Fixes: 71543966
Test: runtest systemui-jank -c android.platform.systemui.tests.jank.SystemUiJankTests -m testAmbientWakeUp
Change-Id: I3b534425c85609a132d33905de18dbc36fd37f0d

packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java

index b9bf80d..b8adb6a 100644 (file)
@@ -98,9 +98,6 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe
     protected void onAttachedToWindow() {
         super.onAttachedToWindow();
 
-        // Set initial content
-        showSlice(Slice.bindSlice(getContext(), mKeyguardSliceUri));
-
         // Make sure we always have the most current slice
         mLiveData.observeForever(this);
     }
@@ -265,7 +262,6 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe
 
         if (wasObserving) {
             mLiveData.observeForever(this);
-            showSlice(Slice.bindSlice(getContext(), mKeyguardSliceUri));
         }
     }