APISonar


org.addhen.smssync.data.util.Logger.log

> org > addhen > smssync > data > util > Logger > log
org APIs addhen APIs smssync APIs data APIs util APIs Logger APIs log APIs

Example 1
public void append(String s) {
        if (mWriter != null) {
            StringBuilder sb = new StringBuilder();
            sb.append(format(new Date()))
                    .append(" ").append(s);
            mWriter.println(sb);
            Logger.log(TAG, "Log " + sb);
        }
    }
Example 2
public void saveTimeFrequency() {
        final String timeFrequency = getTimeValueAsString();
        if (TaskSettingsFragment.TASK_CHECK_TIMES.equals(this.getKey())) {
            Logger.log("TimePreferences", "Save TASK time " + getTimeValueAsString());
            mPrefsFactory.taskCheckTime().set(getTimeValueAsString());
        } else if (AutomationSettingsFragment.AUTO_SYNC_TIMES.equals(this.getKey())) {
            Logger.log("TimePreferences", "Save AUTO time " + getTimeValueAsString());
            mPrefsFactory.autoTime().set(getTimeValueAsString());
        }
    }
Example 3
public boolean syncPendingMessages() {
        Logger.log(TAG, "syncPendingMessages: push pending messages to the Sync URL");

        final List<Message> messages = mMessageDataSource.syncFetchPending();
        if (messages != null && messages.size() > 0) {
            return tweetMessages(messages);
        }

        return false;
    }
Example 4
protected void deleteMessage(Message message) {
        Logger.log(TAG, " message ID " + message.getMessageUuid());
        mMessageDataSource.deleteByUuid(message.getMessageUuid());
    }
Example 5
public void stopServices(Intent intent, int requestCode) {
        Logger.log(CLASS_TAG, "Stopping services");
        SchedulerInstance.INSTANCE.getScheduler(mContext, mFileManager, intent, requestCode)
                .stopScheduler();
    }
Example 6
public void stopAutoSyncService() {
        final Intent intent = new Intent(mContext, AutoSyncScheduledReceiver.class);

        // Stop the scheduled service
        Logger.log(CLASS_TAG, "Stop AutoSyncScheduledService");
        stopServices(intent, ServiceConstants.AUTO_SYNC_SCHEDULED_SERVICE_REQUEST_CODE);
    }
Example 7
private void smsServerResponse(SmssyncResponse response) {
        Logger.log(TAG, "performResponseFromServer(): " + " response:"
                + response);
        if (!mPrefsFactory.enableReplyFrmServer().get()) {
            return;
        }

        if ((response != null) && (response.getPayload() != null)
                && (response.getPayload().getMessages() != null) && (
                response.getPayload().getMessages().size() > 0)) {
            for (Message msg : response.getPayload().getMessages()) {
                sendTaskSms(msg);
            }
        }
    }
Example 8
private String loadTimeFrequency() {
        // TODO: Figure out a way to load the saved frequency without knowing the keys
        String time = null;
        if (TaskSettingsFragment.TASK_CHECK_TIMES.equals(this.getKey())) {
            time = mPrefsFactory.taskCheckTime().get();
        } else if (AutomationSettingsFragment.AUTO_SYNC_TIMES.equals(this.getKey())) {
            time = mPrefsFactory.autoTime().get();
        } else {
            time = TimeFrequencyUtil.DEFAULT_TIME_FREQUENCY;
        }
        Logger.log("TimePreferences", "Loading saved time: " + time);
        return time;
    }
Example 9
public Scheduler(Context context, FileManager fileManager, Intent intent, int requestCode,
            int flags) {
        mContext = context.getApplicationContext();
        mFileManager = fileManager;
        Logger.log(CLASS_TAG, "ScheduleServices() executing scheduled services ");
        mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
        mPendingIntent = PendingIntent.getBroadcast(mContext, requestCode, intent, flags);
    }