From efd8a915b4c37c9f755c25f045cad9e538918dfa Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Fri, 9 Aug 2013 09:40:31 -0700 Subject: Remove phone call receiver in call log fragment The most recent call log item in favorites removes the need to return the call log tab to the All tab on a phone call. Change-Id: Id0a36bc97c04656cf86a485e44e616b7d652d0b2 --- .../android/dialer/calllog/CallLogFragment.java | 52 ---------------------- 1 file changed, 52 deletions(-) diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index 5d750044f..a76d0c17e 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -90,7 +90,6 @@ public class CallLogFragment extends ListFragment private final Handler mHandler = new Handler(); private TelephonyManager mTelephonyManager; - private PhoneStateListener mPhoneStateListener; private class CustomContentObserver extends ContentObserver { public CustomContentObserver() { @@ -322,7 +321,6 @@ public class CallLogFragment extends ListFragment mAdapter.changeCursor(null); getActivity().getContentResolver().unregisterContentObserver(mCallLogObserver); getActivity().getContentResolver().unregisterContentObserver(mContactsObserver); - unregisterPhoneCallReceiver(); } @Override @@ -340,12 +338,6 @@ public class CallLogFragment extends ListFragment } private void updateCallList(int filterType) { - if (filterType == CallLogQueryHandler.CALL_TYPE_ALL) { - unregisterPhoneCallReceiver(); - } else { - // TODO krelease: Make this work - //registerPhoneCallReceiver(); - } mCallLogQueryHandler.fetchCalls(filterType); } @@ -487,48 +479,4 @@ public class CallLogFragment extends ListFragment serviceIntent.setAction(CallLogNotificationsService.ACTION_UPDATE_NOTIFICATIONS); getActivity().startService(serviceIntent); } - - // TODO krelease: Make the ViewPager switch to the correct tab (All) when a phone call is - // placed. - // This should probably be moved to the call log activity. - /** - * Register a phone call filter to reset the call type when a phone call is place. - */ - /* - private void registerPhoneCallReceiver() { - if (mPhoneStateListener != null) { - return; // Already registered. - } - mTelephonyManager = (TelephonyManager) getActivity().getSystemService( - Context.TELEPHONY_SERVICE); - mPhoneStateListener = new PhoneStateListener() { - @Override - public void onCallStateChanged(int state, String incomingNumber) { - if (state != TelephonyManager.CALL_STATE_OFFHOOK && - state != TelephonyManager.CALL_STATE_RINGING) { - return; - } - mHandler.post(new Runnable() { - @Override - public void run() { - if (getActivity() == null || getActivity().isFinishing()) { - return; - } - } - }); - } - }; - mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE); - } - */ - - /** - * Un-registers the phone call receiver. - */ - private void unregisterPhoneCallReceiver() { - if (mPhoneStateListener != null) { - mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE); - mPhoneStateListener = null; - } - } } -- cgit v1.2.3