Buggy code:
public class KeyguardBottomAreaView extends FrameLayout implements View . OnClickListener , View . OnLongClickListener , LockscreenShortcutsHelper . OnChangeListener , UnlockMethodCache . OnUnlockMethodChangedListener , AccessibilityController . AccessibilityStateChangedCallback { static final String TAG = "PhoneStatusBar//KeyguardBottomAreaView" ; private static final Intent SECURE_CAMERA_INTENT = new Intent ( MediaStore . INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE ) . addFlags ( FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS ) ; private static final Intent INSECURE_CAMERA_INTENT = new Intent ( MediaStore . INTENT_ACTION_STILL_IMAGE_CAMERA ) ; private static final Intent PHONE_INTENT = new Intent ( Intent . ACTION_DIAL ) ; private KeyguardAffordanceView mCameraImageView ; private KeyguardAffordanceView mPhoneImageView ; private KeyguardAffordanceView mLockIcon ; private TextView mIndicationText ; private EmergencyButton mEmergencyButton ; private ViewGroup mPreviewContainer ; private View mPhonePreview ; private View mCameraPreview ; private ActivityStarter mActivityStarter ; private UnlockMethodCache mUnlockMethodCache ; private LockPatternUtils mLockPatternUtils ; private PreviewInflater mPreviewInflater ; private KeyguardIndicationController mIndicationController ; private AccessibilityController mAccessibilityController ; private PhoneStatusBar mPhoneStatusBar ; private LockscreenShortcutsHelper mShortcutHelper ; private final TrustDrawable mTrustDrawable ; private int mLastUnlockIconRes = 0 ; public KeyguardBottomAreaView ( Context context ) { } public KeyguardBottomAreaView ( Context context , AttributeSet attrs ) { } public KeyguardBottomAreaView ( Context context , AttributeSet attrs , int defStyleAttr ) { } public KeyguardBottomAreaView ( Context context , AttributeSet attrs , int defStyleAttr , int defStyleRes ) { } private AccessibilityDelegate mAccessibilityDelegate = new AccessibilityDelegate ( ) { @ Override public void onInitializeAccessibilityNodeInfo ( View host , AccessibilityNodeInfo info ) { } @ Override public boolean performAccessibilityAction ( View host , int action , Bundle args ) { } } ; @ Override protected void onFinishInflate ( ) { } private void updateCustomShortcuts ( ) { } private Drawable getScaledDrawable ( Drawable drawable ) { } private void initAccessibility ( ) { } @ Override protected void onConfigurationChanged ( Configuration newConfig ) { } public void setActivityStarter ( ActivityStarter activityStarter ) { } public void setAccessibilityController ( AccessibilityController accessibilityController ) { } public void setPhoneStatusBar ( PhoneStatusBar phoneStatusBar ) { } private Intent getCameraIntent ( ) { } private void updateCameraVisibility ( ) { } private boolean updateVisibilityCheck ( boolean visible , LockscreenShortcutsHelper . Shortcuts shortcut ) { boolean customTarget = mShortcutHelper . isTargetCustom ( shortcut ) ; if ( customTarget ) { boolean isEmpty = mShortcutHelper . isTargetEmpty ( shortcut ) ; <START_BUG> if ( visible && isEmpty ) { <END_BUG> visible = false ; } else { visible = true ; } } return visible ; } private void updatePhoneVisibility ( ) { } private boolean isPhoneVisible ( ) { } private boolean isCameraDisabledByDpm ( ) { } private void watchForCameraPolicyChanges ( ) { } @ Override public void onStateChanged ( boolean accessibilityEnabled , boolean touchExplorationEnabled ) { } private void updateLockIconClickability ( ) { } @ Override public void onClick ( View v ) { } @ Override public boolean onLongClick ( View v ) { } private void handleTrustCircleClick ( ) { } public void launchCamera ( ) { } public void launchPhone ( ) { } @ Override protected void onVisibilityChanged ( View changedView , int visibility ) { } @ Override protected void onDetachedFromWindow ( ) { } private void updateLockIcon ( ) { } private String getIndexHint ( LockscreenShortcutsHelper . Shortcuts shortcut ) { } public String getLeftHint ( ) { } public String getRightHint ( ) { } public KeyguardAffordanceView getPhoneView ( ) { } public KeyguardAffordanceView getCameraView ( ) { } public View getPhonePreview ( ) { } public View getCameraPreview ( ) { } public KeyguardAffordanceView getLockIcon ( ) { } public View getIndicationView ( ) { } @ Override public boolean hasOverlappingRendering ( ) { } @ Override public void onMethodSecureChanged ( boolean methodSecure ) { } private void inflatePreviews ( ) { } private void updateEmergencyButton ( ) { } public void updateTextColor ( int color ) { } public void updateIconColor ( int color ) { } private final BroadcastReceiver mDevicePolicyReceiver = new BroadcastReceiver ( ) { public void onReceive ( Context context , Intent intent ) { } } ; private final KeyguardUpdateMonitorCallback mUpdateMonitorCallback = new KeyguardUpdateMonitorCallback ( ) { @ Override public void onUserSwitchComplete ( int userId ) { } @ Override public void onScreenTurnedOn ( ) { } @ Override public void onScreenTurnedOff ( int why ) { } } ; public void setKeyguardIndicationController ( KeyguardIndicationController keyguardIndicationController ) { } public boolean isTargetCustom ( LockscreenShortcutsHelper . Shortcuts shortcut ) { } @ Override public void onChange ( ) { } private static class IntrinsicSizeDrawable extends InsetDrawable { private final int mIntrinsicWidth ; private final int mIntrinsicHeight ; public IntrinsicSizeDrawable ( Drawable drawable , int intrinsicWidth , int intrinsicHeight ) { } @ Override public int getIntrinsicWidth ( ) { } @ Override public int getIntrinsicHeight ( ) { } } }

Fix:
if ( isEmpty ) {