nus-yam/ex-repair huggingface dataset:
Program: 196334
Project: 196334
Buggy source:
/** 
 * Return vendor id of the device. Vendor id is used to distinguish devices built by other manufactures. This is required for vendor-specific command on CEC standard.
 */
public int getVendorId(){
  return mVendorId;
}

Fixed version (ground truth):
/** 
 * Returns vendor id of the device. Vendor id is used to distinguish devices built by other manufactures. This is required for vendor-specific command on CEC standard.
 */
public int getVendorId(){
  return mVendorId;
}
Program: 196335
Project: 196335
Buggy source:
/** 
 * Serialize this object into a   {@link Parcel}.
 * @param dest The Parcel in which the object should be written.
 * @param flags Additional flags about how the object should be written. May be 0 or{@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE}.
 */
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(mHdmiDeviceType);
  dest.writeInt(mPhysicalAddress);
  dest.writeInt(mPortId);
switch (mHdmiDeviceType) {
case HDMI_DEVICE_TYPE_CEC:
    dest.writeInt(mLogicalAddress);
  dest.writeInt(mDeviceType);
dest.writeInt(mVendorId);
dest.writeInt(mDevicePowerStatus);
dest.writeString(mDisplayName);
break;
case HDMI_DEVICE_TYPE_MHL:
dest.writeInt(mDeviceId);
dest.writeInt(mAdopterId);
break;
default :
}
}

Fixed version (ground truth):
/** 
 * Serializes this object into a   {@link Parcel}.
 * @param dest The Parcel in which the object should be written.
 * @param flags Additional flags about how the object should be written. May be 0 or{@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE}.
 */
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(mHdmiDeviceType);
  dest.writeInt(mPhysicalAddress);
  dest.writeInt(mPortId);
switch (mHdmiDeviceType) {
case HDMI_DEVICE_TYPE_CEC:
    dest.writeInt(mLogicalAddress);
  dest.writeInt(mDeviceType);
dest.writeInt(mVendorId);
dest.writeInt(mDevicePowerStatus);
dest.writeString(mDisplayName);
break;
case HDMI_DEVICE_TYPE_MHL:
dest.writeInt(mDeviceId);
dest.writeInt(mAdopterId);
break;
default :
}
}
Program: 196336
Project: 196336
Buggy source:
/** 
 * Return the port number for which the event occurred.
 * @return port number
 */
public int getPort(){
  return mPort;
}

Fixed version (ground truth):
/** 
 * Returns the port number for which the event occurred.
 * @return port number
 */
public int getPort(){
  return mPort;
}
Program: 196337
Project: 196337
Buggy source:
/** 
 * Return the connection status associated with this event
 * @return true if the device gets connected; otherwise false
 */
public boolean isConnected(){
  return mConnected;
}

Fixed version (ground truth):
/** 
 * Returns the connection status associated with this event
 * @return true if the device gets connected; otherwise false
 */
public boolean isConnected(){
  return mConnected;
}
Program: 196338
Project: 196338
Buggy source:
public HdmiHotplugEvent[] newArray(int size){
  return new HdmiHotplugEvent[size];
}

Fixed version (ground truth):
@Override public HdmiHotplugEvent[] newArray(int size){
  return new HdmiHotplugEvent[size];
}
Program: 196339
Project: 196339
Buggy source:
/** 
 * Rebuild a   {@link HdmiHotplugEvent} previously stored with{@link Parcelable#writeToParcel(Parcel,int)}.
 * @param p {@link HdmiHotplugEvent} object to read the Rating from
 * @return a new {@link HdmiHotplugEvent} created from the data in the parcel
 */
public HdmiHotplugEvent createFromParcel(Parcel p){
  int port=p.readInt();
  boolean connected=p.readByte() == 1;
  return new HdmiHotplugEvent(port,connected);
}

Fixed version (ground truth):
/** 
 * Rebuilds a   {@link HdmiHotplugEvent} previously stored with{@link Parcelable#writeToParcel(Parcel,int)}.
 * @param p {@link HdmiHotplugEvent} object to read the Rating from
 * @return a new {@link HdmiHotplugEvent} created from the data in the parcel
 */
@Override public HdmiHotplugEvent createFromParcel(Parcel p){
  int port=p.readInt();
  boolean connected=p.readByte() == 1;
  return new HdmiHotplugEvent(port,connected);
}
Program: 196340
Project: 196340
Buggy source:
/** 
 * Describe the kinds of special objects contained in this Parcelable's marshalled representation.
 */
@Override public int describeContents(){
  return 0;
}

Fixed version (ground truth):
/** 
 * Describes the kinds of special objects contained in this Parcelable's marshalled representation.
 */
@Override public int describeContents(){
  return 0;
}
Program: 196341
Project: 196341
Buggy source:
/** 
 * Flatten this object in to a Parcel.
 * @param dest The Parcel in which the object should be written.
 * @param flags Additional flags about how the object should be written.May be 0 or  {@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE}.
 */
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(mPort);
  dest.writeByte((byte)(mConnected ? 1 : 0));
}

Fixed version (ground truth):
/** 
 * Flattens this object in to a Parcel.
 * @param dest The Parcel in which the object should be written.
 * @param flags Additional flags about how the object should be written.May be 0 or  {@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE}.
 */
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(mPort);
  dest.writeByte((byte)(mConnected ? 1 : 0));
}
Program: 196342
Project: 196342
Buggy source:
protected abstract int getDeviceType();

Fixed version (ground truth):
abstract int getDeviceType();
Program: 196343
Project: 196343
Buggy source:
public HdmiClient(IHdmiControlService service){
  mService=service;
}

Fixed version (ground truth):
HdmiClient(IHdmiControlService service){
  mService=service;
}
Program: 196344
Project: 196344
Buggy source:
/** 
 * Send a key event to other logical device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
public void sendKeyEvent(int keyCode,boolean isPressed){
  try {
    mService.sendKeyEvent(getDeviceType(),keyCode,isPressed);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Sends a key event to other logical device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
public void sendKeyEvent(int keyCode,boolean isPressed){
  try {
    mService.sendKeyEvent(getDeviceType(),keyCode,isPressed);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 196345
Project: 196345
Buggy source:
/** 
 * Send vendor-specific command.
 * @param targetAddress address of the target device
 * @param params vendor-specific parameter. For &lt;Vendor Command With ID&gt; do notinclude the first 3 bytes (vendor ID).
 * @param hasVendorId {@code true} if the command type will be &lt;Vendor Command With ID&gt;.{@code false} if the command will be &lt;Vendor Command&gt;
 */
public void sendVendorCommand(int targetAddress,byte[] params,boolean hasVendorId){
  try {
    mService.sendVendorCommand(getDeviceType(),targetAddress,params,hasVendorId);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Sends vendor-specific command.
 * @param targetAddress address of the target device
 * @param params vendor-specific parameter. For &lt;Vendor Command With ID&gt; do notinclude the first 3 bytes (vendor ID).
 * @param hasVendorId {@code true} if the command type will be &lt;Vendor Command With ID&gt;.{@code false} if the command will be &lt;Vendor Command&gt;
 */
public void sendVendorCommand(int targetAddress,byte[] params,boolean hasVendorId){
  try {
    mService.sendVendorCommand(getDeviceType(),targetAddress,params,hasVendorId);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 196346
Project: 196346
Buggy source:
/** 
 * @hide - hide this constructor because it has a parameter of typeIHdmiControlService, which is a system private class. The right way to create an instance of this class is using the factory Context.getSystemService.
 */
public HdmiControlManager(IHdmiControlService service){
  mService=service;
  int[] types=null;
  if (mService != null) {
    try {
      types=mService.getSupportedTypes();
    }
 catch (    RemoteException e) {
    }
  }
  mHasTvDevice=hasDeviceType(types,HdmiDeviceInfo.DEVICE_TV);
  mHasPlaybackDevice=hasDeviceType(types,HdmiDeviceInfo.DEVICE_PLAYBACK);
}

Fixed version (ground truth):
/** 
 * {@hide} - hide this constructor because it has a parameter of type IHdmiControlService,which is a system private class. The right way to create an instance of this class is using the factory Context.getSystemService.
 */
public HdmiControlManager(IHdmiControlService service){
  mService=service;
  int[] types=null;
  if (mService != null) {
    try {
      types=mService.getSupportedTypes();
    }
 catch (    RemoteException e) {
    }
  }
  mHasTvDevice=hasDeviceType(types,HdmiDeviceInfo.DEVICE_TV);
  mHasPlaybackDevice=hasDeviceType(types,HdmiDeviceInfo.DEVICE_PLAYBACK);
}
Program: 196347
Project: 196347
Buggy source:
/** 
 * Removes a listener to stop getting informed of   {@link HdmiHotplugEvent}.
 * @param listener {@link HotplugEventListener} instance to be removed
 */
public void removeHotplugEventListener(HotplugEventListener listener){
  if (mService == null) {
    return;
  }
  try {
    mService.removeHotplugEventListener(getHotplugEventListenerWrapper(listener));
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
/** 
 * Removes a listener to stop getting informed of   {@link HdmiHotplugEvent}.
 * @param listener {@link HotplugEventListener} instance to be removed
 */
public void removeHotplugEventListener(HotplugEventListener listener){
  if (mService == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  IHdmiHotplugEventListener wrappedListener=mHotplugEventListeners.remove(listener);
  if (wrappedListener == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  try {
    mService.removeHotplugEventListener(wrappedListener);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 196348
Project: 196348
Buggy source:
/** 
 * Adds a listener to get informed of   {@link HdmiHotplugEvent}. <p>To stop getting the notification, use   {@link #removeHotplugEventListener(HotplugEventListener)}.
 * @param listener {@link HotplugEventListener} instance
 * @see HdmiControlManager#removeHotplugEventListener(HotplugEventListener)
 */
public void addHotplugEventListener(HotplugEventListener listener){
  if (mService == null) {
    return;
  }
  try {
    mService.addHotplugEventListener(getHotplugEventListenerWrapper(listener));
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
/** 
 * Adds a listener to get informed of   {@link HdmiHotplugEvent}. <p>To stop getting the notification, use   {@link #removeHotplugEventListener(HotplugEventListener)}.
 * @param listener {@link HotplugEventListener} instance
 * @see HdmiControlManager#removeHotplugEventListener(HotplugEventListener)
 */
public void addHotplugEventListener(HotplugEventListener listener){
  if (mService == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  if (mHotplugEventListeners.containsKey(listener)) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  IHdmiHotplugEventListener wrappedListener=getHotplugEventListenerWrapper(listener);
  mHotplugEventListeners.put(listener,wrappedListener);
  try {
    mService.addHotplugEventListener(wrappedListener);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 196349
Project: 196349
Buggy source:
/** 
 * Return the physical address of the device.
 */
public int getPhysicalAddress(){
  return mPhysicalAddress;
}

Fixed version (ground truth):
/** 
 * Returns the physical address of the device.
 */
public int getPhysicalAddress(){
  return mPhysicalAddress;
}
Program: 196350
Project: 196350
Buggy source:
/** 
 * Return the CEC logical address of the device.
 */
public int getLogicalAddress(){
  return mLogicalAddress;
}

Fixed version (ground truth):
/** 
 * Returns the CEC logical address of the device.
 */
public int getLogicalAddress(){
  return mLogicalAddress;
}
Program: 196351
Project: 196351
Buggy source:
/** 
 * Return the id of the device.
 */
public int getId(){
  return mId;
}

Fixed version (ground truth):
/** 
 * Returns the id of the device.
 */
public int getId(){
  return mId;
}
Program: 196352
Project: 196352
Buggy source:
/** 
 * Return device's power status. It should be one of the following values. <ul> <li>  {@link HdmiControlManager#POWER_STATUS_ON}<li>  {@link HdmiControlManager#POWER_STATUS_STANDBY}<li>  {@link HdmiControlManager#POWER_STATUS_TRANSIENT_TO_ON}<li>  {@link HdmiControlManager#POWER_STATUS_TRANSIENT_TO_STANDBY}<li>  {@link HdmiControlManager#POWER_STATUS_UNKNOWN}</ul>
 */
public int getDevicePowerStatus(){
  return mDevicePowerStatus;
}

Fixed version (ground truth):
/** 
 * Returns device's power status. It should be one of the following values. <ul> <li>  {@link HdmiControlManager#POWER_STATUS_ON}<li>  {@link HdmiControlManager#POWER_STATUS_STANDBY}<li>  {@link HdmiControlManager#POWER_STATUS_TRANSIENT_TO_ON}<li>  {@link HdmiControlManager#POWER_STATUS_TRANSIENT_TO_STANDBY}<li>  {@link HdmiControlManager#POWER_STATUS_UNKNOWN}</ul>
 */
public int getDevicePowerStatus(){
  return mDevicePowerStatus;
}
Program: 196353
Project: 196353
Buggy source:
/** 
 * Describe the kinds of special objects contained in this Parcelable's marshalled representation.
 */
@Override public int describeContents(){
  return 0;
}

Fixed version (ground truth):
/** 
 * Describes the kinds of special objects contained in this Parcelable's marshalled representation.
 */
@Override public int describeContents(){
  return 0;
}
Program: 196354
Project: 196354
Buggy source:
/** 
 * Return the id to be used for MHL device.
 * @param portId port which the MHL device is connected to
 * @return id for MHL device
 */
public static int idForMhlDevice(int portId){
  return ID_OFFSET_MHL + portId;
}

Fixed version (ground truth):
/** 
 * Returns the id to be used for MHL device.
 * @param portId port which the MHL device is connected to
 * @return id for MHL device
 */
public static int idForMhlDevice(int portId){
  return ID_OFFSET_MHL + portId;
}
Program: 196355
Project: 196355
Buggy source:
/** 
 * Return   {@code true} if the device represents an HDMI-CEC device. {@code false} if the deviceis either MHL or other device.
 */
public boolean isCecDevice(){
  return mHdmiDeviceType == HDMI_DEVICE_TYPE_CEC;
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if the device represents an HDMI-CEC device. {@code false} if the deviceis either MHL or other device.
 */
public boolean isCecDevice(){
  return mHdmiDeviceType == HDMI_DEVICE_TYPE_CEC;
}
Program: 196356
Project: 196356
Buggy source:
/** 
 * Return MHL device id. Return -1 for non-MHL device.
 */
public int getDeviceId(){
  return mDeviceId;
}

Fixed version (ground truth):
/** 
 * Returns MHL device id. Return -1 for non-MHL device.
 */
public int getDeviceId(){
  return mDeviceId;
}
Program: 196357
Project: 196357
Buggy source:
/** 
 * Return   {@code true} if the device is of a type that can be an input source.
 */
public boolean isSourceType(){
  return mDeviceType == DEVICE_PLAYBACK || mDeviceType == DEVICE_RECORDER || mDeviceType == DEVICE_TUNER;
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if the device is of a type that can be an input source.
 */
public boolean isSourceType(){
  return mDeviceType == DEVICE_PLAYBACK || mDeviceType == DEVICE_RECORDER || mDeviceType == DEVICE_TUNER;
}
Program: 196358
Project: 196358
Buggy source:
/** 
 * Return the port ID.
 */
public int getPortId(){
  return mPortId;
}

Fixed version (ground truth):
/** 
 * Returns the port ID.
 */
public int getPortId(){
  return mPortId;
}
Program: 196359
Project: 196359
Buggy source:
/** 
 * Return display (OSD) name of the device.
 */
public String getDisplayName(){
  return mDisplayName;
}

Fixed version (ground truth):
/** 
 * Returns display (OSD) name of the device.
 */
public String getDisplayName(){
  return mDisplayName;
}
Program: 196360
Project: 196360
Buggy source:
/** 
 * Return CEC type of the device. For more details, refer constants between   {@link #DEVICE_TV}and   {@link #DEVICE_INACTIVE}.
 */
public int getDeviceType(){
  return mDeviceType;
}

Fixed version (ground truth):
/** 
 * Returns CEC type of the device. For more details, refer constants between   {@link #DEVICE_TV}and   {@link #DEVICE_INACTIVE}.
 */
public int getDeviceType(){
  return mDeviceType;
}
Program: 196361
Project: 196361
Buggy source:
/** 
 * Return   {@code true} if the device represents an MHL device. {@code false} if the device iseither CEC or other device.
 */
public boolean isMhlDevice(){
  return mHdmiDeviceType == HDMI_DEVICE_TYPE_MHL;
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if the device represents an MHL device. {@code false} if the device iseither CEC or other device.
 */
public boolean isMhlDevice(){
  return mHdmiDeviceType == HDMI_DEVICE_TYPE_MHL;
}
Program: 196362
Project: 196362
Buggy source:
/** 
 * Return MHL adopter id. Return -1 for non-MHL device.
 */
public int getAdopterId(){
  return mAdopterId;
}

Fixed version (ground truth):
/** 
 * Returns MHL adopter id. Return -1 for non-MHL device.
 */
public int getAdopterId(){
  return mAdopterId;
}
Program: 196363
Project: 196363
Buggy source:
/** 
 * Return the id to be used for hardware port.
 * @param portId port id
 * @return id for hardware port
 */
public static int idForHardware(int portId){
  return ID_OFFSET_HARDWARE + portId;
}

Fixed version (ground truth):
/** 
 * Returns the id to be used for hardware port.
 * @param portId port id
 * @return id for hardware port
 */
public static int idForHardware(int portId){
  return ID_OFFSET_HARDWARE + portId;
}
Program: 196364
Project: 196364
Buggy source:
/** 
 * Return the id to be used for CEC device.
 * @param address logical address of CEC device
 * @return id for CEC device
 */
public static int idForCecDevice(int address){
  return ID_OFFSET_CEC + address;
}

Fixed version (ground truth):
/** 
 * Returns the id to be used for CEC device.
 * @param address logical address of CEC device
 * @return id for CEC device
 */
public static int idForCecDevice(int address){
  return ID_OFFSET_CEC + address;
}
Program: 196365
Project: 196365
Buggy source:
/** 
 * Return vendor id of the device. Vendor id is used to distinguish devices built by other manufactures. This is required for vendor-specific command on CEC standard.
 */
public int getVendorId(){
  return mVendorId;
}

Fixed version (ground truth):
/** 
 * Returns vendor id of the device. Vendor id is used to distinguish devices built by other manufactures. This is required for vendor-specific command on CEC standard.
 */
public int getVendorId(){
  return mVendorId;
}
Program: 196366
Project: 196366
Buggy source:
/** 
 * Serialize this object into a   {@link Parcel}.
 * @param dest The Parcel in which the object should be written.
 * @param flags Additional flags about how the object should be written. May be 0 or{@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE}.
 */
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(mHdmiDeviceType);
  dest.writeInt(mPhysicalAddress);
  dest.writeInt(mPortId);
switch (mHdmiDeviceType) {
case HDMI_DEVICE_TYPE_CEC:
    dest.writeInt(mLogicalAddress);
  dest.writeInt(mDeviceType);
dest.writeInt(mVendorId);
dest.writeInt(mDevicePowerStatus);
dest.writeString(mDisplayName);
break;
case HDMI_DEVICE_TYPE_MHL:
dest.writeInt(mDeviceId);
dest.writeInt(mAdopterId);
break;
default :
}
}

Fixed version (ground truth):
/** 
 * Serializes this object into a   {@link Parcel}.
 * @param dest The Parcel in which the object should be written.
 * @param flags Additional flags about how the object should be written. May be 0 or{@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE}.
 */
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(mHdmiDeviceType);
  dest.writeInt(mPhysicalAddress);
  dest.writeInt(mPortId);
switch (mHdmiDeviceType) {
case HDMI_DEVICE_TYPE_CEC:
    dest.writeInt(mLogicalAddress);
  dest.writeInt(mDeviceType);
dest.writeInt(mVendorId);
dest.writeInt(mDevicePowerStatus);
dest.writeString(mDisplayName);
break;
case HDMI_DEVICE_TYPE_MHL:
dest.writeInt(mDeviceId);
dest.writeInt(mAdopterId);
break;
default :
}
}
Program: 196367
Project: 196367
Buggy source:
/** 
 * Return the port number for which the event occurred.
 * @return port number
 */
public int getPort(){
  return mPort;
}

Fixed version (ground truth):
/** 
 * Returns the port number for which the event occurred.
 * @return port number
 */
public int getPort(){
  return mPort;
}
Program: 196368
Project: 196368
Buggy source:
/** 
 * Return the connection status associated with this event
 * @return true if the device gets connected; otherwise false
 */
public boolean isConnected(){
  return mConnected;
}

Fixed version (ground truth):
/** 
 * Returns the connection status associated with this event
 * @return true if the device gets connected; otherwise false
 */
public boolean isConnected(){
  return mConnected;
}
Program: 196369
Project: 196369
Buggy source:
public HdmiHotplugEvent[] newArray(int size){
  return new HdmiHotplugEvent[size];
}

Fixed version (ground truth):
@Override public HdmiHotplugEvent[] newArray(int size){
  return new HdmiHotplugEvent[size];
}
Program: 196370
Project: 196370
Buggy source:
/** 
 * Rebuild a   {@link HdmiHotplugEvent} previously stored with{@link Parcelable#writeToParcel(Parcel,int)}.
 * @param p {@link HdmiHotplugEvent} object to read the Rating from
 * @return a new {@link HdmiHotplugEvent} created from the data in the parcel
 */
public HdmiHotplugEvent createFromParcel(Parcel p){
  int port=p.readInt();
  boolean connected=p.readByte() == 1;
  return new HdmiHotplugEvent(port,connected);
}

Fixed version (ground truth):
/** 
 * Rebuilds a   {@link HdmiHotplugEvent} previously stored with{@link Parcelable#writeToParcel(Parcel,int)}.
 * @param p {@link HdmiHotplugEvent} object to read the Rating from
 * @return a new {@link HdmiHotplugEvent} created from the data in the parcel
 */
@Override public HdmiHotplugEvent createFromParcel(Parcel p){
  int port=p.readInt();
  boolean connected=p.readByte() == 1;
  return new HdmiHotplugEvent(port,connected);
}
Program: 196371
Project: 196371
Buggy source:
/** 
 * Describe the kinds of special objects contained in this Parcelable's marshalled representation.
 */
@Override public int describeContents(){
  return 0;
}

Fixed version (ground truth):
/** 
 * Describes the kinds of special objects contained in this Parcelable's marshalled representation.
 */
@Override public int describeContents(){
  return 0;
}
Program: 196372
Project: 196372
Buggy source:
/** 
 * Flatten this object in to a Parcel.
 * @param dest The Parcel in which the object should be written.
 * @param flags Additional flags about how the object should be written.May be 0 or  {@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE}.
 */
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(mPort);
  dest.writeByte((byte)(mConnected ? 1 : 0));
}

Fixed version (ground truth):
/** 
 * Flattens this object in to a Parcel.
 * @param dest The Parcel in which the object should be written.
 * @param flags Additional flags about how the object should be written.May be 0 or  {@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE}.
 */
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(mPort);
  dest.writeByte((byte)(mConnected ? 1 : 0));
}
Program: 196373
Project: 196373
Buggy source:
protected abstract int getDeviceType();

Fixed version (ground truth):
abstract int getDeviceType();
Program: 196374
Project: 196374
Buggy source:
public HdmiClient(IHdmiControlService service){
  mService=service;
}

Fixed version (ground truth):
HdmiClient(IHdmiControlService service){
  mService=service;
}
Program: 196375
Project: 196375
Buggy source:
/** 
 * Send a key event to other logical device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
public void sendKeyEvent(int keyCode,boolean isPressed){
  try {
    mService.sendKeyEvent(getDeviceType(),keyCode,isPressed);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Sends a key event to other logical device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
public void sendKeyEvent(int keyCode,boolean isPressed){
  try {
    mService.sendKeyEvent(getDeviceType(),keyCode,isPressed);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 196376
Project: 196376
Buggy source:
/** 
 * Send vendor-specific command.
 * @param targetAddress address of the target device
 * @param params vendor-specific parameter. For &lt;Vendor Command With ID&gt; do notinclude the first 3 bytes (vendor ID).
 * @param hasVendorId {@code true} if the command type will be &lt;Vendor Command With ID&gt;.{@code false} if the command will be &lt;Vendor Command&gt;
 */
public void sendVendorCommand(int targetAddress,byte[] params,boolean hasVendorId){
  try {
    mService.sendVendorCommand(getDeviceType(),targetAddress,params,hasVendorId);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Sends vendor-specific command.
 * @param targetAddress address of the target device
 * @param params vendor-specific parameter. For &lt;Vendor Command With ID&gt; do notinclude the first 3 bytes (vendor ID).
 * @param hasVendorId {@code true} if the command type will be &lt;Vendor Command With ID&gt;.{@code false} if the command will be &lt;Vendor Command&gt;
 */
public void sendVendorCommand(int targetAddress,byte[] params,boolean hasVendorId){
  try {
    mService.sendVendorCommand(getDeviceType(),targetAddress,params,hasVendorId);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 196377
Project: 196377
Buggy source:
/** 
 * @hide - hide this constructor because it has a parameter of typeIHdmiControlService, which is a system private class. The right way to create an instance of this class is using the factory Context.getSystemService.
 */
public HdmiControlManager(IHdmiControlService service){
  mService=service;
  int[] types=null;
  if (mService != null) {
    try {
      types=mService.getSupportedTypes();
    }
 catch (    RemoteException e) {
    }
  }
  mHasTvDevice=hasDeviceType(types,HdmiDeviceInfo.DEVICE_TV);
  mHasPlaybackDevice=hasDeviceType(types,HdmiDeviceInfo.DEVICE_PLAYBACK);
}

Fixed version (ground truth):
/** 
 * {@hide} - hide this constructor because it has a parameter of type IHdmiControlService,which is a system private class. The right way to create an instance of this class is using the factory Context.getSystemService.
 */
public HdmiControlManager(IHdmiControlService service){
  mService=service;
  int[] types=null;
  if (mService != null) {
    try {
      types=mService.getSupportedTypes();
    }
 catch (    RemoteException e) {
    }
  }
  mHasTvDevice=hasDeviceType(types,HdmiDeviceInfo.DEVICE_TV);
  mHasPlaybackDevice=hasDeviceType(types,HdmiDeviceInfo.DEVICE_PLAYBACK);
}
Program: 196378
Project: 196378
Buggy source:
/** 
 * Removes a listener to stop getting informed of   {@link HdmiHotplugEvent}.
 * @param listener {@link HotplugEventListener} instance to be removed
 */
public void removeHotplugEventListener(HotplugEventListener listener){
  if (mService == null) {
    return;
  }
  try {
    mService.removeHotplugEventListener(getHotplugEventListenerWrapper(listener));
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
/** 
 * Removes a listener to stop getting informed of   {@link HdmiHotplugEvent}.
 * @param listener {@link HotplugEventListener} instance to be removed
 */
public void removeHotplugEventListener(HotplugEventListener listener){
  if (mService == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  IHdmiHotplugEventListener wrappedListener=mHotplugEventListeners.remove(listener);
  if (wrappedListener == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  try {
    mService.removeHotplugEventListener(wrappedListener);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 196379
Project: 196379
Buggy source:
/** 
 * Adds a listener to get informed of   {@link HdmiHotplugEvent}. <p>To stop getting the notification, use   {@link #removeHotplugEventListener(HotplugEventListener)}.
 * @param listener {@link HotplugEventListener} instance
 * @see HdmiControlManager#removeHotplugEventListener(HotplugEventListener)
 */
public void addHotplugEventListener(HotplugEventListener listener){
  if (mService == null) {
    return;
  }
  try {
    mService.addHotplugEventListener(getHotplugEventListenerWrapper(listener));
  }
 catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
/** 
 * Adds a listener to get informed of   {@link HdmiHotplugEvent}. <p>To stop getting the notification, use   {@link #removeHotplugEventListener(HotplugEventListener)}.
 * @param listener {@link HotplugEventListener} instance
 * @see HdmiControlManager#removeHotplugEventListener(HotplugEventListener)
 */
public void addHotplugEventListener(HotplugEventListener listener){
  if (mService == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  if (mHotplugEventListeners.containsKey(listener)) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  IHdmiHotplugEventListener wrappedListener=getHotplugEventListenerWrapper(listener);
  mHotplugEventListeners.put(listener,wrappedListener);
  try {
    mService.addHotplugEventListener(wrappedListener);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 196380
Project: 196380
Buggy source:
/** 
 * Return the physical address of the device.
 */
public int getPhysicalAddress(){
  return mPhysicalAddress;
}

Fixed version (ground truth):
/** 
 * Returns the physical address of the device.
 */
public int getPhysicalAddress(){
  return mPhysicalAddress;
}
Program: 196381
Project: 196381
Buggy source:
/** 
 * Return the CEC logical address of the device.
 */
public int getLogicalAddress(){
  return mLogicalAddress;
}

Fixed version (ground truth):
/** 
 * Returns the CEC logical address of the device.
 */
public int getLogicalAddress(){
  return mLogicalAddress;
}
Program: 196382
Project: 196382
Buggy source:
/** 
 * Return the id of the device.
 */
public int getId(){
  return mId;
}

Fixed version (ground truth):
/** 
 * Returns the id of the device.
 */
public int getId(){
  return mId;
}
Program: 196383
Project: 196383
Buggy source:
/** 
 * Return device's power status. It should be one of the following values. <ul> <li>  {@link HdmiControlManager#POWER_STATUS_ON}<li>  {@link HdmiControlManager#POWER_STATUS_STANDBY}<li>  {@link HdmiControlManager#POWER_STATUS_TRANSIENT_TO_ON}<li>  {@link HdmiControlManager#POWER_STATUS_TRANSIENT_TO_STANDBY}<li>  {@link HdmiControlManager#POWER_STATUS_UNKNOWN}</ul>
 */
public int getDevicePowerStatus(){
  return mDevicePowerStatus;
}

Fixed version (ground truth):
/** 
 * Returns device's power status. It should be one of the following values. <ul> <li>  {@link HdmiControlManager#POWER_STATUS_ON}<li>  {@link HdmiControlManager#POWER_STATUS_STANDBY}<li>  {@link HdmiControlManager#POWER_STATUS_TRANSIENT_TO_ON}<li>  {@link HdmiControlManager#POWER_STATUS_TRANSIENT_TO_STANDBY}<li>  {@link HdmiControlManager#POWER_STATUS_UNKNOWN}</ul>
 */
public int getDevicePowerStatus(){
  return mDevicePowerStatus;
}
Program: 196384
Project: 196384
Buggy source:
/** 
 * Describe the kinds of special objects contained in this Parcelable's marshalled representation.
 */
@Override public int describeContents(){
  return 0;
}

Fixed version (ground truth):
/** 
 * Describes the kinds of special objects contained in this Parcelable's marshalled representation.
 */
@Override public int describeContents(){
  return 0;
}
Program: 196385
Project: 196385
Buggy source:
/** 
 * Return the id to be used for MHL device.
 * @param portId port which the MHL device is connected to
 * @return id for MHL device
 */
public static int idForMhlDevice(int portId){
  return ID_OFFSET_MHL + portId;
}

Fixed version (ground truth):
/** 
 * Returns the id to be used for MHL device.
 * @param portId port which the MHL device is connected to
 * @return id for MHL device
 */
public static int idForMhlDevice(int portId){
  return ID_OFFSET_MHL + portId;
}
Program: 196386
Project: 196386
Buggy source:
/** 
 * Return   {@code true} if the device represents an HDMI-CEC device. {@code false} if the deviceis either MHL or other device.
 */
public boolean isCecDevice(){
  return mHdmiDeviceType == HDMI_DEVICE_TYPE_CEC;
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if the device represents an HDMI-CEC device. {@code false} if the deviceis either MHL or other device.
 */
public boolean isCecDevice(){
  return mHdmiDeviceType == HDMI_DEVICE_TYPE_CEC;
}
Program: 196387
Project: 196387
Buggy source:
/** 
 * Return MHL device id. Return -1 for non-MHL device.
 */
public int getDeviceId(){
  return mDeviceId;
}

Fixed version (ground truth):
/** 
 * Returns MHL device id. Return -1 for non-MHL device.
 */
public int getDeviceId(){
  return mDeviceId;
}
Program: 196388
Project: 196388
Buggy source:
/** 
 * Return   {@code true} if the device is of a type that can be an input source.
 */
public boolean isSourceType(){
  return mDeviceType == DEVICE_PLAYBACK || mDeviceType == DEVICE_RECORDER || mDeviceType == DEVICE_TUNER;
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if the device is of a type that can be an input source.
 */
public boolean isSourceType(){
  return mDeviceType == DEVICE_PLAYBACK || mDeviceType == DEVICE_RECORDER || mDeviceType == DEVICE_TUNER;
}
Program: 196389
Project: 196389
Buggy source:
/** 
 * Return the port ID.
 */
public int getPortId(){
  return mPortId;
}

Fixed version (ground truth):
/** 
 * Returns the port ID.
 */
public int getPortId(){
  return mPortId;
}
Program: 196390
Project: 196390
Buggy source:
/** 
 * Return display (OSD) name of the device.
 */
public String getDisplayName(){
  return mDisplayName;
}

Fixed version (ground truth):
/** 
 * Returns display (OSD) name of the device.
 */
public String getDisplayName(){
  return mDisplayName;
}
Program: 196391
Project: 196391
Buggy source:
/** 
 * Return CEC type of the device. For more details, refer constants between   {@link #DEVICE_TV}and   {@link #DEVICE_INACTIVE}.
 */
public int getDeviceType(){
  return mDeviceType;
}

Fixed version (ground truth):
/** 
 * Returns CEC type of the device. For more details, refer constants between   {@link #DEVICE_TV}and   {@link #DEVICE_INACTIVE}.
 */
public int getDeviceType(){
  return mDeviceType;
}
Program: 196392
Project: 196392
Buggy source:
/** 
 * Return   {@code true} if the device represents an MHL device. {@code false} if the device iseither CEC or other device.
 */
public boolean isMhlDevice(){
  return mHdmiDeviceType == HDMI_DEVICE_TYPE_MHL;
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if the device represents an MHL device. {@code false} if the device iseither CEC or other device.
 */
public boolean isMhlDevice(){
  return mHdmiDeviceType == HDMI_DEVICE_TYPE_MHL;
}
Program: 196393
Project: 196393
Buggy source:
/** 
 * Return MHL adopter id. Return -1 for non-MHL device.
 */
public int getAdopterId(){
  return mAdopterId;
}

Fixed version (ground truth):
/** 
 * Returns MHL adopter id. Return -1 for non-MHL device.
 */
public int getAdopterId(){
  return mAdopterId;
}
Program: 196394
Project: 196394
Buggy source:
/** 
 * Return the id to be used for hardware port.
 * @param portId port id
 * @return id for hardware port
 */
public static int idForHardware(int portId){
  return ID_OFFSET_HARDWARE + portId;
}

Fixed version (ground truth):
/** 
 * Returns the id to be used for hardware port.
 * @param portId port id
 * @return id for hardware port
 */
public static int idForHardware(int portId){
  return ID_OFFSET_HARDWARE + portId;
}
Program: 196395
Project: 196395
Buggy source:
/** 
 * Return the id to be used for CEC device.
 * @param address logical address of CEC device
 * @return id for CEC device
 */
public static int idForCecDevice(int address){
  return ID_OFFSET_CEC + address;
}

Fixed version (ground truth):
/** 
 * Returns the id to be used for CEC device.
 * @param address logical address of CEC device
 * @return id for CEC device
 */
public static int idForCecDevice(int address){
  return ID_OFFSET_CEC + address;
}
Program: 196396
Project: 196396
Buggy source:
/** 
 * Return vendor id of the device. Vendor id is used to distinguish devices built by other manufactures. This is required for vendor-specific command on CEC standard.
 */
public int getVendorId(){
  return mVendorId;
}

Fixed version (ground truth):
/** 
 * Returns vendor id of the device. Vendor id is used to distinguish devices built by other manufactures. This is required for vendor-specific command on CEC standard.
 */
public int getVendorId(){
  return mVendorId;
}
Program: 196397
Project: 196397
Buggy source:
/** 
 * Serialize this object into a   {@link Parcel}.
 * @param dest The Parcel in which the object should be written.
 * @param flags Additional flags about how the object should be written. May be 0 or{@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE}.
 */
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(mHdmiDeviceType);
  dest.writeInt(mPhysicalAddress);
  dest.writeInt(mPortId);
switch (mHdmiDeviceType) {
case HDMI_DEVICE_TYPE_CEC:
    dest.writeInt(mLogicalAddress);
  dest.writeInt(mDeviceType);
dest.writeInt(mVendorId);
dest.writeInt(mDevicePowerStatus);
dest.writeString(mDisplayName);
break;
case HDMI_DEVICE_TYPE_MHL:
dest.writeInt(mDeviceId);
dest.writeInt(mAdopterId);
break;
default :
}
}

Fixed version (ground truth):
/** 
 * Serializes this object into a   {@link Parcel}.
 * @param dest The Parcel in which the object should be written.
 * @param flags Additional flags about how the object should be written. May be 0 or{@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE}.
 */
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(mHdmiDeviceType);
  dest.writeInt(mPhysicalAddress);
  dest.writeInt(mPortId);
switch (mHdmiDeviceType) {
case HDMI_DEVICE_TYPE_CEC:
    dest.writeInt(mLogicalAddress);
  dest.writeInt(mDeviceType);
dest.writeInt(mVendorId);
dest.writeInt(mDevicePowerStatus);
dest.writeString(mDisplayName);
break;
case HDMI_DEVICE_TYPE_MHL:
dest.writeInt(mDeviceId);
dest.writeInt(mAdopterId);
break;
default :
}
}
Program: 196398
Project: 196398
Buggy source:
/** 
 * Return the port number for which the event occurred.
 * @return port number
 */
public int getPort(){
  return mPort;
}

Fixed version (ground truth):
/** 
 * Returns the port number for which the event occurred.
 * @return port number
 */
public int getPort(){
  return mPort;
}
Program: 196399
Project: 196399
Buggy source:
/** 
 * Return the connection status associated with this event
 * @return true if the device gets connected; otherwise false
 */
public boolean isConnected(){
  return mConnected;
}

Fixed version (ground truth):
/** 
 * Returns the connection status associated with this event
 * @return true if the device gets connected; otherwise false
 */
public boolean isConnected(){
  return mConnected;
}
Program: 196400
Project: 196400
Buggy source:
public HdmiHotplugEvent[] newArray(int size){
  return new HdmiHotplugEvent[size];
}

Fixed version (ground truth):
@Override public HdmiHotplugEvent[] newArray(int size){
  return new HdmiHotplugEvent[size];
}
Program: 196401
Project: 196401
Buggy source:
/** 
 * Rebuild a   {@link HdmiHotplugEvent} previously stored with{@link Parcelable#writeToParcel(Parcel,int)}.
 * @param p {@link HdmiHotplugEvent} object to read the Rating from
 * @return a new {@link HdmiHotplugEvent} created from the data in the parcel
 */
public HdmiHotplugEvent createFromParcel(Parcel p){
  int port=p.readInt();
  boolean connected=p.readByte() == 1;
  return new HdmiHotplugEvent(port,connected);
}

Fixed version (ground truth):
/** 
 * Rebuilds a   {@link HdmiHotplugEvent} previously stored with{@link Parcelable#writeToParcel(Parcel,int)}.
 * @param p {@link HdmiHotplugEvent} object to read the Rating from
 * @return a new {@link HdmiHotplugEvent} created from the data in the parcel
 */
@Override public HdmiHotplugEvent createFromParcel(Parcel p){
  int port=p.readInt();
  boolean connected=p.readByte() == 1;
  return new HdmiHotplugEvent(port,connected);
}
Program: 196402
Project: 196402
Buggy source:
/** 
 * Describe the kinds of special objects contained in this Parcelable's marshalled representation.
 */
@Override public int describeContents(){
  return 0;
}

Fixed version (ground truth):
/** 
 * Describes the kinds of special objects contained in this Parcelable's marshalled representation.
 */
@Override public int describeContents(){
  return 0;
}
Program: 196403
Project: 196403
Buggy source:
/** 
 * Flatten this object in to a Parcel.
 * @param dest The Parcel in which the object should be written.
 * @param flags Additional flags about how the object should be written.May be 0 or  {@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE}.
 */
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(mPort);
  dest.writeByte((byte)(mConnected ? 1 : 0));
}

Fixed version (ground truth):
/** 
 * Flattens this object in to a Parcel.
 * @param dest The Parcel in which the object should be written.
 * @param flags Additional flags about how the object should be written.May be 0 or  {@link Parcelable#PARCELABLE_WRITE_RETURN_VALUE}.
 */
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(mPort);
  dest.writeByte((byte)(mConnected ? 1 : 0));
}
Program: 196404
Project: 196404
Buggy source:
@Override public boolean addGpsStatusListener(IGpsStatusListener listener,String packageName){
  if (mGpsStatusProvider == null) {
    return false;
  }
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,LocationManager.GPS_PROVIDER);
  final int uid=Binder.getCallingUid();
  final long ident=Binder.clearCallingIdentity();
  try {
    if (!checkLocationAccess(uid,packageName,allowedResolutionLevel)) {
      return false;
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
  try {
    mGpsStatusProvider.addGpsStatusListener(listener);
  }
 catch (  RemoteException e) {
    Slog.e(TAG,"String_Node_Str",e);
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean addGpsStatusListener(IGpsStatusListener listener,String packageName){
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,LocationManager.GPS_PROVIDER);
  final int uid=Binder.getCallingUid();
  final long ident=Binder.clearCallingIdentity();
  try {
    if (!checkLocationAccess(uid,packageName,allowedResolutionLevel)) {
      return false;
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
  if (mGpsStatusProvider == null) {
    return false;
  }
  try {
    mGpsStatusProvider.addGpsStatusListener(listener);
  }
 catch (  RemoteException e) {
    Slog.e(TAG,"String_Node_Str",e);
    return false;
  }
  return true;
}
Program: 196405
Project: 196405
Buggy source:
@Override public boolean addGpsStatusListener(IGpsStatusListener listener,String packageName){
  if (mGpsStatusProvider == null) {
    return false;
  }
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,LocationManager.GPS_PROVIDER);
  final int uid=Binder.getCallingUid();
  final long ident=Binder.clearCallingIdentity();
  try {
    if (!checkLocationAccess(uid,packageName,allowedResolutionLevel)) {
      return false;
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
  try {
    mGpsStatusProvider.addGpsStatusListener(listener);
  }
 catch (  RemoteException e) {
    Slog.e(TAG,"String_Node_Str",e);
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean addGpsStatusListener(IGpsStatusListener listener,String packageName){
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,LocationManager.GPS_PROVIDER);
  final int uid=Binder.getCallingUid();
  final long ident=Binder.clearCallingIdentity();
  try {
    if (!checkLocationAccess(uid,packageName,allowedResolutionLevel)) {
      return false;
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
  if (mGpsStatusProvider == null) {
    return false;
  }
  try {
    mGpsStatusProvider.addGpsStatusListener(listener);
  }
 catch (  RemoteException e) {
    Slog.e(TAG,"String_Node_Str",e);
    return false;
  }
  return true;
}
Program: 196406
Project: 196406
Buggy source:
@Override public boolean addGpsStatusListener(IGpsStatusListener listener,String packageName){
  if (mGpsStatusProvider == null) {
    return false;
  }
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,LocationManager.GPS_PROVIDER);
  final int uid=Binder.getCallingUid();
  final long ident=Binder.clearCallingIdentity();
  try {
    if (!checkLocationAccess(uid,packageName,allowedResolutionLevel)) {
      return false;
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
  try {
    mGpsStatusProvider.addGpsStatusListener(listener);
  }
 catch (  RemoteException e) {
    Slog.e(TAG,"String_Node_Str",e);
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean addGpsStatusListener(IGpsStatusListener listener,String packageName){
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,LocationManager.GPS_PROVIDER);
  final int uid=Binder.getCallingUid();
  final long ident=Binder.clearCallingIdentity();
  try {
    if (!checkLocationAccess(uid,packageName,allowedResolutionLevel)) {
      return false;
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
  if (mGpsStatusProvider == null) {
    return false;
  }
  try {
    mGpsStatusProvider.addGpsStatusListener(listener);
  }
 catch (  RemoteException e) {
    Slog.e(TAG,"String_Node_Str",e);
    return false;
  }
  return true;
}
Program: 196407
Project: 196407
Buggy source:
@Override public boolean addGpsStatusListener(IGpsStatusListener listener,String packageName){
  if (mGpsStatusProvider == null) {
    return false;
  }
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,LocationManager.GPS_PROVIDER);
  final int uid=Binder.getCallingUid();
  final long ident=Binder.clearCallingIdentity();
  try {
    if (!checkLocationAccess(uid,packageName,allowedResolutionLevel)) {
      return false;
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
  try {
    mGpsStatusProvider.addGpsStatusListener(listener);
  }
 catch (  RemoteException e) {
    Slog.e(TAG,"String_Node_Str",e);
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean addGpsStatusListener(IGpsStatusListener listener,String packageName){
  int allowedResolutionLevel=getCallerAllowedResolutionLevel();
  checkResolutionLevelIsSufficientForProviderUse(allowedResolutionLevel,LocationManager.GPS_PROVIDER);
  final int uid=Binder.getCallingUid();
  final long ident=Binder.clearCallingIdentity();
  try {
    if (!checkLocationAccess(uid,packageName,allowedResolutionLevel)) {
      return false;
    }
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
  if (mGpsStatusProvider == null) {
    return false;
  }
  try {
    mGpsStatusProvider.addGpsStatusListener(listener);
  }
 catch (  RemoteException e) {
    Slog.e(TAG,"String_Node_Str",e);
    return false;
  }
  return true;
}