diff options
author | Yorke Lee <yorkelee@google.com> | 2013-08-09 20:06:36 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-09 20:06:36 +0000 |
commit | f923f3ed402d0e87f87a90982ea54cf63602cc70 (patch) | |
tree | a888fde8c1353974e7bcd277241849201776b4c5 | |
parent | ea695cb0f877ad49a98df184efe982de83ed09d7 (diff) | |
parent | efd8a915b4c37c9f755c25f045cad9e538918dfa (diff) |
Merge "Remove phone call receiver in call log fragment" into klp-dev
-rw-r--r-- | src/com/android/dialer/calllog/CallLogFragment.java | 52 |
1 files changed, 0 insertions, 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; - } - } } |