use of com.evernote.android.job.JobManager in project android by nextcloud.
the class ContactsPreferenceActivity method cancelContactBackupJobForAccount.
public static void cancelContactBackupJobForAccount(Context context, Account account) {
Log_OC.d(TAG, "disabling contacts backup job for account: " + account.name);
JobManager jobManager = JobManager.create(context);
Set<JobRequest> jobs = jobManager.getAllJobRequestsForTag(ContactsBackupJob.TAG);
for (JobRequest jobRequest : jobs) {
PersistableBundleCompat extras = jobRequest.getExtras();
if (extras.getString(ContactsBackupJob.ACCOUNT, "").equalsIgnoreCase(account.name)) {
jobManager.cancel(jobRequest.getJobId());
}
}
}
use of com.evernote.android.job.JobManager in project PhoneProfilesPlus by henrichg.
the class GeofenceScannerJob method _cancelJob.
private static void _cancelJob() /*final Context context*/
{
try {
JobManager jobManager = JobManager.instance();
jobManager.cancelAllForTag(JOB_TAG_START);
jobManager.cancelAllForTag(JOB_TAG);
} catch (Exception ignored) {
}
}
use of com.evernote.android.job.JobManager in project PhoneProfilesPlus by henrichg.
the class WifiScanJob method _cancelJob.
private static void _cancelJob(final Context context) {
WifiScanJob.setScanRequest(context, false);
WifiScanJob.setWaitForResults(context, false);
WifiScanJob.setWifiEnabledForScan(context, false);
WifiBluetoothScanner.setForceOneWifiScan(context, WifiBluetoothScanner.FORCE_ONE_SCAN_DISABLED);
try {
JobManager jobManager = JobManager.instance();
jobManager.cancelAllForTag(JOB_TAG_SHORT);
jobManager.cancelAllForTag(JOB_TAG);
} catch (Exception ignored) {
}
}
use of com.evernote.android.job.JobManager in project PhoneProfilesPlus by henrichg.
the class BluetoothScanJob method _cancelJob.
private static void _cancelJob(final Context context) {
BluetoothScanJob.setScanRequest(context, false);
BluetoothScanJob.setWaitForResults(context, false);
BluetoothScanJob.setLEScanRequest(context, false);
BluetoothScanJob.setWaitForLEResults(context, false);
BluetoothScanJob.setBluetoothEnabledForScan(context, false);
WifiBluetoothScanner.setForceOneBluetoothScan(context, WifiBluetoothScanner.FORCE_ONE_SCAN_DISABLED);
WifiBluetoothScanner.setForceOneLEBluetoothScan(context, WifiBluetoothScanner.FORCE_ONE_SCAN_DISABLED);
try {
JobManager jobManager = JobManager.instance();
jobManager.cancelAllForTag(JOB_TAG_SHORT);
jobManager.cancelAllForTag(JOB_TAG);
} catch (Exception ignored) {
}
}
use of com.evernote.android.job.JobManager in project android by nextcloud.
the class ContactsPreferenceActivity method cancelPreviousContactBackupJobForAccount.
public static void cancelPreviousContactBackupJobForAccount(Context context, Account account) {
Log_OC.d(TAG, "disabling existing contacts backup job for account: " + account.name);
JobManager jobManager = JobManager.create(context);
Set<JobRequest> jobs = jobManager.getAllJobRequestsForTag(ContactsBackupJob.TAG);
for (JobRequest jobRequest : jobs) {
PersistableBundleCompat extras = jobRequest.getExtras();
if (extras.getString(ContactsBackupJob.ACCOUNT, "").equalsIgnoreCase(account.name) && jobRequest.isPeriodic()) {
jobManager.cancel(jobRequest.getJobId());
}
}
}
Aggregations