Projects >> prayertimes >>9675f1f24757043c28898f96a53eaa4be5f86545

Chunk
Conflicting content
			e.printStackTrace();
		}

<<<<<<< HEAD
public class ServiceSetAlarm extends Service{
	SharedPreferences pref ;
	Editor editor ;
	Intent myIntent;
	PendingIntent pendingIntent;
	AlarmManager alarmManager;
		public void onCreate(){
		
			try {
				 myIntent = new Intent(ServiceSetAlarm.this, ServiceNot.class);
				 pendingIntent = PendingIntent.getService(ServiceSetAlarm.this, 0, myIntent, 0);
		         alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
				pref = PreferenceManager.getDefaultSharedPreferences(this);
				editor = pref.edit();
				editor.putString("moode","notfication"); 
				editor.commit();
				//if(!pref.getBoolean("enabled", false))
					this.setAlarm();
				//else
					//this.stopSelf();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		
=======
>>>>>>> 2b0da85ecfe8c28eb6002cfb7ac280a02c634fd2
	}

	public IBinder onBind(Intent intent) {
Solution content
public class ServiceSetAlarm extends Service{
	SharedPreferences pref ;
	Editor editor ;
	Intent myIntent;
	PendingIntent pendingIntent;
	AlarmManager alarmManager;
		public void onCreate(){
		
			try {
				 myIntent = new Intent(ServiceSetAlarm.this, ServiceNot.class);
				 pendingIntent = PendingIntent.getService(ServiceSetAlarm.this, 0, myIntent, 0);
		         alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
				pref = PreferenceManager.getDefaultSharedPreferences(this);
				editor = pref.edit();
				editor.putString("moode","notfication"); 
				editor.commit();
				//if(!pref.getBoolean("enabled", false))
					this.setAlarm();
				//else
					//this.stopSelf();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		
	}

	public IBinder onBind(Intent intent) {
File
ServiceSetAlarm.java
Developer's decision
Version 1
Kind of conflict
Attribute
Class signature
Method signature
Try statement
Chunk
Conflicting content
	@Override
	public void onStart(Intent intent, int startId) {
		try {
<<<<<<< HEAD
			alarmManager.cancel(pendingIntent);
			//if(!pref.getBoolean("enabled", false))
=======
			if (pref.getBoolean("enabled", false))
>>>>>>> 2b0da85ecfe8c28eb6002cfb7ac280a02c634fd2
				this.setAlarm();
			//else
				//this.stopSelf();
Solution content
				//this.stopSelf();
	@Override
	public void onStart(Intent intent, int startId) {
		try {
			pref = PreferenceManager.getDefaultSharedPreferences(this);
			if(pref.getString("isCityChanged", "false").equals("true"))
			{
				editor = pref.edit();
				editor.putString("moode","notfication"); 
				editor.putString("isCityChanged", "false");
				editor.commit();
			}
			alarmManager.cancel(pendingIntent);
			//if(!pref.getBoolean("enabled", false))
				this.setAlarm();
			//else
File
ServiceSetAlarm.java
Developer's decision
Manual
Kind of conflict
Comment
If statement
Method invocation
Chunk
Conflicting content
			e.printStackTrace();
		}
	}
<<<<<<< HEAD
	
	@Override
	public void onDestroy() {
		alarmManager.cancel(pendingIntent);
		
	}
	public int getSec(int hh,int mm,int ss){
		return ((hh*3600)+(mm*60)+ss);
	}   
	public void setAlarm() throws IOException{
=======

	public int getSec(int hh, int mm, int ss) {
		return ((hh * 3600) + (mm * 60) + ss);
	}

	public void setAlarm() throws IOException {
>>>>>>> 2b0da85ecfe8c28eb6002cfb7ac280a02c634fd2
		pref = PreferenceManager.getDefaultSharedPreferences(this);
		String key = pref.getString("moode", "notfication");
		editor = pref.edit();
Solution content
			e.printStackTrace();
		}
	}
	
	@Override
	public void onDestroy() {
		alarmManager.cancel(pendingIntent);
		
	}

	public int getSec(int hh, int mm, int ss) {
		return ((hh * 3600) + (mm * 60) + ss);
	}

	public void setAlarm() throws IOException {
		pref = PreferenceManager.getDefaultSharedPreferences(this);
		String key = pref.getString("moode", "notfication");
		editor = pref.edit();
File
ServiceSetAlarm.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method declaration
Method signature
Chunk
Conflicting content
		editor = pref.edit();
		editor.putString("moode", "notfication");
		editor.commit();
<<<<<<< HEAD
                 Calendar calendar = Calendar.getInstance();
                 calendar.setTimeInMillis(System.currentTimeMillis());
                 int nextPrayer = manager.nearestPrayerTime(h, m,s, yy, mm, dd);
     			int def =  manager.diffrent((h*3600+m*60+s),nextPrayer);             
                 calendar.add(Calendar.SECOND, def);
                 alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),pendingIntent);
		
	}
	private void silent(){
		Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(System.currentTimeMillis());
        pref = PreferenceManager.getDefaultSharedPreferences(this);
        int sec = Integer.parseInt(pref.getString("silentStart", "20"));
        calendar.add(Calendar.SECOND, 60);
        alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),pendingIntent);
		
	}
	
	private void general(){
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(System.currentTimeMillis());
        pref = PreferenceManager.getDefaultSharedPreferences(this);
		 int sec = Integer.parseInt(pref.getString("silentDuration", "20"));
        calendar.add(Calendar.SECOND, 60);
        alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),pendingIntent);
        this.stopSelf();
=======
		Intent myIntent = new Intent(ServiceSetAlarm.this, ServiceNot.class);
		PendingIntent pendingIntent = PendingIntent.getService(
				ServiceSetAlarm.this, 0, myIntent, 0);
		AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
		Calendar calendar = Calendar.getInstance();
		calendar.setTimeInMillis(System.currentTimeMillis());
		int nextPrayer = manager.nearestPrayerTime(h, m, s, yy, mm, dd);
		int def = manager.diffrent((h * 3600 + m * 60 + s), nextPrayer);
		calendar.add(Calendar.SECOND, def);
		alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
				pendingIntent);

	}

	private void silent() {
		Intent myIntent = new Intent(ServiceSetAlarm.this, ServiceNot.class);
		PendingIntent pendingIntent = PendingIntent.getService(
				ServiceSetAlarm.this, 0, myIntent, 0);
		AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
		Calendar calendar = Calendar.getInstance();
		calendar.setTimeInMillis(System.currentTimeMillis());
		pref = PreferenceManager.getDefaultSharedPreferences(this);
		int sec = Integer.parseInt(pref.getString("silentStart", "20"));
		calendar.add(Calendar.SECOND, sec * 60);
		alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
				pendingIntent);

	}

	private void general() {
		Intent myIntent = new Intent(ServiceSetAlarm.this, ServiceNot.class);
		PendingIntent pendingIntent = PendingIntent.getService(
				ServiceSetAlarm.this, 0, myIntent, 0);
		AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
		Calendar calendar = Calendar.getInstance();
		calendar.setTimeInMillis(System.currentTimeMillis());
		pref = PreferenceManager.getDefaultSharedPreferences(this);
		int sec = Integer.parseInt(pref.getString("silentDuration", "20"));
		calendar.add(Calendar.SECOND, sec * 60);
		alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
				pendingIntent);
		this.stopSelf();
>>>>>>> 2b0da85ecfe8c28eb6002cfb7ac280a02c634fd2
	}
}
Solution content
		editor = pref.edit();
		editor.putString("moode", "notfication");
		editor.commit();
                 Calendar calendar = Calendar.getInstance();
                 calendar.setTimeInMillis(System.currentTimeMillis());
                 int nextPrayer = manager.nearestPrayerTime(h, m,s, yy, mm, dd);
     			int def =  manager.diffrent((h*3600+m*60+s),nextPrayer);             
                 calendar.add(Calendar.SECOND, def);
                 alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),pendingIntent);
		
	}
	private void silent(){
		Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(System.currentTimeMillis());
        pref = PreferenceManager.getDefaultSharedPreferences(this);
        int sec = Integer.parseInt(pref.getString("silentStart", "20"));
        calendar.add(Calendar.SECOND, 60);
        alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),pendingIntent);
		
	}
	
	private void general(){
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(System.currentTimeMillis());
        pref = PreferenceManager.getDefaultSharedPreferences(this);
		 int sec = Integer.parseInt(pref.getString("silentDuration", "20"));
        calendar.add(Calendar.SECOND, 60);
        alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),pendingIntent);

	}


}
File
ServiceSetAlarm.java
Developer's decision
Combination
Kind of conflict
Attribute
Cast expression
Method declaration
Method invocation
Method signature
Variable