Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84235ee9 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Add extra to exclude specific MIME-types from Fast-Track.

Also added ContactHeaderWidget accessor for passing along
this list when triggering Fast-Track.  This is used so that
the header widget can hide the profile icon when launched
while already looking at the profile.
parent 06a0323a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1772,6 +1772,13 @@ public final class ContactsContract {
         */
        public static final int MODE_LARGE = 3;

        /**
         * Optional extra used with {@link #SHOW_OR_CREATE_CONTACT} to indicate
         * a list of specific MIME-types to exclude and not display. Stored as a
         * {@link String} array.
         */
        public static final String EXTRA_EXCLUDE_MIMES = "exclude_mimes";

        /**
         * Intents related to the Contacts app UI.
         */
+15 −0
Original line number Diff line number Diff line
@@ -80,6 +80,8 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
    protected Uri mContactUri;
    protected Uri mStatusUri;

    protected String[] mExcludeMimes = null;

    protected ContentResolver mContentResolver;

    /**
@@ -291,6 +293,15 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
        mStatusView.setText(snippet);
    }

    /**
     * Set a list of specific MIME-types to exclude and not display. For
     * example, this can be used to hide the {@link Contacts#CONTENT_ITEM_TYPE}
     * profile icon.
     */
    public void setExcludeMimes(String[] excludeMimes) {
        mExcludeMimes = excludeMimes;
    }

    /**
     * Convenience method for binding all available data from an existing
     * contact.
@@ -428,6 +439,10 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
                final Rect target = getTargetRect(view);
                intent.putExtra(Intents.EXTRA_TARGET_RECT, target);
                intent.putExtra(Intents.EXTRA_MODE, Intents.MODE_SMALL);
                if (mExcludeMimes != null) {
                    // Exclude specific MIME-types when requested
                    intent.putExtra(Intents.EXTRA_EXCLUDE_MIMES, mExcludeMimes);
                }
                mContext.startActivity(intent);
                break;
            }