nus-yam/ex-repair huggingface dataset:
Program: 195138
Project: 195138
Buggy source:
private void killBackgroundUserProcessesWithRecordAudioPermission(UserInfo oldUser){
  PackageManager pm=mContext.getPackageManager();
  ComponentName homeActivityName=null;
  if (!oldUser.isManagedProfile()) {
    homeActivityName=LocalServices.getService(ActivityManagerInternal.class).getHomeActivityForUser(oldUser.id);
  }
  final String[] permissions={Manifest.permission.RECORD_AUDIO};
  List<PackageInfo> packages;
  try {
    packages=AppGlobals.getPackageManager().getPackagesHoldingPermissions(permissions,0,oldUser.id).getList();
  }
 catch (  RemoteException e) {
    throw new AndroidRuntimeException(e);
  }
  for (int j=packages.size() - 1; j >= 0; j--) {
    PackageInfo pkg=packages.get(j);
    if (homeActivityName != null && pkg.packageName.equals(homeActivityName.getPackageName()) && pkg.applicationInfo.isSystemApp()) {
      continue;
    }
    try {
      ActivityManagerNative.getDefault().killUid(pkg.applicationInfo.uid,"String_Node_Str");
    }
 catch (    RemoteException e) {
      Log.w(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private void killBackgroundUserProcessesWithRecordAudioPermission(UserInfo oldUser){
  PackageManager pm=mContext.getPackageManager();
  ComponentName homeActivityName=null;
  if (!oldUser.isManagedProfile()) {
    homeActivityName=LocalServices.getService(ActivityManagerInternal.class).getHomeActivityForUser(oldUser.id);
  }
  final String[] permissions={Manifest.permission.RECORD_AUDIO};
  List<PackageInfo> packages;
  try {
    packages=AppGlobals.getPackageManager().getPackagesHoldingPermissions(permissions,0,oldUser.id).getList();
  }
 catch (  RemoteException e) {
    throw new AndroidRuntimeException(e);
  }
  for (int j=packages.size() - 1; j >= 0; j--) {
    PackageInfo pkg=packages.get(j);
    if (UserHandle.getAppId(pkg.applicationInfo.uid) < FIRST_APPLICATION_UID) {
      continue;
    }
    if (homeActivityName != null && pkg.packageName.equals(homeActivityName.getPackageName()) && pkg.applicationInfo.isSystemApp()) {
      continue;
    }
    try {
      ActivityManagerNative.getDefault().killUid(pkg.applicationInfo.uid,"String_Node_Str");
    }
 catch (    RemoteException e) {
      Log.w(TAG,"String_Node_Str",e);
    }
  }
}
Program: 195139
Project: 195139
Buggy source:
@Override public ComponentName getHomeActivityForUser(int userId){
synchronized (ActivityManagerService.this) {
    ActivityRecord homeActivity=mStackSupervisor.getHomeActivityForUser(userId);
    return homeActivity.realActivity;
  }
}

Fixed version (ground truth):
@Override public ComponentName getHomeActivityForUser(int userId){
synchronized (ActivityManagerService.this) {
    ActivityRecord homeActivity=mStackSupervisor.getHomeActivityForUser(userId);
    return homeActivity == null ? null : homeActivity.realActivity;
  }
}
Program: 195140
Project: 195140
Buggy source:
private void killBackgroundUserProcessesWithRecordAudioPermission(UserInfo oldUser){
  PackageManager pm=mContext.getPackageManager();
  ComponentName homeActivityName=null;
  if (!oldUser.isManagedProfile()) {
    homeActivityName=LocalServices.getService(ActivityManagerInternal.class).getHomeActivityForUser(oldUser.id);
  }
  final String[] permissions={Manifest.permission.RECORD_AUDIO};
  List<PackageInfo> packages;
  try {
    packages=AppGlobals.getPackageManager().getPackagesHoldingPermissions(permissions,0,oldUser.id).getList();
  }
 catch (  RemoteException e) {
    throw new AndroidRuntimeException(e);
  }
  for (int j=packages.size() - 1; j >= 0; j--) {
    PackageInfo pkg=packages.get(j);
    if (homeActivityName != null && pkg.packageName.equals(homeActivityName.getPackageName()) && pkg.applicationInfo.isSystemApp()) {
      continue;
    }
    try {
      ActivityManagerNative.getDefault().killUid(pkg.applicationInfo.uid,"String_Node_Str");
    }
 catch (    RemoteException e) {
      Log.w(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private void killBackgroundUserProcessesWithRecordAudioPermission(UserInfo oldUser){
  PackageManager pm=mContext.getPackageManager();
  ComponentName homeActivityName=null;
  if (!oldUser.isManagedProfile()) {
    homeActivityName=LocalServices.getService(ActivityManagerInternal.class).getHomeActivityForUser(oldUser.id);
  }
  final String[] permissions={Manifest.permission.RECORD_AUDIO};
  List<PackageInfo> packages;
  try {
    packages=AppGlobals.getPackageManager().getPackagesHoldingPermissions(permissions,0,oldUser.id).getList();
  }
 catch (  RemoteException e) {
    throw new AndroidRuntimeException(e);
  }
  for (int j=packages.size() - 1; j >= 0; j--) {
    PackageInfo pkg=packages.get(j);
    if (UserHandle.getAppId(pkg.applicationInfo.uid) < FIRST_APPLICATION_UID) {
      continue;
    }
    if (homeActivityName != null && pkg.packageName.equals(homeActivityName.getPackageName()) && pkg.applicationInfo.isSystemApp()) {
      continue;
    }
    try {
      ActivityManagerNative.getDefault().killUid(pkg.applicationInfo.uid,"String_Node_Str");
    }
 catch (    RemoteException e) {
      Log.w(TAG,"String_Node_Str",e);
    }
  }
}
Program: 195141
Project: 195141
Buggy source:
@Override public ComponentName getHomeActivityForUser(int userId){
synchronized (ActivityManagerService.this) {
    ActivityRecord homeActivity=mStackSupervisor.getHomeActivityForUser(userId);
    return homeActivity.realActivity;
  }
}

Fixed version (ground truth):
@Override public ComponentName getHomeActivityForUser(int userId){
synchronized (ActivityManagerService.this) {
    ActivityRecord homeActivity=mStackSupervisor.getHomeActivityForUser(userId);
    return homeActivity == null ? null : homeActivity.realActivity;
  }
}
Program: 195142
Project: 195142
Buggy source:
private void killBackgroundUserProcessesWithRecordAudioPermission(UserInfo oldUser){
  PackageManager pm=mContext.getPackageManager();
  ComponentName homeActivityName=null;
  if (!oldUser.isManagedProfile()) {
    homeActivityName=LocalServices.getService(ActivityManagerInternal.class).getHomeActivityForUser(oldUser.id);
  }
  final String[] permissions={Manifest.permission.RECORD_AUDIO};
  List<PackageInfo> packages;
  try {
    packages=AppGlobals.getPackageManager().getPackagesHoldingPermissions(permissions,0,oldUser.id).getList();
  }
 catch (  RemoteException e) {
    throw new AndroidRuntimeException(e);
  }
  for (int j=packages.size() - 1; j >= 0; j--) {
    PackageInfo pkg=packages.get(j);
    if (homeActivityName != null && pkg.packageName.equals(homeActivityName.getPackageName()) && pkg.applicationInfo.isSystemApp()) {
      continue;
    }
    try {
      ActivityManagerNative.getDefault().killUid(pkg.applicationInfo.uid,"String_Node_Str");
    }
 catch (    RemoteException e) {
      Log.w(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private void killBackgroundUserProcessesWithRecordAudioPermission(UserInfo oldUser){
  PackageManager pm=mContext.getPackageManager();
  ComponentName homeActivityName=null;
  if (!oldUser.isManagedProfile()) {
    homeActivityName=LocalServices.getService(ActivityManagerInternal.class).getHomeActivityForUser(oldUser.id);
  }
  final String[] permissions={Manifest.permission.RECORD_AUDIO};
  List<PackageInfo> packages;
  try {
    packages=AppGlobals.getPackageManager().getPackagesHoldingPermissions(permissions,0,oldUser.id).getList();
  }
 catch (  RemoteException e) {
    throw new AndroidRuntimeException(e);
  }
  for (int j=packages.size() - 1; j >= 0; j--) {
    PackageInfo pkg=packages.get(j);
    if (UserHandle.getAppId(pkg.applicationInfo.uid) < FIRST_APPLICATION_UID) {
      continue;
    }
    if (homeActivityName != null && pkg.packageName.equals(homeActivityName.getPackageName()) && pkg.applicationInfo.isSystemApp()) {
      continue;
    }
    try {
      ActivityManagerNative.getDefault().killUid(pkg.applicationInfo.uid,"String_Node_Str");
    }
 catch (    RemoteException e) {
      Log.w(TAG,"String_Node_Str",e);
    }
  }
}
Program: 195143
Project: 195143
Buggy source:
public void setSystemUiVisibility(int vis,int mask){
synchronized (mList) {
    mHandler.removeMessages(MSG_SET_SYSTEMUI_VISIBILITY);
    mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY,vis,mask,null).sendToTarget();
  }
}

Fixed version (ground truth):
public void setSystemUiVisibility(int vis,int mask){
synchronized (mList) {
    mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY,vis,mask,null).sendToTarget();
  }
}
Program: 195144
Project: 195144
Buggy source:
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
  }
 else {
    Runnable endRunnable=new Runnable(){
      @Override public void run(){
        if (!mHeadsUpManager.hasPinnedHeadsUp()) {
          mStatusBarWindowManager.setHeadsUpShowing(false);
        }
      }
    }
;
    if (!mNotificationPanel.isFullyCollapsed()) {
      endRunnable.run();
    }
 else {
      mStackScroller.runAfterAnimationFinished(endRunnable);
    }
  }
}

Fixed version (ground truth):
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
    mStatusBarWindowManager.setForceStatusBarVisible(true);
  }
 else {
    Runnable endRunnable=new Runnable(){
      @Override public void run(){
        if (!mHeadsUpManager.hasPinnedHeadsUp()) {
          mStatusBarWindowManager.setHeadsUpShowing(false);
        }
      }
    }
;
    if (!mNotificationPanel.isFullyCollapsed()) {
      endRunnable.run();
    }
 else {
      mStackScroller.runAfterAnimationFinished(endRunnable);
    }
  }
}
Program: 195145
Project: 195145
Buggy source:
private void checkBarModes(){
  if (mDemoMode)   return;
  checkBarMode(mStatusBarMode,mStatusBarWindowState,mStatusBarView.getBarTransitions());
  if (mNavigationBarView != null) {
    checkBarMode(mNavigationBarMode,mNavigationBarWindowState,mNavigationBarView.getBarTransitions());
  }
}

Fixed version (ground truth):
private void checkBarModes(){
  if (mDemoMode)   return;
  checkBarMode(mStatusBarMode,mStatusBarWindowState,mStatusBarView.getBarTransitions(),mNoAnimationOnNextBarModeChange);
  if (mNavigationBarView != null) {
    checkBarMode(mNavigationBarMode,mNavigationBarWindowState,mNavigationBarView.getBarTransitions(),mNoAnimationOnNextBarModeChange);
  }
  mNoAnimationOnNextBarModeChange=false;
}
Program: 195146
Project: 195146
Buggy source:
private void checkBarMode(int mode,int windowState,BarTransitions transitions){
  final boolean powerSave=mBatteryController.isPowerSave();
  final boolean anim=(mScreenOn == null || mScreenOn) && windowState != WINDOW_STATE_HIDDEN && !powerSave;
  if (powerSave && getBarState() == StatusBarState.SHADE) {
    mode=MODE_WARNING;
  }
  transitions.transitionTo(mode,anim);
}

Fixed version (ground truth):
private void checkBarMode(int mode,int windowState,BarTransitions transitions,boolean noAnimation){
  final boolean powerSave=mBatteryController.isPowerSave();
  final boolean anim=!noAnimation && (mScreenOn == null || mScreenOn) && windowState != WINDOW_STATE_HIDDEN && !powerSave;
  if (powerSave && getBarState() == StatusBarState.SHADE) {
    mode=MODE_WARNING;
  }
  transitions.transitionTo(mode,anim);
}
Program: 195149
Project: 195149
Buggy source:
void makeExpandedInvisible(){
  if (SPEW)   Log.d(TAG,"String_Node_Str" + mExpandedVisible + "String_Node_Str"+ mExpandedVisible);
  if (!mExpandedVisible || mStatusBarWindow == null) {
    return;
  }
  mStatusBarView.collapseAllPanels(false,false,1.0f);
  mNotificationPanel.closeQs();
  mExpandedVisible=false;
  if (mNavigationBarView != null)   mNavigationBarView.setSlippery(false);
  visibilityChanged(false);
  mStatusBarWindowManager.setStatusBarExpanded(false);
  mStatusBarView.setFocusable(true);
  dismissPopups();
  runPostCollapseRunnables();
  setInteracting(StatusBarManager.WINDOW_STATUS_BAR,false);
  showBouncer();
  disable(mDisabledUnmodified1,mDisabledUnmodified2,true);
  if (!mStatusBarKeyguardViewManager.isShowing()) {
    WindowManagerGlobal.getInstance().trimMemory(ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN);
  }
}

Fixed version (ground truth):
void makeExpandedInvisible(){
  if (SPEW)   Log.d(TAG,"String_Node_Str" + mExpandedVisible + "String_Node_Str"+ mExpandedVisible);
  if (!mExpandedVisible || mStatusBarWindow == null) {
    return;
  }
  mStatusBarView.collapseAllPanels(false,false,1.0f);
  mNotificationPanel.closeQs();
  mExpandedVisible=false;
  if (mNavigationBarView != null)   mNavigationBarView.setSlippery(false);
  visibilityChanged(false);
  mStatusBarWindowManager.setStatusBarExpanded(false);
  mStatusBarWindowManager.setForceStatusBarVisible(false);
  mStatusBarView.setFocusable(true);
  dismissPopups();
  runPostCollapseRunnables();
  setInteracting(StatusBarManager.WINDOW_STATUS_BAR,false);
  showBouncer();
  disable(mDisabledUnmodified1,mDisabledUnmodified2,true);
  if (!mStatusBarKeyguardViewManager.isShowing()) {
    WindowManagerGlobal.getInstance().trimMemory(ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN);
  }
}
Program: 195150
Project: 195150
Buggy source:
private void apply(State state){
  applyKeyguardFlags(state);
  applyFocusableFlag(state);
  adjustScreenOrientation(state);
  applyHeight(state);
  applyUserActivityTimeout(state);
  applyInputFeatures(state);
  applyFitsSystemWindows(state);
  applyModalFlag(state);
  if (mLp.copyFrom(mLpChanged) != 0) {
    mWindowManager.updateViewLayout(mStatusBarView,mLp);
  }
}

Fixed version (ground truth):
private void apply(State state){
  applyKeyguardFlags(state);
  applyForceStatusBarVisibleFlag(state);
  applyFocusableFlag(state);
  adjustScreenOrientation(state);
  applyHeight(state);
  applyUserActivityTimeout(state);
  applyInputFeatures(state);
  applyFitsSystemWindows(state);
  applyModalFlag(state);
  if (mLp.copyFrom(mLpChanged) != 0) {
    mWindowManager.updateViewLayout(mStatusBarView,mLp);
  }
}
Program: 195151
Project: 195151
Buggy source:
public int updateVisibilityLw(boolean transientAllowed,int oldVis,int vis){
  if (mWin == null)   return vis;
  if (isTransientShowing() || isTransientShowRequested()) {
    if (transientAllowed) {
      vis|=mTransientFlag;
      if ((oldVis & mTransientFlag) == 0) {
        vis|=mUnhideFlag;
      }
      setTransientBarState(TRANSIENT_BAR_SHOWING);
    }
 else {
      setTransientBarState(TRANSIENT_BAR_NONE);
    }
  }
  if (mTransientBarState != TRANSIENT_BAR_NONE) {
    vis|=mTransientFlag;
    vis&=~View.SYSTEM_UI_FLAG_LOW_PROFILE;
  }
  if ((vis & mTranslucentFlag) != 0 || (oldVis & mTranslucentFlag) != 0 || ((vis | oldVis) & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
    mLastTranslucent=SystemClock.uptimeMillis();
  }
  return vis;
}

Fixed version (ground truth):
public int updateVisibilityLw(boolean transientAllowed,int oldVis,int vis){
  if (mWin == null)   return vis;
  if (isTransientShowing() || isTransientShowRequested()) {
    if (transientAllowed) {
      vis|=mTransientFlag;
      if ((oldVis & mTransientFlag) == 0) {
        vis|=mUnhideFlag;
      }
      setTransientBarState(TRANSIENT_BAR_SHOWING);
    }
 else {
      setTransientBarState(TRANSIENT_BAR_NONE);
    }
  }
  if (mShowTransparent) {
    vis|=View.SYSTEM_UI_TRANSPARENT;
    if (mSetUnHideFlagWhenNextTransparent) {
      vis|=mUnhideFlag;
      mSetUnHideFlagWhenNextTransparent=false;
    }
  }
  if (mTransientBarState != TRANSIENT_BAR_NONE) {
    vis|=mTransientFlag;
    vis&=~View.SYSTEM_UI_FLAG_LOW_PROFILE;
  }
  if ((vis & mTranslucentFlag) != 0 || (oldVis & mTranslucentFlag) != 0 || ((vis | oldVis) & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
    mLastTranslucent=SystemClock.uptimeMillis();
  }
  return vis;
}
Program: 195152
Project: 195152
Buggy source:
public boolean setBarShowingLw(final boolean show){
  if (mWin == null)   return false;
  if (show && mTransientBarState == TRANSIENT_BAR_HIDING) {
    mPendingShow=true;
    return false;
  }
  final boolean wasVis=mWin.isVisibleLw();
  final boolean wasAnim=mWin.isAnimatingLw();
  final boolean change=show ? mWin.showLw(true) : mWin.hideLw(true);
  final int state=computeStateLw(wasVis,wasAnim,mWin,change);
  final boolean stateChanged=updateStateLw(state);
  return change || stateChanged;
}

Fixed version (ground truth):
public boolean setBarShowingLw(final boolean show){
  if (mWin == null)   return false;
  if (show && mTransientBarState == TRANSIENT_BAR_HIDING) {
    mPendingShow=true;
    return false;
  }
  final boolean wasVis=mWin.isVisibleLw();
  final boolean wasAnim=mWin.isAnimatingLw();
  final boolean change=show ? mWin.showLw(!mNoAnimationOnNextShow) : mWin.hideLw(!mNoAnimationOnNextShow);
  mNoAnimationOnNextShow=false;
  final int state=computeStateLw(wasVis,wasAnim,mWin,change);
  final boolean stateChanged=updateStateLw(state);
  return change || stateChanged;
}
Program: 195153
Project: 195153
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void beginPostLayoutPolicyLw(int displayWidth,int displayHeight){
  mTopFullscreenOpaqueWindowState=null;
  mTopFullscreenOpaqueOrDimmingWindowState=null;
  mAppsToBeHidden.clear();
  mAppsThatDismissKeyguard.clear();
  mForceStatusBar=false;
  mForceStatusBarFromKeyguard=false;
  mForcingShowNavBar=false;
  mForcingShowNavBarLayer=-1;
  mHideLockScreen=false;
  mAllowLockscreenWhenOn=false;
  mDismissKeyguard=DISMISS_KEYGUARD_NONE;
  mShowingLockscreen=false;
  mShowingDream=false;
  mWinShowWhenLocked=null;
  mKeyguardSecure=isKeyguardSecure();
  mKeyguardSecureIncludingHidden=mKeyguardSecure && (mKeyguardDelegate != null && mKeyguardDelegate.isShowing());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public void beginPostLayoutPolicyLw(int displayWidth,int displayHeight){
  mTopFullscreenOpaqueWindowState=null;
  mTopFullscreenOpaqueOrDimmingWindowState=null;
  mAppsToBeHidden.clear();
  mAppsThatDismissKeyguard.clear();
  mForceStatusBar=false;
  mForceStatusBarFromKeyguard=false;
  mForceStatusBarTransparent=false;
  mForcingShowNavBar=false;
  mForcingShowNavBarLayer=-1;
  mHideLockScreen=false;
  mAllowLockscreenWhenOn=false;
  mDismissKeyguard=DISMISS_KEYGUARD_NONE;
  mShowingLockscreen=false;
  mShowingDream=false;
  mWinShowWhenLocked=null;
  mKeyguardSecure=isKeyguardSecure();
  mKeyguardSecureIncludingHidden=mKeyguardSecure && (mKeyguardDelegate != null && mKeyguardDelegate.isShowing());
}
Program: 195156
Project: 195156
Buggy source:
@Override public boolean activeServiceSupportsLaunchFromKeyguard() throws RemoteException {
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo.getSupportsLaunchFromKeyguard();
  }
}

Fixed version (ground truth):
@Override public boolean activeServiceSupportsLaunchFromKeyguard() throws RemoteException {
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo != null && mImpl.mInfo.getSupportsLaunchFromKeyguard();
  }
}
Program: 195157
Project: 195157
Buggy source:
@Override public boolean activeServiceSupportsAssist(){
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo.getSupportsAssist();
  }
}

Fixed version (ground truth):
@Override public boolean activeServiceSupportsAssist(){
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo != null && mImpl.mInfo.getSupportsAssist();
  }
}
Program: 195158
Project: 195158
Buggy source:
public void setSystemUiVisibility(int vis,int mask){
synchronized (mList) {
    mHandler.removeMessages(MSG_SET_SYSTEMUI_VISIBILITY);
    mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY,vis,mask,null).sendToTarget();
  }
}

Fixed version (ground truth):
public void setSystemUiVisibility(int vis,int mask){
synchronized (mList) {
    mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY,vis,mask,null).sendToTarget();
  }
}
Program: 195159
Project: 195159
Buggy source:
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
  }
 else {
    Runnable endRunnable=new Runnable(){
      @Override public void run(){
        if (!mHeadsUpManager.hasPinnedHeadsUp()) {
          mStatusBarWindowManager.setHeadsUpShowing(false);
        }
      }
    }
;
    if (!mNotificationPanel.isFullyCollapsed()) {
      endRunnable.run();
    }
 else {
      mStackScroller.runAfterAnimationFinished(endRunnable);
    }
  }
}

Fixed version (ground truth):
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
    mStatusBarWindowManager.setForceStatusBarVisible(true);
  }
 else {
    Runnable endRunnable=new Runnable(){
      @Override public void run(){
        if (!mHeadsUpManager.hasPinnedHeadsUp()) {
          mStatusBarWindowManager.setHeadsUpShowing(false);
        }
      }
    }
;
    if (!mNotificationPanel.isFullyCollapsed()) {
      endRunnable.run();
    }
 else {
      mStackScroller.runAfterAnimationFinished(endRunnable);
    }
  }
}
Program: 195160
Project: 195160
Buggy source:
private void checkBarModes(){
  if (mDemoMode)   return;
  checkBarMode(mStatusBarMode,mStatusBarWindowState,mStatusBarView.getBarTransitions());
  if (mNavigationBarView != null) {
    checkBarMode(mNavigationBarMode,mNavigationBarWindowState,mNavigationBarView.getBarTransitions());
  }
}

Fixed version (ground truth):
private void checkBarModes(){
  if (mDemoMode)   return;
  checkBarMode(mStatusBarMode,mStatusBarWindowState,mStatusBarView.getBarTransitions(),mNoAnimationOnNextBarModeChange);
  if (mNavigationBarView != null) {
    checkBarMode(mNavigationBarMode,mNavigationBarWindowState,mNavigationBarView.getBarTransitions(),mNoAnimationOnNextBarModeChange);
  }
  mNoAnimationOnNextBarModeChange=false;
}
Program: 195161
Project: 195161
Buggy source:
private void checkBarMode(int mode,int windowState,BarTransitions transitions){
  final boolean powerSave=mBatteryController.isPowerSave();
  final boolean anim=(mScreenOn == null || mScreenOn) && windowState != WINDOW_STATE_HIDDEN && !powerSave;
  if (powerSave && getBarState() == StatusBarState.SHADE) {
    mode=MODE_WARNING;
  }
  transitions.transitionTo(mode,anim);
}

Fixed version (ground truth):
private void checkBarMode(int mode,int windowState,BarTransitions transitions,boolean noAnimation){
  final boolean powerSave=mBatteryController.isPowerSave();
  final boolean anim=!noAnimation && (mScreenOn == null || mScreenOn) && windowState != WINDOW_STATE_HIDDEN && !powerSave;
  if (powerSave && getBarState() == StatusBarState.SHADE) {
    mode=MODE_WARNING;
  }
  transitions.transitionTo(mode,anim);
}
Program: 195164
Project: 195164
Buggy source:
void makeExpandedInvisible(){
  if (SPEW)   Log.d(TAG,"String_Node_Str" + mExpandedVisible + "String_Node_Str"+ mExpandedVisible);
  if (!mExpandedVisible || mStatusBarWindow == null) {
    return;
  }
  mStatusBarView.collapseAllPanels(false,false,1.0f);
  mNotificationPanel.closeQs();
  mExpandedVisible=false;
  if (mNavigationBarView != null)   mNavigationBarView.setSlippery(false);
  visibilityChanged(false);
  mStatusBarWindowManager.setStatusBarExpanded(false);
  mStatusBarView.setFocusable(true);
  dismissPopups();
  runPostCollapseRunnables();
  setInteracting(StatusBarManager.WINDOW_STATUS_BAR,false);
  showBouncer();
  disable(mDisabledUnmodified1,mDisabledUnmodified2,true);
  if (!mStatusBarKeyguardViewManager.isShowing()) {
    WindowManagerGlobal.getInstance().trimMemory(ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN);
  }
}

Fixed version (ground truth):
void makeExpandedInvisible(){
  if (SPEW)   Log.d(TAG,"String_Node_Str" + mExpandedVisible + "String_Node_Str"+ mExpandedVisible);
  if (!mExpandedVisible || mStatusBarWindow == null) {
    return;
  }
  mStatusBarView.collapseAllPanels(false,false,1.0f);
  mNotificationPanel.closeQs();
  mExpandedVisible=false;
  if (mNavigationBarView != null)   mNavigationBarView.setSlippery(false);
  visibilityChanged(false);
  mStatusBarWindowManager.setStatusBarExpanded(false);
  mStatusBarWindowManager.setForceStatusBarVisible(false);
  mStatusBarView.setFocusable(true);
  dismissPopups();
  runPostCollapseRunnables();
  setInteracting(StatusBarManager.WINDOW_STATUS_BAR,false);
  showBouncer();
  disable(mDisabledUnmodified1,mDisabledUnmodified2,true);
  if (!mStatusBarKeyguardViewManager.isShowing()) {
    WindowManagerGlobal.getInstance().trimMemory(ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN);
  }
}
Program: 195165
Project: 195165
Buggy source:
private void apply(State state){
  applyKeyguardFlags(state);
  applyFocusableFlag(state);
  adjustScreenOrientation(state);
  applyHeight(state);
  applyUserActivityTimeout(state);
  applyInputFeatures(state);
  applyFitsSystemWindows(state);
  applyModalFlag(state);
  if (mLp.copyFrom(mLpChanged) != 0) {
    mWindowManager.updateViewLayout(mStatusBarView,mLp);
  }
}

Fixed version (ground truth):
private void apply(State state){
  applyKeyguardFlags(state);
  applyForceStatusBarVisibleFlag(state);
  applyFocusableFlag(state);
  adjustScreenOrientation(state);
  applyHeight(state);
  applyUserActivityTimeout(state);
  applyInputFeatures(state);
  applyFitsSystemWindows(state);
  applyModalFlag(state);
  if (mLp.copyFrom(mLpChanged) != 0) {
    mWindowManager.updateViewLayout(mStatusBarView,mLp);
  }
}
Program: 195166
Project: 195166
Buggy source:
public int updateVisibilityLw(boolean transientAllowed,int oldVis,int vis){
  if (mWin == null)   return vis;
  if (isTransientShowing() || isTransientShowRequested()) {
    if (transientAllowed) {
      vis|=mTransientFlag;
      if ((oldVis & mTransientFlag) == 0) {
        vis|=mUnhideFlag;
      }
      setTransientBarState(TRANSIENT_BAR_SHOWING);
    }
 else {
      setTransientBarState(TRANSIENT_BAR_NONE);
    }
  }
  if (mTransientBarState != TRANSIENT_BAR_NONE) {
    vis|=mTransientFlag;
    vis&=~View.SYSTEM_UI_FLAG_LOW_PROFILE;
  }
  if ((vis & mTranslucentFlag) != 0 || (oldVis & mTranslucentFlag) != 0 || ((vis | oldVis) & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
    mLastTranslucent=SystemClock.uptimeMillis();
  }
  return vis;
}

Fixed version (ground truth):
public int updateVisibilityLw(boolean transientAllowed,int oldVis,int vis){
  if (mWin == null)   return vis;
  if (isTransientShowing() || isTransientShowRequested()) {
    if (transientAllowed) {
      vis|=mTransientFlag;
      if ((oldVis & mTransientFlag) == 0) {
        vis|=mUnhideFlag;
      }
      setTransientBarState(TRANSIENT_BAR_SHOWING);
    }
 else {
      setTransientBarState(TRANSIENT_BAR_NONE);
    }
  }
  if (mShowTransparent) {
    vis|=View.SYSTEM_UI_TRANSPARENT;
    if (mSetUnHideFlagWhenNextTransparent) {
      vis|=mUnhideFlag;
      mSetUnHideFlagWhenNextTransparent=false;
    }
  }
  if (mTransientBarState != TRANSIENT_BAR_NONE) {
    vis|=mTransientFlag;
    vis&=~View.SYSTEM_UI_FLAG_LOW_PROFILE;
  }
  if ((vis & mTranslucentFlag) != 0 || (oldVis & mTranslucentFlag) != 0 || ((vis | oldVis) & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
    mLastTranslucent=SystemClock.uptimeMillis();
  }
  return vis;
}
Program: 195167
Project: 195167
Buggy source:
public boolean setBarShowingLw(final boolean show){
  if (mWin == null)   return false;
  if (show && mTransientBarState == TRANSIENT_BAR_HIDING) {
    mPendingShow=true;
    return false;
  }
  final boolean wasVis=mWin.isVisibleLw();
  final boolean wasAnim=mWin.isAnimatingLw();
  final boolean change=show ? mWin.showLw(true) : mWin.hideLw(true);
  final int state=computeStateLw(wasVis,wasAnim,mWin,change);
  final boolean stateChanged=updateStateLw(state);
  return change || stateChanged;
}

Fixed version (ground truth):
public boolean setBarShowingLw(final boolean show){
  if (mWin == null)   return false;
  if (show && mTransientBarState == TRANSIENT_BAR_HIDING) {
    mPendingShow=true;
    return false;
  }
  final boolean wasVis=mWin.isVisibleLw();
  final boolean wasAnim=mWin.isAnimatingLw();
  final boolean change=show ? mWin.showLw(!mNoAnimationOnNextShow) : mWin.hideLw(!mNoAnimationOnNextShow);
  mNoAnimationOnNextShow=false;
  final int state=computeStateLw(wasVis,wasAnim,mWin,change);
  final boolean stateChanged=updateStateLw(state);
  return change || stateChanged;
}
Program: 195168
Project: 195168
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void beginPostLayoutPolicyLw(int displayWidth,int displayHeight){
  mTopFullscreenOpaqueWindowState=null;
  mTopFullscreenOpaqueOrDimmingWindowState=null;
  mAppsToBeHidden.clear();
  mAppsThatDismissKeyguard.clear();
  mForceStatusBar=false;
  mForceStatusBarFromKeyguard=false;
  mForcingShowNavBar=false;
  mForcingShowNavBarLayer=-1;
  mHideLockScreen=false;
  mAllowLockscreenWhenOn=false;
  mDismissKeyguard=DISMISS_KEYGUARD_NONE;
  mShowingLockscreen=false;
  mShowingDream=false;
  mWinShowWhenLocked=null;
  mKeyguardSecure=isKeyguardSecure();
  mKeyguardSecureIncludingHidden=mKeyguardSecure && (mKeyguardDelegate != null && mKeyguardDelegate.isShowing());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public void beginPostLayoutPolicyLw(int displayWidth,int displayHeight){
  mTopFullscreenOpaqueWindowState=null;
  mTopFullscreenOpaqueOrDimmingWindowState=null;
  mAppsToBeHidden.clear();
  mAppsThatDismissKeyguard.clear();
  mForceStatusBar=false;
  mForceStatusBarFromKeyguard=false;
  mForceStatusBarTransparent=false;
  mForcingShowNavBar=false;
  mForcingShowNavBarLayer=-1;
  mHideLockScreen=false;
  mAllowLockscreenWhenOn=false;
  mDismissKeyguard=DISMISS_KEYGUARD_NONE;
  mShowingLockscreen=false;
  mShowingDream=false;
  mWinShowWhenLocked=null;
  mKeyguardSecure=isKeyguardSecure();
  mKeyguardSecureIncludingHidden=mKeyguardSecure && (mKeyguardDelegate != null && mKeyguardDelegate.isShowing());
}
Program: 195171
Project: 195171
Buggy source:
@Override public boolean activeServiceSupportsLaunchFromKeyguard() throws RemoteException {
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo.getSupportsLaunchFromKeyguard();
  }
}

Fixed version (ground truth):
@Override public boolean activeServiceSupportsLaunchFromKeyguard() throws RemoteException {
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo != null && mImpl.mInfo.getSupportsLaunchFromKeyguard();
  }
}
Program: 195172
Project: 195172
Buggy source:
@Override public boolean activeServiceSupportsAssist(){
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo.getSupportsAssist();
  }
}

Fixed version (ground truth):
@Override public boolean activeServiceSupportsAssist(){
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo != null && mImpl.mInfo.getSupportsAssist();
  }
}
Program: 195173
Project: 195173
Buggy source:
@Override public boolean activeServiceSupportsLaunchFromKeyguard() throws RemoteException {
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo.getSupportsLaunchFromKeyguard();
  }
}

Fixed version (ground truth):
@Override public boolean activeServiceSupportsLaunchFromKeyguard() throws RemoteException {
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo != null && mImpl.mInfo.getSupportsLaunchFromKeyguard();
  }
}
Program: 195174
Project: 195174
Buggy source:
@Override public boolean activeServiceSupportsAssist(){
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo.getSupportsAssist();
  }
}

Fixed version (ground truth):
@Override public boolean activeServiceSupportsAssist(){
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo != null && mImpl.mInfo.getSupportsAssist();
  }
}
Program: 195175
Project: 195175
Buggy source:
public void setSystemUiVisibility(int vis,int mask){
synchronized (mList) {
    mHandler.removeMessages(MSG_SET_SYSTEMUI_VISIBILITY);
    mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY,vis,mask,null).sendToTarget();
  }
}

Fixed version (ground truth):
public void setSystemUiVisibility(int vis,int mask){
synchronized (mList) {
    mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY,vis,mask,null).sendToTarget();
  }
}
Program: 195176
Project: 195176
Buggy source:
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
  }
 else {
    Runnable endRunnable=new Runnable(){
      @Override public void run(){
        if (!mHeadsUpManager.hasPinnedHeadsUp()) {
          mStatusBarWindowManager.setHeadsUpShowing(false);
        }
      }
    }
;
    if (!mNotificationPanel.isFullyCollapsed()) {
      endRunnable.run();
    }
 else {
      mStackScroller.runAfterAnimationFinished(endRunnable);
    }
  }
}

Fixed version (ground truth):
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
    mStatusBarWindowManager.setForceStatusBarVisible(true);
  }
 else {
    Runnable endRunnable=new Runnable(){
      @Override public void run(){
        if (!mHeadsUpManager.hasPinnedHeadsUp()) {
          mStatusBarWindowManager.setHeadsUpShowing(false);
        }
      }
    }
;
    if (!mNotificationPanel.isFullyCollapsed()) {
      endRunnable.run();
    }
 else {
      mStackScroller.runAfterAnimationFinished(endRunnable);
    }
  }
}
Program: 195177
Project: 195177
Buggy source:
private void checkBarModes(){
  if (mDemoMode)   return;
  checkBarMode(mStatusBarMode,mStatusBarWindowState,mStatusBarView.getBarTransitions());
  if (mNavigationBarView != null) {
    checkBarMode(mNavigationBarMode,mNavigationBarWindowState,mNavigationBarView.getBarTransitions());
  }
}

Fixed version (ground truth):
private void checkBarModes(){
  if (mDemoMode)   return;
  checkBarMode(mStatusBarMode,mStatusBarWindowState,mStatusBarView.getBarTransitions(),mNoAnimationOnNextBarModeChange);
  if (mNavigationBarView != null) {
    checkBarMode(mNavigationBarMode,mNavigationBarWindowState,mNavigationBarView.getBarTransitions(),mNoAnimationOnNextBarModeChange);
  }
  mNoAnimationOnNextBarModeChange=false;
}
Program: 195178
Project: 195178
Buggy source:
private void checkBarMode(int mode,int windowState,BarTransitions transitions){
  final boolean powerSave=mBatteryController.isPowerSave();
  final boolean anim=(mScreenOn == null || mScreenOn) && windowState != WINDOW_STATE_HIDDEN && !powerSave;
  if (powerSave && getBarState() == StatusBarState.SHADE) {
    mode=MODE_WARNING;
  }
  transitions.transitionTo(mode,anim);
}

Fixed version (ground truth):
private void checkBarMode(int mode,int windowState,BarTransitions transitions,boolean noAnimation){
  final boolean powerSave=mBatteryController.isPowerSave();
  final boolean anim=!noAnimation && (mScreenOn == null || mScreenOn) && windowState != WINDOW_STATE_HIDDEN && !powerSave;
  if (powerSave && getBarState() == StatusBarState.SHADE) {
    mode=MODE_WARNING;
  }
  transitions.transitionTo(mode,anim);
}
Program: 195181
Project: 195181
Buggy source:
void makeExpandedInvisible(){
  if (SPEW)   Log.d(TAG,"String_Node_Str" + mExpandedVisible + "String_Node_Str"+ mExpandedVisible);
  if (!mExpandedVisible || mStatusBarWindow == null) {
    return;
  }
  mStatusBarView.collapseAllPanels(false,false,1.0f);
  mNotificationPanel.closeQs();
  mExpandedVisible=false;
  if (mNavigationBarView != null)   mNavigationBarView.setSlippery(false);
  visibilityChanged(false);
  mStatusBarWindowManager.setStatusBarExpanded(false);
  mStatusBarView.setFocusable(true);
  dismissPopups();
  runPostCollapseRunnables();
  setInteracting(StatusBarManager.WINDOW_STATUS_BAR,false);
  showBouncer();
  disable(mDisabledUnmodified1,mDisabledUnmodified2,true);
  if (!mStatusBarKeyguardViewManager.isShowing()) {
    WindowManagerGlobal.getInstance().trimMemory(ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN);
  }
}

Fixed version (ground truth):
void makeExpandedInvisible(){
  if (SPEW)   Log.d(TAG,"String_Node_Str" + mExpandedVisible + "String_Node_Str"+ mExpandedVisible);
  if (!mExpandedVisible || mStatusBarWindow == null) {
    return;
  }
  mStatusBarView.collapseAllPanels(false,false,1.0f);
  mNotificationPanel.closeQs();
  mExpandedVisible=false;
  if (mNavigationBarView != null)   mNavigationBarView.setSlippery(false);
  visibilityChanged(false);
  mStatusBarWindowManager.setStatusBarExpanded(false);
  mStatusBarWindowManager.setForceStatusBarVisible(false);
  mStatusBarView.setFocusable(true);
  dismissPopups();
  runPostCollapseRunnables();
  setInteracting(StatusBarManager.WINDOW_STATUS_BAR,false);
  showBouncer();
  disable(mDisabledUnmodified1,mDisabledUnmodified2,true);
  if (!mStatusBarKeyguardViewManager.isShowing()) {
    WindowManagerGlobal.getInstance().trimMemory(ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN);
  }
}
Program: 195182
Project: 195182
Buggy source:
private void apply(State state){
  applyKeyguardFlags(state);
  applyFocusableFlag(state);
  adjustScreenOrientation(state);
  applyHeight(state);
  applyUserActivityTimeout(state);
  applyInputFeatures(state);
  applyFitsSystemWindows(state);
  applyModalFlag(state);
  if (mLp.copyFrom(mLpChanged) != 0) {
    mWindowManager.updateViewLayout(mStatusBarView,mLp);
  }
}

Fixed version (ground truth):
private void apply(State state){
  applyKeyguardFlags(state);
  applyForceStatusBarVisibleFlag(state);
  applyFocusableFlag(state);
  adjustScreenOrientation(state);
  applyHeight(state);
  applyUserActivityTimeout(state);
  applyInputFeatures(state);
  applyFitsSystemWindows(state);
  applyModalFlag(state);
  if (mLp.copyFrom(mLpChanged) != 0) {
    mWindowManager.updateViewLayout(mStatusBarView,mLp);
  }
}
Program: 195183
Project: 195183
Buggy source:
public int updateVisibilityLw(boolean transientAllowed,int oldVis,int vis){
  if (mWin == null)   return vis;
  if (isTransientShowing() || isTransientShowRequested()) {
    if (transientAllowed) {
      vis|=mTransientFlag;
      if ((oldVis & mTransientFlag) == 0) {
        vis|=mUnhideFlag;
      }
      setTransientBarState(TRANSIENT_BAR_SHOWING);
    }
 else {
      setTransientBarState(TRANSIENT_BAR_NONE);
    }
  }
  if (mTransientBarState != TRANSIENT_BAR_NONE) {
    vis|=mTransientFlag;
    vis&=~View.SYSTEM_UI_FLAG_LOW_PROFILE;
  }
  if ((vis & mTranslucentFlag) != 0 || (oldVis & mTranslucentFlag) != 0 || ((vis | oldVis) & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
    mLastTranslucent=SystemClock.uptimeMillis();
  }
  return vis;
}

Fixed version (ground truth):
public int updateVisibilityLw(boolean transientAllowed,int oldVis,int vis){
  if (mWin == null)   return vis;
  if (isTransientShowing() || isTransientShowRequested()) {
    if (transientAllowed) {
      vis|=mTransientFlag;
      if ((oldVis & mTransientFlag) == 0) {
        vis|=mUnhideFlag;
      }
      setTransientBarState(TRANSIENT_BAR_SHOWING);
    }
 else {
      setTransientBarState(TRANSIENT_BAR_NONE);
    }
  }
  if (mShowTransparent) {
    vis|=View.SYSTEM_UI_TRANSPARENT;
    if (mSetUnHideFlagWhenNextTransparent) {
      vis|=mUnhideFlag;
      mSetUnHideFlagWhenNextTransparent=false;
    }
  }
  if (mTransientBarState != TRANSIENT_BAR_NONE) {
    vis|=mTransientFlag;
    vis&=~View.SYSTEM_UI_FLAG_LOW_PROFILE;
  }
  if ((vis & mTranslucentFlag) != 0 || (oldVis & mTranslucentFlag) != 0 || ((vis | oldVis) & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
    mLastTranslucent=SystemClock.uptimeMillis();
  }
  return vis;
}
Program: 195184
Project: 195184
Buggy source:
public boolean setBarShowingLw(final boolean show){
  if (mWin == null)   return false;
  if (show && mTransientBarState == TRANSIENT_BAR_HIDING) {
    mPendingShow=true;
    return false;
  }
  final boolean wasVis=mWin.isVisibleLw();
  final boolean wasAnim=mWin.isAnimatingLw();
  final boolean change=show ? mWin.showLw(true) : mWin.hideLw(true);
  final int state=computeStateLw(wasVis,wasAnim,mWin,change);
  final boolean stateChanged=updateStateLw(state);
  return change || stateChanged;
}

Fixed version (ground truth):
public boolean setBarShowingLw(final boolean show){
  if (mWin == null)   return false;
  if (show && mTransientBarState == TRANSIENT_BAR_HIDING) {
    mPendingShow=true;
    return false;
  }
  final boolean wasVis=mWin.isVisibleLw();
  final boolean wasAnim=mWin.isAnimatingLw();
  final boolean change=show ? mWin.showLw(!mNoAnimationOnNextShow) : mWin.hideLw(!mNoAnimationOnNextShow);
  mNoAnimationOnNextShow=false;
  final int state=computeStateLw(wasVis,wasAnim,mWin,change);
  final boolean stateChanged=updateStateLw(state);
  return change || stateChanged;
}
Program: 195185
Project: 195185
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void beginPostLayoutPolicyLw(int displayWidth,int displayHeight){
  mTopFullscreenOpaqueWindowState=null;
  mTopFullscreenOpaqueOrDimmingWindowState=null;
  mAppsToBeHidden.clear();
  mAppsThatDismissKeyguard.clear();
  mForceStatusBar=false;
  mForceStatusBarFromKeyguard=false;
  mForcingShowNavBar=false;
  mForcingShowNavBarLayer=-1;
  mHideLockScreen=false;
  mAllowLockscreenWhenOn=false;
  mDismissKeyguard=DISMISS_KEYGUARD_NONE;
  mShowingLockscreen=false;
  mShowingDream=false;
  mWinShowWhenLocked=null;
  mKeyguardSecure=isKeyguardSecure();
  mKeyguardSecureIncludingHidden=mKeyguardSecure && (mKeyguardDelegate != null && mKeyguardDelegate.isShowing());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public void beginPostLayoutPolicyLw(int displayWidth,int displayHeight){
  mTopFullscreenOpaqueWindowState=null;
  mTopFullscreenOpaqueOrDimmingWindowState=null;
  mAppsToBeHidden.clear();
  mAppsThatDismissKeyguard.clear();
  mForceStatusBar=false;
  mForceStatusBarFromKeyguard=false;
  mForceStatusBarTransparent=false;
  mForcingShowNavBar=false;
  mForcingShowNavBarLayer=-1;
  mHideLockScreen=false;
  mAllowLockscreenWhenOn=false;
  mDismissKeyguard=DISMISS_KEYGUARD_NONE;
  mShowingLockscreen=false;
  mShowingDream=false;
  mWinShowWhenLocked=null;
  mKeyguardSecure=isKeyguardSecure();
  mKeyguardSecureIncludingHidden=mKeyguardSecure && (mKeyguardDelegate != null && mKeyguardDelegate.isShowing());
}
Program: 195188
Project: 195188
Buggy source:
@Override public boolean activeServiceSupportsLaunchFromKeyguard() throws RemoteException {
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo.getSupportsLaunchFromKeyguard();
  }
}

Fixed version (ground truth):
@Override public boolean activeServiceSupportsLaunchFromKeyguard() throws RemoteException {
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo != null && mImpl.mInfo.getSupportsLaunchFromKeyguard();
  }
}
Program: 195189
Project: 195189
Buggy source:
@Override public boolean activeServiceSupportsAssist(){
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo.getSupportsAssist();
  }
}

Fixed version (ground truth):
@Override public boolean activeServiceSupportsAssist(){
  enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE);
synchronized (this) {
    return mImpl != null && mImpl.mInfo != null && mImpl.mInfo.getSupportsAssist();
  }
}
Program: 195190
Project: 195190
Buggy source:
public void setSystemUiVisibility(int vis,int mask){
synchronized (mList) {
    mHandler.removeMessages(MSG_SET_SYSTEMUI_VISIBILITY);
    mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY,vis,mask,null).sendToTarget();
  }
}

Fixed version (ground truth):
public void setSystemUiVisibility(int vis,int mask){
synchronized (mList) {
    mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY,vis,mask,null).sendToTarget();
  }
}
Program: 195191
Project: 195191
Buggy source:
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
  }
 else {
    Runnable endRunnable=new Runnable(){
      @Override public void run(){
        if (!mHeadsUpManager.hasPinnedHeadsUp()) {
          mStatusBarWindowManager.setHeadsUpShowing(false);
        }
      }
    }
;
    if (!mNotificationPanel.isFullyCollapsed()) {
      endRunnable.run();
    }
 else {
      mStackScroller.runAfterAnimationFinished(endRunnable);
    }
  }
}

Fixed version (ground truth):
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
    mStatusBarWindowManager.setForceStatusBarVisible(true);
  }
 else {
    Runnable endRunnable=new Runnable(){
      @Override public void run(){
        if (!mHeadsUpManager.hasPinnedHeadsUp()) {
          mStatusBarWindowManager.setHeadsUpShowing(false);
        }
      }
    }
;
    if (!mNotificationPanel.isFullyCollapsed()) {
      endRunnable.run();
    }
 else {
      mStackScroller.runAfterAnimationFinished(endRunnable);
    }
  }
}
Program: 195192
Project: 195192
Buggy source:
private void checkBarModes(){
  if (mDemoMode)   return;
  checkBarMode(mStatusBarMode,mStatusBarWindowState,mStatusBarView.getBarTransitions());
  if (mNavigationBarView != null) {
    checkBarMode(mNavigationBarMode,mNavigationBarWindowState,mNavigationBarView.getBarTransitions());
  }
}

Fixed version (ground truth):
private void checkBarModes(){
  if (mDemoMode)   return;
  checkBarMode(mStatusBarMode,mStatusBarWindowState,mStatusBarView.getBarTransitions(),mNoAnimationOnNextBarModeChange);
  if (mNavigationBarView != null) {
    checkBarMode(mNavigationBarMode,mNavigationBarWindowState,mNavigationBarView.getBarTransitions(),mNoAnimationOnNextBarModeChange);
  }
  mNoAnimationOnNextBarModeChange=false;
}
Program: 195193
Project: 195193
Buggy source:
private void checkBarMode(int mode,int windowState,BarTransitions transitions){
  final boolean powerSave=mBatteryController.isPowerSave();
  final boolean anim=(mScreenOn == null || mScreenOn) && windowState != WINDOW_STATE_HIDDEN && !powerSave;
  if (powerSave && getBarState() == StatusBarState.SHADE) {
    mode=MODE_WARNING;
  }
  transitions.transitionTo(mode,anim);
}

Fixed version (ground truth):
private void checkBarMode(int mode,int windowState,BarTransitions transitions,boolean noAnimation){
  final boolean powerSave=mBatteryController.isPowerSave();
  final boolean anim=!noAnimation && (mScreenOn == null || mScreenOn) && windowState != WINDOW_STATE_HIDDEN && !powerSave;
  if (powerSave && getBarState() == StatusBarState.SHADE) {
    mode=MODE_WARNING;
  }
  transitions.transitionTo(mode,anim);
}