Search in sources :

Example 26 with CallSuper

use of androidx.annotation.CallSuper in project android_packages_apps_Settings by crdroidandroid.

the class BaseSearchIndexProvider method getNonIndexableKeys.

@Override
@CallSuper
public List<String> getNonIndexableKeys(Context context) {
    if (!isPageSearchEnabled(context)) {
        // Entire page should be suppressed, mark all keys from this page as non-indexable.
        return getNonIndexableKeysFromXml(context, true);
    }
    final List<String> nonIndexableKeys = new ArrayList<>();
    nonIndexableKeys.addAll(getNonIndexableKeysFromXml(context, false));
    final List<AbstractPreferenceController> controllers = getPreferenceControllers(context);
    if (controllers != null && !controllers.isEmpty()) {
        for (AbstractPreferenceController controller : controllers) {
            if (controller instanceof PreferenceControllerMixin) {
                ((PreferenceControllerMixin) controller).updateNonIndexableKeys(nonIndexableKeys);
            } else if (controller instanceof BasePreferenceController) {
                ((BasePreferenceController) controller).updateNonIndexableKeys(nonIndexableKeys);
            } else {
                Log.e(TAG, controller.getClass().getName() + " must implement " + PreferenceControllerMixin.class.getName() + " treating the key non-indexable");
                nonIndexableKeys.add(controller.getPreferenceKey());
            }
        }
    }
    return nonIndexableKeys;
}
Also used : BasePreferenceController(com.android.settings.core.BasePreferenceController) AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) PreferenceControllerMixin(com.android.settings.core.PreferenceControllerMixin) ArrayList(java.util.ArrayList) CallSuper(androidx.annotation.CallSuper)

Example 27 with CallSuper

use of androidx.annotation.CallSuper in project android_packages_apps_Settings by crdroidandroid.

the class BaseSearchIndexProvider method getDynamicRawDataToIndex.

@Override
@CallSuper
public List<SearchIndexableRaw> getDynamicRawDataToIndex(Context context, boolean enabled) {
    final List<SearchIndexableRaw> dynamicRaws = new ArrayList<>();
    if (!isPageSearchEnabled(context)) {
        // Entire page should be suppressed, do not add dynamic raw data.
        return dynamicRaws;
    }
    final List<AbstractPreferenceController> controllers = getPreferenceControllers(context);
    if (controllers == null || controllers.isEmpty()) {
        return dynamicRaws;
    }
    for (AbstractPreferenceController controller : controllers) {
        if (controller instanceof PreferenceControllerMixin) {
            ((PreferenceControllerMixin) controller).updateDynamicRawDataToIndex(dynamicRaws);
        } else if (controller instanceof BasePreferenceController) {
            ((BasePreferenceController) controller).updateDynamicRawDataToIndex(dynamicRaws);
        } else {
            Log.e(TAG, controller.getClass().getName() + " must implement " + PreferenceControllerMixin.class.getName() + " treating the dynamic indexable");
        }
    }
    return dynamicRaws;
}
Also used : BasePreferenceController(com.android.settings.core.BasePreferenceController) AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) PreferenceControllerMixin(com.android.settings.core.PreferenceControllerMixin) ArrayList(java.util.ArrayList) SearchIndexableRaw(com.android.settingslib.search.SearchIndexableRaw) CallSuper(androidx.annotation.CallSuper)

Example 28 with CallSuper

use of androidx.annotation.CallSuper in project open-event-orga-app by fossasia.

the class AbstractBasePresenter method attach.

@Override
@CallSuper
public void attach(V view) {
    this.view = view;
    this.compositeDisposable = new CompositeDisposable();
    attachCount++;
}
Also used : CompositeDisposable(io.reactivex.disposables.CompositeDisposable) CallSuper(androidx.annotation.CallSuper)

Example 29 with CallSuper

use of androidx.annotation.CallSuper in project BaseProject by feer921.

the class TheActivityLifeCycleCallback method onActivityDestroyed.

// 基类有逻辑处理,则需要调用本基类
@CallSuper
@Override
public void onActivityDestroyed(Activity activity) {
    boolean isMarkedFinish = false;
    Intent theFlagIntent = activity.getIntent();
    if (theFlagIntent != null) {
        isMarkedFinish = theFlagIntent.getBooleanExtra("onActivityFinish", false);
    }
    if (!isMarkedFinish) {
        existActivityCount--;
    }
    if (LIFE_CIRCLE_DEBUG) {
        CommonLog.i(TAG, "-->onActivityDestroyed() activity = " + activity + " existActivityCount = " + existActivityCount + " isMarkedFinish = " + isMarkedFinish);
    }
}
Also used : Intent(android.content.Intent) CallSuper(androidx.annotation.CallSuper)

Example 30 with CallSuper

use of androidx.annotation.CallSuper in project ExoPlayer by google.

the class DecoderVideoRenderer method onInputFormatChanged.

/**
 * Called when a new format is read from the upstream source.
 *
 * @param formatHolder A {@link FormatHolder} that holds the new {@link Format}.
 * @throws ExoPlaybackException If an error occurs (re-)initializing the decoder.
 */
@CallSuper
protected void onInputFormatChanged(FormatHolder formatHolder) throws ExoPlaybackException {
    waitingForFirstSampleInFormat = true;
    Format newFormat = Assertions.checkNotNull(formatHolder.format);
    setSourceDrmSession(formatHolder.drmSession);
    Format oldFormat = inputFormat;
    inputFormat = newFormat;
    if (decoder == null) {
        maybeInitDecoder();
        eventDispatcher.inputFormatChanged(inputFormat, /* decoderReuseEvaluation= */
        null);
        return;
    }
    DecoderReuseEvaluation evaluation;
    if (sourceDrmSession != decoderDrmSession) {
        evaluation = new DecoderReuseEvaluation(decoder.getName(), oldFormat, newFormat, REUSE_RESULT_NO, DISCARD_REASON_DRM_SESSION_CHANGED);
    } else {
        evaluation = canReuseDecoder(decoder.getName(), oldFormat, newFormat);
    }
    if (evaluation.result == REUSE_RESULT_NO) {
        if (decoderReceivedBuffers) {
            // Signal end of stream and wait for any final output buffers before re-initialization.
            decoderReinitializationState = REINITIALIZATION_STATE_SIGNAL_END_OF_STREAM;
        } else {
            // There aren't any final output buffers, so release the decoder immediately.
            releaseDecoder();
            maybeInitDecoder();
        }
    }
    eventDispatcher.inputFormatChanged(inputFormat, evaluation);
}
Also used : Format(com.google.android.exoplayer2.Format) DecoderReuseEvaluation(com.google.android.exoplayer2.decoder.DecoderReuseEvaluation) CallSuper(androidx.annotation.CallSuper)

Aggregations

CallSuper (androidx.annotation.CallSuper)45 BasePreferenceController (com.android.settings.core.BasePreferenceController)8 PreferenceControllerMixin (com.android.settings.core.PreferenceControllerMixin)8 AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)8 ArrayList (java.util.ArrayList)8 Bundle (android.os.Bundle)6 Nullable (androidx.annotation.Nullable)6 View (android.view.View)4 TextView (android.widget.TextView)4 FragmentActivity (androidx.fragment.app.FragmentActivity)4 BaseRegistrationViewModel (org.thoughtcrime.securesms.registration.viewmodel.BaseRegistrationViewModel)4 SuppressLint (android.annotation.SuppressLint)3 TypedArray (android.content.res.TypedArray)3 SearchIndexableRaw (com.android.settingslib.search.SearchIndexableRaw)3 Intent (android.content.Intent)2 IntentFilter (android.content.IntentFilter)2 Resources (android.content.res.Resources)2 Paint (android.graphics.Paint)2 InputType (android.text.InputType)2 EditorInfo (android.view.inputmethod.EditorInfo)2