From bf0f0fd52ee2315ffd01f7968e5808bea9fdc045 Mon Sep 17 00:00:00 2001 From: Nancy Chen Date: Wed, 18 Nov 2015 14:32:33 -0800 Subject: getContext() -> getActivity() in fragments for backwards compatibility. getContext() did not exist prior to API level 23, so override getContext() to return the activity in dialer code. Bug: 25776171 Change-Id: I817a1ba2ef29c032065b1e7eee6c033b050fb61d --- src/com/android/dialer/dialpad/DialpadFragment.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/com/android/dialer/dialpad/DialpadFragment.java') diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 760b02032..246b0d7fa 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -273,6 +273,11 @@ public class DialpadFragment extends Fragment return (TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE); } + @Override + public Context getContext() { + return getActivity(); + } + @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { mWasEmptyBeforeTextChange = TextUtils.isEmpty(s); -- cgit v1.2.3