nus-yam/ex-repair huggingface dataset:
Program: 191086
Project: 191086
Buggy source:
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
    mStatusBarWindowManager.setForceStatusBarVisible(true);
    if (mNotificationPanel.isFullyCollapsed()) {
      mNotificationPanel.requestLayout();
      mStatusBarWindowManager.setForceWindowCollapsed(true);
      mNotificationPanel.post(new Runnable(){
        @Override public void run(){
          mStatusBarWindowManager.setForceWindowCollapsed(false);
        }
      }
);
    }
  }
 else {
    if (!mNotificationPanel.isFullyCollapsed() || mNotificationPanel.isTracking()) {
      mStatusBarWindowManager.setHeadsUpShowing(false);
    }
 else {
      mHeadsUpManager.setHeadsUpGoingAway(true);
      mStackScroller.runAfterAnimationFinished(new Runnable(){
        @Override public void run(){
          if (!mHeadsUpManager.hasPinnedHeadsUp()) {
            mStatusBarWindowManager.setHeadsUpShowing(false);
            mHeadsUpManager.setHeadsUpGoingAway(false);
          }
        }
      }
);
    }
  }
}

Fixed version (ground truth):
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
    mStatusBarWindowManager.setForceStatusBarVisible(true);
    if (mNotificationPanel.isFullyCollapsed()) {
      mNotificationPanel.requestLayout();
      mStatusBarWindowManager.setForceWindowCollapsed(true);
      mNotificationPanel.post(new Runnable(){
        @Override public void run(){
          mStatusBarWindowManager.setForceWindowCollapsed(false);
        }
      }
);
    }
  }
 else {
    if (!mNotificationPanel.isFullyCollapsed() || mNotificationPanel.isTracking()) {
      mStatusBarWindowManager.setHeadsUpShowing(false);
    }
 else {
      mHeadsUpManager.setHeadsUpGoingAway(true);
      mStackScroller.runAfterAnimationFinished(new Runnable(){
        @Override public void run(){
          if (!mHeadsUpManager.hasPinnedHeadsUp()) {
            mStatusBarWindowManager.setHeadsUpShowing(false);
            mHeadsUpManager.setHeadsUpGoingAway(false);
          }
          removeRemoteInputEntriesKeptUntilCollapsed();
        }
      }
);
    }
  }
}
Program: 191088
Project: 191088
Buggy source:
public boolean isActive(){
  return mEditText.isFocused();
}

Fixed version (ground truth):
public boolean isActive(){
  return mEditText.isFocused() && mEditText.isEnabled();
}
Program: 191089
Project: 191089
Buggy source:
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
    mStatusBarWindowManager.setForceStatusBarVisible(true);
    if (mNotificationPanel.isFullyCollapsed()) {
      mNotificationPanel.requestLayout();
      mStatusBarWindowManager.setForceWindowCollapsed(true);
      mNotificationPanel.post(new Runnable(){
        @Override public void run(){
          mStatusBarWindowManager.setForceWindowCollapsed(false);
        }
      }
);
    }
  }
 else {
    if (!mNotificationPanel.isFullyCollapsed() || mNotificationPanel.isTracking()) {
      mStatusBarWindowManager.setHeadsUpShowing(false);
    }
 else {
      mHeadsUpManager.setHeadsUpGoingAway(true);
      mStackScroller.runAfterAnimationFinished(new Runnable(){
        @Override public void run(){
          if (!mHeadsUpManager.hasPinnedHeadsUp()) {
            mStatusBarWindowManager.setHeadsUpShowing(false);
            mHeadsUpManager.setHeadsUpGoingAway(false);
          }
        }
      }
);
    }
  }
}

Fixed version (ground truth):
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
    mStatusBarWindowManager.setForceStatusBarVisible(true);
    if (mNotificationPanel.isFullyCollapsed()) {
      mNotificationPanel.requestLayout();
      mStatusBarWindowManager.setForceWindowCollapsed(true);
      mNotificationPanel.post(new Runnable(){
        @Override public void run(){
          mStatusBarWindowManager.setForceWindowCollapsed(false);
        }
      }
);
    }
  }
 else {
    if (!mNotificationPanel.isFullyCollapsed() || mNotificationPanel.isTracking()) {
      mStatusBarWindowManager.setHeadsUpShowing(false);
    }
 else {
      mHeadsUpManager.setHeadsUpGoingAway(true);
      mStackScroller.runAfterAnimationFinished(new Runnable(){
        @Override public void run(){
          if (!mHeadsUpManager.hasPinnedHeadsUp()) {
            mStatusBarWindowManager.setHeadsUpShowing(false);
            mHeadsUpManager.setHeadsUpGoingAway(false);
          }
          removeRemoteInputEntriesKeptUntilCollapsed();
        }
      }
);
    }
  }
}
Program: 191091
Project: 191091
Buggy source:
public boolean isActive(){
  return mEditText.isFocused();
}

Fixed version (ground truth):
public boolean isActive(){
  return mEditText.isFocused() && mEditText.isEnabled();
}
Program: 191092
Project: 191092
Buggy source:
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
    mStatusBarWindowManager.setForceStatusBarVisible(true);
    if (mNotificationPanel.isFullyCollapsed()) {
      mNotificationPanel.requestLayout();
      mStatusBarWindowManager.setForceWindowCollapsed(true);
      mNotificationPanel.post(new Runnable(){
        @Override public void run(){
          mStatusBarWindowManager.setForceWindowCollapsed(false);
        }
      }
);
    }
  }
 else {
    if (!mNotificationPanel.isFullyCollapsed() || mNotificationPanel.isTracking()) {
      mStatusBarWindowManager.setHeadsUpShowing(false);
    }
 else {
      mHeadsUpManager.setHeadsUpGoingAway(true);
      mStackScroller.runAfterAnimationFinished(new Runnable(){
        @Override public void run(){
          if (!mHeadsUpManager.hasPinnedHeadsUp()) {
            mStatusBarWindowManager.setHeadsUpShowing(false);
            mHeadsUpManager.setHeadsUpGoingAway(false);
          }
        }
      }
);
    }
  }
}

Fixed version (ground truth):
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
    mStatusBarWindowManager.setForceStatusBarVisible(true);
    if (mNotificationPanel.isFullyCollapsed()) {
      mNotificationPanel.requestLayout();
      mStatusBarWindowManager.setForceWindowCollapsed(true);
      mNotificationPanel.post(new Runnable(){
        @Override public void run(){
          mStatusBarWindowManager.setForceWindowCollapsed(false);
        }
      }
);
    }
  }
 else {
    if (!mNotificationPanel.isFullyCollapsed() || mNotificationPanel.isTracking()) {
      mStatusBarWindowManager.setHeadsUpShowing(false);
    }
 else {
      mHeadsUpManager.setHeadsUpGoingAway(true);
      mStackScroller.runAfterAnimationFinished(new Runnable(){
        @Override public void run(){
          if (!mHeadsUpManager.hasPinnedHeadsUp()) {
            mStatusBarWindowManager.setHeadsUpShowing(false);
            mHeadsUpManager.setHeadsUpGoingAway(false);
          }
          removeRemoteInputEntriesKeptUntilCollapsed();
        }
      }
);
    }
  }
}
Program: 191094
Project: 191094
Buggy source:
public boolean isActive(){
  return mEditText.isFocused();
}

Fixed version (ground truth):
public boolean isActive(){
  return mEditText.isFocused() && mEditText.isEnabled();
}
Program: 191095
Project: 191095
Buggy source:
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
    mStatusBarWindowManager.setForceStatusBarVisible(true);
    if (mNotificationPanel.isFullyCollapsed()) {
      mNotificationPanel.requestLayout();
      mStatusBarWindowManager.setForceWindowCollapsed(true);
      mNotificationPanel.post(new Runnable(){
        @Override public void run(){
          mStatusBarWindowManager.setForceWindowCollapsed(false);
        }
      }
);
    }
  }
 else {
    if (!mNotificationPanel.isFullyCollapsed() || mNotificationPanel.isTracking()) {
      mStatusBarWindowManager.setHeadsUpShowing(false);
    }
 else {
      mHeadsUpManager.setHeadsUpGoingAway(true);
      mStackScroller.runAfterAnimationFinished(new Runnable(){
        @Override public void run(){
          if (!mHeadsUpManager.hasPinnedHeadsUp()) {
            mStatusBarWindowManager.setHeadsUpShowing(false);
            mHeadsUpManager.setHeadsUpGoingAway(false);
          }
        }
      }
);
    }
  }
}

Fixed version (ground truth):
@Override public void onHeadsUpPinnedModeChanged(boolean inPinnedMode){
  if (inPinnedMode) {
    mStatusBarWindowManager.setHeadsUpShowing(true);
    mStatusBarWindowManager.setForceStatusBarVisible(true);
    if (mNotificationPanel.isFullyCollapsed()) {
      mNotificationPanel.requestLayout();
      mStatusBarWindowManager.setForceWindowCollapsed(true);
      mNotificationPanel.post(new Runnable(){
        @Override public void run(){
          mStatusBarWindowManager.setForceWindowCollapsed(false);
        }
      }
);
    }
  }
 else {
    if (!mNotificationPanel.isFullyCollapsed() || mNotificationPanel.isTracking()) {
      mStatusBarWindowManager.setHeadsUpShowing(false);
    }
 else {
      mHeadsUpManager.setHeadsUpGoingAway(true);
      mStackScroller.runAfterAnimationFinished(new Runnable(){
        @Override public void run(){
          if (!mHeadsUpManager.hasPinnedHeadsUp()) {
            mStatusBarWindowManager.setHeadsUpShowing(false);
            mHeadsUpManager.setHeadsUpGoingAway(false);
          }
          removeRemoteInputEntriesKeptUntilCollapsed();
        }
      }
);
    }
  }
}
Program: 191097
Project: 191097
Buggy source:
public boolean isActive(){
  return mEditText.isFocused();
}

Fixed version (ground truth):
public boolean isActive(){
  return mEditText.isFocused() && mEditText.isEnabled();
}
Program: 191098
Project: 191098
Buggy source:
public int getSlotIndex(String slot){
  final int N=mSlots.size();
  for (int i=0; i < N; i++) {
    if (slot.equals(mSlots.get(i))) {
      return i;
    }
  }
  mSlots.add(0,slot);
  mIcons.add(0,null);
  return 0;
}

Fixed version (ground truth):
public int getSlotIndex(String slot){
  final int N=mSlots.size();
  for (int i=0; i < N; i++) {
    if (slot.equals(mSlots.get(i))) {
      return i;
    }
  }
  mSlots.add(slot);
  mIcons.add(null);
  return N;
}
Program: 191099
Project: 191099
Buggy source:
protected List<String> loadTileSpecs(Context context,String tileList){
  final Resources res=context.getResources();
  final String defaultTileList=res.getString(R.string.quick_settings_tiles_default);
  if (tileList == null) {
    tileList=res.getString(R.string.quick_settings_tiles);
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + tileList);
  }
 else {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + tileList);
  }
  final ArrayList<String> tiles=new ArrayList<String>();
  boolean addedDefault=false;
  for (  String tile : tileList.split("String_Node_Str")) {
    tile=tile.trim();
    if (tile.isEmpty())     continue;
    if (tile.equals("String_Node_Str")) {
      if (!addedDefault) {
        tiles.addAll(Arrays.asList(defaultTileList.split("String_Node_Str")));
        addedDefault=true;
      }
    }
 else {
      tiles.add(tile);
    }
  }
  return tiles;
}

Fixed version (ground truth):
protected List<String> loadTileSpecs(Context context,String tileList){
  final Resources res=context.getResources();
  final String defaultTileList=res.getString(R.string.quick_settings_tiles_default);
  if (tileList == null) {
    tileList=res.getString(R.string.quick_settings_tiles);
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + tileList);
  }
 else {
    for (    String tile : res.getString(R.string.quick_settings_tiles).split("String_Node_Str")) {
      tile=tile.trim();
      if (tile.isEmpty())       continue;
      if (tile.startsWith(IntentTile.PREFIX)) {
        tileList=tileList.concat("String_Node_Str").concat(tile);
      }
    }
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + tileList);
  }
  final ArrayList<String> tiles=new ArrayList<String>();
  boolean addedDefault=false;
  for (  String tile : tileList.split("String_Node_Str")) {
    tile=tile.trim();
    if (tile.isEmpty())     continue;
    if (tile.equals("String_Node_Str")) {
      if (!addedDefault) {
        tiles.addAll(Arrays.asList(defaultTileList.split("String_Node_Str")));
        addedDefault=true;
      }
    }
 else {
      tiles.add(tile);
    }
  }
  return tiles;
}
Program: 191101
Project: 191101
Buggy source:
@Override public void onHotspotChanged(boolean enabled){
  mIconController.setIconVisibility(mSlotHotspot,enabled);
}

Fixed version (ground truth):
@Override public void onHotspotChanged(boolean enabled){
  mIconController.setIcon(mSlotHotspot,R.drawable.stat_sys_hotspot,mContext.getString(R.string.accessibility_status_bar_hotspot));
  mIconController.setIconVisibility(mSlotHotspot,enabled);
}
Program: 191102
Project: 191102
Buggy source:
private VerifyCredentialResponse doVerifyPattern(String pattern,CredentialHash storedHash,boolean hasChallenge,long challenge,int userId) throws RemoteException {
  boolean shouldReEnrollBaseZero=storedHash != null && storedHash.isBaseZeroPattern;
  String patternToVerify;
  if (shouldReEnrollBaseZero) {
    patternToVerify=LockPatternUtils.patternStringToBaseZero(pattern);
  }
 else {
    patternToVerify=pattern;
  }
  VerifyCredentialResponse response=verifyCredential(userId,storedHash,patternToVerify,hasChallenge,challenge,new CredentialUtil(){
    @Override public void setCredential(    String pattern,    String oldPattern,    int userId) throws RemoteException {
      setLockPatternInternal(pattern,oldPattern,userId);
    }
    @Override public byte[] toHash(    String pattern,    int userId){
      return LockPatternUtils.patternToHash(LockPatternUtils.stringToPattern(pattern));
    }
    @Override public String adjustForKeystore(    String pattern){
      return LockPatternUtils.patternStringToBaseZero(pattern);
    }
  }
);
  if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK && shouldReEnrollBaseZero) {
    setLockPatternInternal(pattern,patternToVerify,userId);
  }
  if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK)   retainPassword(pattern);
  return response;
}

Fixed version (ground truth):
private VerifyCredentialResponse doVerifyPattern(String pattern,CredentialHash storedHash,boolean hasChallenge,long challenge,int userId) throws RemoteException {
  boolean shouldReEnrollBaseZero=storedHash != null && storedHash.isBaseZeroPattern;
  String patternToVerify;
  if (shouldReEnrollBaseZero) {
    patternToVerify=LockPatternUtils.patternStringToBaseZero(pattern);
  }
 else {
    patternToVerify=pattern;
  }
  VerifyCredentialResponse response=verifyCredential(userId,storedHash,patternToVerify,hasChallenge,challenge,new CredentialUtil(){
    @Override public void setCredential(    String pattern,    String oldPattern,    int userId) throws RemoteException {
      setLockPatternInternal(pattern,oldPattern,userId);
    }
    @Override public byte[] toHash(    String pattern,    int userId){
      return LockPatternUtils.patternToHash(LockPatternUtils.stringToPattern(pattern));
    }
    @Override public String adjustForKeystore(    String pattern){
      return LockPatternUtils.patternStringToBaseZero(pattern);
    }
  }
);
  if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK && shouldReEnrollBaseZero) {
    setLockPatternInternal(pattern,patternToVerify,userId);
  }
  return response;
}
Program: 191103
Project: 191103
Buggy source:
@Override public VerifyCredentialResponse checkPattern(String pattern,int userId) throws RemoteException {
  return doVerifyPattern(pattern,false,0,userId);
}

Fixed version (ground truth):
@Override public VerifyCredentialResponse checkPattern(String pattern,int userId) throws RemoteException {
  VerifyCredentialResponse response=doVerifyPattern(pattern,false,0,userId);
  if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK)   retainPassword(pattern);
  return response;
}
Program: 191106
Project: 191106
Buggy source:
private void updateSuppression(NotificationGroup group){
  if (group == null || mUpdatingSuppressionBlocked) {
    return;
  }
  boolean prevSuppressed=group.suppressed;
  group.suppressed=group.summary != null && !group.expanded && (group.children.size() == 1 || (group.children.size() == 0 && group.summary.notification.getNotification().isGroupSummary() && hasIsolatedChildren(group)));
  if (prevSuppressed != group.suppressed) {
    if (group.suppressed) {
      handleSuppressedSummaryHeadsUpped(group.summary);
    }
    mListener.onGroupsChanged();
  }
}

Fixed version (ground truth):
private void updateSuppression(NotificationGroup group){
  if (group == null) {
    return;
  }
  boolean prevSuppressed=group.suppressed;
  group.suppressed=group.summary != null && !group.expanded && (group.children.size() == 1 || (group.children.size() == 0 && group.summary.notification.getNotification().isGroupSummary() && hasIsolatedChildren(group)));
  if (prevSuppressed != group.suppressed) {
    if (group.suppressed) {
      handleSuppressedSummaryHeadsUpped(group.summary);
    }
    if (!mIsUpdatingUnchangedGroup) {
      mListener.onGroupsChanged();
    }
  }
}
Program: 191107
Project: 191107
Buggy source:
public void onEntryUpdated(NotificationData.Entry entry,StatusBarNotification oldNotification){
  String oldKey=oldNotification.getGroupKey();
  String newKey=entry.notification.getGroupKey();
  boolean groupKeysChanged=!oldKey.equals(newKey);
  boolean wasGroupChild=isGroupChild(oldNotification);
  boolean isGroupChild=isGroupChild(entry.notification);
  mUpdatingSuppressionBlocked=!groupKeysChanged && wasGroupChild == isGroupChild;
  if (mGroupMap.get(getGroupKey(oldNotification)) != null) {
    onEntryRemovedInternal(entry,oldNotification);
  }
  onEntryAdded(entry);
  mUpdatingSuppressionBlocked=false;
  if (isIsolated(entry.notification)) {
    mIsolatedEntries.put(entry.key,entry.notification);
    if (groupKeysChanged) {
      updateSuppression(mGroupMap.get(oldKey));
      updateSuppression(mGroupMap.get(newKey));
    }
  }
 else   if (!wasGroupChild && isGroupChild) {
    onEntryBecomingChild(entry);
  }
}

Fixed version (ground truth):
public void onEntryUpdated(NotificationData.Entry entry,StatusBarNotification oldNotification){
  String oldKey=oldNotification.getGroupKey();
  String newKey=entry.notification.getGroupKey();
  boolean groupKeysChanged=!oldKey.equals(newKey);
  boolean wasGroupChild=isGroupChild(oldNotification);
  boolean isGroupChild=isGroupChild(entry.notification);
  mIsUpdatingUnchangedGroup=!groupKeysChanged && wasGroupChild == isGroupChild;
  if (mGroupMap.get(getGroupKey(oldNotification)) != null) {
    onEntryRemovedInternal(entry,oldNotification);
  }
  onEntryAdded(entry);
  mIsUpdatingUnchangedGroup=false;
  if (isIsolated(entry.notification)) {
    mIsolatedEntries.put(entry.key,entry.notification);
    if (groupKeysChanged) {
      updateSuppression(mGroupMap.get(oldKey));
      updateSuppression(mGroupMap.get(newKey));
    }
  }
 else   if (!wasGroupChild && isGroupChild) {
    onEntryBecomingChild(entry);
  }
}
Program: 191108
Project: 191108
Buggy source:
private void updateSuppression(NotificationGroup group){
  if (group == null || mUpdatingSuppressionBlocked) {
    return;
  }
  boolean prevSuppressed=group.suppressed;
  group.suppressed=group.summary != null && !group.expanded && (group.children.size() == 1 || (group.children.size() == 0 && group.summary.notification.getNotification().isGroupSummary() && hasIsolatedChildren(group)));
  if (prevSuppressed != group.suppressed) {
    if (group.suppressed) {
      handleSuppressedSummaryHeadsUpped(group.summary);
    }
    mListener.onGroupsChanged();
  }
}

Fixed version (ground truth):
private void updateSuppression(NotificationGroup group){
  if (group == null) {
    return;
  }
  boolean prevSuppressed=group.suppressed;
  group.suppressed=group.summary != null && !group.expanded && (group.children.size() == 1 || (group.children.size() == 0 && group.summary.notification.getNotification().isGroupSummary() && hasIsolatedChildren(group)));
  if (prevSuppressed != group.suppressed) {
    if (group.suppressed) {
      handleSuppressedSummaryHeadsUpped(group.summary);
    }
    if (!mIsUpdatingUnchangedGroup) {
      mListener.onGroupsChanged();
    }
  }
}
Program: 191109
Project: 191109
Buggy source:
public void onEntryUpdated(NotificationData.Entry entry,StatusBarNotification oldNotification){
  String oldKey=oldNotification.getGroupKey();
  String newKey=entry.notification.getGroupKey();
  boolean groupKeysChanged=!oldKey.equals(newKey);
  boolean wasGroupChild=isGroupChild(oldNotification);
  boolean isGroupChild=isGroupChild(entry.notification);
  mUpdatingSuppressionBlocked=!groupKeysChanged && wasGroupChild == isGroupChild;
  if (mGroupMap.get(getGroupKey(oldNotification)) != null) {
    onEntryRemovedInternal(entry,oldNotification);
  }
  onEntryAdded(entry);
  mUpdatingSuppressionBlocked=false;
  if (isIsolated(entry.notification)) {
    mIsolatedEntries.put(entry.key,entry.notification);
    if (groupKeysChanged) {
      updateSuppression(mGroupMap.get(oldKey));
      updateSuppression(mGroupMap.get(newKey));
    }
  }
 else   if (!wasGroupChild && isGroupChild) {
    onEntryBecomingChild(entry);
  }
}

Fixed version (ground truth):
public void onEntryUpdated(NotificationData.Entry entry,StatusBarNotification oldNotification){
  String oldKey=oldNotification.getGroupKey();
  String newKey=entry.notification.getGroupKey();
  boolean groupKeysChanged=!oldKey.equals(newKey);
  boolean wasGroupChild=isGroupChild(oldNotification);
  boolean isGroupChild=isGroupChild(entry.notification);
  mIsUpdatingUnchangedGroup=!groupKeysChanged && wasGroupChild == isGroupChild;
  if (mGroupMap.get(getGroupKey(oldNotification)) != null) {
    onEntryRemovedInternal(entry,oldNotification);
  }
  onEntryAdded(entry);
  mIsUpdatingUnchangedGroup=false;
  if (isIsolated(entry.notification)) {
    mIsolatedEntries.put(entry.key,entry.notification);
    if (groupKeysChanged) {
      updateSuppression(mGroupMap.get(oldKey));
      updateSuppression(mGroupMap.get(newKey));
    }
  }
 else   if (!wasGroupChild && isGroupChild) {
    onEntryBecomingChild(entry);
  }
}
Program: 191110
Project: 191110
Buggy source:
private void updateSuppression(NotificationGroup group){
  if (group == null || mUpdatingSuppressionBlocked) {
    return;
  }
  boolean prevSuppressed=group.suppressed;
  group.suppressed=group.summary != null && !group.expanded && (group.children.size() == 1 || (group.children.size() == 0 && group.summary.notification.getNotification().isGroupSummary() && hasIsolatedChildren(group)));
  if (prevSuppressed != group.suppressed) {
    if (group.suppressed) {
      handleSuppressedSummaryHeadsUpped(group.summary);
    }
    mListener.onGroupsChanged();
  }
}

Fixed version (ground truth):
private void updateSuppression(NotificationGroup group){
  if (group == null) {
    return;
  }
  boolean prevSuppressed=group.suppressed;
  group.suppressed=group.summary != null && !group.expanded && (group.children.size() == 1 || (group.children.size() == 0 && group.summary.notification.getNotification().isGroupSummary() && hasIsolatedChildren(group)));
  if (prevSuppressed != group.suppressed) {
    if (group.suppressed) {
      handleSuppressedSummaryHeadsUpped(group.summary);
    }
    if (!mIsUpdatingUnchangedGroup) {
      mListener.onGroupsChanged();
    }
  }
}
Program: 191111
Project: 191111
Buggy source:
public void onEntryUpdated(NotificationData.Entry entry,StatusBarNotification oldNotification){
  String oldKey=oldNotification.getGroupKey();
  String newKey=entry.notification.getGroupKey();
  boolean groupKeysChanged=!oldKey.equals(newKey);
  boolean wasGroupChild=isGroupChild(oldNotification);
  boolean isGroupChild=isGroupChild(entry.notification);
  mUpdatingSuppressionBlocked=!groupKeysChanged && wasGroupChild == isGroupChild;
  if (mGroupMap.get(getGroupKey(oldNotification)) != null) {
    onEntryRemovedInternal(entry,oldNotification);
  }
  onEntryAdded(entry);
  mUpdatingSuppressionBlocked=false;
  if (isIsolated(entry.notification)) {
    mIsolatedEntries.put(entry.key,entry.notification);
    if (groupKeysChanged) {
      updateSuppression(mGroupMap.get(oldKey));
      updateSuppression(mGroupMap.get(newKey));
    }
  }
 else   if (!wasGroupChild && isGroupChild) {
    onEntryBecomingChild(entry);
  }
}

Fixed version (ground truth):
public void onEntryUpdated(NotificationData.Entry entry,StatusBarNotification oldNotification){
  String oldKey=oldNotification.getGroupKey();
  String newKey=entry.notification.getGroupKey();
  boolean groupKeysChanged=!oldKey.equals(newKey);
  boolean wasGroupChild=isGroupChild(oldNotification);
  boolean isGroupChild=isGroupChild(entry.notification);
  mIsUpdatingUnchangedGroup=!groupKeysChanged && wasGroupChild == isGroupChild;
  if (mGroupMap.get(getGroupKey(oldNotification)) != null) {
    onEntryRemovedInternal(entry,oldNotification);
  }
  onEntryAdded(entry);
  mIsUpdatingUnchangedGroup=false;
  if (isIsolated(entry.notification)) {
    mIsolatedEntries.put(entry.key,entry.notification);
    if (groupKeysChanged) {
      updateSuppression(mGroupMap.get(oldKey));
      updateSuppression(mGroupMap.get(newKey));
    }
  }
 else   if (!wasGroupChild && isGroupChild) {
    onEntryBecomingChild(entry);
  }
}
Program: 191113
Project: 191113
Buggy source:
@Override protected void onDraw(Canvas canvas){
  canvas.drawRect(0,mCurrentBounds.top,getWidth(),mCurrentBounds.bottom,mBackgroundPaint);
  if (DEBUG) {
    int y=mTopPadding;
    canvas.drawLine(0,y,getWidth(),y,mDebugPaint);
    y=(int)(getLayoutHeight() - mBottomStackPeekSize - mBottomStackSlowDownHeight);
    canvas.drawLine(0,y,getWidth(),y,mDebugPaint);
    y=(int)(getLayoutHeight() - mBottomStackPeekSize);
    canvas.drawLine(0,y,getWidth(),y,mDebugPaint);
    y=(int)getLayoutHeight();
    canvas.drawLine(0,y,getWidth(),y,mDebugPaint);
    y=getHeight() - getEmptyBottomMargin();
    canvas.drawLine(0,y,getWidth(),y,mDebugPaint);
  }
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  if (mCurrentBounds.top < mCurrentBounds.bottom) {
    canvas.drawRect(0,mCurrentBounds.top,getWidth(),mCurrentBounds.bottom,mBackgroundPaint);
  }
  if (DEBUG) {
    int y=mTopPadding;
    canvas.drawLine(0,y,getWidth(),y,mDebugPaint);
    y=(int)(getLayoutHeight() - mBottomStackPeekSize - mBottomStackSlowDownHeight);
    canvas.drawLine(0,y,getWidth(),y,mDebugPaint);
    y=(int)(getLayoutHeight() - mBottomStackPeekSize);
    canvas.drawLine(0,y,getWidth(),y,mDebugPaint);
    y=(int)getLayoutHeight();
    canvas.drawLine(0,y,getWidth(),y,mDebugPaint);
    y=getHeight() - getEmptyBottomMargin();
    canvas.drawLine(0,y,getWidth(),y,mDebugPaint);
  }
}
Program: 191116
Project: 191116
Buggy source:
void removeIcon(@UserIdInt int userId,ShortcutInfo shortcut){
  if (shortcut.getBitmapPath() != null) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + shortcut.getBitmapPath());
    }
    new File(shortcut.getBitmapPath()).delete();
    shortcut.setBitmapPath(null);
  }
  shortcut.setIconResourceId(0);
  shortcut.setIconResName(null);
  shortcut.clearFlags(ShortcutInfo.FLAG_HAS_ICON_FILE | ShortcutInfo.FLAG_HAS_ICON_RES);
}

Fixed version (ground truth):
void removeIcon(@UserIdInt int userId,ShortcutInfo shortcut){
  shortcut.setIconResourceId(0);
  shortcut.setIconResName(null);
  shortcut.clearFlags(ShortcutInfo.FLAG_HAS_ICON_FILE | ShortcutInfo.FLAG_HAS_ICON_RES);
}
Program: 191117
Project: 191117
Buggy source:
private void cleanupDanglingBitmapDirectoriesLocked(@UserIdInt int userId,@NonNull ShortcutUser user){
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + userId);
  }
  final long start=injectElapsedRealtime();
  final File bitmapDir=getUserBitmapFilePath(userId);
  final File[] children=bitmapDir.listFiles();
  if (children == null) {
    return;
  }
  for (  File child : children) {
    if (!child.isDirectory()) {
      continue;
    }
    final String packageName=child.getName();
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + packageName);
    }
    if (!user.hasPackage(packageName)) {
      if (DEBUG) {
        Slog.d(TAG,"String_Node_Str" + packageName);
      }
      cleanupBitmapsForPackage(userId,packageName);
    }
 else {
      cleanupDanglingBitmapFilesLocked(userId,user,packageName,child);
    }
  }
  logDurationStat(Stats.CLEANUP_DANGLING_BITMAPS,start);
}

Fixed version (ground truth):
private void cleanupDanglingBitmapDirectoriesLocked(@UserIdInt int userId){
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + userId);
  }
  final long start=injectElapsedRealtime();
  final ShortcutUser user=getUserShortcutsLocked(userId);
  final File bitmapDir=getUserBitmapFilePath(userId);
  final File[] children=bitmapDir.listFiles();
  if (children == null) {
    return;
  }
  for (  File child : children) {
    if (!child.isDirectory()) {
      continue;
    }
    final String packageName=child.getName();
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + packageName);
    }
    if (!user.hasPackage(packageName)) {
      if (DEBUG) {
        Slog.d(TAG,"String_Node_Str" + packageName);
      }
      cleanupBitmapsForPackage(userId,packageName);
    }
 else {
      cleanupDanglingBitmapFilesLocked(userId,user,packageName,child);
    }
  }
  logDurationStat(Stats.CLEANUP_DANGLING_BITMAPS,start);
}
Program: 191118
Project: 191118
Buggy source:
@Nullable private ShortcutUser loadUserLocked(@UserIdInt int userId){
  final File path=getUserFile(userId);
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + path);
  }
  final AtomicFile file=new AtomicFile(path);
  final FileInputStream in;
  try {
    in=file.openRead();
  }
 catch (  FileNotFoundException e) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + path);
    }
    return null;
  }
  try {
    final ShortcutUser ret=loadUserInternal(userId,in,false);
    cleanupDanglingBitmapDirectoriesLocked(userId,ret);
    return ret;
  }
 catch (  IOException|XmlPullParserException e) {
    Slog.e(TAG,"String_Node_Str" + file.getBaseFile(),e);
    return null;
  }
 finally {
    IoUtils.closeQuietly(in);
  }
}

Fixed version (ground truth):
@Nullable private ShortcutUser loadUserLocked(@UserIdInt int userId){
  final File path=getUserFile(userId);
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + path);
  }
  final AtomicFile file=new AtomicFile(path);
  final FileInputStream in;
  try {
    in=file.openRead();
  }
 catch (  FileNotFoundException e) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + path);
    }
    return null;
  }
  try {
    final ShortcutUser ret=loadUserInternal(userId,in,false);
    return ret;
  }
 catch (  IOException|XmlPullParserException e) {
    Slog.e(TAG,"String_Node_Str" + file.getBaseFile(),e);
    return null;
  }
 finally {
    IoUtils.closeQuietly(in);
  }
}
Program: 191119
Project: 191119
Buggy source:
protected boolean isUserUnlockedL(@UserIdInt int userId){
  return mUnlockedUsers.get(userId);
}

Fixed version (ground truth):
protected boolean isUserUnlockedL(@UserIdInt int userId){
  if (mUnlockedUsers.get(userId)) {
    return true;
  }
  final long token=injectClearCallingIdentity();
  try {
    return mUserManager.isUserUnlockingOrUnlocked(userId);
  }
  finally {
    injectRestoreCallingIdentity(token);
  }
}
Program: 191120
Project: 191120
Buggy source:
private void saveUserLocked(@UserIdInt int userId){
  final File path=getUserFile(userId);
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + path);
  }
  path.getParentFile().mkdirs();
  final AtomicFile file=new AtomicFile(path);
  FileOutputStream os=null;
  try {
    os=file.startWrite();
    saveUserInternalLocked(userId,os,false);
    file.finishWrite(os);
  }
 catch (  XmlPullParserException|IOException e) {
    Slog.e(TAG,"String_Node_Str" + file.getBaseFile(),e);
    file.failWrite(os);
  }
}

Fixed version (ground truth):
private void saveUserLocked(@UserIdInt int userId){
  final File path=getUserFile(userId);
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + path);
  }
  path.getParentFile().mkdirs();
  final AtomicFile file=new AtomicFile(path);
  FileOutputStream os=null;
  try {
    os=file.startWrite();
    saveUserInternalLocked(userId,os,false);
    file.finishWrite(os);
    cleanupDanglingBitmapDirectoriesLocked(userId);
  }
 catch (  XmlPullParserException|IOException e) {
    Slog.e(TAG,"String_Node_Str" + file.getBaseFile(),e);
    file.failWrite(os);
  }
}
Program: 191122
Project: 191122
Buggy source:
void removeIcon(@UserIdInt int userId,ShortcutInfo shortcut){
  if (shortcut.getBitmapPath() != null) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + shortcut.getBitmapPath());
    }
    new File(shortcut.getBitmapPath()).delete();
    shortcut.setBitmapPath(null);
  }
  shortcut.setIconResourceId(0);
  shortcut.setIconResName(null);
  shortcut.clearFlags(ShortcutInfo.FLAG_HAS_ICON_FILE | ShortcutInfo.FLAG_HAS_ICON_RES);
}

Fixed version (ground truth):
void removeIcon(@UserIdInt int userId,ShortcutInfo shortcut){
  shortcut.setIconResourceId(0);
  shortcut.setIconResName(null);
  shortcut.clearFlags(ShortcutInfo.FLAG_HAS_ICON_FILE | ShortcutInfo.FLAG_HAS_ICON_RES);
}
Program: 191123
Project: 191123
Buggy source:
private void cleanupDanglingBitmapDirectoriesLocked(@UserIdInt int userId,@NonNull ShortcutUser user){
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + userId);
  }
  final long start=injectElapsedRealtime();
  final File bitmapDir=getUserBitmapFilePath(userId);
  final File[] children=bitmapDir.listFiles();
  if (children == null) {
    return;
  }
  for (  File child : children) {
    if (!child.isDirectory()) {
      continue;
    }
    final String packageName=child.getName();
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + packageName);
    }
    if (!user.hasPackage(packageName)) {
      if (DEBUG) {
        Slog.d(TAG,"String_Node_Str" + packageName);
      }
      cleanupBitmapsForPackage(userId,packageName);
    }
 else {
      cleanupDanglingBitmapFilesLocked(userId,user,packageName,child);
    }
  }
  logDurationStat(Stats.CLEANUP_DANGLING_BITMAPS,start);
}

Fixed version (ground truth):
private void cleanupDanglingBitmapDirectoriesLocked(@UserIdInt int userId){
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + userId);
  }
  final long start=injectElapsedRealtime();
  final ShortcutUser user=getUserShortcutsLocked(userId);
  final File bitmapDir=getUserBitmapFilePath(userId);
  final File[] children=bitmapDir.listFiles();
  if (children == null) {
    return;
  }
  for (  File child : children) {
    if (!child.isDirectory()) {
      continue;
    }
    final String packageName=child.getName();
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + packageName);
    }
    if (!user.hasPackage(packageName)) {
      if (DEBUG) {
        Slog.d(TAG,"String_Node_Str" + packageName);
      }
      cleanupBitmapsForPackage(userId,packageName);
    }
 else {
      cleanupDanglingBitmapFilesLocked(userId,user,packageName,child);
    }
  }
  logDurationStat(Stats.CLEANUP_DANGLING_BITMAPS,start);
}
Program: 191124
Project: 191124
Buggy source:
@Nullable private ShortcutUser loadUserLocked(@UserIdInt int userId){
  final File path=getUserFile(userId);
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + path);
  }
  final AtomicFile file=new AtomicFile(path);
  final FileInputStream in;
  try {
    in=file.openRead();
  }
 catch (  FileNotFoundException e) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + path);
    }
    return null;
  }
  try {
    final ShortcutUser ret=loadUserInternal(userId,in,false);
    cleanupDanglingBitmapDirectoriesLocked(userId,ret);
    return ret;
  }
 catch (  IOException|XmlPullParserException e) {
    Slog.e(TAG,"String_Node_Str" + file.getBaseFile(),e);
    return null;
  }
 finally {
    IoUtils.closeQuietly(in);
  }
}

Fixed version (ground truth):
@Nullable private ShortcutUser loadUserLocked(@UserIdInt int userId){
  final File path=getUserFile(userId);
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + path);
  }
  final AtomicFile file=new AtomicFile(path);
  final FileInputStream in;
  try {
    in=file.openRead();
  }
 catch (  FileNotFoundException e) {
    if (DEBUG) {
      Slog.d(TAG,"String_Node_Str" + path);
    }
    return null;
  }
  try {
    final ShortcutUser ret=loadUserInternal(userId,in,false);
    return ret;
  }
 catch (  IOException|XmlPullParserException e) {
    Slog.e(TAG,"String_Node_Str" + file.getBaseFile(),e);
    return null;
  }
 finally {
    IoUtils.closeQuietly(in);
  }
}
Program: 191125
Project: 191125
Buggy source:
protected boolean isUserUnlockedL(@UserIdInt int userId){
  return mUnlockedUsers.get(userId);
}

Fixed version (ground truth):
protected boolean isUserUnlockedL(@UserIdInt int userId){
  if (mUnlockedUsers.get(userId)) {
    return true;
  }
  final long token=injectClearCallingIdentity();
  try {
    return mUserManager.isUserUnlockingOrUnlocked(userId);
  }
  finally {
    injectRestoreCallingIdentity(token);
  }
}
Program: 191126
Project: 191126
Buggy source:
private void saveUserLocked(@UserIdInt int userId){
  final File path=getUserFile(userId);
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + path);
  }
  path.getParentFile().mkdirs();
  final AtomicFile file=new AtomicFile(path);
  FileOutputStream os=null;
  try {
    os=file.startWrite();
    saveUserInternalLocked(userId,os,false);
    file.finishWrite(os);
  }
 catch (  XmlPullParserException|IOException e) {
    Slog.e(TAG,"String_Node_Str" + file.getBaseFile(),e);
    file.failWrite(os);
  }
}

Fixed version (ground truth):
private void saveUserLocked(@UserIdInt int userId){
  final File path=getUserFile(userId);
  if (DEBUG) {
    Slog.d(TAG,"String_Node_Str" + path);
  }
  path.getParentFile().mkdirs();
  final AtomicFile file=new AtomicFile(path);
  FileOutputStream os=null;
  try {
    os=file.startWrite();
    saveUserInternalLocked(userId,os,false);
    file.finishWrite(os);
    cleanupDanglingBitmapDirectoriesLocked(userId);
  }
 catch (  XmlPullParserException|IOException e) {
    Slog.e(TAG,"String_Node_Str" + file.getBaseFile(),e);
    file.failWrite(os);
  }
}
Program: 191128
Project: 191128
Buggy source:
/** 
 * Called to do initial creation of a fragment.  This is called after  {@link #onAttach(Activity)} and before{@link #onCreateView(LayoutInflater,ViewGroup,Bundle)}, but is not called if the fragment instance is retained across Activity re-creation (see   {@link #setRetainInstance(boolean)}). <p>Note that this can be called while the fragment's activity is still in the process of being created.  As such, you can not rely on things like the activity's content view hierarchy being initialized at this point.  If you want to do work once the activity itself is created, see   {@link #onActivityCreated(Bundle)}. <p>If your app's <code>targetSdkVersion</code> is 23 or lower, child fragments being restored from the savedInstanceState are restored after <code>onCreate</code> returns. When targeting N or above and running on an N or newer platform version they are restored by <code>Fragment.onCreate</code>.</p>
 * @param savedInstanceState If the fragment is being re-created froma previous saved state, this is the state.
 */
@CallSuper public void onCreate(@Nullable Bundle savedInstanceState){
  mCalled=true;
  final Context context=getContext();
  final int version=context != null ? context.getApplicationInfo().targetSdkVersion : 0;
  if (version >= Build.VERSION_CODES.N) {
    restoreChildFragmentState(savedInstanceState,true);
    if (mChildFragmentManager != null && !mChildFragmentManager.isStateAtLeast(Fragment.CREATED)) {
      mChildFragmentManager.dispatchCreate();
    }
  }
}

Fixed version (ground truth):
/** 
 * Called to do initial creation of a fragment.  This is called after  {@link #onAttach(Activity)} and before{@link #onCreateView(LayoutInflater,ViewGroup,Bundle)}, but is not called if the fragment instance is retained across Activity re-creation (see   {@link #setRetainInstance(boolean)}). <p>Note that this can be called while the fragment's activity is still in the process of being created.  As such, you can not rely on things like the activity's content view hierarchy being initialized at this point.  If you want to do work once the activity itself is created, see   {@link #onActivityCreated(Bundle)}. <p>If your app's <code>targetSdkVersion</code> is   {@link android.os.Build.VERSION_CODES#M}or lower, child fragments being restored from the savedInstanceState are restored after <code>onCreate</code> returns. When targeting @link android.os.Build.VERSION_CODES#N} or above and running on an N or newer platform version they are restored by <code>Fragment.onCreate</code>.</p>
 * @param savedInstanceState If the fragment is being re-created froma previous saved state, this is the state.
 */
@CallSuper public void onCreate(@Nullable Bundle savedInstanceState){
  mCalled=true;
  final Context context=getContext();
  final int version=context != null ? context.getApplicationInfo().targetSdkVersion : 0;
  if (version >= Build.VERSION_CODES.N) {
    restoreChildFragmentState(savedInstanceState,true);
    if (mChildFragmentManager != null && !mChildFragmentManager.isStateAtLeast(Fragment.CREATED)) {
      mChildFragmentManager.dispatchCreate();
    }
  }
}
Program: 191129
Project: 191129
Buggy source:
/** 
 * In order to avoid breaking old apps, we only throw exception on invalid VectorDrawable animations * for apps targeting N and later. For older apps, we ignore (i.e. quietly skip) these animations.
 * @return whether invalid animations for vector drawable should be ignored.
 */
private static boolean shouldIgnoreInvalidAnimation(){
  Application app=ActivityThread.currentApplication();
  if (app == null || app.getApplicationInfo() == null) {
    return true;
  }
  if (app.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.N) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * In order to avoid breaking old apps, we only throw exception on invalid VectorDrawable animations for apps targeting N and later. For older apps, we ignore (i.e. quietly skip) these animations.
 * @return whether invalid animations for vector drawable should be ignored.
 */
private static boolean shouldIgnoreInvalidAnimation(){
  Application app=ActivityThread.currentApplication();
  if (app == null || app.getApplicationInfo() == null) {
    return true;
  }
  if (app.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.N) {
    return true;
  }
  return false;
}
Program: 191130
Project: 191130
Buggy source:
/** 
 * Called to do initial creation of a fragment.  This is called after  {@link #onAttach(Activity)} and before{@link #onCreateView(LayoutInflater,ViewGroup,Bundle)}, but is not called if the fragment instance is retained across Activity re-creation (see   {@link #setRetainInstance(boolean)}). <p>Note that this can be called while the fragment's activity is still in the process of being created.  As such, you can not rely on things like the activity's content view hierarchy being initialized at this point.  If you want to do work once the activity itself is created, see   {@link #onActivityCreated(Bundle)}. <p>If your app's <code>targetSdkVersion</code> is 23 or lower, child fragments being restored from the savedInstanceState are restored after <code>onCreate</code> returns. When targeting N or above and running on an N or newer platform version they are restored by <code>Fragment.onCreate</code>.</p>
 * @param savedInstanceState If the fragment is being re-created froma previous saved state, this is the state.
 */
@CallSuper public void onCreate(@Nullable Bundle savedInstanceState){
  mCalled=true;
  final Context context=getContext();
  final int version=context != null ? context.getApplicationInfo().targetSdkVersion : 0;
  if (version >= Build.VERSION_CODES.N) {
    restoreChildFragmentState(savedInstanceState,true);
    if (mChildFragmentManager != null && !mChildFragmentManager.isStateAtLeast(Fragment.CREATED)) {
      mChildFragmentManager.dispatchCreate();
    }
  }
}

Fixed version (ground truth):
/** 
 * Called to do initial creation of a fragment.  This is called after  {@link #onAttach(Activity)} and before{@link #onCreateView(LayoutInflater,ViewGroup,Bundle)}, but is not called if the fragment instance is retained across Activity re-creation (see   {@link #setRetainInstance(boolean)}). <p>Note that this can be called while the fragment's activity is still in the process of being created.  As such, you can not rely on things like the activity's content view hierarchy being initialized at this point.  If you want to do work once the activity itself is created, see   {@link #onActivityCreated(Bundle)}. <p>If your app's <code>targetSdkVersion</code> is   {@link android.os.Build.VERSION_CODES#M}or lower, child fragments being restored from the savedInstanceState are restored after <code>onCreate</code> returns. When targeting @link android.os.Build.VERSION_CODES#N} or above and running on an N or newer platform version they are restored by <code>Fragment.onCreate</code>.</p>
 * @param savedInstanceState If the fragment is being re-created froma previous saved state, this is the state.
 */
@CallSuper public void onCreate(@Nullable Bundle savedInstanceState){
  mCalled=true;
  final Context context=getContext();
  final int version=context != null ? context.getApplicationInfo().targetSdkVersion : 0;
  if (version >= Build.VERSION_CODES.N) {
    restoreChildFragmentState(savedInstanceState,true);
    if (mChildFragmentManager != null && !mChildFragmentManager.isStateAtLeast(Fragment.CREATED)) {
      mChildFragmentManager.dispatchCreate();
    }
  }
}
Program: 191131
Project: 191131
Buggy source:
/** 
 * In order to avoid breaking old apps, we only throw exception on invalid VectorDrawable animations * for apps targeting N and later. For older apps, we ignore (i.e. quietly skip) these animations.
 * @return whether invalid animations for vector drawable should be ignored.
 */
private static boolean shouldIgnoreInvalidAnimation(){
  Application app=ActivityThread.currentApplication();
  if (app == null || app.getApplicationInfo() == null) {
    return true;
  }
  if (app.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.N) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * In order to avoid breaking old apps, we only throw exception on invalid VectorDrawable animations for apps targeting N and later. For older apps, we ignore (i.e. quietly skip) these animations.
 * @return whether invalid animations for vector drawable should be ignored.
 */
private static boolean shouldIgnoreInvalidAnimation(){
  Application app=ActivityThread.currentApplication();
  if (app == null || app.getApplicationInfo() == null) {
    return true;
  }
  if (app.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.N) {
    return true;
  }
  return false;
}