Search in sources :

Example 6 with SurveyFeatureProvider

use of com.android.settings.overlay.SurveyFeatureProvider in project android_packages_apps_Settings by crdroidandroid.

the class SurveyMixin method onResume.

@Override
public void onResume() {
    Activity activity = mFragment.getActivity();
    // guard against the activity not existing yet or the feature being disabled
    if (activity != null) {
        SurveyFeatureProvider provider = FeatureFactory.getFactory(activity).getSurveyFeatureProvider(activity);
        if (provider != null) {
            // Try to download a survey if there is none available, show the survey otherwise
            String id = provider.getSurveyId(activity, mName);
            if (provider.getSurveyExpirationDate(activity, id) <= -1) {
                // register the receiver to show the survey on completion.
                mReceiver = provider.createAndRegisterReceiver(activity);
                provider.downloadSurvey(activity, id, null);
            } else {
                provider.showSurveyIfAvailable(activity, id);
            }
        }
    }
}
Also used : SurveyFeatureProvider(com.android.settings.overlay.SurveyFeatureProvider) Activity(android.app.Activity)

Example 7 with SurveyFeatureProvider

use of com.android.settings.overlay.SurveyFeatureProvider in project android_packages_apps_Settings by SudaMod.

the class SurveyMixin method onResume.

@Override
public void onResume() {
    Activity activity = mFragment.getActivity();
    // guard against the activity not existing yet or the feature being disabled
    if (activity != null) {
        SurveyFeatureProvider provider = FeatureFactory.getFactory(activity).getSurveyFeatureProvider(activity);
        if (provider != null) {
            // Try to download a survey if there is none available, show the survey otherwise
            String id = provider.getSurveyId(activity, mName);
            if (provider.getSurveyExpirationDate(activity, id) <= -1) {
                // register the receiver to show the survey on completion.
                mReceiver = provider.createAndRegisterReceiver(activity);
                provider.downloadSurvey(activity, id, null);
            } else {
                provider.showSurveyIfAvailable(activity, id);
            }
        }
    }
}
Also used : SurveyFeatureProvider(com.android.settings.overlay.SurveyFeatureProvider) Activity(android.app.Activity)

Example 8 with SurveyFeatureProvider

use of com.android.settings.overlay.SurveyFeatureProvider in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SurveyMixin method onResume.

@Override
public void onResume() {
    Activity activity = mFragment.getActivity();
    // guard against the activity not existing yet or the feature being disabled
    if (activity != null) {
        SurveyFeatureProvider provider = FeatureFactory.getFactory(activity).getSurveyFeatureProvider(activity);
        if (provider != null) {
            // Try to download a survey if there is none available, show the survey otherwise
            String id = provider.getSurveyId(activity, mName);
            if (provider.getSurveyExpirationDate(activity, id) <= -1) {
                // register the receiver to show the survey on completion.
                mReceiver = provider.createAndRegisterReceiver(activity);
                provider.downloadSurvey(activity, id, null);
            } else {
                provider.showSurveyIfAvailable(activity, id);
            }
        }
    }
}
Also used : SurveyFeatureProvider(com.android.settings.overlay.SurveyFeatureProvider) Activity(android.app.Activity)

Example 9 with SurveyFeatureProvider

use of com.android.settings.overlay.SurveyFeatureProvider in project android_packages_apps_Settings by omnirom.

the class SurveyMixin method onResume.

@Override
public void onResume() {
    Activity activity = mFragment.getActivity();
    // guard against the activity not existing yet or the feature being disabled
    if (activity != null) {
        SurveyFeatureProvider provider = FeatureFactory.getFactory(activity).getSurveyFeatureProvider(activity);
        if (provider != null) {
            // Try to download a survey if there is none available, show the survey otherwise
            String id = provider.getSurveyId(activity, mName);
            if (provider.getSurveyExpirationDate(activity, id) <= -1) {
                // register the receiver to show the survey on completion.
                mReceiver = provider.createAndRegisterReceiver(activity);
                provider.downloadSurvey(activity, id, null);
            } else {
                provider.showSurveyIfAvailable(activity, id);
            }
        }
    }
}
Also used : SurveyFeatureProvider(com.android.settings.overlay.SurveyFeatureProvider) Activity(android.app.Activity)

Aggregations

Activity (android.app.Activity)9 SurveyFeatureProvider (com.android.settings.overlay.SurveyFeatureProvider)9