Projects >> Speedometer >>82c7d9e369ab4ab179571afc2df793c07c93a50d

Chunk
Conflicting content
  
  /** Set the interval for checkin in seconds */
  public synchronized void setCheckinInterval(long interval) {
<<<<<<< HEAD
    this.checkinIntervalSec = interval;
    // the new checkin schedule will start in PAUSE_BETWEEN_CHECKIN_CHANGE_SEC seconds
    alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, 
        System.currentTimeMillis() + Config.PAUSE_BETWEEN_CHECKIN_CHANGE_MSEC, 
        checkinIntervalSec * 1000, checkinIntentSender);
    
    Log.i(SpeedometerApp.TAG, "Setting checkin interval to " + interval + " seconds");
=======
    this.checkinIntervalSec = Math.max(Config.MIN_CHECKIN_INTERVAL_SEC, interval);
    if (this.checkinFuture != null) {
      this.checkinFuture.cancel(true);
      // the new checkin schedule will start in PAUSE_BETWEEN_CHECKIN_CHANGE_SEC seconds
      this.checkinFuture = checkinExecutor.scheduleAtFixedRate(this.checkinTask, 
          Config.PAUSE_BETWEEN_CHECKIN_CHANGE_SEC, this.checkinIntervalSec, TimeUnit.SECONDS);
      Log.i(SpeedometerApp.TAG, "Setting checkin interval to " + interval + " seconds");
    }
>>>>>>> 2d7c0959c1acd94b8875c5d4722a051f632213ad
  }
  
  /** Returns the checkin interval of the scheduler in seconds */
Solution content
  
  /** Set the interval for checkin in seconds */
  public synchronized void setCheckinInterval(long interval) {
    this.checkinIntervalSec = Math.max(Config.MIN_CHECKIN_INTERVAL_SEC, interval);
    if (this.checkinFuture != null) {
      this.checkinFuture.cancel(true);
      // the new checkin schedule will start in PAUSE_BETWEEN_CHECKIN_CHANGE_SEC seconds
      this.checkinFuture = checkinExecutor.scheduleAtFixedRate(this.checkinTask, 
          Config.PAUSE_BETWEEN_CHECKIN_CHANGE_SEC, this.checkinIntervalSec, TimeUnit.SECONDS);
      Log.i(SpeedometerApp.TAG, "Setting checkin interval to " + interval + " seconds");
    }
  }
  
  /** Returns the checkin interval of the scheduler in seconds */
File
MeasurementScheduler.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
If statement
Method invocation
Variable
Chunk
Conflicting content
  /** Submit a MeasurementTask to the scheduler */
  public boolean submitTask(MeasurementTask task) {
    try {
<<<<<<< HEAD
      boolean result = this.taskQueue.add(task);
      if (task.getDescription().priority == MeasurementTask.USER_PRIORITY) {
        handleMeasurement();
      }
      return result;
=======
      if (taskQueue.size() >= Config.MAX_TASK_QUEUE_SIZE ||
          pendingTasks.size() >= Config.MAX_TASK_QUEUE_SIZE) {
        return false;
      }
      //Automatically notifies the scheduler waiting on taskQueue.take()
      return this.taskQueue.add(task);
>>>>>>> 2d7c0959c1acd94b8875c5d4722a051f632213ad
    } catch (NullPointerException e) {
      Log.e(SpeedometerApp.TAG, "The task to be added is null");
      return false;
Solution content
  /** Submit a MeasurementTask to the scheduler */
  public boolean submitTask(MeasurementTask task) {
    try {
      if (taskQueue.size() >= Config.MAX_TASK_QUEUE_SIZE ||
          pendingTasks.size() >= Config.MAX_TASK_QUEUE_SIZE) {
        return false;
      }
      //Automatically notifies the scheduler waiting on taskQueue.take()
      return this.taskQueue.add(task);
    } catch (NullPointerException e) {
      Log.e(SpeedometerApp.TAG, "The task to be added is null");
      return false;
File
MeasurementScheduler.java
Developer's decision
Version 2
Kind of conflict
Comment
If statement
Method invocation
Return statement
Variable