-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from Mahmud0808/master
Merge master into fdroid
- Loading branch information
Showing
71 changed files
with
1,376 additions
and
1,700 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ local.properties | |
/app/release/ | ||
/*.hprof | ||
/.idea/deploymentTargetDropDown.xml | ||
/.kotlin/sessions/*.salive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
app/src/main/java/com/drdisagree/colorblendr/service/RestartBroadcastReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.drdisagree.colorblendr.service; | ||
|
||
import static android.content.Context.JOB_SCHEDULER_SERVICE; | ||
|
||
import android.app.job.JobInfo; | ||
import android.app.job.JobScheduler; | ||
import android.content.BroadcastReceiver; | ||
import android.content.ComponentName; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.util.Log; | ||
|
||
public class RestartBroadcastReceiver extends BroadcastReceiver { | ||
|
||
private static final String TAG = RestartBroadcastReceiver.class.getSimpleName(); | ||
private static JobScheduler jobScheduler; | ||
|
||
@Override | ||
public void onReceive(Context context, Intent intent) { | ||
Log.i(TAG, "Service Stopped, but this is a never ending service."); | ||
scheduleJob(context); | ||
} | ||
|
||
public static void scheduleJob(Context context) { | ||
if (jobScheduler == null) { | ||
jobScheduler = (JobScheduler) context.getSystemService(JOB_SCHEDULER_SERVICE); | ||
} | ||
|
||
ComponentName componentName = new ComponentName(context, ScheduledJobService.class); | ||
|
||
JobInfo jobInfo = new JobInfo.Builder(1, componentName) | ||
.setOverrideDeadline(0) | ||
.setPersisted(true).build(); | ||
|
||
jobScheduler.schedule(jobInfo); | ||
} | ||
} |
Oops, something went wrong.