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

Commit 75e84518 authored by Joe Onorato's avatar Joe Onorato
Browse files

Make QuickContactActivity look at the sourceBounds property of Intent as well.

parent 2bbeffbe
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -65,13 +65,30 @@ public final class QuickContactActivity extends Activity implements
        final Bundle extras = intent.getExtras();

        // Read requested parameters for displaying
        final Rect target = (Rect)extras.getParcelable(QuickContact.EXTRA_TARGET_RECT);
        final Rect target = getTargetRect(intent);
        final int mode = extras.getInt(QuickContact.EXTRA_MODE, QuickContact.MODE_MEDIUM);
        final String[] excludeMimes = extras.getStringArray(QuickContact.EXTRA_EXCLUDE_MIMES);

        mQuickContact.show(lookupUri, target, mode, excludeMimes);
    }

    private Rect getTargetRect(Intent intent) {
        Rect target = intent.getSourceBounds();
        if (target != null) {
            return target;
        }
        final Bundle extras = intent.getExtras();
        try {
            target = (Rect)extras.getParcelable(QuickContact.EXTRA_TARGET_RECT);
            if (target != null) {
                return target;
            }
        } catch (ClassCastException ex) {
            // fall through
        }
        return new Rect(0, 0, 0, 0);
    }

    /** {@inheritDoc} */
    @Override
    public void onBackPressed() {