T
- The PeriodicReplicationReceiver
associated with this Service that is
responsible for handling the alarms triggered by the AlarmManager
at
the intervals when replication is required and handles resetting of alarms after
reboot of the device.public abstract class PeriodicReplicationService<T extends PeriodicReplicationReceiver> extends ReplicationService
Service
is an abstract class that is the basis for creating a service
that performs periodic replications (i.e. replications that occur at regular intervals). The
period between replications may be varied depending on whether other application components
are bound to the service or not, so as to allow for more frequent replications when an app
is in active use and less frequent replications the rest of the time.ReplicationService.LocalBinder, ReplicationService.ReplicationCompleteListener, ReplicationService.SimpleReplicationCompleteListener
Modifier and Type | Field and Description |
---|---|
static int |
COMMAND_DEVICE_REBOOTED |
static int |
COMMAND_START_PERIODIC_REPLICATION |
static int |
COMMAND_STOP_PERIODIC_REPLICATION |
COMMAND_NONE, COMMAND_START_REPLICATION, COMMAND_STOP_REPLICATION, EXTRA_COMMAND, EXTRA_INTENT
START_CONTINUATION_MASK, START_FLAG_REDELIVERY, START_FLAG_RETRY, START_NOT_STICKY, START_REDELIVER_INTENT, START_STICKY, START_STICKY_COMPATIBILITY
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, AUDIO_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_WAIVE_PRIORITY, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MODE_APPEND, MODE_MULTI_PROCESS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NFC_SERVICE, NOTIFICATION_SERVICE, POWER_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, STORAGE_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, UI_MODE_SERVICE, USB_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
Modifier and Type | Method and Description |
---|---|
android.os.IBinder |
onBind(android.content.Intent intent) |
void |
onCreate() |
void |
onRebind(android.content.Intent intent) |
boolean |
onUnbind(android.content.Intent intent) |
void |
startPeriodicReplication()
Start periodic replications.
|
void |
stopPeriodicReplication()
Stop replications currently in progress and cancel future scheduled replications.
|
addListener, allReplicationsCompleted, onStartCommand, removeListener, replicationCompleted, replicationErrored, setOperationStartedListener, setReplicationPolicyManager, setReplicators
getApplication, onConfigurationChanged, onDestroy, onLowMemory, onStart, onTaskRemoved, onTrimMemory, startForeground, stopForeground, stopSelf, stopSelf, stopSelfResult
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalFilesDir, getFilesDir, getFileStreamPath, getMainLooper, getObbDir, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getSystemService, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, revokeUriPermission, sendBroadcast, sendBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendStickyBroadcast, sendStickyOrderedBroadcast, setTheme, setWallpaper, setWallpaper, startActivities, startActivity, startInstrumentation, startIntentSender, startService, stopService, unbindService, unregisterReceiver
public static final int COMMAND_START_PERIODIC_REPLICATION
public static final int COMMAND_STOP_PERIODIC_REPLICATION
public static final int COMMAND_DEVICE_REBOOTED
public void onCreate()
onCreate
in class ReplicationService
public android.os.IBinder onBind(android.content.Intent intent)
onBind
in class ReplicationService
public boolean onUnbind(android.content.Intent intent)
onUnbind
in class ReplicationService
public void onRebind(android.content.Intent intent)
onRebind
in class ReplicationService
public void startPeriodicReplication()
public void stopPeriodicReplication()