Android Open Source - Tacere Prefs






From Project

Back to project page Tacere.

License

The source code is released under:

MIT License

If you think the Android project Tacere listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (c) 2014 Jonathan Nelson//from ww w  . j a v  a 2s  . c om
 * Released under the BSD license.  For details see the COPYING file.
 */

package org.ciasaboark.tacere.prefs;

import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Log;

import org.ciasaboark.tacere.event.ringer.Intervals;
import org.ciasaboark.tacere.event.ringer.RingerType;
import org.ciasaboark.tacere.manager.AlarmManagerWrapper;
import org.ciasaboark.tacere.manager.ServiceStateManager;
import org.ciasaboark.tacere.service.RequestTypes;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Presents an abstracted view of the preferences that can be modified by the user
 *
 * @author Jonathan Nelson <ciasaboark@gmail.com>
 */
public class Prefs implements SharedPreferences.OnSharedPreferenceChangeListener {
    public static final String PREFERENCES_NAME = "org.ciasaboark.tacere.preferences";
    private static final String TAG = "Prefs";
    private static SharedPreferences sharedPreferences;
    private static SharedPreferences.OnSharedPreferenceChangeListener listener;
    private SharedPreferences.Editor editor;
    private Context context;

    public Prefs(final Context ctx) {
        this.context = ctx;
        if (sharedPreferences == null) {
            sharedPreferences = context.getSharedPreferences(PREFERENCES_NAME,
                    Context.MODE_PRIVATE);
        }

        if (listener == null) {
            listener = new SharedPreferences.OnSharedPreferenceChangeListener() {
                @Override
                public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
                    //the only preferences that we care to monitor changes on
                    String[] preferences = {
                            Keys.SILENCE_MEDIA,
                            Keys.BUFFER_MINUTES,
                            Keys.CALENDAR_RINGERS,
                            Keys.DO_NOT_DISTURB,
                            Keys.EVENT_RINGERS,
                            Keys.IS_SERVICE_ACTIVATED,
                            Keys.LOOKAHEAD_DAYS,
                            Keys.RINGER_TYPE,
                            Keys.SELECTED_CALENDARS,
                            Keys.SILENCE_ALARM,
                            Keys.SILENCE_ALL_DAY_EVENTS,
                            Keys.SILENCE_FREE_TIME_EVENTS,
                            Keys.SYNC_ALL_CALENDARS
                    };
                    //a few preferences get updated fairly often, it might be worth checking for them by
                    // name to avoid the loop
                    if (TextUtils.equals(key, ServiceStateManager.SERVICE_STATE_KEY)) {
                        return;
                    }

                    for (String pref : preferences) {
                        if (TextUtils.equals(pref, key)) {
                            AlarmManagerWrapper alarmManagerWrapper = new AlarmManagerWrapper(context);
                            alarmManagerWrapper.scheduleImmediateAlarm(RequestTypes.SETTINGS_CHANGED);
                            break;
                        }
                    }
                }
            };
            sharedPreferences.registerOnSharedPreferenceChangeListener(listener);
        }

        this.editor = sharedPreferences.edit();
    }

    @Override
    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {

    }

    public SharedPreferences getBaseSharedPreferences() {
        return sharedPreferences;
    }

    public List<Long> getSelectedCalendarsIds() {
        String calendars = sharedPreferences.getString(Keys.SELECTED_CALENDARS, "");
        String[] calendarIdArray = calendars.split(",");
        List<Long> calendarList = new ArrayList<Long>();
        for (String calendarId : calendarIdArray) {
            try {
                long id = Long.parseLong(calendarId);
                calendarList.add(id);
            } catch (NumberFormatException e) {
                if (!calendarId.equals("")) {   //ignore the trailing ","
                    Log.e(TAG, "unable to read calendar id '" + calendarId + "' as integer" +
                            " value, ignoring");
                }
            }
        }
        return calendarList;
    }

    public void setSelectedCalendars(List<Long> calendarList) {
        //setting specific calendar ids to sync should clear the preference to sync all calendars
        setSyncAllCalendars(false);
        List<Long> noDuplicates = new ArrayList<Long>();
        //remove any duplicate entries
        for (Long l : calendarList) {
            if (!noDuplicates.contains(l)) {
                noDuplicates.add(l);
            }
        }

        String commaSeparatedCalIds = "";
        for (long id : noDuplicates) {
            commaSeparatedCalIds += id + ",";
        }
        editor.putString(Keys.SELECTED_CALENDARS, commaSeparatedCalIds).commit();
    }

    public void setSyncAllCalendars(boolean syncAllCalendars) {
        //syncing all calendars will remove any previously selected calendars to sync
        if (syncAllCalendars) {
            setSelectedCalendars(new ArrayList());
        }
        editor.putBoolean(Keys.SYNC_ALL_CALENDARS, syncAllCalendars).commit();
    }

    public boolean shouldAllCalendarsBeSynced() {
        boolean syncAllCalendars = sharedPreferences.getBoolean(Keys.SYNC_ALL_CALENDARS, DefaultPrefs.SYNC_ALL_CALENDARS);
        return syncAllCalendars;
    }

    public Boolean isServiceActivated() {
        return sharedPreferences.getBoolean(Keys.IS_SERVICE_ACTIVATED, DefaultPrefs.IS_SERVICE_ACTIVATED);
    }

    public void setIsServiceActivated(Boolean isServiceActivated) {
        editor.putBoolean(Keys.IS_SERVICE_ACTIVATED, isServiceActivated).commit();
    }

    public Boolean shouldAvailableEventsSilence() {
        return sharedPreferences.getBoolean(Keys.SILENCE_FREE_TIME_EVENTS, DefaultPrefs.SILENCE_FREE_TIME_EVENTS);
    }

    public void setSilenceFreeTimeEvents(Boolean silenceFreeTimeEvents) {
        editor.putBoolean(Keys.SILENCE_FREE_TIME_EVENTS, silenceFreeTimeEvents).commit();

    }

    public Boolean shouldAllDayEventsSilence() {
        return sharedPreferences.getBoolean(Keys.SILENCE_ALL_DAY_EVENTS, DefaultPrefs.SILENCE_ALL_DAY_EVENTS);
    }

    public void setSilenceAllDayEvents(Boolean silenceAllDayEvents) {
        editor.putBoolean(Keys.SILENCE_ALL_DAY_EVENTS, silenceAllDayEvents).commit();
    }

    public RingerType getRingerType() {
        final int NO_STORED_RINGER = -1;
        RingerType storedRinger = DefaultPrefs.RINGER_TYPE;
        int ringerInt = sharedPreferences.getInt(Keys.RINGER_TYPE, NO_STORED_RINGER);

        if (ringerInt != NO_STORED_RINGER) {
            storedRinger = RingerType.getTypeForInt(ringerInt);
        }
        return storedRinger;
    }

    public void setRingerType(RingerType ringerType) {
        if (ringerType == null) {
            throw new IllegalArgumentException("Given ringer type must not be null");
        }
        Log.d(TAG, "Storing new default ringer type: " + ringerType.toString());
        editor.putInt(Keys.RINGER_TYPE, ringerType.value).commit();
    }

    public int getQuicksilenceMinutes() {
        return sharedPreferences.getInt(Keys.QUICKSILENCE_MINUTES,
                DefaultPrefs.QUICK_SILENCE_MINUTES);
    }

    public void setQuicksilenceMinutes(int quicksilenceMinutes) {
        editor.putInt(Keys.QUICKSILENCE_MINUTES, quicksilenceMinutes).commit();
    }

    public int getQuickSilenceHours() {

        return sharedPreferences.getInt(Keys.QUICKSILENCE_HOURS, DefaultPrefs.QUICK_SILENCE_HOURS);
    }

    public void setQuickSilenceHours(int quickSilenceHours) {
        editor.putInt(Keys.QUICKSILENCE_HOURS, quickSilenceHours).commit();
    }

    public int getBufferMinutes() {
        return sharedPreferences.getInt(Keys.BUFFER_MINUTES, DefaultPrefs.BUFFER_MINUTES);
    }

    public void setBufferMinutes(int bufferMinutes) {
        editor.putInt(Keys.BUFFER_MINUTES, bufferMinutes).commit();
    }

    public Intervals getLookaheadDays() {
        int intervalValue = sharedPreferences.getInt(Keys.LOOKAHEAD_DAYS, -1);

        Intervals interval;
        try {
            interval = Intervals.getTypeForInt(intervalValue);
        } catch (IllegalArgumentException e) {
            //use the default value
            interval = DefaultPrefs.LOOKAHEAD_DAYS;
        }

        return interval;
    }

    public void setLookaheadDays(Intervals lookaheadDays) {
        if (lookaheadDays == null) {
            throw new IllegalArgumentException("Interval can not be null");
        }

        editor.putInt(Keys.LOOKAHEAD_DAYS, lookaheadDays.value).commit();
    }

    public boolean getDoNotDisturb() {
        return sharedPreferences.getBoolean(Keys.DO_NOT_DISTURB, DefaultPrefs.DO_NOT_DISTURB);
    }

    public void setDoNotDisturb(boolean doNotDisturb) {
        editor.putBoolean(Keys.DO_NOT_DISTURB, doNotDisturb).commit();
    }

    public int getDefaultMediaVolume() {
        return DefaultPrefs.MEDIA_VOLUME;
    }

    public int getDefaultAlarmVolume() {
        return DefaultPrefs.ALARM_VOLUME;
    }

    public boolean getBoolean(String key) {
        if (sharedPreferences.contains(key)) {
            return sharedPreferences.getBoolean(key, true);
        } else {
            throw new IllegalArgumentException("key " + key + " not found in preferences");
        }
    }

    public int readInt(String key) {
        if (sharedPreferences.contains(key)) {
            return sharedPreferences.getInt(key, Integer.MIN_VALUE);
        } else {
            throw new IllegalArgumentException("key " + key + " not found in preferences");
        }
    }

    public String readString(String key) {
        if (sharedPreferences.contains(key)) {
            return sharedPreferences.getString(key, null);
        } else {
            throw new IllegalArgumentException("key " + key + " not found in preferences");
        }
    }

    public long readLong(String key) {
        if (sharedPreferences.contains(key)) {
            return sharedPreferences.getLong(key, Long.MIN_VALUE);
        } else {
            throw new IllegalArgumentException("key " + key + " not found in preferences");
        }
    }

    public RingerType getRingerForEventSeries(long eventId) {
        RingerType ringer = RingerType.UNDEFINED;

        Map<Long, Integer> map = getEventRingersMap();
        if (map.containsKey(eventId)) {
            int ringerInt = map.get(eventId);
            try {
                ringer = RingerType.getTypeForInt(ringerInt);
            } catch (IllegalArgumentException e) {
                Log.e(TAG, e.getMessage());
                throw e;
            }
        }

        return ringer;
    }


    private Map<Long, Integer> getEventRingersMap() {
        //Event string should be in the format of <event id (long)>:<ringer type (int)>,...
        //i.e.: 134:1,5:2,16000:0,
        String eventsString = sharedPreferences.getString(Keys.EVENT_RINGERS, "");
        return convertStringToLongIntegerMap(eventsString);
    }

    private Map<Long, Integer> convertStringToLongIntegerMap(String line) {
        Map<Long, Integer> map = new HashMap<Long, Integer>();

        if (line != "") {
            String[] keyValueTuples = line.split(",");
            for (String tuple : keyValueTuples) {
                try {
                    String[] keyValuePair = tuple.split(":");
                    Long key = Long.parseLong(keyValuePair[0]);
                    Integer value = Integer.parseInt(keyValuePair[1]);
                    map.put(key, value);
                } catch (NumberFormatException e) {
                    Log.e(TAG, "error reading event id and ringer type from string: " + tuple);
                }
            }
        }

        return map;
    }

    public void setRingerForEventSeries(long eventId, RingerType ringerType) {
        Map<Long, Integer> eventsMap = getEventRingersMap();
        eventsMap.put(eventId, ringerType.value);
        setEventsRingerMap(eventsMap);
    }

    private void setEventsRingerMap(Map<Long, Integer> map) {
        String eventRingers = convertMapToString(map);
        editor.putString(Keys.EVENT_RINGERS, eventRingers).commit();
    }

    private String convertMapToString(Map<Long, Integer> map) {
        String line = "";
        for (Long k : map.keySet()) {
            String key = k.toString();
            String value = map.get(k).toString();
            line += key + ":" + value + ",";
        }
        return line;
    }

    public void unsetRingerTypeForEventSeries(long eventId) {
        Map<Long, Integer> eventsMap = getEventRingersMap();
        eventsMap.remove(eventId);
        setEventsRingerMap(eventsMap);
    }


    public RingerType getRingerForCalendar(long calendarId) {
        RingerType ringer = RingerType.UNDEFINED;

        Map<Long, Integer> map = getCalendarRingersMap();
        if (map.containsKey(calendarId)) {
            int ringerInt = map.get(calendarId);
            try {
                ringer = RingerType.getTypeForInt(ringerInt);
            } catch (IllegalArgumentException e) {
                Log.e(TAG, e.getMessage());
                throw e;
            }
        }

        return ringer;
    }

    private Map<Long, Integer> getCalendarRingersMap() {
        String eventsString = sharedPreferences.getString(Keys.CALENDAR_RINGERS, "");
        return convertStringToLongIntegerMap(eventsString);
    }

    private void setCalendarRingersMap(Map<Long, Integer> map) {
        String calendarRingers = convertMapToString(map);
        editor.putString(Keys.CALENDAR_RINGERS, calendarRingers).commit();
    }

    public void setRingerForCalendar(long calendarId, int ringerType) {
        Map<Long, Integer> calendarMap = getCalendarRingersMap();
        calendarMap.put(calendarId, ringerType);
        setCalendarRingersMap(calendarMap);
    }

    public void unsetRingerTypeForCalendar(long calendarId) {
        Map<Long, Integer> calendarMap = getCalendarRingersMap();
        calendarMap.remove(calendarId);
        setCalendarRingersMap(calendarMap);
    }

    public <V> void storePreference(String key, V value) {
        SharedPreferences.Editor sharedPrefEdit = sharedPreferences.edit();
        if (value instanceof String) {
            sharedPrefEdit.putString(key, (String) value);
        } else if (value instanceof Integer) {
            sharedPrefEdit.putInt(key, (Integer) value);
        } else if (value instanceof Long) {
            sharedPrefEdit.putLong(key, (Long) value);
        } else if (value instanceof Boolean) {
            sharedPrefEdit.putBoolean(key, (Boolean) value);
        } else {
            throw new IllegalArgumentException(TAG
                    + " unable to store preference with unsupported type: "
                    + value.getClass().getName());
        }

        sharedPrefEdit.apply();
    }

    public void restoreDefaultPreferences() {
        sharedPreferences.edit().clear().commit();
    }

    public void remove(String key) {
        if (key == null) {
            throw new IllegalArgumentException("unable to remove null key");
        }
        sharedPreferences.edit().remove(key).apply();
    }

    public boolean shouldMediaVolumeBeSilenced() {
        return sharedPreferences.getBoolean(Keys.SILENCE_MEDIA, DefaultPrefs.SILENCE_MEDIA);
    }

    public void setMediaVolumeShouldSilence(boolean shouldSilence) {
        editor.putBoolean(Keys.SILENCE_MEDIA, shouldSilence).commit();
    }

    public boolean shouldAlarmVolumeBeSilenced() {
        return sharedPreferences.getBoolean(Keys.SILENCE_ALARM, DefaultPrefs.SILENCE_ALARM);
    }

    public void setAlarmVolumeShouldSilence(boolean shouldSilence) {
        editor.putBoolean(Keys.SILENCE_ALARM, shouldSilence).commit();
    }

    public void storeMediaVolume(int curVolume) {
        editor.putInt(Keys.VOLUME_MEDIA, curVolume).commit();
    }

    public void storeAlarmVolume(int curVolume) {
        editor.putInt(Keys.VOL, curVolume).commit();
    }

    public int getStoredMediaVolume() {
        return sharedPreferences.getInt(Keys.VOLUME_MEDIA, -1);
    }

    public int getStoredAlarmVolume() {
        return sharedPreferences.getInt(Keys.VOL, -1);
    }

    public boolean isFirstRun() {
        SharedPreferences firstRunPreferences = context.getSharedPreferences("FIRSTRUN", Context.MODE_PRIVATE);
        return firstRunPreferences.getBoolean(Keys.IS_FIRSTRUN, true);
    }

    public void disableFirstRun() {
        SharedPreferences firstRunPreferences = context.getSharedPreferences("FIRSTRUN", Context.MODE_PRIVATE);
        firstRunPreferences.edit().putBoolean(Keys.IS_FIRSTRUN, false).commit();
    }


    private static class Keys {
        public static final String IS_SERVICE_ACTIVATED = "IS_ACTIVATED";
        public static final String SILENCE_FREE_TIME_EVENTS = "SILENCE_FREE_TIME_EVENTS";
        public static final String SILENCE_ALL_DAY_EVENTS = "SILENCE_ALL_DAY_EVENTS";
        public static final String RINGER_TYPE = "RINGER_TYPE";
        public static final String QUICKSILENCE_MINUTES = "QUICK_SILENCE_MINUTES";
        public static final String QUICKSILENCE_HOURS = "QUICK_SILENCE_HOURS";
        public static final String BUFFER_MINUTES = "BUFFER_MINUTES";
        public static final String LOOKAHEAD_DAYS = "LOOKAHEAD_DAYS";
        public static final String DO_NOT_DISTURB = "DO_NOT_DISTURB";
        public static final String SELECTED_CALENDARS = "SELECTED_CALENDARS";
        public static final String SYNC_ALL_CALENDARS = "SYNC_ALL_CALENDARS";
        public static final String SILENCE_MEDIA = "SILENCE_MEDIA";
        public static final String SILENCE_ALARM = "SILENCE_ALARM";
        public static final String EVENT_RINGERS = "EVENT_RINGERS";
        public static final String CALENDAR_RINGERS = "CALENDAR_RINGERS";
        public static final String IS_FIRSTRUN = "IS_FIRSTRUN";
        public static final String VOLUME_MEDIA = "VOLUME_MEDIA";
        public static final String VOL = "VOLUME_ALARM";
    }
}




Java Source Code List

.EventInstanceTest.java
com.viewpagerindicator.BuildConfig.java
com.viewpagerindicator.BuildConfig.java
com.viewpagerindicator.CirclePageIndicator.java
com.viewpagerindicator.IconPageIndicator.java
com.viewpagerindicator.IconPagerAdapter.java
com.viewpagerindicator.IcsLinearLayout.java
com.viewpagerindicator.LinePageIndicator.java
com.viewpagerindicator.PageIndicator.java
com.viewpagerindicator.TabPageIndicator.java
com.viewpagerindicator.TitlePageIndicator.java
com.viewpagerindicator.UnderlinePageIndicator.java
org.ciasaboark.tacere.ApplicationTest.java
org.ciasaboark.tacere.Tacere.java
org.ciasaboark.tacere.activity.AboutActivity.java
org.ciasaboark.tacere.activity.AboutLicenseActivity.java
org.ciasaboark.tacere.activity.AdvancedSettingsActivity.java
org.ciasaboark.tacere.activity.BetaReleaseActivity.java
org.ciasaboark.tacere.activity.BetaSettingsActivity.java
org.ciasaboark.tacere.activity.BugReportActivity.java
org.ciasaboark.tacere.activity.DonationActivityTest.java
org.ciasaboark.tacere.activity.LicenseCheckWrapper.java
org.ciasaboark.tacere.activity.MainActivity.java
org.ciasaboark.tacere.activity.ProUpgradeActivity.java
org.ciasaboark.tacere.activity.SelectCalendarsActivity.java
org.ciasaboark.tacere.activity.SettingsActivity.java
org.ciasaboark.tacere.activity.ShowUpdatesActivity.java
org.ciasaboark.tacere.activity.TutorialActivity.java
org.ciasaboark.tacere.activity.fragment.AdvancedSettingsFragment.java
org.ciasaboark.tacere.activity.fragment.BetaSettingsFragment.java
org.ciasaboark.tacere.activity.fragment.EventDetailsFragment.java
org.ciasaboark.tacere.activity.fragment.MainSettingsFragment.java
org.ciasaboark.tacere.activity.fragment.SelectCalendarsFragment.java
org.ciasaboark.tacere.activity.fragment.TutorialCrashReporterFragment.java
org.ciasaboark.tacere.activity.fragment.TutorialEndFragment.java
org.ciasaboark.tacere.activity.fragment.TutorialEventListFragment.java
org.ciasaboark.tacere.activity.fragment.TutorialProVersionFragment.java
org.ciasaboark.tacere.activity.fragment.TutorialRingerPriorityFragment.java
org.ciasaboark.tacere.activity.fragment.TutorialWelcomeFragment.java
org.ciasaboark.tacere.adapter.EventCursorAdapter.java
org.ciasaboark.tacere.billing.Authenticator.java
org.ciasaboark.tacere.billing.google.Base64DecoderException.java
org.ciasaboark.tacere.billing.google.Base64.java
org.ciasaboark.tacere.billing.google.IabException.java
org.ciasaboark.tacere.billing.google.IabHelper.java
org.ciasaboark.tacere.billing.google.IabResult.java
org.ciasaboark.tacere.billing.google.Inventory.java
org.ciasaboark.tacere.billing.google.Purchase.java
org.ciasaboark.tacere.billing.google.Security.java
org.ciasaboark.tacere.billing.google.SkuDetails.java
org.ciasaboark.tacere.bug.CrashReportManager.java
org.ciasaboark.tacere.converter.DateConverterTest.java
org.ciasaboark.tacere.converter.DateConverter.java
org.ciasaboark.tacere.converter.TimeConverter.java
org.ciasaboark.tacere.database.Columns.java
org.ciasaboark.tacere.database.DataSetManager.java
org.ciasaboark.tacere.database.DatabaseInterface.java
org.ciasaboark.tacere.database.EventDatabaseOpenHelper.java
org.ciasaboark.tacere.database.NoSuchEventInstanceException.java
org.ciasaboark.tacere.database.TooltipManager.java
org.ciasaboark.tacere.event.Calendar.java
org.ciasaboark.tacere.event.EventInstance.java
org.ciasaboark.tacere.event.EventManager.java
org.ciasaboark.tacere.event.ringer.Intervals.java
org.ciasaboark.tacere.event.ringer.RingerSource.java
org.ciasaboark.tacere.event.ringer.RingerType.java
org.ciasaboark.tacere.key.ApplicationTest.java
org.ciasaboark.tacere.key.MainActivity.java
org.ciasaboark.tacere.manager.AlarmManagerWrapper.java
org.ciasaboark.tacere.manager.NotificationManagerWrapper.java
org.ciasaboark.tacere.manager.RingerStateManager.java
org.ciasaboark.tacere.manager.ServiceStateManager.java
org.ciasaboark.tacere.manager.VolumesManager.java
org.ciasaboark.tacere.notifier.WidgetNotifier.java
org.ciasaboark.tacere.prefs.BetaPrefs.java
org.ciasaboark.tacere.prefs.DefaultPrefs.java
org.ciasaboark.tacere.prefs.PrefsTest.java
org.ciasaboark.tacere.prefs.Prefs.java
org.ciasaboark.tacere.prefs.Updates.java
org.ciasaboark.tacere.receiver.BootCompletedReceiver.java
org.ciasaboark.tacere.receiver.ProviderChangedReceiver.java
org.ciasaboark.tacere.service.EventSilencerService.java
org.ciasaboark.tacere.service.ExtendEventService.java
org.ciasaboark.tacere.service.ExtendQuicksilenceService.java
org.ciasaboark.tacere.service.RequestTypes.java
org.ciasaboark.tacere.service.ResetEventServiceTest.java
org.ciasaboark.tacere.service.ResetEventService.java
org.ciasaboark.tacere.service.SkipEventService.java
org.ciasaboark.tacere.versioning.Versioning.java
org.ciasaboark.tacere.view.EventListItem.java
org.ciasaboark.tacere.widget.ActiveEventWidgetProvider.java
org.ciasaboark.tacere.widget.EventListWidgetProvider.java
org.ciasaboark.tacere.widget.QuickSilenceTinyWidgetProvider.java
org.ciasaboark.tacere.widget.QuickSilenceWidgetProvider.java
org.ciasaboark.tacere.widget.activity.WidgetPopupRinger.java
org.ciasaboark.tacere.widget.adapter.WidgetEventListAdapter.java
org.ciasaboark.tacere.widget.service.WidgetService.java