From 85b10b0dd0e568699f349ba500ddc8d3e6c1c12d Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 4 Oct 2011 20:59:01 -0700 Subject: [PATCH] Fix 5317948: Don't display facelock when transport controls are showing. Change-Id: I0061fa9ec184846b0ed82c977a2e48b36cb079af --- .../policy/impl/LockPatternKeyguardView.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java index ca5d27467b3d3..899a7610b40c1 100644 --- a/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java +++ b/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.java @@ -231,6 +231,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler } }; + private TransportControlView mTransportControlView; + /** * @return Whether we are stuck on the lock screen because the sim is * missing. @@ -516,7 +518,10 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler // When screen is turned on, need to bind to FaceLock service if we are using FaceLock // But only if not dealing with a call - if (mUpdateMonitor.getPhoneState() == TelephonyManager.CALL_STATE_IDLE) { + final boolean transportInvisible = mTransportControlView == null ? true : + mTransportControlView.getVisibility() != View.VISIBLE; + if (mUpdateMonitor.getPhoneState() == TelephonyManager.CALL_STATE_IDLE + && transportInvisible) { bindToFaceLock(); } else { mHandler.sendEmptyMessage(MSG_HIDE_FACELOCK_AREA_VIEW); @@ -805,14 +810,13 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler } private void initializeTransportControlView(View view) { - com.android.internal.widget.TransportControlView tcv = - (TransportControlView) view.findViewById(R.id.transport); - if (tcv == null) { + mTransportControlView = (TransportControlView) view.findViewById(R.id.transport); + if (mTransportControlView == null) { if (DEBUG) Log.w(TAG, "Couldn't find transport control widget"); } else { mUpdateMonitor.reportClockVisible(true); - tcv.setVisibility(View.GONE); // hide tcv until we get the callback below to show it. - tcv.setCallback(mWidgetCallback); + mTransportControlView.setVisibility(View.GONE); // hide until it requests being shown. + mTransportControlView.setCallback(mWidgetCallback); } }