nus-yam/ex-repair huggingface dataset:
Program: 2362
Project: 2362
Buggy source:
/** 
 * Return the name of the package that invoked this activity.  This is who the data in   {@link #setResult setResult()} will be sent to.  You canuse this information to validate that the recipient is allowed to receive the data. <p>Note: if the calling activity is not expecting a result (that is it did not use the  {@link #startActivityForResult} form that includes a request code), then the calling package will be  null. 
 * @return The package of the activity that will receive yourreply, or null if none.
 */
public String getCallingPackage(){
  try {
    return ActivityManagerNative.getDefault().getCallingPackage(mToken);
  }
 catch (  RemoteException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Return the name of the package that invoked this activity.  This is who the data in   {@link #setResult setResult()} will be sent to.  You canuse this information to validate that the recipient is allowed to receive the data. <p class="note">Note: if the calling activity is not expecting a result (that is it did not use the  {@link #startActivityForResult} form that includes a request code), then the calling package will be  null.</p> <p class="note">Note: prior to  {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2}, the result from this method was unstable.  If the process hosting the calling package was no longer running, it would return null instead of the proper package name.  You can use   {@link #getCallingActivity()} and retrieve the package namefrom that instead.</p>
 * @return The package of the activity that will receive yourreply, or null if none.
 */
public String getCallingPackage(){
  try {
    return ActivityManagerNative.getDefault().getCallingPackage(mToken);
  }
 catch (  RemoteException e) {
    return null;
  }
}
Program: 2363
Project: 2363
Buggy source:
public String getCallingPackage(IBinder token){
synchronized (this) {
    ActivityRecord r=getCallingRecordLocked(token);
    return r != null && r.app != null ? r.info.packageName : null;
  }
}

Fixed version (ground truth):
public String getCallingPackage(IBinder token){
synchronized (this) {
    ActivityRecord r=getCallingRecordLocked(token);
    return r != null ? r.info.packageName : null;
  }
}
Program: 2364
Project: 2364
Buggy source:
private boolean verifyPreloadConfig(TypedValue value,String name){
  if ((value.changingConfigurations & ~(ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_DENSITY)) != 0) {
    String resName;
    try {
      resName=getResourceName(value.resourceId);
    }
 catch (    NotFoundException e) {
      resName="String_Node_Str";
    }
    Log.w(TAG,"String_Node_Str" + name + "String_Node_Str"+ Integer.toHexString(value.resourceId)+ "String_Node_Str"+ resName+ "String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean verifyPreloadConfig(int changingConfigurations,int resourceId,String name){
  if (((changingConfigurations & ~(ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_DENSITY)) & VARYING_CONFIGS) != 0) {
    String resName;
    try {
      resName=getResourceName(resourceId);
    }
 catch (    NotFoundException e) {
      resName="String_Node_Str";
    }
    Log.w(TAG,"String_Node_Str" + name + "String_Node_Str"+ Integer.toHexString(resourceId)+ "String_Node_Str"+ resName+ "String_Node_Str");
    return false;
  }
  return true;
}
Program: 2367
Project: 2367
Buggy source:
@Override public int getChangingConfigurations(){
  return mChangingConfigurations;
}

Fixed version (ground truth):
@Override public int getChangingConfigurations(){
  return mChangingConfigurations | mChildrenChangingConfigurations;
}
Program: 2368
Project: 2368
Buggy source:
public static String currentPackageName(){
  ActivityThread am=currentActivityThread();
  return (am != null && am.mBoundApplication != null) ? am.mBoundApplication.processName : null;
}

Fixed version (ground truth):
public static String currentPackageName(){
  ActivityThread am=currentActivityThread();
  return (am != null && am.mBoundApplication != null) ? am.mBoundApplication.appInfo.packageName : null;
}
Program: 2370
Project: 2370
Buggy source:
public static String currentPackageName(){
  ActivityThread am=currentActivityThread();
  return (am != null && am.mBoundApplication != null) ? am.mBoundApplication.processName : null;
}

Fixed version (ground truth):
public static String currentPackageName(){
  ActivityThread am=currentActivityThread();
  return (am != null && am.mBoundApplication != null) ? am.mBoundApplication.appInfo.packageName : null;
}
Program: 2372
Project: 2372
Buggy source:
public static String currentPackageName(){
  ActivityThread am=currentActivityThread();
  return (am != null && am.mBoundApplication != null) ? am.mBoundApplication.processName : null;
}

Fixed version (ground truth):
public static String currentPackageName(){
  ActivityThread am=currentActivityThread();
  return (am != null && am.mBoundApplication != null) ? am.mBoundApplication.appInfo.packageName : null;
}
Program: 2374
Project: 2374
Buggy source:
/** 
 * Return the name of the activity that invoked this activity.  This is who the data in   {@link #setResult setResult()} will be sent to.  Youcan use this information to validate that the recipient is allowed to receive the data. <p>Note: if the calling activity is not expecting a result (that is it did not use the  {@link #startActivityForResult} form that includes a request code), then the calling package will be  null. 
 * @return String The full name of the activity that will receive yourreply, or null if none.
 */
public ComponentName getCallingActivity(){
  try {
    return ActivityManagerNative.getDefault().getCallingActivity(mToken);
  }
 catch (  RemoteException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Return the name of the activity that invoked this activity.  This is who the data in   {@link #setResult setResult()} will be sent to.  Youcan use this information to validate that the recipient is allowed to receive the data. <p class="note">Note: if the calling activity is not expecting a result (that is it did not use the  {@link #startActivityForResult} form that includes a request code), then the calling package will be  null. 
 * @return The ComponentName of the activity that will receive yourreply, or null if none.
 */
public ComponentName getCallingActivity(){
  try {
    return ActivityManagerNative.getDefault().getCallingActivity(mToken);
  }
 catch (  RemoteException e) {
    return null;
  }
}
Program: 2375
Project: 2375
Buggy source:
/** 
 * Return the name of the package that invoked this activity.  This is who the data in   {@link #setResult setResult()} will be sent to.  You canuse this information to validate that the recipient is allowed to receive the data. <p>Note: if the calling activity is not expecting a result (that is it did not use the  {@link #startActivityForResult} form that includes a request code), then the calling package will be  null. 
 * @return The package of the activity that will receive yourreply, or null if none.
 */
public String getCallingPackage(){
  try {
    return ActivityManagerNative.getDefault().getCallingPackage(mToken);
  }
 catch (  RemoteException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Return the name of the package that invoked this activity.  This is who the data in   {@link #setResult setResult()} will be sent to.  You canuse this information to validate that the recipient is allowed to receive the data. <p class="note">Note: if the calling activity is not expecting a result (that is it did not use the  {@link #startActivityForResult} form that includes a request code), then the calling package will be  null.</p> <p class="note">Note: prior to  {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2}, the result from this method was unstable.  If the process hosting the calling package was no longer running, it would return null instead of the proper package name.  You can use   {@link #getCallingActivity()} and retrieve the package namefrom that instead.</p>
 * @return The package of the activity that will receive yourreply, or null if none.
 */
public String getCallingPackage(){
  try {
    return ActivityManagerNative.getDefault().getCallingPackage(mToken);
  }
 catch (  RemoteException e) {
    return null;
  }
}
Program: 2376
Project: 2376
Buggy source:
public String getCallingPackage(IBinder token){
synchronized (this) {
    ActivityRecord r=getCallingRecordLocked(token);
    return r != null && r.app != null ? r.info.packageName : null;
  }
}

Fixed version (ground truth):
public String getCallingPackage(IBinder token){
synchronized (this) {
    ActivityRecord r=getCallingRecordLocked(token);
    return r != null ? r.info.packageName : null;
  }
}
Program: 2377
Project: 2377
Buggy source:
private boolean verifyPreloadConfig(TypedValue value,String name){
  if ((value.changingConfigurations & ~(ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_DENSITY)) != 0) {
    String resName;
    try {
      resName=getResourceName(value.resourceId);
    }
 catch (    NotFoundException e) {
      resName="String_Node_Str";
    }
    Log.w(TAG,"String_Node_Str" + name + "String_Node_Str"+ Integer.toHexString(value.resourceId)+ "String_Node_Str"+ resName+ "String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean verifyPreloadConfig(int changingConfigurations,int resourceId,String name){
  if (((changingConfigurations & ~(ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_DENSITY)) & VARYING_CONFIGS) != 0) {
    String resName;
    try {
      resName=getResourceName(resourceId);
    }
 catch (    NotFoundException e) {
      resName="String_Node_Str";
    }
    Log.w(TAG,"String_Node_Str" + name + "String_Node_Str"+ Integer.toHexString(resourceId)+ "String_Node_Str"+ resName+ "String_Node_Str");
    return false;
  }
  return true;
}
Program: 2380
Project: 2380
Buggy source:
@Override public int getChangingConfigurations(){
  return mChangingConfigurations;
}

Fixed version (ground truth):
@Override public int getChangingConfigurations(){
  return mChangingConfigurations | mChildrenChangingConfigurations;
}
Program: 2381
Project: 2381
Buggy source:
private boolean verifyPreloadConfig(TypedValue value,String name){
  if ((value.changingConfigurations & ~(ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_DENSITY)) != 0) {
    String resName;
    try {
      resName=getResourceName(value.resourceId);
    }
 catch (    NotFoundException e) {
      resName="String_Node_Str";
    }
    Log.w(TAG,"String_Node_Str" + name + "String_Node_Str"+ Integer.toHexString(value.resourceId)+ "String_Node_Str"+ resName+ "String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean verifyPreloadConfig(int changingConfigurations,int resourceId,String name){
  if (((changingConfigurations & ~(ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_DENSITY)) & VARYING_CONFIGS) != 0) {
    String resName;
    try {
      resName=getResourceName(resourceId);
    }
 catch (    NotFoundException e) {
      resName="String_Node_Str";
    }
    Log.w(TAG,"String_Node_Str" + name + "String_Node_Str"+ Integer.toHexString(resourceId)+ "String_Node_Str"+ resName+ "String_Node_Str");
    return false;
  }
  return true;
}
Program: 2384
Project: 2384
Buggy source:
@Override public int getChangingConfigurations(){
  return mChangingConfigurations;
}

Fixed version (ground truth):
@Override public int getChangingConfigurations(){
  return mChangingConfigurations | mChildrenChangingConfigurations;
}
Program: 2385
Project: 2385
Buggy source:
public KeyguardHostView(Context context,AttributeSet attrs){
  super(context,attrs);
  mLockPatternUtils=new LockPatternUtils(context);
  mUserId=mLockPatternUtils.getCurrentUser();
  DevicePolicyManager dpm=(DevicePolicyManager)mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
  if (dpm != null) {
    mDisabledFeatures=getDisabledFeatures(dpm);
    mCameraDisabled=dpm.getCameraDisabled(null);
  }
  mSafeModeEnabled=LockPatternUtils.isSafeModeEnabled();
  Context userContext=null;
  try {
    final String packageName="String_Node_Str";
    userContext=mContext.createPackageContextAsUser(packageName,0,new UserHandle(mUserId));
  }
 catch (  NameNotFoundException e) {
    e.printStackTrace();
    userContext=context;
  }
  mAppWidgetHost=new AppWidgetHost(userContext,APPWIDGET_HOST_ID,mOnClickHandler,Looper.myLooper());
  cleanupAppWidgetIds();
  mAppWidgetManager=AppWidgetManager.getInstance(userContext);
  mSecurityModel=new KeyguardSecurityModel(context);
  mViewStateManager=new KeyguardViewStateManager(this);
  mUserSetupCompleted=Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.USER_SETUP_COMPLETE,0,UserHandle.USER_CURRENT) != 0;
  getInitialTransportState();
  if (mSafeModeEnabled) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
public KeyguardHostView(Context context,AttributeSet attrs){
  super(context,attrs);
  if (DEBUG)   Log.e(TAG,"String_Node_Str");
  mLockPatternUtils=new LockPatternUtils(context);
  mUserId=mLockPatternUtils.getCurrentUser();
  DevicePolicyManager dpm=(DevicePolicyManager)mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
  if (dpm != null) {
    mDisabledFeatures=getDisabledFeatures(dpm);
    mCameraDisabled=dpm.getCameraDisabled(null);
  }
  mSafeModeEnabled=LockPatternUtils.isSafeModeEnabled();
  Context userContext=null;
  try {
    final String packageName="String_Node_Str";
    userContext=mContext.createPackageContextAsUser(packageName,0,new UserHandle(mUserId));
  }
 catch (  NameNotFoundException e) {
    e.printStackTrace();
    userContext=context;
  }
  mAppWidgetHost=new AppWidgetHost(userContext,APPWIDGET_HOST_ID,mOnClickHandler,Looper.myLooper());
  cleanupAppWidgetIds();
  mAppWidgetManager=AppWidgetManager.getInstance(userContext);
  mSecurityModel=new KeyguardSecurityModel(context);
  mViewStateManager=new KeyguardViewStateManager(this);
  mUserSetupCompleted=Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.USER_SETUP_COMPLETE,0,UserHandle.USER_CURRENT) != 0;
  getInitialTransportState();
  if (mSafeModeEnabled) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
}
Program: 2386
Project: 2386
Buggy source:
private void ensureTransportPresentOrRemoved(int state){
  int page=getWidgetPosition(R.id.keyguard_transport_control);
  if (state == TRANSPORT_INVISIBLE || state == TRANSPORT_VISIBLE) {
    if (page == -1) {
      if (DEBUGXPORT)       Log.v(TAG,"String_Node_Str");
      int lastWidget=mAppWidgetContainer.getChildCount() - 1;
      int position=0;
      if (lastWidget >= 0) {
        position=mAppWidgetContainer.isCameraPage(lastWidget) ? lastWidget : lastWidget + 1;
      }
      mAppWidgetContainer.addWidget(getTransportControlView(),position);
    }
  }
 else   if (page != -1) {
    if (DEBUGXPORT)     Log.v(TAG,"String_Node_Str");
    mAppWidgetContainer.removeWidget(getTransportControlView());
    mTransportControl=null;
  }
}

Fixed version (ground truth):
/** 
 * Examines the current state and adds the transport to the widget pager when the state changes. Showing the initial transport and keeping it around is a bit tricky because the signals coming from music players aren't always clear. Here's how the states are handled:  {@link TRANSPORT_GONE} means we have no reason to show the transport - remove it if present.{@link TRANSPORT_INVISIBLE} means we have potential to show the transport because a musicplayer is registered but not currently playing music (or we don't know the state yet). The code adds it conditionally on play state. {@link #TRANSPORT_VISIBLE} means a music player is active and transport should be showing.Once the transport is showing, we always show it until keyguard is dismissed. This state is maintained by onSave/RestoreInstanceState(). This state is cleared in {@link KeyguardViewManager#hide} when keyguard is dismissed, which causes the transport to begone when keyguard is restarted until we get an update with the current state.
 * @param state
 */
private void ensureTransportPresentOrRemoved(int state){
  final boolean showing=getWidgetPosition(R.id.keyguard_transport_control) != -1;
  final boolean visible=state == TRANSPORT_VISIBLE;
  final boolean shouldBeVisible=state == TRANSPORT_INVISIBLE && isMusicPlaying(state);
  if (!showing && (visible || shouldBeVisible)) {
    if (DEBUGXPORT)     Log.v(TAG,"String_Node_Str");
    int lastWidget=mAppWidgetContainer.getChildCount() - 1;
    int position=0;
    if (lastWidget >= 0) {
      position=mAppWidgetContainer.isCameraPage(lastWidget) ? lastWidget : lastWidget + 1;
    }
    mAppWidgetContainer.addWidget(getOrCreateTransportControl(),position);
  }
 else   if (showing && state == TRANSPORT_GONE) {
    if (DEBUGXPORT)     Log.v(TAG,"String_Node_Str");
    mAppWidgetContainer.removeWidget(getOrCreateTransportControl());
    mTransportControl=null;
  }
}
Program: 2387
Project: 2387
Buggy source:
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  mPlaybackState=dcs.playbackState;
}

Fixed version (ground truth):
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  mPlaybackState=dcs.playbackState;
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ mPlaybackState);
}
Program: 2388
Project: 2388
Buggy source:
@Override public Parcelable onSaveInstanceState(){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  ss.transportState=mTransportState;
  ss.appWidgetToShow=mAppWidgetToShow;
  return ss;
}

Fixed version (ground truth):
@Override public Parcelable onSaveInstanceState(){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  final boolean showing=mTransportControl != null && mAppWidgetContainer.getWidgetPageIndex(mTransportControl) >= 0;
  ss.transportState=showing ? TRANSPORT_VISIBLE : mTransportState;
  ss.appWidgetToShow=mAppWidgetToShow;
  return ss;
}
Program: 2389
Project: 2389
Buggy source:
private int getAppropriateWidgetPage(int musicTransportState){
  if (mAppWidgetToShow != AppWidgetManager.INVALID_APPWIDGET_ID) {
    final int childCount=mAppWidgetContainer.getChildCount();
    for (int i=0; i < childCount; i++) {
      if (mAppWidgetContainer.getWidgetPageAt(i).getContentAppWidgetId() == mAppWidgetToShow) {
        return i;
      }
    }
    mAppWidgetToShow=AppWidgetManager.INVALID_APPWIDGET_ID;
  }
  if (musicTransportState == TRANSPORT_VISIBLE) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return mAppWidgetContainer.getWidgetPageIndex(getTransportControlView());
  }
  int rightMost=mAppWidgetContainer.getChildCount() - 1;
  if (mAppWidgetContainer.isCameraPage(rightMost)) {
    rightMost--;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + rightMost);
  return rightMost;
}

Fixed version (ground truth):
private int getAppropriateWidgetPage(int musicTransportState){
  if (mAppWidgetToShow != AppWidgetManager.INVALID_APPWIDGET_ID) {
    final int childCount=mAppWidgetContainer.getChildCount();
    for (int i=0; i < childCount; i++) {
      if (mAppWidgetContainer.getWidgetPageAt(i).getContentAppWidgetId() == mAppWidgetToShow) {
        return i;
      }
    }
    mAppWidgetToShow=AppWidgetManager.INVALID_APPWIDGET_ID;
  }
  if (musicTransportState == TRANSPORT_VISIBLE) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return mAppWidgetContainer.getWidgetPageIndex(getOrCreateTransportControl());
  }
  int rightMost=mAppWidgetContainer.getChildCount() - 1;
  if (mAppWidgetContainer.isCameraPage(rightMost)) {
    rightMost--;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + rightMost);
  return rightMost;
}
Program: 2390
Project: 2390
Buggy source:
@Override public void onRestoreInstanceState(Parcelable state){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  post(mSwitchPageRunnable);
}
Program: 2391
Project: 2391
Buggy source:
protected void handleSetPlaybackState(int generationId,int playbackState,long eventTime){
  if (generationId == mDisplayClientState.clientGeneration) {
    for (int i=0; i < mCallbacks.size(); i++) {
      KeyguardUpdateMonitorCallback cb=mCallbacks.get(i).get();
      if (cb != null) {
        cb.onMusicPlaybackStateChanged(playbackState,eventTime);
      }
    }
  }
 else {
    Log.w(TAG,"String_Node_Str" + generationId + "String_Node_Str");
  }
}

Fixed version (ground truth):
protected void handleSetPlaybackState(int generationId,int playbackState,long eventTime){
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + generationId + "String_Node_Str"+ playbackState+ "String_Node_Str"+ eventTime+ "String_Node_Str");
  mDisplayClientState.playbackState=playbackState;
  mDisplayClientState.playbackEventTime=eventTime;
  if (generationId == mDisplayClientState.clientGeneration) {
    for (int i=0; i < mCallbacks.size(); i++) {
      KeyguardUpdateMonitorCallback cb=mCallbacks.get(i).get();
      if (cb != null) {
        cb.onMusicPlaybackStateChanged(playbackState,eventTime);
      }
    }
  }
 else {
    Log.w(TAG,"String_Node_Str" + generationId + "String_Node_Str");
  }
}
Program: 2392
Project: 2392
Buggy source:
protected void handleSetGenerationId(int clientGeneration,boolean clearing,PendingIntent p){
  mDisplayClientState.clientGeneration=clientGeneration;
  mDisplayClientState.clearing=clearing;
  mDisplayClientState.intent=p;
  for (int i=0; i < mCallbacks.size(); i++) {
    KeyguardUpdateMonitorCallback cb=mCallbacks.get(i).get();
    if (cb != null) {
      cb.onMusicClientIdChanged(clientGeneration,clearing,p);
    }
  }
}

Fixed version (ground truth):
protected void handleSetGenerationId(int clientGeneration,boolean clearing,PendingIntent p){
  mDisplayClientState.clientGeneration=clientGeneration;
  mDisplayClientState.clearing=clearing;
  mDisplayClientState.intent=p;
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + clientGeneration + "String_Node_Str"+ clearing+ "String_Node_Str");
  for (int i=0; i < mCallbacks.size(); i++) {
    KeyguardUpdateMonitorCallback cb=mCallbacks.get(i).get();
    if (cb != null) {
      cb.onMusicClientIdChanged(clientGeneration,clearing,p);
    }
  }
}
Program: 2393
Project: 2393
Buggy source:
/** 
 * Send message to keyguard telling it to reset its state.
 * @param options options about how to show the keyguard
 * @see #handleReset()
 */
private void resetStateLocked(Bundle options){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  Message msg=mHandler.obtainMessage(RESET,options);
  mHandler.sendMessage(msg);
}

Fixed version (ground truth):
/** 
 * Send message to keyguard telling it to reset its state.
 * @param options options about how to show the keyguard
 * @see #handleReset()
 */
private void resetStateLocked(Bundle options){
  if (DEBUG)   Log.e(TAG,"String_Node_Str");
  Message msg=mHandler.obtainMessage(RESET,options);
  mHandler.sendMessage(msg);
}
Program: 2397
Project: 2397
Buggy source:
public KeyguardHostView(Context context,AttributeSet attrs){
  super(context,attrs);
  mLockPatternUtils=new LockPatternUtils(context);
  mUserId=mLockPatternUtils.getCurrentUser();
  DevicePolicyManager dpm=(DevicePolicyManager)mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
  if (dpm != null) {
    mDisabledFeatures=getDisabledFeatures(dpm);
    mCameraDisabled=dpm.getCameraDisabled(null);
  }
  mSafeModeEnabled=LockPatternUtils.isSafeModeEnabled();
  Context userContext=null;
  try {
    final String packageName="String_Node_Str";
    userContext=mContext.createPackageContextAsUser(packageName,0,new UserHandle(mUserId));
  }
 catch (  NameNotFoundException e) {
    e.printStackTrace();
    userContext=context;
  }
  mAppWidgetHost=new AppWidgetHost(userContext,APPWIDGET_HOST_ID,mOnClickHandler,Looper.myLooper());
  cleanupAppWidgetIds();
  mAppWidgetManager=AppWidgetManager.getInstance(userContext);
  mSecurityModel=new KeyguardSecurityModel(context);
  mViewStateManager=new KeyguardViewStateManager(this);
  mUserSetupCompleted=Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.USER_SETUP_COMPLETE,0,UserHandle.USER_CURRENT) != 0;
  getInitialTransportState();
  if (mSafeModeEnabled) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
public KeyguardHostView(Context context,AttributeSet attrs){
  super(context,attrs);
  if (DEBUG)   Log.e(TAG,"String_Node_Str");
  mLockPatternUtils=new LockPatternUtils(context);
  mUserId=mLockPatternUtils.getCurrentUser();
  DevicePolicyManager dpm=(DevicePolicyManager)mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
  if (dpm != null) {
    mDisabledFeatures=getDisabledFeatures(dpm);
    mCameraDisabled=dpm.getCameraDisabled(null);
  }
  mSafeModeEnabled=LockPatternUtils.isSafeModeEnabled();
  Context userContext=null;
  try {
    final String packageName="String_Node_Str";
    userContext=mContext.createPackageContextAsUser(packageName,0,new UserHandle(mUserId));
  }
 catch (  NameNotFoundException e) {
    e.printStackTrace();
    userContext=context;
  }
  mAppWidgetHost=new AppWidgetHost(userContext,APPWIDGET_HOST_ID,mOnClickHandler,Looper.myLooper());
  cleanupAppWidgetIds();
  mAppWidgetManager=AppWidgetManager.getInstance(userContext);
  mSecurityModel=new KeyguardSecurityModel(context);
  mViewStateManager=new KeyguardViewStateManager(this);
  mUserSetupCompleted=Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.USER_SETUP_COMPLETE,0,UserHandle.USER_CURRENT) != 0;
  getInitialTransportState();
  if (mSafeModeEnabled) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
}
Program: 2398
Project: 2398
Buggy source:
private void ensureTransportPresentOrRemoved(int state){
  int page=getWidgetPosition(R.id.keyguard_transport_control);
  if (state == TRANSPORT_INVISIBLE || state == TRANSPORT_VISIBLE) {
    if (page == -1) {
      if (DEBUGXPORT)       Log.v(TAG,"String_Node_Str");
      int lastWidget=mAppWidgetContainer.getChildCount() - 1;
      int position=0;
      if (lastWidget >= 0) {
        position=mAppWidgetContainer.isCameraPage(lastWidget) ? lastWidget : lastWidget + 1;
      }
      mAppWidgetContainer.addWidget(getTransportControlView(),position);
    }
  }
 else   if (page != -1) {
    if (DEBUGXPORT)     Log.v(TAG,"String_Node_Str");
    mAppWidgetContainer.removeWidget(getTransportControlView());
    mTransportControl=null;
  }
}

Fixed version (ground truth):
/** 
 * Examines the current state and adds the transport to the widget pager when the state changes. Showing the initial transport and keeping it around is a bit tricky because the signals coming from music players aren't always clear. Here's how the states are handled:  {@link TRANSPORT_GONE} means we have no reason to show the transport - remove it if present.{@link TRANSPORT_INVISIBLE} means we have potential to show the transport because a musicplayer is registered but not currently playing music (or we don't know the state yet). The code adds it conditionally on play state. {@link #TRANSPORT_VISIBLE} means a music player is active and transport should be showing.Once the transport is showing, we always show it until keyguard is dismissed. This state is maintained by onSave/RestoreInstanceState(). This state is cleared in {@link KeyguardViewManager#hide} when keyguard is dismissed, which causes the transport to begone when keyguard is restarted until we get an update with the current state.
 * @param state
 */
private void ensureTransportPresentOrRemoved(int state){
  final boolean showing=getWidgetPosition(R.id.keyguard_transport_control) != -1;
  final boolean visible=state == TRANSPORT_VISIBLE;
  final boolean shouldBeVisible=state == TRANSPORT_INVISIBLE && isMusicPlaying(state);
  if (!showing && (visible || shouldBeVisible)) {
    if (DEBUGXPORT)     Log.v(TAG,"String_Node_Str");
    int lastWidget=mAppWidgetContainer.getChildCount() - 1;
    int position=0;
    if (lastWidget >= 0) {
      position=mAppWidgetContainer.isCameraPage(lastWidget) ? lastWidget : lastWidget + 1;
    }
    mAppWidgetContainer.addWidget(getOrCreateTransportControl(),position);
  }
 else   if (showing && state == TRANSPORT_GONE) {
    if (DEBUGXPORT)     Log.v(TAG,"String_Node_Str");
    mAppWidgetContainer.removeWidget(getOrCreateTransportControl());
    mTransportControl=null;
  }
}
Program: 2399
Project: 2399
Buggy source:
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  mPlaybackState=dcs.playbackState;
}

Fixed version (ground truth):
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  mPlaybackState=dcs.playbackState;
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ mPlaybackState);
}
Program: 2400
Project: 2400
Buggy source:
@Override public Parcelable onSaveInstanceState(){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  ss.transportState=mTransportState;
  ss.appWidgetToShow=mAppWidgetToShow;
  return ss;
}

Fixed version (ground truth):
@Override public Parcelable onSaveInstanceState(){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  final boolean showing=mTransportControl != null && mAppWidgetContainer.getWidgetPageIndex(mTransportControl) >= 0;
  ss.transportState=showing ? TRANSPORT_VISIBLE : mTransportState;
  ss.appWidgetToShow=mAppWidgetToShow;
  return ss;
}
Program: 2401
Project: 2401
Buggy source:
private int getAppropriateWidgetPage(int musicTransportState){
  if (mAppWidgetToShow != AppWidgetManager.INVALID_APPWIDGET_ID) {
    final int childCount=mAppWidgetContainer.getChildCount();
    for (int i=0; i < childCount; i++) {
      if (mAppWidgetContainer.getWidgetPageAt(i).getContentAppWidgetId() == mAppWidgetToShow) {
        return i;
      }
    }
    mAppWidgetToShow=AppWidgetManager.INVALID_APPWIDGET_ID;
  }
  if (musicTransportState == TRANSPORT_VISIBLE) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return mAppWidgetContainer.getWidgetPageIndex(getTransportControlView());
  }
  int rightMost=mAppWidgetContainer.getChildCount() - 1;
  if (mAppWidgetContainer.isCameraPage(rightMost)) {
    rightMost--;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + rightMost);
  return rightMost;
}

Fixed version (ground truth):
private int getAppropriateWidgetPage(int musicTransportState){
  if (mAppWidgetToShow != AppWidgetManager.INVALID_APPWIDGET_ID) {
    final int childCount=mAppWidgetContainer.getChildCount();
    for (int i=0; i < childCount; i++) {
      if (mAppWidgetContainer.getWidgetPageAt(i).getContentAppWidgetId() == mAppWidgetToShow) {
        return i;
      }
    }
    mAppWidgetToShow=AppWidgetManager.INVALID_APPWIDGET_ID;
  }
  if (musicTransportState == TRANSPORT_VISIBLE) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return mAppWidgetContainer.getWidgetPageIndex(getOrCreateTransportControl());
  }
  int rightMost=mAppWidgetContainer.getChildCount() - 1;
  if (mAppWidgetContainer.isCameraPage(rightMost)) {
    rightMost--;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + rightMost);
  return rightMost;
}
Program: 2402
Project: 2402
Buggy source:
@Override public void onRestoreInstanceState(Parcelable state){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  post(mSwitchPageRunnable);
}

Fixed version (ground truth):
@Override public void onRestoreInstanceState(Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
    return;
  }
  SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  mTransportState=(ss.transportState);
  mAppWidgetToShow=ss.appWidgetToShow;
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  post(mSwitchPageRunnable);
}
Program: 2403
Project: 2403
Buggy source:
protected void handleSetPlaybackState(int generationId,int playbackState,long eventTime){
  if (generationId == mDisplayClientState.clientGeneration) {
    for (int i=0; i < mCallbacks.size(); i++) {
      KeyguardUpdateMonitorCallback cb=mCallbacks.get(i).get();
      if (cb != null) {
        cb.onMusicPlaybackStateChanged(playbackState,eventTime);
      }
    }
  }
 else {
    Log.w(TAG,"String_Node_Str" + generationId + "String_Node_Str");
  }
}

Fixed version (ground truth):
protected void handleSetPlaybackState(int generationId,int playbackState,long eventTime){
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + generationId + "String_Node_Str"+ playbackState+ "String_Node_Str"+ eventTime+ "String_Node_Str");
  mDisplayClientState.playbackState=playbackState;
  mDisplayClientState.playbackEventTime=eventTime;
  if (generationId == mDisplayClientState.clientGeneration) {
    for (int i=0; i < mCallbacks.size(); i++) {
      KeyguardUpdateMonitorCallback cb=mCallbacks.get(i).get();
      if (cb != null) {
        cb.onMusicPlaybackStateChanged(playbackState,eventTime);
      }
    }
  }
 else {
    Log.w(TAG,"String_Node_Str" + generationId + "String_Node_Str");
  }
}
Program: 2404
Project: 2404
Buggy source:
protected void handleSetGenerationId(int clientGeneration,boolean clearing,PendingIntent p){
  mDisplayClientState.clientGeneration=clientGeneration;
  mDisplayClientState.clearing=clearing;
  mDisplayClientState.intent=p;
  for (int i=0; i < mCallbacks.size(); i++) {
    KeyguardUpdateMonitorCallback cb=mCallbacks.get(i).get();
    if (cb != null) {
      cb.onMusicClientIdChanged(clientGeneration,clearing,p);
    }
  }
}

Fixed version (ground truth):
protected void handleSetGenerationId(int clientGeneration,boolean clearing,PendingIntent p){
  mDisplayClientState.clientGeneration=clientGeneration;
  mDisplayClientState.clearing=clearing;
  mDisplayClientState.intent=p;
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + clientGeneration + "String_Node_Str"+ clearing+ "String_Node_Str");
  for (int i=0; i < mCallbacks.size(); i++) {
    KeyguardUpdateMonitorCallback cb=mCallbacks.get(i).get();
    if (cb != null) {
      cb.onMusicClientIdChanged(clientGeneration,clearing,p);
    }
  }
}
Program: 2405
Project: 2405
Buggy source:
/** 
 * Send message to keyguard telling it to reset its state.
 * @param options options about how to show the keyguard
 * @see #handleReset()
 */
private void resetStateLocked(Bundle options){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  Message msg=mHandler.obtainMessage(RESET,options);
  mHandler.sendMessage(msg);
}

Fixed version (ground truth):
/** 
 * Send message to keyguard telling it to reset its state.
 * @param options options about how to show the keyguard
 * @see #handleReset()
 */
private void resetStateLocked(Bundle options){
  if (DEBUG)   Log.e(TAG,"String_Node_Str");
  Message msg=mHandler.obtainMessage(RESET,options);
  mHandler.sendMessage(msg);
}
Program: 2406
Project: 2406
Buggy source:
private boolean verifyPreloadConfig(TypedValue value,String name){
  if ((value.changingConfigurations & ~(ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_DENSITY)) != 0) {
    String resName;
    try {
      resName=getResourceName(value.resourceId);
    }
 catch (    NotFoundException e) {
      resName="String_Node_Str";
    }
    Log.w(TAG,"String_Node_Str" + name + "String_Node_Str"+ Integer.toHexString(value.resourceId)+ "String_Node_Str"+ resName+ "String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean verifyPreloadConfig(int changingConfigurations,int resourceId,String name){
  if (((changingConfigurations & ~(ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_DENSITY)) & VARYING_CONFIGS) != 0) {
    String resName;
    try {
      resName=getResourceName(resourceId);
    }
 catch (    NotFoundException e) {
      resName="String_Node_Str";
    }
    Log.w(TAG,"String_Node_Str" + name + "String_Node_Str"+ Integer.toHexString(resourceId)+ "String_Node_Str"+ resName+ "String_Node_Str");
    return false;
  }
  return true;
}
Program: 2409
Project: 2409
Buggy source:
@Override public int getChangingConfigurations(){
  return mChangingConfigurations;
}

Fixed version (ground truth):
@Override public int getChangingConfigurations(){
  return mChangingConfigurations | mChildrenChangingConfigurations;
}
Program: 2410
Project: 2410
Buggy source:
public KeyguardHostView(Context context,AttributeSet attrs){
  super(context,attrs);
  mLockPatternUtils=new LockPatternUtils(context);
  mUserId=mLockPatternUtils.getCurrentUser();
  DevicePolicyManager dpm=(DevicePolicyManager)mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
  if (dpm != null) {
    mDisabledFeatures=getDisabledFeatures(dpm);
    mCameraDisabled=dpm.getCameraDisabled(null);
  }
  mSafeModeEnabled=LockPatternUtils.isSafeModeEnabled();
  Context userContext=null;
  try {
    final String packageName="String_Node_Str";
    userContext=mContext.createPackageContextAsUser(packageName,0,new UserHandle(mUserId));
  }
 catch (  NameNotFoundException e) {
    e.printStackTrace();
    userContext=context;
  }
  mAppWidgetHost=new AppWidgetHost(userContext,APPWIDGET_HOST_ID,mOnClickHandler,Looper.myLooper());
  cleanupAppWidgetIds();
  mAppWidgetManager=AppWidgetManager.getInstance(userContext);
  mSecurityModel=new KeyguardSecurityModel(context);
  mViewStateManager=new KeyguardViewStateManager(this);
  mUserSetupCompleted=Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.USER_SETUP_COMPLETE,0,UserHandle.USER_CURRENT) != 0;
  getInitialTransportState();
  if (mSafeModeEnabled) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
public KeyguardHostView(Context context,AttributeSet attrs){
  super(context,attrs);
  if (DEBUG)   Log.e(TAG,"String_Node_Str");
  mLockPatternUtils=new LockPatternUtils(context);
  mUserId=mLockPatternUtils.getCurrentUser();
  DevicePolicyManager dpm=(DevicePolicyManager)mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
  if (dpm != null) {
    mDisabledFeatures=getDisabledFeatures(dpm);
    mCameraDisabled=dpm.getCameraDisabled(null);
  }
  mSafeModeEnabled=LockPatternUtils.isSafeModeEnabled();
  Context userContext=null;
  try {
    final String packageName="String_Node_Str";
    userContext=mContext.createPackageContextAsUser(packageName,0,new UserHandle(mUserId));
  }
 catch (  NameNotFoundException e) {
    e.printStackTrace();
    userContext=context;
  }
  mAppWidgetHost=new AppWidgetHost(userContext,APPWIDGET_HOST_ID,mOnClickHandler,Looper.myLooper());
  cleanupAppWidgetIds();
  mAppWidgetManager=AppWidgetManager.getInstance(userContext);
  mSecurityModel=new KeyguardSecurityModel(context);
  mViewStateManager=new KeyguardViewStateManager(this);
  mUserSetupCompleted=Settings.Secure.getIntForUser(mContext.getContentResolver(),Settings.Secure.USER_SETUP_COMPLETE,0,UserHandle.USER_CURRENT) != 0;
  getInitialTransportState();
  if (mSafeModeEnabled) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
  if ((mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0) {
    Log.v(TAG,"String_Node_Str");
  }
}
Program: 2411
Project: 2411
Buggy source:
private void ensureTransportPresentOrRemoved(int state){
  int page=getWidgetPosition(R.id.keyguard_transport_control);
  if (state == TRANSPORT_INVISIBLE || state == TRANSPORT_VISIBLE) {
    if (page == -1) {
      if (DEBUGXPORT)       Log.v(TAG,"String_Node_Str");
      int lastWidget=mAppWidgetContainer.getChildCount() - 1;
      int position=0;
      if (lastWidget >= 0) {
        position=mAppWidgetContainer.isCameraPage(lastWidget) ? lastWidget : lastWidget + 1;
      }
      mAppWidgetContainer.addWidget(getTransportControlView(),position);
    }
  }
 else   if (page != -1) {
    if (DEBUGXPORT)     Log.v(TAG,"String_Node_Str");
    mAppWidgetContainer.removeWidget(getTransportControlView());
    mTransportControl=null;
  }
}

Fixed version (ground truth):
/** 
 * Examines the current state and adds the transport to the widget pager when the state changes. Showing the initial transport and keeping it around is a bit tricky because the signals coming from music players aren't always clear. Here's how the states are handled:  {@link TRANSPORT_GONE} means we have no reason to show the transport - remove it if present.{@link TRANSPORT_INVISIBLE} means we have potential to show the transport because a musicplayer is registered but not currently playing music (or we don't know the state yet). The code adds it conditionally on play state. {@link #TRANSPORT_VISIBLE} means a music player is active and transport should be showing.Once the transport is showing, we always show it until keyguard is dismissed. This state is maintained by onSave/RestoreInstanceState(). This state is cleared in {@link KeyguardViewManager#hide} when keyguard is dismissed, which causes the transport to begone when keyguard is restarted until we get an update with the current state.
 * @param state
 */
private void ensureTransportPresentOrRemoved(int state){
  final boolean showing=getWidgetPosition(R.id.keyguard_transport_control) != -1;
  final boolean visible=state == TRANSPORT_VISIBLE;
  final boolean shouldBeVisible=state == TRANSPORT_INVISIBLE && isMusicPlaying(state);
  if (!showing && (visible || shouldBeVisible)) {
    if (DEBUGXPORT)     Log.v(TAG,"String_Node_Str");
    int lastWidget=mAppWidgetContainer.getChildCount() - 1;
    int position=0;
    if (lastWidget >= 0) {
      position=mAppWidgetContainer.isCameraPage(lastWidget) ? lastWidget : lastWidget + 1;
    }
    mAppWidgetContainer.addWidget(getOrCreateTransportControl(),position);
  }
 else   if (showing && state == TRANSPORT_GONE) {
    if (DEBUGXPORT)     Log.v(TAG,"String_Node_Str");
    mAppWidgetContainer.removeWidget(getOrCreateTransportControl());
    mTransportControl=null;
  }
}
Program: 2412
Project: 2412
Buggy source:
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  mPlaybackState=dcs.playbackState;
}

Fixed version (ground truth):
private void getInitialTransportState(){
  DisplayClientState dcs=KeyguardUpdateMonitor.getInstance(mContext).getCachedDisplayClientState();
  mTransportState=(dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE));
  mPlaybackState=dcs.playbackState;
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + mTransportState + "String_Node_Str"+ mPlaybackState);
}
Program: 2413
Project: 2413
Buggy source:
@Override public Parcelable onSaveInstanceState(){
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  ss.transportState=mTransportState;
  ss.appWidgetToShow=mAppWidgetToShow;
  return ss;
}

Fixed version (ground truth):
@Override public Parcelable onSaveInstanceState(){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mTransportState);
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  final boolean showing=mTransportControl != null && mAppWidgetContainer.getWidgetPageIndex(mTransportControl) >= 0;
  ss.transportState=showing ? TRANSPORT_VISIBLE : mTransportState;
  ss.appWidgetToShow=mAppWidgetToShow;
  return ss;
}
Program: 2414
Project: 2414
Buggy source:
private int getAppropriateWidgetPage(int musicTransportState){
  if (mAppWidgetToShow != AppWidgetManager.INVALID_APPWIDGET_ID) {
    final int childCount=mAppWidgetContainer.getChildCount();
    for (int i=0; i < childCount; i++) {
      if (mAppWidgetContainer.getWidgetPageAt(i).getContentAppWidgetId() == mAppWidgetToShow) {
        return i;
      }
    }
    mAppWidgetToShow=AppWidgetManager.INVALID_APPWIDGET_ID;
  }
  if (musicTransportState == TRANSPORT_VISIBLE) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return mAppWidgetContainer.getWidgetPageIndex(getTransportControlView());
  }
  int rightMost=mAppWidgetContainer.getChildCount() - 1;
  if (mAppWidgetContainer.isCameraPage(rightMost)) {
    rightMost--;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + rightMost);
  return rightMost;
}

Fixed version (ground truth):
private int getAppropriateWidgetPage(int musicTransportState){
  if (mAppWidgetToShow != AppWidgetManager.INVALID_APPWIDGET_ID) {
    final int childCount=mAppWidgetContainer.getChildCount();
    for (int i=0; i < childCount; i++) {
      if (mAppWidgetContainer.getWidgetPageAt(i).getContentAppWidgetId() == mAppWidgetToShow) {
        return i;
      }
    }
    mAppWidgetToShow=AppWidgetManager.INVALID_APPWIDGET_ID;
  }
  if (musicTransportState == TRANSPORT_VISIBLE) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return mAppWidgetContainer.getWidgetPageIndex(getOrCreateTransportControl());
  }
  int rightMost=mAppWidgetContainer.getChildCount() - 1;
  if (mAppWidgetContainer.isCameraPage(rightMost)) {
    rightMost--;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + rightMost);
  return rightMost;
}