When telling window manager that Keyguard window is in the correct
state for a fp-touch-to-wake sequence, it takes more than 1 frame at
the moment because the signal that WM is waiting for the next draw
is delayed by one frame because it is posted at the end of the
runnable queue.
To correctly fix this, we should post it at the beginning at the
queue, but this is way too risky this late. Instead, add a isolated
SysUI hack to report it faster.
Bug:
23401557
Change-Id: Icf64101e27611c7c01d108123021b22186f1e70c
return false;
}
+ /**
+ * Force the window to report its next draw.
+ * <p>
+ * This method is only supposed to be used to speed up the interaction from SystemUI and window
+ * manager when waiting for the first frame to be drawn when turning on the screen. DO NOT USE
+ * unless you fully understand this interaction.
+ * @hide
+ */
+ public void setReportNextDraw() {
+ mReportNextDraw = true;
+ invalidate();
+ }
+
void changeCanvasOpacity(boolean opaque) {
Log.d(TAG, "changeCanvasOpacity: opaque=" + opaque);
if (mAttachInfo.mHardwareRenderer != null) {
}
mHiding = false;
+ if (mWakeAndUnlocking && mDrawnCallback != null) {
+
+ // Hack level over 9000: To speed up wake-and-unlock sequence, force it to report
+ // the next draw from here so we don't have to wait for window manager to signal
+ // this to our ViewRootImpl.
+ mStatusBarKeyguardViewManager.getViewRootImpl().setReportNextDraw();
+ notifyDrawn(mDrawnCallback);
+ }
+
// only play "unlock" noises if not on a call (since the incall UI
// disables the keyguard)
if (TelephonyManager.EXTRA_STATE_IDLE.equals(mPhoneState)) {
updateActivityLockScreenState();
adjustStatusBarLocked();
sendUserPresentBroadcast();
- if (mWakeAndUnlocking && mDrawnCallback != null) {
- notifyDrawn(mDrawnCallback);
- }
}
}
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
+import android.view.ViewRootImpl;
import android.view.WindowManagerGlobal;
import com.android.internal.widget.LockPatternUtils;
public void showBouncerMessage(String message, int color) {
mBouncer.showMessage(message, color);
}
+
+ public ViewRootImpl getViewRootImpl() {
+ return mPhoneStatusBar.getStatusBarView().getViewRootImpl();
+ }
}