Search in sources :

Example 21 with SuggestionFeatureProvider

use of com.android.settings.dashboard.suggestions.SuggestionFeatureProvider in project platform_packages_apps_Settings by BlissRoms.

the class DoubleTapPowerSettings method onAttach.

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    SuggestionFeatureProvider suggestionFeatureProvider = FeatureFactory.getFactory(context).getSuggestionFeatureProvider(context);
    SharedPreferences prefs = suggestionFeatureProvider.getSharedPrefs(context);
    prefs.edit().putBoolean(PREF_KEY_SUGGESTION_COMPLETE, true).apply();
}
Also used : SharedPreferences(android.content.SharedPreferences) SuggestionFeatureProvider(com.android.settings.dashboard.suggestions.SuggestionFeatureProvider)

Example 22 with SuggestionFeatureProvider

use of com.android.settings.dashboard.suggestions.SuggestionFeatureProvider in project platform_packages_apps_Settings by BlissRoms.

the class DoubleTwistGestureSettings method onAttach.

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    SuggestionFeatureProvider suggestionFeatureProvider = FeatureFactory.getFactory(context).getSuggestionFeatureProvider(context);
    SharedPreferences prefs = suggestionFeatureProvider.getSharedPrefs(context);
    prefs.edit().putBoolean(PREF_KEY_SUGGESTION_COMPLETE, true).apply();
}
Also used : SharedPreferences(android.content.SharedPreferences) SuggestionFeatureProvider(com.android.settings.dashboard.suggestions.SuggestionFeatureProvider)

Example 23 with SuggestionFeatureProvider

use of com.android.settings.dashboard.suggestions.SuggestionFeatureProvider in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class DoubleTapPowerSettings method onAttach.

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    SuggestionFeatureProvider suggestionFeatureProvider = FeatureFactory.getFactory(context).getSuggestionFeatureProvider(context);
    SharedPreferences prefs = suggestionFeatureProvider.getSharedPrefs(context);
    prefs.edit().putBoolean(PREF_KEY_SUGGESTION_COMPLETE, true).apply();
}
Also used : SharedPreferences(android.content.SharedPreferences) SuggestionFeatureProvider(com.android.settings.dashboard.suggestions.SuggestionFeatureProvider)

Example 24 with SuggestionFeatureProvider

use of com.android.settings.dashboard.suggestions.SuggestionFeatureProvider in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ZenOnboardingActivity method withinShowTimeThreshold.

private static boolean withinShowTimeThreshold(Context context) {
    final SuggestionFeatureProvider featureProvider = FeatureFactory.getFactory(context).getSuggestionFeatureProvider(context);
    final SharedPreferences prefs = featureProvider.getSharedPrefs(context);
    final long currentTimeMs = System.currentTimeMillis();
    final long firstDisplayTimeMs;
    if (!prefs.contains(PREF_KEY_SUGGESTION_FIRST_DISPLAY_TIME)) {
        firstDisplayTimeMs = currentTimeMs;
        prefs.edit().putLong(PREF_KEY_SUGGESTION_FIRST_DISPLAY_TIME, currentTimeMs).commit();
    } else {
        firstDisplayTimeMs = prefs.getLong(PREF_KEY_SUGGESTION_FIRST_DISPLAY_TIME, -1);
    }
    final long showTimeMs = firstDisplayTimeMs + ALWAYS_SHOW_THRESHOLD;
    final boolean stillShow = currentTimeMs < showTimeMs;
    Log.d(TAG, "still show zen suggestion based on time: " + stillShow + " showTimeMs=" + showTimeMs);
    return stillShow;
}
Also used : SharedPreferences(android.content.SharedPreferences) SuggestionFeatureProvider(com.android.settings.dashboard.suggestions.SuggestionFeatureProvider)

Example 25 with SuggestionFeatureProvider

use of com.android.settings.dashboard.suggestions.SuggestionFeatureProvider in project android_packages_apps_Settings by omnirom.

the class DoubleTapPowerSettings method onAttach.

@Override
public void onAttach(Context context) {
    super.onAttach(context);
    SuggestionFeatureProvider suggestionFeatureProvider = FeatureFactory.getFactory(context).getSuggestionFeatureProvider(context);
    SharedPreferences prefs = suggestionFeatureProvider.getSharedPrefs(context);
    prefs.edit().putBoolean(PREF_KEY_SUGGESTION_COMPLETE, true).apply();
}
Also used : SharedPreferences(android.content.SharedPreferences) SuggestionFeatureProvider(com.android.settings.dashboard.suggestions.SuggestionFeatureProvider)

Aggregations

SharedPreferences (android.content.SharedPreferences)59 SuggestionFeatureProvider (com.android.settings.dashboard.suggestions.SuggestionFeatureProvider)59 Intent (android.content.Intent)6 AmbientDisplayConfiguration (android.hardware.display.AmbientDisplayConfiguration)6 VideoPreference (com.android.settings.widget.VideoPreference)1 IllustrationPreference (com.android.settingslib.widget.IllustrationPreference)1