mirror of
https://github.com/moparisthebest/k-9
synced 2024-08-13 17:03:48 -04:00
Stop using Intent.setClassName()
Use the type-safe Intent constructor to reference internal classes.
This commit is contained in:
parent
461778ed11
commit
24e6b39dc0
@ -163,8 +163,7 @@ public class MailService extends CoreService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void cancel() {
|
private void cancel() {
|
||||||
Intent i = new Intent();
|
Intent i = new Intent(this, MailService.class);
|
||||||
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService");
|
|
||||||
i.setAction(ACTION_CHECK_MAIL);
|
i.setAction(ACTION_CHECK_MAIL);
|
||||||
BootReceiver.cancelIntent(this, i);
|
BootReceiver.cancelIntent(this, i);
|
||||||
}
|
}
|
||||||
@ -304,8 +303,7 @@ public class MailService extends CoreService {
|
|||||||
Log.e(K9.LOG_TAG, "Exception while logging", e);
|
Log.e(K9.LOG_TAG, "Exception while logging", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
Intent i = new Intent();
|
Intent i = new Intent(this, MailService.class);
|
||||||
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService");
|
|
||||||
i.setAction(ACTION_CHECK_MAIL);
|
i.setAction(ACTION_CHECK_MAIL);
|
||||||
BootReceiver.scheduleIntent(MailService.this, nextTime, i);
|
BootReceiver.scheduleIntent(MailService.this, nextTime, i);
|
||||||
}
|
}
|
||||||
@ -410,8 +408,7 @@ public class MailService extends CoreService {
|
|||||||
long nextTime = System.currentTimeMillis() + minInterval;
|
long nextTime = System.currentTimeMillis() + minInterval;
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.d(K9.LOG_TAG, "Next pusher refresh scheduled for " + new Date(nextTime));
|
Log.d(K9.LOG_TAG, "Next pusher refresh scheduled for " + new Date(nextTime));
|
||||||
Intent i = new Intent();
|
Intent i = new Intent(this, MailService.class);
|
||||||
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService");
|
|
||||||
i.setAction(ACTION_REFRESH_PUSHERS);
|
i.setAction(ACTION_REFRESH_PUSHERS);
|
||||||
BootReceiver.scheduleIntent(MailService.this, nextTime, i);
|
BootReceiver.scheduleIntent(MailService.this, nextTime, i);
|
||||||
}
|
}
|
||||||
|
@ -134,15 +134,13 @@ public class RemoteControlService extends CoreService {
|
|||||||
editor.commit();
|
editor.commit();
|
||||||
|
|
||||||
if (needsReschedule) {
|
if (needsReschedule) {
|
||||||
Intent i = new Intent();
|
Intent i = new Intent(RemoteControlService.this, RemoteControlService.class);
|
||||||
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.RemoteControlService");
|
|
||||||
i.setAction(RESCHEDULE_ACTION);
|
i.setAction(RESCHEDULE_ACTION);
|
||||||
long nextTime = System.currentTimeMillis() + 10000;
|
long nextTime = System.currentTimeMillis() + 10000;
|
||||||
BootReceiver.scheduleIntent(RemoteControlService.this, nextTime, i);
|
BootReceiver.scheduleIntent(RemoteControlService.this, nextTime, i);
|
||||||
}
|
}
|
||||||
if (needsPushRestart) {
|
if (needsPushRestart) {
|
||||||
Intent i = new Intent();
|
Intent i = new Intent(RemoteControlService.this, RemoteControlService.class);
|
||||||
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.RemoteControlService");
|
|
||||||
i.setAction(PUSH_RESTART_ACTION);
|
i.setAction(PUSH_RESTART_ACTION);
|
||||||
long nextTime = System.currentTimeMillis() + 10000;
|
long nextTime = System.currentTimeMillis() + 10000;
|
||||||
BootReceiver.scheduleIntent(RemoteControlService.this, nextTime, i);
|
BootReceiver.scheduleIntent(RemoteControlService.this, nextTime, i);
|
||||||
|
@ -31,8 +31,7 @@ public class SleepService extends CoreService {
|
|||||||
sleepDatum.reacquireLatch = new CountDownLatch(1);
|
sleepDatum.reacquireLatch = new CountDownLatch(1);
|
||||||
sleepData.put(id, sleepDatum);
|
sleepData.put(id, sleepDatum);
|
||||||
|
|
||||||
Intent i = new Intent();
|
Intent i = new Intent(context, SleepService.class);
|
||||||
i.setClassName(context.getPackageName(), "com.fsck.k9.service.SleepService");
|
|
||||||
i.putExtra(LATCH_ID, id);
|
i.putExtra(LATCH_ID, id);
|
||||||
i.setAction(ALARM_FIRED + "." + id);
|
i.setAction(ALARM_FIRED + "." + id);
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
|
Loading…
Reference in New Issue
Block a user