blob: 63a03b9e673d0567467f96872fb8f0e179037986 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
package de.danoeh.antennapod.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import de.danoeh.antennapod.AppConfig;
import de.danoeh.antennapod.preferences.UserPreferences;
/** Listens for events that make it necessary to reset the update alarm. */
public class AlarmUpdateReceiver extends BroadcastReceiver {
private static final String TAG = "AlarmUpdateReceiver";
@Override
public void onReceive(Context context, Intent intent) {
if (AppConfig.DEBUG)
Log.d(TAG, "Received intent");
if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
if (AppConfig.DEBUG)
Log.d(TAG, "Resetting update alarm after reboot");
} else if (intent.getAction().equals(Intent.ACTION_PACKAGE_REPLACED)) {
if (AppConfig.DEBUG)
Log.d(TAG, "Resetting update alarm after app upgrade");
}
UserPreferences.restartUpdateAlarm(UserPreferences.getUpdateInterval());
}
}
|