mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-13 14:48:04 -05: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() {
|
||||
Intent i = new Intent();
|
||||
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService");
|
||||
Intent i = new Intent(this, MailService.class);
|
||||
i.setAction(ACTION_CHECK_MAIL);
|
||||
BootReceiver.cancelIntent(this, i);
|
||||
}
|
||||
@ -304,8 +303,7 @@ public class MailService extends CoreService {
|
||||
Log.e(K9.LOG_TAG, "Exception while logging", e);
|
||||
}
|
||||
|
||||
Intent i = new Intent();
|
||||
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService");
|
||||
Intent i = new Intent(this, MailService.class);
|
||||
i.setAction(ACTION_CHECK_MAIL);
|
||||
BootReceiver.scheduleIntent(MailService.this, nextTime, i);
|
||||
}
|
||||
@ -410,8 +408,7 @@ public class MailService extends CoreService {
|
||||
long nextTime = System.currentTimeMillis() + minInterval;
|
||||
if (K9.DEBUG)
|
||||
Log.d(K9.LOG_TAG, "Next pusher refresh scheduled for " + new Date(nextTime));
|
||||
Intent i = new Intent();
|
||||
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.MailService");
|
||||
Intent i = new Intent(this, MailService.class);
|
||||
i.setAction(ACTION_REFRESH_PUSHERS);
|
||||
BootReceiver.scheduleIntent(MailService.this, nextTime, i);
|
||||
}
|
||||
|
@ -134,15 +134,13 @@ public class RemoteControlService extends CoreService {
|
||||
editor.commit();
|
||||
|
||||
if (needsReschedule) {
|
||||
Intent i = new Intent();
|
||||
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.RemoteControlService");
|
||||
Intent i = new Intent(RemoteControlService.this, RemoteControlService.class);
|
||||
i.setAction(RESCHEDULE_ACTION);
|
||||
long nextTime = System.currentTimeMillis() + 10000;
|
||||
BootReceiver.scheduleIntent(RemoteControlService.this, nextTime, i);
|
||||
}
|
||||
if (needsPushRestart) {
|
||||
Intent i = new Intent();
|
||||
i.setClassName(getApplication().getPackageName(), "com.fsck.k9.service.RemoteControlService");
|
||||
Intent i = new Intent(RemoteControlService.this, RemoteControlService.class);
|
||||
i.setAction(PUSH_RESTART_ACTION);
|
||||
long nextTime = System.currentTimeMillis() + 10000;
|
||||
BootReceiver.scheduleIntent(RemoteControlService.this, nextTime, i);
|
||||
|
@ -31,8 +31,7 @@ public class SleepService extends CoreService {
|
||||
sleepDatum.reacquireLatch = new CountDownLatch(1);
|
||||
sleepData.put(id, sleepDatum);
|
||||
|
||||
Intent i = new Intent();
|
||||
i.setClassName(context.getPackageName(), "com.fsck.k9.service.SleepService");
|
||||
Intent i = new Intent(context, SleepService.class);
|
||||
i.putExtra(LATCH_ID, id);
|
||||
i.setAction(ALARM_FIRED + "." + id);
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
Loading…
Reference in New Issue
Block a user