Buggy code:
private static void dumpBarTransitions ( PrintWriter pw , String var , BarTransitions transitions ) { } @ Override public void createAndAddWindows ( ) { } private void addStatusBarWindow ( ) { } static final float saturate ( float a ) { } @ Override public void updateExpandedViewPos ( int thingy ) { } void updateDisplaySize ( ) { } public void startActivityDismissingKeyguard ( final Intent intent , boolean onlyProvisioned , final boolean dismissShade ) { } private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver ( ) { public void onReceive ( Context context , Intent intent ) { } } ; private void resetUserExpandedStates ( ) { } @ Override protected void dismissKeyguardThenExecute ( final OnDismissAction action , boolean afterKeyguardGone ) { } @ Override protected void onConfigurationChanged ( Configuration newConfig ) { } @ Override public void userSwitched ( int newUserId ) { } private void setControllerUsers ( ) { } private void resetUserSetupObserver ( ) { } private void setHeadsUpVisibility ( boolean vis ) { } public void onHeadsUpDismissed ( ) { } void updateResources ( ) { } private void updateClockSize ( ) { } protected void loadDimens ( ) { } @ Override protected void visibilityChanged ( boolean visible ) { } private void stopNotificationLogging ( ) { } private void startNotificationLoggingIfScreenOnAndVisible ( ) { } private void logNotificationVisibilityChanges ( Collection < String > newlyVisible , Collection < String > noLongerVisible ) { } void postStartTracing ( ) { } void vibrate ( ) { } Runnable mStartTracing = new Runnable ( ) { public void run ( ) { } } ; Runnable mStopTracing = new Runnable ( ) { public void run ( ) { } } ; @ Override protected void haltTicker ( ) { } @ Override protected boolean shouldDisableNavbarGestures ( ) { } public void postStartSettingsActivity ( final Intent intent , int delay ) { } private void handleStartSettingsActivity ( Intent intent , boolean onlyProvisioned ) { } private static class FastColorDrawable extends Drawable { private final int mColor ; public FastColorDrawable ( int color ) { } @ Override public void draw ( Canvas canvas ) { } @ Override public void setAlpha ( int alpha ) { } @ Override public void setColorFilter ( ColorFilter cf ) { } @ Override public int getOpacity ( ) { } @ Override public void setBounds ( int left , int top , int right , int bottom ) { } @ Override public void setBounds ( Rect bounds ) { } } @ Override public void destroy ( ) { } private boolean mDemoModeAllowed ; private boolean mDemoMode ; private DemoStatusIcons mDemoStatusIcons ; @ Override public void dispatchDemoCommand ( String command , Bundle args ) { } private void dispatchDemoCommandToView ( String command , Bundle args , int id ) { } public int getBarState ( ) { } public void showKeyguard ( ) { } public boolean isCollapsing ( ) { } public void addPostCollapseAction ( Runnable r ) { } public boolean isInLaunchTransition ( ) { } public void fadeKeyguardAfterLaunchTransition ( final Runnable beforeFading , final Runnable endRunnable ) { } public boolean hideKeyguard ( ) { } public long calculateGoingToFullShadeDelay ( ) { } public void setKeyguardFadingAway ( long delay , long fadeoutDuration ) { } public boolean isKeyguardFadingAway ( ) { } public void finishKeyguardFadingAway ( ) { } private void updatePublicMode ( ) { } private void updateKeyguardState ( boolean goingToFullShade , boolean fromShadeLocked ) { } private void updateDozingState ( ) { } public void updateStackScrollerState ( boolean goingToFullShade ) { } public void userActivity ( ) { } public boolean interceptMediaKey ( KeyEvent event ) { } public boolean onMenuPressed ( ) { } public boolean onBackPressed ( ) { } public boolean onSpacePressed ( ) { } private void showBouncer ( ) { } private void instantExpandNotificationsPanel ( ) { } private void instantCollapseNotificationPanel ( ) { <START_BUG> mNotificationPanel . setExpandedFraction ( 0 ) ; <END_BUG> } @ Override public void onActivated ( ActivatableNotificationView view ) { } public void setBarState ( int state ) { } @ Override public void onActivationReset ( ActivatableNotificationView view ) { } public void onTrackingStarted ( ) { } public void onUnlockHintStarted ( ) { } public void onHintFinished ( ) { } public void onCameraHintStarted ( ) { } public void onPhoneHintStarted ( ) { } public void onTrackingStopped ( boolean expand ) { } @ Override protected int getMaxKeyguardNotifications ( ) { } public NavigationBarView getNavigationBarView ( ) { } @ Override public boolean onDraggedDown ( View startingChild ) { } @ Override public void onDragDownReset ( ) { } @ Override public void onThresholdReached ( ) { } @ Override public void onTouchSlopExceeded ( ) { } @ Override public void setEmptyDragAmount ( float amount ) { } public void goToLockedShade ( View expandView ) { } public void goToKeyguard ( ) { } public ViewGroup getQuickSettingsOverlayParent ( ) { } public long getKeyguardFadingAwayDelay ( ) { } public long getKeyguardFadingAwayDuration ( ) { } public LinearLayout getSystemIcons ( ) { } public LinearLayout getSystemIconArea ( ) { } @ Override public void setBouncerShowing ( boolean bouncerShowing ) { } public void onScreenTurnedOff ( ) { } public void onScreenTurnedOn ( ) { } private void handleLongPressBackRecents ( View v ) { } @ Override protected void showRecents ( boolean triggeredFromAltTab ) { } @ Override protected void hideRecents ( boolean triggeredFromAltTab , boolean triggeredFromHomeKey ) { } @ Override protected void toggleRecents ( ) { } @ Override public void onVisibilityChanged ( boolean visible ) { } public boolean hasActiveNotifications ( ) { } public void wakeUpIfDozing ( long time , boolean fromTouch ) { } private final class ShadeUpdates { private final ArraySet < String > mVisibleNotifications = new ArraySet < String > ( ) ; private final ArraySet < String > mNewVisibleNotifications = new ArraySet < String > ( ) ; public void check ( ) { }

Fix:
mNotificationPanel . instantCollapse ( ) ;