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 boolean DEBUG = false ; 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 static final int DOZE_ANIMATION_STAGGER_DELAY = 48 ; private static final int DOZE_ANIMATION_ELEMENT_DURATION = 250 ; private static final int VISUALIZER_ANIMATION_DURATION_IN = 300 ; private static final int VISUALIZER_ANIMATION_DURATION_OUT = 0 ; 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 final Interpolator mLinearOutSlowInInterpolator ; private int mLastUnlockIconRes = 0 ; private VisualizerView mVisualizer ; private boolean mScreenOn ; private boolean mLinked ; private boolean mVisualizerEnabled ; private boolean mPowerSaveModeEnabled ; private KeyguardBottomAreaView . SettingsObserver mSettingsObserver ; private boolean mLongClickToForceLock ; private boolean mLongClickToSleep ; private PowerManager mPm ; 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 ) { if ( isProtected ( mShortcutHelper . getIntent ( shortcut ) ) ) { return false ; } } else if ( ( shortcut == ( Shortcuts . LEFT_SHORTCUT ) ) && ( isProtected ( KeyguardBottomAreaView . PHONE_INTENT ) ) ) { return false ; } else if ( ( shortcut == ( Shortcuts . RIGHT_SHORTCUT ) ) && ( isProtected ( getCameraIntent ( ) ) ) ) { return false ; } if ( customTarget ) { boolean isEmpty = mShortcutHelper . isTargetEmpty ( shortcut ) ; <START_BUG> if ( visible && isEmpty ) { <END_BUG> visible = false ; } else { visible = true ; } } return visible ; } private boolean isProtected ( Intent intent ) { } 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 onAttachedToWindow ( ) { } @ 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 ( ) { } public void onMethodSecureChanged ( boolean methodSecure ) { } public void onUnlockMethodStateChanged ( ) { } private void inflatePreviews ( ) { } private void updateEmergencyButton ( ) { } public void updateTextColor ( int color ) { } public void updateIconColor ( int color ) { } public void startFinishDozeAnimation ( ) { } private void startFinishDozeAnimationElement ( View element , long delay ) { } private final BroadcastReceiver mDevicePolicyReceiver = new BroadcastReceiver ( ) { public void onReceive ( Context context , Intent intent ) { } } ; private final BroadcastReceiver mReceiver = new BroadcastReceiver ( ) { @ Override 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 ) { } @ Override public void onKeyguardVisibilityChanged ( boolean showing ) { } } ; 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 ;

Fix:
if ( isEmpty ) {