public class NotificationsSyncAdapterService extends Service
Modifier and Type | Class and Description |
---|---|
private static class |
NotificationsSyncAdapterService.SyncAdapterImpl |
Modifier and Type | Field and Description |
---|---|
private static SecureConnection |
conn |
private static DataBaseHelper |
dbHelper |
private static String |
errorMessage |
static boolean |
isConnected |
static boolean |
isDebuggable |
private static String |
METHOD_NAME |
private static int |
NOTIF_ALERT_ID |
private static int |
notifCount |
private static Preferences |
prefs |
private static Object |
result |
private static int |
SIZE_LIMIT |
private static NotificationsSyncAdapterService.SyncAdapterImpl |
sSyncAdapter |
static String |
START_SYNC |
static String |
STOP_SYNC |
private static String |
TAG |
private static IWebserviceClient |
webserviceClient |
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, APP_OPS_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, BLUETOOTH_SERVICE, CAPTIONING_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_ROUTER_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, PRINT_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, STORAGE_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, UI_MODE_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
Constructor and Description |
---|
NotificationsSyncAdapterService() |
Modifier and Type | Method and Description |
---|---|
protected static void |
addParam(String param,
Object value)
Adds a parameter to webservice request.
|
protected static void |
createRequest(String clientType)
Creates webservice request.
|
private static void |
getNotifications() |
private NotificationsSyncAdapterService.SyncAdapterImpl |
getSyncAdapter() |
private static void |
logUser() |
IBinder |
onBind(Intent intent) |
void |
onCreate() |
void |
onDestroy() |
int |
onStartCommand(Intent intent,
int flags,
int startId) |
boolean |
onUnbind(Intent intent) |
private static void |
performSync(Context context,
Account account,
Bundle extras,
String authority,
ContentProviderClient provider,
SyncResult syncResult) |
private static void |
sendReadedNotifications(Context context)
Sends to SWAD the "seen notifications" info
|
protected static void |
sendRequest(Class<?> cl,
boolean simple)
Sends a SOAP request to the specified webservice in METHOD_NAME class
constant of the webservice client.
|
dump, getApplication, onConfigurationChanged, onLowMemory, onRebind, onStart, onTaskRemoved, onTrimMemory, startForeground, stopForeground, stopSelf, stopSelf, stopSelfResult
attachBaseContext, bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createConfigurationContext, createDisplayContext, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getFilesDir, getFileStreamPath, getMainLooper, getObbDir, getObbDirs, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getSystemService, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme, setWallpaper, setWallpaper, startActivities, startActivities, startActivity, startActivity, startInstrumentation, startIntentSender, startIntentSender, startService, stopService, unbindService, unregisterReceiver
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks
private static final String TAG
private static Preferences prefs
private static SecureConnection conn
private static NotificationsSyncAdapterService.SyncAdapterImpl sSyncAdapter
private static int notifCount
private static final int NOTIF_ALERT_ID
private static int SIZE_LIMIT
private static DataBaseHelper dbHelper
private static IWebserviceClient webserviceClient
private static String METHOD_NAME
private static Object result
private static String errorMessage
public static final String START_SYNC
public static final String STOP_SYNC
public static boolean isConnected
public static boolean isDebuggable
public int onStartCommand(Intent intent, int flags, int startId)
onStartCommand
in class Service
private NotificationsSyncAdapterService.SyncAdapterImpl getSyncAdapter()
protected static void createRequest(String clientType)
protected static void addParam(String param, Object value)
param
- Parameter name.value
- Parameter value.protected static void sendRequest(Class<?> cl, boolean simple) throws IOException, XmlPullParserException
cl
- Class to be mappedsimple
- Flag for select simple or complex responseXmlPullParserException
IOException
private static void logUser() throws IOException, XmlPullParserException
IOException
XmlPullParserException
private static void getNotifications() throws IOException, XmlPullParserException
IOException
XmlPullParserException
private static void sendReadedNotifications(Context context)
private static void performSync(Context context, Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) throws IOException, XmlPullParserException, NoSuchAlgorithmException, KeyManagementException, KeyStoreException, CertificateException, UnrecoverableKeyException