Search in sources :

Example 81 with CallSuper

use of android.annotation.CallSuper in project android_frameworks_base by ResurrectionRemix.

the class Preference method onBindView.

/**
     * Binds the created View to the data for this Preference.
     * <p>
     * This is a good place to grab references to custom Views in the layout and
     * set properties on them.
     * <p>
     * Make sure to call through to the superclass's implementation.
     * 
     * @param view The View that shows this Preference.
     * @see #onCreateView(ViewGroup)
     */
@CallSuper
protected void onBindView(View view) {
    final TextView titleView = (TextView) view.findViewById(com.android.internal.R.id.title);
    if (titleView != null) {
        final CharSequence title = getTitle();
        if (!TextUtils.isEmpty(title)) {
            titleView.setText(title);
            titleView.setVisibility(View.VISIBLE);
        } else {
            titleView.setVisibility(View.GONE);
        }
    }
    final TextView summaryView = (TextView) view.findViewById(com.android.internal.R.id.summary);
    if (summaryView != null) {
        final CharSequence summary = getSummary();
        if (!TextUtils.isEmpty(summary)) {
            summaryView.setText(summary);
            summaryView.setVisibility(View.VISIBLE);
        } else {
            summaryView.setVisibility(View.GONE);
        }
    }
    final ImageView imageView = (ImageView) view.findViewById(com.android.internal.R.id.icon);
    if (imageView != null) {
        if (mIconResId != 0 || mIcon != null) {
            if (mIcon == null) {
                mIcon = getContext().getDrawable(mIconResId);
            }
            if (mIcon != null) {
                imageView.setImageDrawable(mIcon);
            }
        }
        imageView.setVisibility(mIcon != null ? View.VISIBLE : View.GONE);
    }
    final View imageFrame = view.findViewById(com.android.internal.R.id.icon_frame);
    if (imageFrame != null) {
        imageFrame.setVisibility(mIcon != null ? View.VISIBLE : View.GONE);
    }
    if (mShouldDisableView) {
        setEnabledStateOnViews(view, isEnabled());
    }
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) ListView(android.widget.ListView) CallSuper(android.annotation.CallSuper)

Example 82 with CallSuper

use of android.annotation.CallSuper in project android_frameworks_base by crdroidandroid.

the class DocumentsProvider method canonicalize.

/**
     * Implementation is provided by the parent class. Can be overridden to
     * provide additional functionality, but subclasses <em>must</em> always
     * call the superclass. If the superclass returns {@code null}, the subclass
     * may implement custom behavior.
     * <p>
     * This is typically used to resolve a subtree URI into a concrete document
     * reference, issuing a narrower single-document URI permission grant along
     * the way.
     *
     * @see DocumentsContract#buildDocumentUriUsingTree(Uri, String)
     */
@CallSuper
@Override
public Uri canonicalize(Uri uri) {
    final Context context = getContext();
    switch(mMatcher.match(uri)) {
        case MATCH_DOCUMENT_TREE:
            enforceTree(uri);
            final Uri narrowUri = buildDocumentUri(uri.getAuthority(), getDocumentId(uri));
            // Caller may only have prefix grant, so extend them a grant to
            // the narrow URI.
            final int modeFlags = getCallingOrSelfUriPermissionModeFlags(context, uri);
            context.grantUriPermission(getCallingPackage(), narrowUri, modeFlags);
            return narrowUri;
    }
    return null;
}
Also used : Context(android.content.Context) Uri(android.net.Uri) DocumentsContract.buildDocumentUri(android.provider.DocumentsContract.buildDocumentUri) DocumentsContract.isTreeUri(android.provider.DocumentsContract.isTreeUri) DocumentsContract.buildTreeDocumentUri(android.provider.DocumentsContract.buildTreeDocumentUri) Point(android.graphics.Point) CallSuper(android.annotation.CallSuper)

Example 83 with CallSuper

use of android.annotation.CallSuper in project android_frameworks_base by crdroidandroid.

the class DialogPreference method onBindDialogView.

/**
     * Binds views in the content View of the dialog to data.
     * <p>
     * Make sure to call through to the superclass implementation.
     * 
     * @param view The content View of the dialog, if it is custom.
     */
@CallSuper
protected void onBindDialogView(View view) {
    View dialogMessageView = view.findViewById(com.android.internal.R.id.message);
    if (dialogMessageView != null) {
        final CharSequence message = getDialogMessage();
        int newVisibility = View.GONE;
        if (!TextUtils.isEmpty(message)) {
            if (dialogMessageView instanceof TextView) {
                ((TextView) dialogMessageView).setText(message);
            }
            newVisibility = View.VISIBLE;
        }
        if (dialogMessageView.getVisibility() != newVisibility) {
            dialogMessageView.setVisibility(newVisibility);
        }
    }
}
Also used : TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) CallSuper(android.annotation.CallSuper)

Example 84 with CallSuper

use of android.annotation.CallSuper in project android_frameworks_base by crdroidandroid.

the class AndroidKeyStoreSignatureSpiBase method resetWhilePreservingInitState.

/**
     * Resets this cipher while preserving the initialized state. This must be equivalent to
     * rolling back the cipher's state to just after the most recent {@code engineInit} completed
     * successfully.
     *
     * <p>Subclasses storing additional post-init state should override this method, reset the
     * additional state, and then chain to superclass.
     */
@CallSuper
protected void resetWhilePreservingInitState() {
    IBinder operationToken = mOperationToken;
    if (operationToken != null) {
        mOperationToken = null;
        mKeyStore.abort(operationToken);
    }
    mOperationHandle = 0;
    mMessageStreamer = null;
    mCachedException = null;
}
Also used : IBinder(android.os.IBinder) CallSuper(android.annotation.CallSuper)

Example 85 with CallSuper

use of android.annotation.CallSuper in project android_frameworks_base by crdroidandroid.

the class AndroidKeyStoreCipherSpiBase method resetWhilePreservingInitState.

/**
     * Resets this cipher while preserving the initialized state. This must be equivalent to
     * rolling back the cipher's state to just after the most recent {@code engineInit} completed
     * successfully.
     *
     * <p>Subclasses storing additional post-init state should override this method, reset the
     * additional state, and then chain to superclass.
     */
@CallSuper
protected void resetWhilePreservingInitState() {
    IBinder operationToken = mOperationToken;
    if (operationToken != null) {
        mKeyStore.abort(operationToken);
    }
    mOperationToken = null;
    mOperationHandle = 0;
    mMainDataStreamer = null;
    mAdditionalAuthenticationDataStreamer = null;
    mAdditionalAuthenticationDataStreamerClosed = false;
    mCachedException = null;
}
Also used : IBinder(android.os.IBinder) CallSuper(android.annotation.CallSuper)

Aggregations

CallSuper (android.annotation.CallSuper)89 IBinder (android.os.IBinder)20 View (android.view.View)15 TextView (android.widget.TextView)15 Point (android.graphics.Point)13 Drawable (android.graphics.drawable.Drawable)13 Context (android.content.Context)10 ImageView (android.widget.ImageView)10 ListView (android.widget.ListView)10 Paint (android.graphics.Paint)8 ColorDrawable (android.graphics.drawable.ColorDrawable)8 InputMethodManager (android.view.inputmethod.InputMethodManager)8 ScrollBarDrawable (android.widget.ScrollBarDrawable)8 MainThread (android.annotation.MainThread)5 TypedArray (android.content.res.TypedArray)5 Uri (android.net.Uri)5 Parcelable (android.os.Parcelable)5 DocumentsContract.buildDocumentUri (android.provider.DocumentsContract.buildDocumentUri)5 DocumentsContract.buildTreeDocumentUri (android.provider.DocumentsContract.buildTreeDocumentUri)5 DocumentsContract.isTreeUri (android.provider.DocumentsContract.isTreeUri)5