Fixing emergency dialer flicker on lock screen (issue 5314293)

Change-Id: Ia9bf4acb84923e200b89ee55fc53bc92877001cf
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index 4d828c4..e3a4df9 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -936,9 +936,11 @@
      *
      * If there's currently a call in progress, the button will take them to the call
      * @param button the button to update
+     * @param showIfCapable indicates whether the button should be shown if emergency calls are
+     *                      possible on the device
      */
-    public void updateEmergencyCallButtonState(Button button) {
-        if (isEmergencyCallCapable()) {
+    public void updateEmergencyCallButtonState(Button button, boolean showIfCapable) {
+        if (isEmergencyCallCapable() && showIfCapable) {
             button.setVisibility(View.VISIBLE);
         } else {
             button.setVisibility(View.GONE);