nus-yam/ex-repair huggingface dataset:
Program: 193163
Project: 193163
Buggy source:
private void recreateNotificationHeader(){
  final Notification.Builder builder=Notification.Builder.recoverBuilder(getContext(),getStatusBarNotification().getNotification());
  final RemoteViews header=builder.makeNotificationHeader();
  if (mNotificationHeader == null) {
    mNotificationHeader=(NotificationHeaderView)header.apply(getContext(),this);
    final View expandButton=mNotificationHeader.findViewById(com.android.internal.R.id.expand_button);
    expandButton.setVisibility(VISIBLE);
    mNotificationHeader.setOnClickListener(mExpandClickListener);
    mNotificationHeaderWrapper=NotificationViewWrapper.wrap(getContext(),mNotificationHeader);
    addView(mNotificationHeader);
  }
 else {
    header.reapply(getContext(),mNotificationHeader);
    mNotificationHeaderWrapper.notifyContentUpdated();
  }
  updateHeaderExpandButton();
  updateChildrenHeaderAppearance();
  updateHeaderChildCount();
}

Fixed version (ground truth):
private void recreateNotificationHeader(){
  final Notification.Builder builder=Notification.Builder.recoverBuilder(getContext(),getStatusBarNotification().getNotification());
  final RemoteViews header=builder.makeNotificationHeader();
  if (mNotificationHeader == null) {
    mNotificationHeader=(NotificationHeaderView)header.apply(getContext(),this);
    final View expandButton=mNotificationHeader.findViewById(com.android.internal.R.id.expand_button);
    expandButton.setVisibility(VISIBLE);
    mNotificationHeader.setOnClickListener(mExpandClickListener);
    mNotificationHeaderWrapper=NotificationViewWrapper.wrap(getContext(),mNotificationHeader);
    addView(mNotificationHeader,indexOfChild(mChildrenContainer) + 1);
  }
 else {
    header.reapply(getContext(),mNotificationHeader);
    mNotificationHeaderWrapper.notifyContentUpdated();
  }
  updateHeaderExpandButton();
  updateChildrenHeaderAppearance();
  updateHeaderChildCount();
}
Program: 193165
Project: 193165
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  int childCount=mChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=mChildren.get(i);
    if (child.getVisibility() == View.GONE) {
      continue;
    }
    child.layout(0,0,getWidth(),child.getMeasuredHeight());
    mDividers.get(i).layout(0,0,getWidth(),mDividerHeight);
  }
  if (mGroupOverflowContainer != null) {
    mGroupOverflowContainer.layout(0,0,getWidth(),mGroupOverflowContainer.getMeasuredHeight());
  }
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  int childCount=Math.min(mChildren.size(),NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED);
  for (int i=0; i < childCount; i++) {
    View child=mChildren.get(i);
    if (child.getVisibility() == View.GONE) {
      continue;
    }
    child.layout(0,0,getWidth(),child.getMeasuredHeight());
    mDividers.get(i).layout(0,0,getWidth(),mDividerHeight);
  }
  if (mGroupOverflowContainer != null) {
    mGroupOverflowContainer.layout(0,0,getWidth(),mGroupOverflowContainer.getMeasuredHeight());
  }
}
Program: 193166
Project: 193166
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int ownMaxHeight=mMaxNotificationHeight;
  int heightMode=MeasureSpec.getMode(heightMeasureSpec);
  boolean hasFixedHeight=heightMode == MeasureSpec.EXACTLY;
  boolean isHeightLimited=heightMode == MeasureSpec.AT_MOST;
  if (hasFixedHeight || isHeightLimited) {
    int size=MeasureSpec.getSize(heightMeasureSpec);
    ownMaxHeight=Math.min(ownMaxHeight,size);
  }
  int newHeightSpec=MeasureSpec.makeMeasureSpec(ownMaxHeight,MeasureSpec.AT_MOST);
  int dividerHeightSpec=MeasureSpec.makeMeasureSpec(mDividerHeight,MeasureSpec.EXACTLY);
  int height=mNotificationHeaderHeight + mNotificatonTopPadding;
  int childCount=mChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=mChildren.get(i);
    child.measure(widthMeasureSpec,newHeightSpec);
    height+=child.getMeasuredHeight();
    View divider=mDividers.get(i);
    divider.measure(widthMeasureSpec,dividerHeightSpec);
    height+=mDividerHeight;
  }
  int width=MeasureSpec.getSize(widthMeasureSpec);
  if (mGroupOverflowContainer != null) {
    mGroupOverflowContainer.measure(widthMeasureSpec,newHeightSpec);
  }
  setMeasuredDimension(width,height);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int ownMaxHeight=mMaxNotificationHeight;
  int heightMode=MeasureSpec.getMode(heightMeasureSpec);
  boolean hasFixedHeight=heightMode == MeasureSpec.EXACTLY;
  boolean isHeightLimited=heightMode == MeasureSpec.AT_MOST;
  if (hasFixedHeight || isHeightLimited) {
    int size=MeasureSpec.getSize(heightMeasureSpec);
    ownMaxHeight=Math.min(ownMaxHeight,size);
  }
  int newHeightSpec=MeasureSpec.makeMeasureSpec(ownMaxHeight,MeasureSpec.AT_MOST);
  int dividerHeightSpec=MeasureSpec.makeMeasureSpec(mDividerHeight,MeasureSpec.EXACTLY);
  int height=mNotificationHeaderHeight + mNotificatonTopPadding;
  int childCount=Math.min(mChildren.size(),NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED);
  for (int i=0; i < childCount; i++) {
    View child=mChildren.get(i);
    child.measure(widthMeasureSpec,newHeightSpec);
    height+=child.getMeasuredHeight();
    View divider=mDividers.get(i);
    divider.measure(widthMeasureSpec,dividerHeightSpec);
    height+=mDividerHeight;
  }
  int width=MeasureSpec.getSize(widthMeasureSpec);
  if (mGroupOverflowContainer != null) {
    mGroupOverflowContainer.measure(widthMeasureSpec,newHeightSpec);
  }
  setMeasuredDimension(width,height);
}
Program: 193167
Project: 193167
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  requestPanelHeightUpdate();
  mHasLayoutedSinceDown=true;
  if (mUpdateFlingOnLayout) {
    abortAnimations();
    fling(mUpdateFlingVelocity,true);
    mUpdateFlingOnLayout=false;
  }
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  if (mLayoutHeight != getHeight()) {
    mLayoutHeight=getHeight();
    mStatusBar.onPanelHeightChanged();
  }
  requestPanelHeightUpdate();
  mHasLayoutedSinceDown=true;
  if (mUpdateFlingOnLayout) {
    abortAnimations();
    fling(mUpdateFlingVelocity,true);
    mUpdateFlingOnLayout=false;
  }
}
Program: 193168
Project: 193168
Buggy source:
public void expand(final boolean animate){
  if (!isFullyCollapsed() && !isCollapsing()) {
    return;
  }
  mInstantExpanding=true;
  mUpdateFlingOnLayout=false;
  abortAnimations();
  cancelPeek();
  if (mTracking) {
    onTrackingStopped(true);
  }
  if (mExpanding) {
    notifyExpandingFinished();
  }
  notifyBarPanelExpansionChanged();
  getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      if (mStatusBar.getStatusBarWindow().getHeight() != mStatusBar.getStatusBarHeight()) {
        getViewTreeObserver().removeOnGlobalLayoutListener(this);
        mStatusBar.onPanelExpandedAndLayouted();
        if (animate) {
          mBar.startOpeningPanel(PanelView.this);
          notifyExpandingStarted();
          fling(0,true);
        }
 else {
          setExpandedFraction(1f);
        }
        mInstantExpanding=false;
      }
    }
  }
);
  requestLayout();
}

Fixed version (ground truth):
public void expand(final boolean animate){
  if (!isFullyCollapsed() && !isCollapsing()) {
    return;
  }
  mInstantExpanding=true;
  mUpdateFlingOnLayout=false;
  abortAnimations();
  cancelPeek();
  if (mTracking) {
    onTrackingStopped(true);
  }
  if (mExpanding) {
    notifyExpandingFinished();
  }
  notifyBarPanelExpansionChanged();
  getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      if (mStatusBar.getStatusBarWindow().getHeight() != mStatusBar.getStatusBarHeight()) {
        getViewTreeObserver().removeOnGlobalLayoutListener(this);
        if (animate) {
          mBar.startOpeningPanel(PanelView.this);
          notifyExpandingStarted();
          fling(0,true);
        }
 else {
          setExpandedFraction(1f);
        }
        mInstantExpanding=false;
      }
    }
  }
);
  requestLayout();
}
Program: 193169
Project: 193169
Buggy source:
@Override public void onGlobalLayout(){
  if (mStatusBar.getStatusBarWindow().getHeight() != mStatusBar.getStatusBarHeight()) {
    getViewTreeObserver().removeOnGlobalLayoutListener(this);
    mStatusBar.onPanelExpandedAndLayouted();
    if (animate) {
      mBar.startOpeningPanel(PanelView.this);
      notifyExpandingStarted();
      fling(0,true);
    }
 else {
      setExpandedFraction(1f);
    }
    mInstantExpanding=false;
  }
}

Fixed version (ground truth):
@Override public void onGlobalLayout(){
  if (mStatusBar.getStatusBarWindow().getHeight() != mStatusBar.getStatusBarHeight()) {
    getViewTreeObserver().removeOnGlobalLayoutListener(this);
    if (animate) {
      mBar.startOpeningPanel(PanelView.this);
      notifyExpandingStarted();
      fling(0,true);
    }
 else {
      setExpandedFraction(1f);
    }
    mInstantExpanding=false;
  }
}
Program: 193170
Project: 193170
Buggy source:
private void recreateNotificationHeader(){
  final Notification.Builder builder=Notification.Builder.recoverBuilder(getContext(),getStatusBarNotification().getNotification());
  final RemoteViews header=builder.makeNotificationHeader();
  if (mNotificationHeader == null) {
    mNotificationHeader=(NotificationHeaderView)header.apply(getContext(),this);
    final View expandButton=mNotificationHeader.findViewById(com.android.internal.R.id.expand_button);
    expandButton.setVisibility(VISIBLE);
    mNotificationHeader.setOnClickListener(mExpandClickListener);
    mNotificationHeaderWrapper=NotificationViewWrapper.wrap(getContext(),mNotificationHeader);
    addView(mNotificationHeader);
  }
 else {
    header.reapply(getContext(),mNotificationHeader);
    mNotificationHeaderWrapper.notifyContentUpdated();
  }
  updateHeaderExpandButton();
  updateChildrenHeaderAppearance();
  updateHeaderChildCount();
}

Fixed version (ground truth):
private void recreateNotificationHeader(){
  final Notification.Builder builder=Notification.Builder.recoverBuilder(getContext(),getStatusBarNotification().getNotification());
  final RemoteViews header=builder.makeNotificationHeader();
  if (mNotificationHeader == null) {
    mNotificationHeader=(NotificationHeaderView)header.apply(getContext(),this);
    final View expandButton=mNotificationHeader.findViewById(com.android.internal.R.id.expand_button);
    expandButton.setVisibility(VISIBLE);
    mNotificationHeader.setOnClickListener(mExpandClickListener);
    mNotificationHeaderWrapper=NotificationViewWrapper.wrap(getContext(),mNotificationHeader);
    addView(mNotificationHeader,indexOfChild(mChildrenContainer) + 1);
  }
 else {
    header.reapply(getContext(),mNotificationHeader);
    mNotificationHeaderWrapper.notifyContentUpdated();
  }
  updateHeaderExpandButton();
  updateChildrenHeaderAppearance();
  updateHeaderChildCount();
}
Program: 193171
Project: 193171
Buggy source:
/** 
 * @param onKeyguard whether to prevent notification expansion
 */
public void setOnKeyguard(boolean onKeyguard){
  if (onKeyguard != mOnKeyguard) {
    final boolean wasExpanded=isExpanded();
    mOnKeyguard=onKeyguard;
    logExpansionEvent(false,wasExpanded);
    if (wasExpanded != isExpanded()) {
      notifyHeightChanged(false);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param onKeyguard whether to prevent notification expansion
 */
public void setOnKeyguard(boolean onKeyguard){
  if (onKeyguard != mOnKeyguard) {
    final boolean wasExpanded=isExpanded();
    mOnKeyguard=onKeyguard;
    logExpansionEvent(false,wasExpanded);
    if (wasExpanded != isExpanded()) {
      if (mIsSummaryWithChildren) {
        mChildrenContainer.updateGroupOverflow();
      }
      notifyHeightChanged(false);
    }
  }
}
Program: 193172
Project: 193172
Buggy source:
/** 
 * Called when the panel was layouted expanded for the first time after being collapsed.
 */
public void onPanelExpandedAndLayouted(){
  if (mState == StatusBarState.KEYGUARD) {
    updateRowStates();
    mStackScroller.onHeightChanged(null,false);
  }
}

Fixed version (ground truth):
/** 
 * Called when the panel was layouted expanded for the first time after being collapsed.
 */
public void onPanelExpandedAndLayouted(){
  if (mState == StatusBarState.KEYGUARD) {
    updateRowStates();
  }
}
Program: 193173
Project: 193173
Buggy source:
/** 
 * Called when the panel was layouted expanded for the first time after being collapsed.
 */
public void onPanelExpandedAndLayouted(){
  if (mState == StatusBarState.KEYGUARD) {
    updateRowStates();
    mStackScroller.onHeightChanged(null,false);
  }
}

Fixed version (ground truth):
/** 
 * Called when the panel was layouted expanded for the first time after being collapsed.
 */
public void onPanelExpandedAndLayouted(){
  if (mState == StatusBarState.KEYGUARD) {
    updateRowStates();
  }
}
Program: 193174
Project: 193174
Buggy source:
/** 
 * @param onKeyguard whether to prevent notification expansion
 */
public void setOnKeyguard(boolean onKeyguard){
  if (onKeyguard != mOnKeyguard) {
    final boolean wasExpanded=isExpanded();
    mOnKeyguard=onKeyguard;
    logExpansionEvent(false,wasExpanded);
    if (wasExpanded != isExpanded()) {
      notifyHeightChanged(false);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param onKeyguard whether to prevent notification expansion
 */
public void setOnKeyguard(boolean onKeyguard){
  if (onKeyguard != mOnKeyguard) {
    final boolean wasExpanded=isExpanded();
    mOnKeyguard=onKeyguard;
    logExpansionEvent(false,wasExpanded);
    if (wasExpanded != isExpanded()) {
      if (mIsSummaryWithChildren) {
        mChildrenContainer.updateGroupOverflow();
      }
      notifyHeightChanged(false);
    }
  }
}
Program: 193178
Project: 193178
Buggy source:
private void updateNotificationViews(Entry entry,StatusBarNotification sbn){
  final RemoteViews contentView=entry.cachedContentView;
  final RemoteViews bigContentView=entry.cachedBigContentView;
  final RemoteViews headsUpContentView=entry.cachedHeadsUpContentView;
  final RemoteViews publicContentView=entry.cachedPublicContentView;
  contentView.reapply(mContext,entry.getContentView(),mOnClickHandler);
  if (bigContentView != null && entry.getExpandedContentView() != null) {
    bigContentView.reapply(sbn.getPackageContext(mContext),entry.getExpandedContentView(),mOnClickHandler);
  }
  View headsUpChild=entry.getHeadsUpContentView();
  if (headsUpContentView != null && headsUpChild != null) {
    headsUpContentView.reapply(sbn.getPackageContext(mContext),headsUpChild,mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(sbn.getPackageContext(mContext),entry.getPublicContentView(),mOnClickHandler);
  }
  mNotificationClicker.register(entry.row,sbn);
  entry.row.updateStatusBarNotification(entry.notification);
  entry.row.resetHeight();
  applyRemoteInput(entry);
}

Fixed version (ground truth):
private void updateNotificationViews(Entry entry,StatusBarNotification sbn){
  final RemoteViews contentView=entry.cachedContentView;
  final RemoteViews bigContentView=entry.cachedBigContentView;
  final RemoteViews headsUpContentView=entry.cachedHeadsUpContentView;
  final RemoteViews publicContentView=entry.cachedPublicContentView;
  contentView.reapply(mContext,entry.getContentView(),mOnClickHandler);
  if (bigContentView != null && entry.getExpandedContentView() != null) {
    bigContentView.reapply(sbn.getPackageContext(mContext),entry.getExpandedContentView(),mOnClickHandler);
  }
  View headsUpChild=entry.getHeadsUpContentView();
  if (headsUpContentView != null && headsUpChild != null) {
    headsUpContentView.reapply(sbn.getPackageContext(mContext),headsUpChild,mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(sbn.getPackageContext(mContext),entry.getPublicContentView(),mOnClickHandler);
  }
  mNotificationClicker.register(entry.row,sbn);
  entry.row.onNotificationUpdated(entry);
  entry.row.resetHeight();
  applyRemoteInput(entry);
}
Program: 193179
Project: 193179
Buggy source:
private void updateChildrenVisibility(boolean animated){
  if (mChildrenContainer == null) {
    return;
  }
  mChildrenContainer.setVisibility(mIsSummaryWithChildren ? VISIBLE : INVISIBLE);
  mNotificationHeader.setVisibility(mIsSummaryWithChildren ? VISIBLE : INVISIBLE);
  mPrivateLayout.setVisibility(!mIsSummaryWithChildren ? VISIBLE : INVISIBLE);
}

Fixed version (ground truth):
private void updateChildrenVisibility(){
  if (mChildrenContainer == null) {
    return;
  }
  mChildrenContainer.setVisibility(mIsSummaryWithChildren ? VISIBLE : INVISIBLE);
  mNotificationHeader.setVisibility(mIsSummaryWithChildren ? VISIBLE : INVISIBLE);
  mPrivateLayout.setVisibility(!mIsSummaryWithChildren ? VISIBLE : INVISIBLE);
  updateLimits();
}
Program: 193180
Project: 193180
Buggy source:
private void onChildrenCountChanged(){
  mIsSummaryWithChildren=BaseStatusBar.ENABLE_CHILD_NOTIFICATIONS && mGroupManager.hasGroupChildren(mStatusBarNotification);
  if (mIsSummaryWithChildren) {
    if (mChildrenContainer == null) {
      mChildrenContainerStub.inflate();
    }
    if (mNotificationHeader == null) {
      recreateNotificationHeader();
    }
  }
  mPrivateLayout.updateExpandButtons(isExpandable());
  updateChildrenHeaderAppearance();
  updateHeaderChildCount();
  updateChildrenVisibility(true);
}

Fixed version (ground truth):
private void onChildrenCountChanged(){
  mIsSummaryWithChildren=BaseStatusBar.ENABLE_CHILD_NOTIFICATIONS && mGroupManager.hasGroupChildren(mStatusBarNotification);
  if (mIsSummaryWithChildren) {
    if (mChildrenContainer == null) {
      mChildrenContainerStub.inflate();
    }
    if (mNotificationHeader == null) {
      recreateNotificationHeader();
    }
  }
  mPrivateLayout.updateExpandButtons(isExpandable());
  updateChildrenHeaderAppearance();
  updateHeaderChildCount();
  updateChildrenVisibility();
}
Program: 193181
Project: 193181
Buggy source:
public ExpandableNotificationRow(Context context,AttributeSet attrs){
  super(context,attrs);
  mFalsingManager=FalsingManager.getInstance(context);
}

Fixed version (ground truth):
public ExpandableNotificationRow(Context context,AttributeSet attrs){
  super(context,attrs);
  mFalsingManager=FalsingManager.getInstance(context);
  mNotificationMinHeightLegacy=getResources().getDimensionPixelSize(R.dimen.notification_min_height_legacy);
  mNotificationMinHeight=getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  mNotificationMaxHeight=getResources().getDimensionPixelSize(R.dimen.notification_max_height);
}
Program: 193182
Project: 193182
Buggy source:
protected void loadDimens(){
  final Resources res=mContext.getResources();
  mNaturalBarHeight=res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
  mRowMinHeightLegacy=res.getDimensionPixelSize(R.dimen.notification_min_height_legacy);
  mRowMinHeight=res.getDimensionPixelSize(R.dimen.notification_min_height);
  mRowMaxHeight=res.getDimensionPixelSize(R.dimen.notification_max_height);
  mMaxAllowedKeyguardNotifications=res.getInteger(R.integer.keyguard_max_notification_count);
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
}

Fixed version (ground truth):
protected void loadDimens(){
  final Resources res=mContext.getResources();
  mNaturalBarHeight=res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
  mMaxAllowedKeyguardNotifications=res.getInteger(R.integer.keyguard_max_notification_count);
  if (DEBUG)   Log.v(TAG,"String_Node_Str");
}
Program: 193183
Project: 193183
Buggy source:
@Override public void setDark(boolean dark,boolean fade,long delay){
  if (mInvertHelper != null) {
    if (fade) {
      mInvertHelper.fade(dark,delay);
    }
 else {
      mInvertHelper.update(dark);
    }
  }
  if (mIcon != null) {
    if (fade) {
      fadeIconColorFilter(mIcon,dark,delay);
      fadeIconAlpha(mIcon,dark,delay);
    }
 else {
      updateIconColorFilter(mIcon,dark);
      updateIconAlpha(mIcon,dark);
    }
  }
  setPictureGrayscale(dark,fade,delay);
  setProgressBarDark(dark,fade,delay);
}

Fixed version (ground truth):
@Override public void setDark(boolean dark,boolean fade,long delay){
  if (mInvertHelper != null) {
    if (fade) {
      mInvertHelper.fade(dark,delay);
    }
 else {
      mInvertHelper.update(dark);
    }
  }
  if (mIcon != null) {
    boolean hadColorFilter=mNotificationHeader.getOriginalIconColor() != NotificationHeaderView.NO_COLOR;
    if (fade) {
      if (hadColorFilter) {
        fadeIconColorFilter(mIcon,dark,delay);
        fadeIconAlpha(mIcon,dark,delay);
      }
 else {
        fadeGrayscale(mIcon,dark,delay);
      }
    }
 else {
      if (hadColorFilter) {
        updateIconColorFilter(mIcon,dark);
        updateIconAlpha(mIcon,dark);
      }
 else {
        updateGrayscale(mIcon,dark);
      }
    }
  }
  setPictureGrayscale(dark,fade,delay);
  setProgressBarDark(dark,fade,delay);
}
Program: 193184
Project: 193184
Buggy source:
/** 
 * Called by UserManagerService 
 */
void cleanUpUser(UserManagerService userManager,int userHandle){
synchronized (mPackages) {
    mDirtyUsers.remove(userHandle);
    mUserNeedsBadging.delete(userHandle);
    mSettings.removeUserLPw(userHandle);
    mPendingBroadcasts.remove(userHandle);
  }
synchronized (mInstallLock) {
    if (mInstaller != null) {
      final StorageManager storage=mContext.getSystemService(StorageManager.class);
      for (      VolumeInfo vol : storage.getWritablePrivateVolumes()) {
        final String volumeUuid=vol.getFsUuid();
        if (DEBUG_INSTALL)         Slog.d(TAG,"String_Node_Str" + volumeUuid);
        mInstaller.removeUserDataDirs(volumeUuid,userHandle);
      }
    }
synchronized (mPackages) {
      removeUnusedPackagesLILPw(userManager,userHandle);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called by UserManagerService 
 */
void cleanUpUser(UserManagerService userManager,int userHandle){
synchronized (mPackages) {
    mDirtyUsers.remove(userHandle);
    mUserNeedsBadging.delete(userHandle);
    mSettings.removeUserLPw(userHandle);
    mPendingBroadcasts.remove(userHandle);
  }
synchronized (mInstallLock) {
    final StorageManager storage=mContext.getSystemService(StorageManager.class);
    for (    VolumeInfo vol : storage.getWritablePrivateVolumes()) {
      final String volumeUuid=vol.getFsUuid();
      if (DEBUG_INSTALL)       Slog.d(TAG,"String_Node_Str" + volumeUuid);
      mInstaller.removeUserDataDirs(volumeUuid,userHandle);
    }
synchronized (mPackages) {
      removeUnusedPackagesLILPw(userManager,userHandle);
    }
  }
}
Program: 193185
Project: 193185
Buggy source:
/** 
 * Called by UserManagerService 
 */
void createNewUser(int userHandle){
  if (mInstaller != null) {
synchronized (mInstallLock) {
synchronized (mPackages) {
        mInstaller.createUserConfig(userHandle);
        mSettings.createNewUserLILPw(this,mInstaller,userHandle);
      }
    }
synchronized (mPackages) {
      applyFactoryDefaultBrowserLPw(userHandle);
      primeDomainVerificationsLPw(userHandle);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called by UserManagerService 
 */
void createNewUser(int userHandle){
synchronized (mInstallLock) {
    mInstaller.createUserConfig(userHandle);
    mSettings.createNewUserLI(this,mInstaller,userHandle);
  }
synchronized (mPackages) {
    applyFactoryDefaultBrowserLPw(userHandle);
    primeDomainVerificationsLPw(userHandle);
  }
}
Program: 193186
Project: 193186
Buggy source:
/** 
 * Called by UserManagerService 
 */
void cleanUpUser(UserManagerService userManager,int userHandle){
synchronized (mPackages) {
    mDirtyUsers.remove(userHandle);
    mUserNeedsBadging.delete(userHandle);
    mSettings.removeUserLPw(userHandle);
    mPendingBroadcasts.remove(userHandle);
  }
synchronized (mInstallLock) {
    if (mInstaller != null) {
      final StorageManager storage=mContext.getSystemService(StorageManager.class);
      for (      VolumeInfo vol : storage.getWritablePrivateVolumes()) {
        final String volumeUuid=vol.getFsUuid();
        if (DEBUG_INSTALL)         Slog.d(TAG,"String_Node_Str" + volumeUuid);
        mInstaller.removeUserDataDirs(volumeUuid,userHandle);
      }
    }
synchronized (mPackages) {
      removeUnusedPackagesLILPw(userManager,userHandle);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called by UserManagerService 
 */
void cleanUpUser(UserManagerService userManager,int userHandle){
synchronized (mPackages) {
    mDirtyUsers.remove(userHandle);
    mUserNeedsBadging.delete(userHandle);
    mSettings.removeUserLPw(userHandle);
    mPendingBroadcasts.remove(userHandle);
  }
synchronized (mInstallLock) {
    final StorageManager storage=mContext.getSystemService(StorageManager.class);
    for (    VolumeInfo vol : storage.getWritablePrivateVolumes()) {
      final String volumeUuid=vol.getFsUuid();
      if (DEBUG_INSTALL)       Slog.d(TAG,"String_Node_Str" + volumeUuid);
      mInstaller.removeUserDataDirs(volumeUuid,userHandle);
    }
synchronized (mPackages) {
      removeUnusedPackagesLILPw(userManager,userHandle);
    }
  }
}
Program: 193187
Project: 193187
Buggy source:
/** 
 * Called by UserManagerService 
 */
void createNewUser(int userHandle){
  if (mInstaller != null) {
synchronized (mInstallLock) {
synchronized (mPackages) {
        mInstaller.createUserConfig(userHandle);
        mSettings.createNewUserLILPw(this,mInstaller,userHandle);
      }
    }
synchronized (mPackages) {
      applyFactoryDefaultBrowserLPw(userHandle);
      primeDomainVerificationsLPw(userHandle);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called by UserManagerService 
 */
void createNewUser(int userHandle){
synchronized (mInstallLock) {
    mInstaller.createUserConfig(userHandle);
    mSettings.createNewUserLI(this,mInstaller,userHandle);
  }
synchronized (mPackages) {
    applyFactoryDefaultBrowserLPw(userHandle);
    primeDomainVerificationsLPw(userHandle);
  }
}
Program: 193188
Project: 193188
Buggy source:
/** 
 * Called when the panel was layouted expanded for the first time after being collapsed.
 */
public void onPanelExpandedAndLayouted(){
  if (mState == StatusBarState.KEYGUARD) {
    updateRowStates();
  }
}

Fixed version (ground truth):
/** 
 * Called when the panel was layouted expanded for the first time after being collapsed.
 */
public void onPanelExpandedAndLayouted(){
  if (mState == StatusBarState.KEYGUARD) {
    updateRowStates();
    mStackScroller.onHeightChanged(null,false);
  }
}
Program: 193189
Project: 193189
Buggy source:
/** 
 * Updates the configuration based on the current state of the system
 */
void update(Context context,SystemServicesProxy ssp,Rect windowRect){
  lockToAppEnabled=!ssp.hasFreeformWorkspaceSupport() && ssp.getSystemSetting(context,Settings.System.LOCK_TO_APP_ENABLED) != 0;
  hasDockedTasks=ssp.hasDockedTask();
  boolean isLandscape=windowRect.width() > windowRect.height();
  hasTransposedNavBar=isLandscape && isLargeScreen && !isXLargeScreen;
  hasTransposedSearchBar=isLandscape && isLargeScreen && !isXLargeScreen;
}

Fixed version (ground truth):
/** 
 * Updates the configuration based on the current state of the system
 */
void update(Context context,SystemServicesProxy ssp,Rect windowRect){
  lockToAppEnabled=!ssp.hasFreeformWorkspaceSupport() && ssp.getSystemSetting(context,Settings.System.LOCK_TO_APP_ENABLED) != 0;
  boolean isLandscape=windowRect.width() > windowRect.height();
  hasTransposedNavBar=isLandscape && isLargeScreen && !isXLargeScreen;
  hasTransposedSearchBar=isLandscape && isLargeScreen && !isXLargeScreen;
}
Program: 193190
Project: 193190
Buggy source:
/** 
 * Updates the configuration based on the current state of the system
 */
void update(Context context,SystemServicesProxy ssp,Rect windowRect){
  lockToAppEnabled=!ssp.hasFreeformWorkspaceSupport() && ssp.getSystemSetting(context,Settings.System.LOCK_TO_APP_ENABLED) != 0;
  hasDockedTasks=ssp.hasDockedTask();
  boolean isLandscape=windowRect.width() > windowRect.height();
  hasTransposedNavBar=isLandscape && isLargeScreen && !isXLargeScreen;
  hasTransposedSearchBar=isLandscape && isLargeScreen && !isXLargeScreen;
}

Fixed version (ground truth):
/** 
 * Updates the configuration based on the current state of the system
 */
void update(Context context,SystemServicesProxy ssp,Rect windowRect){
  lockToAppEnabled=!ssp.hasFreeformWorkspaceSupport() && ssp.getSystemSetting(context,Settings.System.LOCK_TO_APP_ENABLED) != 0;
  boolean isLandscape=windowRect.width() > windowRect.height();
  hasTransposedNavBar=isLandscape && isLargeScreen && !isXLargeScreen;
  hasTransposedSearchBar=isLandscape && isLargeScreen && !isXLargeScreen;
}
Program: 193191
Project: 193191
Buggy source:
public void updateStatusBarNotification(StatusBarNotification statusBarNotification){
  mStatusBarNotification=statusBarNotification;
  mPrivateLayout.onNotificationUpdated(statusBarNotification);
  mPublicLayout.onNotificationUpdated(statusBarNotification);
  updateVetoButton();
  if (mIsSummaryWithChildren) {
    recreateNotificationHeader();
  }
  onChildrenCountChanged();
}

Fixed version (ground truth):
public void updateStatusBarNotification(StatusBarNotification statusBarNotification){
  mStatusBarNotification=statusBarNotification;
  mPrivateLayout.onNotificationUpdated(statusBarNotification);
  mPublicLayout.onNotificationUpdated(statusBarNotification);
  updateVetoButton();
  if (mIsSummaryWithChildren) {
    recreateNotificationHeader();
  }
  if (mIconAnimationRunning) {
    setIconAnimationRunning(true);
  }
  onChildrenCountChanged();
}
Program: 193192
Project: 193192
Buggy source:
@Override public boolean onTouchEvent(MotionEvent event){
  if (!mDraggingDown) {
    return false;
  }
  final float x=event.getX();
  final float y=event.getY();
switch (event.getActionMasked()) {
case MotionEvent.ACTION_MOVE:
    mLastHeight=y - mInitialTouchY;
  captureStartingChild(mInitialTouchX,mInitialTouchY);
if (mStartingChild != null) {
  handleExpansion(mLastHeight,mStartingChild);
}
 else {
  mDragDownCallback.setEmptyDragAmount(mLastHeight);
}
if (mLastHeight > mMinDragDistance) {
if (!mDraggedFarEnough) {
  mDraggedFarEnough=true;
  mDragDownCallback.onThresholdReached();
}
}
 else {
if (mDraggedFarEnough) {
  mDraggedFarEnough=false;
  mDragDownCallback.onDragDownReset();
}
}
return true;
case MotionEvent.ACTION_UP:
if (!isFalseTouch() && mDragDownCallback.onDraggedDown(mStartingChild,(int)(y - mInitialTouchY))) {
if (mStartingChild == null) {
mDragDownCallback.setEmptyDragAmount(0f);
}
 else {
mCallback.setUserLockedChild(mStartingChild,false);
}
mDraggingDown=false;
}
 else {
stopDragging();
return false;
}
break;
case MotionEvent.ACTION_CANCEL:
stopDragging();
return false;
}
return false;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent event){
  if (!mDraggingDown) {
    return false;
  }
  final float x=event.getX();
  final float y=event.getY();
switch (event.getActionMasked()) {
case MotionEvent.ACTION_MOVE:
    mLastHeight=y - mInitialTouchY;
  captureStartingChild(mInitialTouchX,mInitialTouchY);
if (mStartingChild != null) {
  handleExpansion(mLastHeight,mStartingChild);
}
 else {
  mDragDownCallback.setEmptyDragAmount(mLastHeight);
}
if (mLastHeight > mMinDragDistance) {
if (!mDraggedFarEnough) {
  mDraggedFarEnough=true;
  mDragDownCallback.onCrossedThreshold(true);
}
}
 else {
if (mDraggedFarEnough) {
  mDraggedFarEnough=false;
  mDragDownCallback.onCrossedThreshold(false);
}
}
return true;
case MotionEvent.ACTION_UP:
if (!isFalseTouch() && mDragDownCallback.onDraggedDown(mStartingChild,(int)(y - mInitialTouchY))) {
if (mStartingChild == null) {
mDragDownCallback.setEmptyDragAmount(0f);
}
 else {
mCallback.setUserLockedChild(mStartingChild,false);
}
mDraggingDown=false;
}
 else {
stopDragging();
return false;
}
break;
case MotionEvent.ACTION_CANCEL:
stopDragging();
return false;
}
return false;
}
Program: 193193
Project: 193193
Buggy source:
@Override public void onDragDownReset(){
  mStackScroller.setDimmed(true,true);
}

Fixed version (ground truth):
@Override public void onDragDownReset(){
  mStackScroller.setDimmed(true,true);
  mStackScroller.resetScrollPosition();
}
Program: 193194
Project: 193194
Buggy source:
private boolean isGlobalOrSecureSettingRestrictedForUser(String setting,int userId){
  String restriction=sSettingToUserRestrictionMap.get(setting);
  if (restriction == null) {
    return false;
  }
  return mUserManager.hasUserRestriction(restriction,new UserHandle(userId));
}

Fixed version (ground truth):
/** 
 * Checks whether changing a setting to a value is prohibited by the corresponding user restriction. <p>See also   {@link com.android.server.pm.UserRestrictionsUtils#applyUserRestrictionLR}, which should be in sync with this method.
 * @return true if the change is prohibited, false if the change is allowed.
 */
private boolean isGlobalOrSecureSettingRestrictedForUser(String setting,int userId,String value){
  String restriction;
switch (setting) {
case Settings.Secure.LOCATION_MODE:
    if (String.valueOf(Settings.Secure.LOCATION_MODE_OFF).equals(value))     return false;
  restriction=UserManager.DISALLOW_SHARE_LOCATION;
break;
case Settings.Secure.LOCATION_PROVIDERS_ALLOWED:
if (value != null && value.startsWith("String_Node_Str")) return false;
restriction=UserManager.DISALLOW_SHARE_LOCATION;
break;
case Settings.Secure.INSTALL_NON_MARKET_APPS:
if ("String_Node_Str".equals(value)) return false;
restriction=UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES;
break;
case Settings.Global.ADB_ENABLED:
if ("String_Node_Str".equals(value)) return false;
restriction=UserManager.DISALLOW_DEBUGGING_FEATURES;
break;
case Settings.Global.PACKAGE_VERIFIER_ENABLE:
case Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB:
if ("String_Node_Str".equals(value)) return false;
restriction=UserManager.ENSURE_VERIFY_APPS;
break;
case Settings.Global.PREFERRED_NETWORK_MODE:
restriction=UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS;
break;
default :
return false;
}
return mUserManager.hasUserRestriction(restriction,UserHandle.of(userId));
}
Program: 193195
Project: 193195
Buggy source:
private boolean mutateSecureSetting(String name,String value,int requestingUserId,int operation){
  enforceWritePermission(Manifest.permission.WRITE_SECURE_SETTINGS);
  final int callingUserId=resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
  if (isGlobalOrSecureSettingRestrictedForUser(name,callingUserId)) {
    return false;
  }
  final int owningUserId=resolveOwningUserIdForSecureSettingLocked(callingUserId,name);
  if (owningUserId != callingUserId) {
    return false;
  }
  if (Settings.Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) {
    return updateLocationProvidersAllowedLocked(value,owningUserId);
  }
synchronized (mLock) {
switch (operation) {
case MUTATION_OPERATION_INSERT:
{
        return mSettingsRegistry.insertSettingLocked(SettingsRegistry.SETTINGS_TYPE_SECURE,owningUserId,name,value,getCallingPackage());
      }
case MUTATION_OPERATION_DELETE:
{
      return mSettingsRegistry.deleteSettingLocked(SettingsRegistry.SETTINGS_TYPE_SECURE,owningUserId,name);
    }
case MUTATION_OPERATION_UPDATE:
{
    return mSettingsRegistry.updateSettingLocked(SettingsRegistry.SETTINGS_TYPE_SECURE,owningUserId,name,value,getCallingPackage());
  }
}
}
return false;
}

Fixed version (ground truth):
private boolean mutateSecureSetting(String name,String value,int requestingUserId,int operation){
  enforceWritePermission(Manifest.permission.WRITE_SECURE_SETTINGS);
  final int callingUserId=resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
  if (isGlobalOrSecureSettingRestrictedForUser(name,callingUserId,value)) {
    return false;
  }
  final int owningUserId=resolveOwningUserIdForSecureSettingLocked(callingUserId,name);
  if (owningUserId != callingUserId) {
    return false;
  }
  if (Settings.Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) {
    return updateLocationProvidersAllowedLocked(value,owningUserId);
  }
synchronized (mLock) {
switch (operation) {
case MUTATION_OPERATION_INSERT:
{
        return mSettingsRegistry.insertSettingLocked(SettingsRegistry.SETTINGS_TYPE_SECURE,owningUserId,name,value,getCallingPackage());
      }
case MUTATION_OPERATION_DELETE:
{
      return mSettingsRegistry.deleteSettingLocked(SettingsRegistry.SETTINGS_TYPE_SECURE,owningUserId,name);
    }
case MUTATION_OPERATION_UPDATE:
{
    return mSettingsRegistry.updateSettingLocked(SettingsRegistry.SETTINGS_TYPE_SECURE,owningUserId,name,value,getCallingPackage());
  }
}
}
return false;
}
Program: 193196
Project: 193196
Buggy source:
private boolean mutateGlobalSetting(String name,String value,int requestingUserId,int operation){
  enforceWritePermission(Manifest.permission.WRITE_SECURE_SETTINGS);
  final int callingUserId=resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
  if (isGlobalOrSecureSettingRestrictedForUser(name,callingUserId)) {
    return false;
  }
synchronized (mLock) {
switch (operation) {
case MUTATION_OPERATION_INSERT:
{
        return mSettingsRegistry.insertSettingLocked(SettingsRegistry.SETTINGS_TYPE_GLOBAL,UserHandle.USER_SYSTEM,name,value,getCallingPackage());
      }
case MUTATION_OPERATION_DELETE:
{
      return mSettingsRegistry.deleteSettingLocked(SettingsRegistry.SETTINGS_TYPE_GLOBAL,UserHandle.USER_SYSTEM,name);
    }
case MUTATION_OPERATION_UPDATE:
{
    return mSettingsRegistry.updateSettingLocked(SettingsRegistry.SETTINGS_TYPE_GLOBAL,UserHandle.USER_SYSTEM,name,value,getCallingPackage());
  }
}
}
return false;
}

Fixed version (ground truth):
private boolean mutateGlobalSetting(String name,String value,int requestingUserId,int operation){
  enforceWritePermission(Manifest.permission.WRITE_SECURE_SETTINGS);
  final int callingUserId=resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
  if (isGlobalOrSecureSettingRestrictedForUser(name,callingUserId,value)) {
    return false;
  }
synchronized (mLock) {
switch (operation) {
case MUTATION_OPERATION_INSERT:
{
        return mSettingsRegistry.insertSettingLocked(SettingsRegistry.SETTINGS_TYPE_GLOBAL,UserHandle.USER_SYSTEM,name,value,getCallingPackage());
      }
case MUTATION_OPERATION_DELETE:
{
      return mSettingsRegistry.deleteSettingLocked(SettingsRegistry.SETTINGS_TYPE_GLOBAL,UserHandle.USER_SYSTEM,name);
    }
case MUTATION_OPERATION_UPDATE:
{
    return mSettingsRegistry.updateSettingLocked(SettingsRegistry.SETTINGS_TYPE_GLOBAL,UserHandle.USER_SYSTEM,name,value,getCallingPackage());
  }
}
}
return false;
}
Program: 193200
Project: 193200
Buggy source:
private boolean isGlobalOrSecureSettingRestrictedForUser(String setting,int userId){
  String restriction=sSettingToUserRestrictionMap.get(setting);
  if (restriction == null) {
    return false;
  }
  return mUserManager.hasUserRestriction(restriction,new UserHandle(userId));
}

Fixed version (ground truth):
/** 
 * Checks whether changing a setting to a value is prohibited by the corresponding user restriction. <p>See also   {@link com.android.server.pm.UserRestrictionsUtils#applyUserRestrictionLR}, which should be in sync with this method.
 * @return true if the change is prohibited, false if the change is allowed.
 */
private boolean isGlobalOrSecureSettingRestrictedForUser(String setting,int userId,String value){
  String restriction;
switch (setting) {
case Settings.Secure.LOCATION_MODE:
    if (String.valueOf(Settings.Secure.LOCATION_MODE_OFF).equals(value))     return false;
  restriction=UserManager.DISALLOW_SHARE_LOCATION;
break;
case Settings.Secure.LOCATION_PROVIDERS_ALLOWED:
if (value != null && value.startsWith("String_Node_Str")) return false;
restriction=UserManager.DISALLOW_SHARE_LOCATION;
break;
case Settings.Secure.INSTALL_NON_MARKET_APPS:
if ("String_Node_Str".equals(value)) return false;
restriction=UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES;
break;
case Settings.Global.ADB_ENABLED:
if ("String_Node_Str".equals(value)) return false;
restriction=UserManager.DISALLOW_DEBUGGING_FEATURES;
break;
case Settings.Global.PACKAGE_VERIFIER_ENABLE:
case Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB:
if ("String_Node_Str".equals(value)) return false;
restriction=UserManager.ENSURE_VERIFY_APPS;
break;
case Settings.Global.PREFERRED_NETWORK_MODE:
restriction=UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS;
break;
default :
return false;
}
return mUserManager.hasUserRestriction(restriction,UserHandle.of(userId));
}
Program: 193201
Project: 193201
Buggy source:
private boolean mutateSecureSetting(String name,String value,int requestingUserId,int operation){
  enforceWritePermission(Manifest.permission.WRITE_SECURE_SETTINGS);
  final int callingUserId=resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
  if (isGlobalOrSecureSettingRestrictedForUser(name,callingUserId)) {
    return false;
  }
  final int owningUserId=resolveOwningUserIdForSecureSettingLocked(callingUserId,name);
  if (owningUserId != callingUserId) {
    return false;
  }
  if (Settings.Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) {
    return updateLocationProvidersAllowedLocked(value,owningUserId);
  }
synchronized (mLock) {
switch (operation) {
case MUTATION_OPERATION_INSERT:
{
        return mSettingsRegistry.insertSettingLocked(SettingsRegistry.SETTINGS_TYPE_SECURE,owningUserId,name,value,getCallingPackage());
      }
case MUTATION_OPERATION_DELETE:
{
      return mSettingsRegistry.deleteSettingLocked(SettingsRegistry.SETTINGS_TYPE_SECURE,owningUserId,name);
    }
case MUTATION_OPERATION_UPDATE:
{
    return mSettingsRegistry.updateSettingLocked(SettingsRegistry.SETTINGS_TYPE_SECURE,owningUserId,name,value,getCallingPackage());
  }
}
}
return false;
}

Fixed version (ground truth):
private boolean mutateSecureSetting(String name,String value,int requestingUserId,int operation){
  enforceWritePermission(Manifest.permission.WRITE_SECURE_SETTINGS);
  final int callingUserId=resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
  if (isGlobalOrSecureSettingRestrictedForUser(name,callingUserId,value)) {
    return false;
  }
  final int owningUserId=resolveOwningUserIdForSecureSettingLocked(callingUserId,name);
  if (owningUserId != callingUserId) {
    return false;
  }
  if (Settings.Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) {
    return updateLocationProvidersAllowedLocked(value,owningUserId);
  }
synchronized (mLock) {
switch (operation) {
case MUTATION_OPERATION_INSERT:
{
        return mSettingsRegistry.insertSettingLocked(SettingsRegistry.SETTINGS_TYPE_SECURE,owningUserId,name,value,getCallingPackage());
      }
case MUTATION_OPERATION_DELETE:
{
      return mSettingsRegistry.deleteSettingLocked(SettingsRegistry.SETTINGS_TYPE_SECURE,owningUserId,name);
    }
case MUTATION_OPERATION_UPDATE:
{
    return mSettingsRegistry.updateSettingLocked(SettingsRegistry.SETTINGS_TYPE_SECURE,owningUserId,name,value,getCallingPackage());
  }
}
}
return false;
}
Program: 193202
Project: 193202
Buggy source:
private boolean mutateGlobalSetting(String name,String value,int requestingUserId,int operation){
  enforceWritePermission(Manifest.permission.WRITE_SECURE_SETTINGS);
  final int callingUserId=resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
  if (isGlobalOrSecureSettingRestrictedForUser(name,callingUserId)) {
    return false;
  }
synchronized (mLock) {
switch (operation) {
case MUTATION_OPERATION_INSERT:
{
        return mSettingsRegistry.insertSettingLocked(SettingsRegistry.SETTINGS_TYPE_GLOBAL,UserHandle.USER_SYSTEM,name,value,getCallingPackage());
      }
case MUTATION_OPERATION_DELETE:
{
      return mSettingsRegistry.deleteSettingLocked(SettingsRegistry.SETTINGS_TYPE_GLOBAL,UserHandle.USER_SYSTEM,name);
    }
case MUTATION_OPERATION_UPDATE:
{
    return mSettingsRegistry.updateSettingLocked(SettingsRegistry.SETTINGS_TYPE_GLOBAL,UserHandle.USER_SYSTEM,name,value,getCallingPackage());
  }
}
}
return false;
}

Fixed version (ground truth):
private boolean mutateGlobalSetting(String name,String value,int requestingUserId,int operation){
  enforceWritePermission(Manifest.permission.WRITE_SECURE_SETTINGS);
  final int callingUserId=resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
  if (isGlobalOrSecureSettingRestrictedForUser(name,callingUserId,value)) {
    return false;
  }
synchronized (mLock) {
switch (operation) {
case MUTATION_OPERATION_INSERT:
{
        return mSettingsRegistry.insertSettingLocked(SettingsRegistry.SETTINGS_TYPE_GLOBAL,UserHandle.USER_SYSTEM,name,value,getCallingPackage());
      }
case MUTATION_OPERATION_DELETE:
{
      return mSettingsRegistry.deleteSettingLocked(SettingsRegistry.SETTINGS_TYPE_GLOBAL,UserHandle.USER_SYSTEM,name);
    }
case MUTATION_OPERATION_UPDATE:
{
    return mSettingsRegistry.updateSettingLocked(SettingsRegistry.SETTINGS_TYPE_GLOBAL,UserHandle.USER_SYSTEM,name,value,getCallingPackage());
  }
}
}
return false;
}
Program: 193204
Project: 193204
Buggy source:
@Override public void onUidIdle(int uid) throws RemoteException {
  removeForStoppedLocked(uid);
}

Fixed version (ground truth):
@Override public void onUidIdle(int uid) throws RemoteException {
synchronized (mLock) {
    removeForStoppedLocked(uid);
  }
}
Program: 193205
Project: 193205
Buggy source:
@Override public void onUidIdle(int uid) throws RemoteException {
  removeForStoppedLocked(uid);
}

Fixed version (ground truth):
@Override public void onUidIdle(int uid) throws RemoteException {
synchronized (mLock) {
    removeForStoppedLocked(uid);
  }
}
Program: 193207
Project: 193207
Buggy source:
VoiceInteractionManagerServiceImpl(Context context,Handler handler,Object lock,int userHandle,ComponentName service){
  mContext=context;
  mHandler=handler;
  mLock=lock;
  mUser=userHandle;
  mComponent=service;
  mAm=ActivityManagerNative.getDefault();
  VoiceInteractionServiceInfo info;
  try {
    info=new VoiceInteractionServiceInfo(context.getPackageManager(),service,mUser);
  }
 catch (  RemoteException|PackageManager.NameNotFoundException e) {
    Slog.w(TAG,"String_Node_Str" + service,e);
    mInfo=null;
    mSessionComponentName=null;
    mIWindowManager=null;
    mValid=false;
    return;
  }
  mInfo=info;
  if (mInfo.getParseError() != null) {
    Slog.w(TAG,"String_Node_Str" + mInfo.getParseError());
    mSessionComponentName=null;
    mIWindowManager=null;
    mValid=false;
    return;
  }
  mValid=true;
  mSessionComponentName=new ComponentName(service.getPackageName(),mInfo.getSessionService());
  mIWindowManager=IWindowManager.Stub.asInterface(ServiceManager.getService(Context.WINDOW_SERVICE));
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
  mContext.registerReceiver(mBroadcastReceiver,filter,null,handler);
}

Fixed version (ground truth):
VoiceInteractionManagerServiceImpl(Context context,Handler handler,Object lock,int userHandle,ComponentName service){
  mContext=context;
  mHandler=handler;
  mLock=lock;
  mUser=userHandle;
  mComponent=service;
  mAm=ActivityManagerNative.getDefault();
  VoiceInteractionServiceInfo info;
  try {
    info=new VoiceInteractionServiceInfo(context.getPackageManager(),service,mUser);
  }
 catch (  PackageManager.NameNotFoundException e) {
    Slog.w(TAG,"String_Node_Str" + service,e);
    mInfo=null;
    mSessionComponentName=null;
    mIWindowManager=null;
    mValid=false;
    return;
  }
  mInfo=info;
  if (mInfo.getParseError() != null) {
    Slog.w(TAG,"String_Node_Str" + mInfo.getParseError());
    mSessionComponentName=null;
    mIWindowManager=null;
    mValid=false;
    return;
  }
  mValid=true;
  mSessionComponentName=new ComponentName(service.getPackageName(),mInfo.getSessionService());
  mIWindowManager=IWindowManager.Stub.asInterface(ServiceManager.getService(Context.WINDOW_SERVICE));
  IntentFilter filter=new IntentFilter();
  filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
  mContext.registerReceiver(mBroadcastReceiver,filter,null,handler);
}