@@ -231,6 +231,8 @@ public void requestHide(View view) {
231231 }
232232 };
233233
234+ private TransportControlView mTransportControlView ;
235+
234236 /**
235237 * @return Whether we are stuck on the lock screen because the sim is
236238 * missing.
@@ -516,7 +518,10 @@ public void onScreenTurnedOn() {
516518
517519 // When screen is turned on, need to bind to FaceLock service if we are using FaceLock
518520 // But only if not dealing with a call
519- if (mUpdateMonitor .getPhoneState () == TelephonyManager .CALL_STATE_IDLE ) {
521+ final boolean transportInvisible = mTransportControlView == null ? true :
522+ mTransportControlView .getVisibility () != View .VISIBLE ;
523+ if (mUpdateMonitor .getPhoneState () == TelephonyManager .CALL_STATE_IDLE
524+ && transportInvisible ) {
520525 bindToFaceLock ();
521526 } else {
522527 mHandler .sendEmptyMessage (MSG_HIDE_FACELOCK_AREA_VIEW );
@@ -805,14 +810,13 @@ View createUnlockScreenFor(UnlockMode unlockMode) {
805810 }
806811
807812 private void initializeTransportControlView (View view ) {
808- com .android .internal .widget .TransportControlView tcv =
809- (TransportControlView ) view .findViewById (R .id .transport );
810- if (tcv == null ) {
813+ mTransportControlView = (TransportControlView ) view .findViewById (R .id .transport );
814+ if (mTransportControlView == null ) {
811815 if (DEBUG ) Log .w (TAG , "Couldn't find transport control widget" );
812816 } else {
813817 mUpdateMonitor .reportClockVisible (true );
814- tcv .setVisibility (View .GONE ); // hide tcv until we get the callback below to show it .
815- tcv .setCallback (mWidgetCallback );
818+ mTransportControlView .setVisibility (View .GONE ); // hide until it requests being shown .
819+ mTransportControlView .setCallback (mWidgetCallback );
816820 }
817821 }
818822
0 commit comments