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

Commit 4a28965e authored by John Shao's avatar John Shao
Browse files

Fix for LMP crash for Fragment.getContext()

Fragment.getContext() was added in API level 23 so changing
usage from getContext() to mContext and adding override to
the fragment just in case.

Bug 30601104

Change-Id: I682cb28b60ca3d4103cb41f34d331ef761cde2f2
parent 86fee6d7
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -750,6 +750,11 @@ abstract public class ContactEditorBaseFragment extends Fragment implements
        }
    }

    @Override
    public Context getContext() {
        return getActivity();
    }

    @Override
    public void onCreateOptionsMenu(Menu menu, final MenuInflater inflater) {
        inflater.inflate(R.menu.edit_contact, menu);
@@ -1477,7 +1482,7 @@ abstract public class ContactEditorBaseFragment extends Fragment implements
                if (saveSucceeded && contactLookupUri != null) {
                    final Uri lookupUri = maybeConvertToLegacyLookupUri(
                            mContext, contactLookupUri, mLookupUri);
                    resultIntent = ImplicitIntentsUtil.composeQuickContactIntent(getContext(),
                    resultIntent = ImplicitIntentsUtil.composeQuickContactIntent(mContext,
                            lookupUri, QuickContactActivity.MODE_FULLY_EXPANDED);
                    resultIntent.putExtra(QuickContactActivity.EXTRA_PREVIOUS_SCREEN_TYPE,
                            ScreenType.EDITOR);
@@ -1534,7 +1539,7 @@ abstract public class ContactEditorBaseFragment extends Fragment implements
        }

        mContactIdForJoin = ContentUris.parseId(contactLookupUri);
        final Intent intent = new Intent(getContext(), ContactSelectionActivity.class);
        final Intent intent = new Intent(mContext, ContactSelectionActivity.class);
        intent.setAction(UiIntentActions.PICK_JOIN_CONTACT_ACTION);
        intent.putExtra(UiIntentActions.TARGET_CONTACT_ID_EXTRA_KEY, mContactIdForJoin);
        startActivityForResult(intent, REQUEST_CODE_JOIN);