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

Commit 277c358f authored by cketti's avatar cketti
Browse files

Cache information whether or not contact picker intent is available for this device.

parent b6561c8b
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ public abstract class Contacts {

    protected Context mContext;
    protected ContentResolver mContentResolver;
    protected Boolean mHasContactPicker;

    /**
     * Constructor
@@ -192,10 +193,10 @@ public abstract class Contacts {
     * @return True, if the device supports picking contacts. False, otherwise.
     */
    public boolean hasContactPicker() {
        if (mContext.getPackageManager().queryIntentActivities(contactPickerIntent(), 0).size() > 0) {
            return true;
        } else {
            return false;
        if (mHasContactPicker == null) {
            mHasContactPicker = (mContext.getPackageManager().
                    queryIntentActivities(contactPickerIntent(), 0).size() > 0);
        }
        return mHasContactPicker;
    }
}