Merge "Clean up todos in Dialer" into klp-dev
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 79d8d69..c9c94fa 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -81,9 +81,6 @@
 
 /**
  * The dialer tab's title is 'phone', a more common name (see strings.xml).
- *
- * TODO krelease: All classes currently prefixed with New will replace the original classes or
- * be renamed more appropriately before shipping.
  */
 public class DialtactsActivity extends TransactionSafeActivity implements View.OnClickListener,
         DialpadFragment.OnDialpadQueryChangedListener, PopupMenu.OnMenuItemClickListener,
@@ -370,6 +367,8 @@
                 final PopupMenu popupMenu = new PopupMenu(DialtactsActivity.this, view);
                 final Menu menu = popupMenu.getMenu();
                 popupMenu.inflate(R.menu.dialtacts_options);
+                final MenuItem clearFrequents = menu.findItem(R.id.menu_clear_frequents);
+                clearFrequents.setEnabled(mPhoneFavoriteFragment.hasFrequents());
                 popupMenu.setOnMenuItemClickListener(this);
                 popupMenu.show();
                 break;
@@ -379,9 +378,8 @@
                 break;
             case R.id.call_history_on_dialpad_button:
             case R.id.call_history_button:
-                // TODO krelease: This should start an intent with content type
-                // CallLog.Calls.CONTENT_TYPE, once the intent filters for the call log activity
-                // is enabled
+                // Use explicit CallLogActivity intent instead of ACTION_VIEW +
+                // CONTENT_TYPE, so that we always open our call log from our dialer
                 final Intent intent = new Intent(this, CallLogActivity.class);
                 startActivity(intent);
                 break;
@@ -610,9 +608,6 @@
      * @param intent Intent that contains information about which tab should be selected
      */
     private void displayFragment(Intent intent) {
-        // TODO krelease: Make navigation via intent work by displaying the correct fragment
-        // as appropriate.
-
         // If we got here by hitting send and we're in call forward along to the in-call activity
         boolean recentCallsRequest = Calls.CONTENT_TYPE.equals(intent.resolveType(
             getContentResolver()));
diff --git a/src/com/android/dialer/calllog/CallLogListItemHelper.java b/src/com/android/dialer/calllog/CallLogListItemHelper.java
index fdebeb1..23366e4 100644
--- a/src/com/android/dialer/calllog/CallLogListItemHelper.java
+++ b/src/com/android/dialer/calllog/CallLogListItemHelper.java
@@ -27,10 +27,6 @@
 
 /**
  * Helper class to fill in the views of a call log entry.
- * TODO krelease: The only difference between this and the original is that we don't touch
- * divider views, which are not present in the new dialer. Once the new dialer replaces
- * the old one, we can replace it entirely. Otherwise we would have redundant divider=null
- * checks all over the place.
  */
 /* package */class CallLogListItemHelper {
     /** Helper for populating the details of a phone call. */
diff --git a/src/com/android/dialer/list/PhoneFavoriteFragment.java b/src/com/android/dialer/list/PhoneFavoriteFragment.java
index 64a9b84..3cff901 100644
--- a/src/com/android/dialer/list/PhoneFavoriteFragment.java
+++ b/src/com/android/dialer/list/PhoneFavoriteFragment.java
@@ -135,7 +135,6 @@
     private OnListFragmentScrolledListener mActivityScrollListener;
     private PhoneFavoriteMergedAdapter mAdapter;
     private PhoneFavoritesTileAdapter mContactTileAdapter;
-    private PhoneNumberListAdapter mAllContactsAdapter;
 
     private CallLogAdapter mCallLogAdapter;
     private CallLogQueryHandler mCallLogQueryHandler;
@@ -161,8 +160,6 @@
             new ContactTileLoaderListener();
     private final ScrollListener mScrollListener = new ScrollListener();
 
-    private boolean mOptionsMenuHasFrequents;
-
     @Override
     public void onAttach(Activity activity) {
         if (DEBUG) Log.d(TAG, "onAttach()");
@@ -245,24 +242,8 @@
         return listLayout;
     }
 
-
-    // TODO krelease: update the options menu when displaying the popup menu instead. We could
-    // possibly get rid of this method entirely.
-    private boolean isOptionsMenuChanged() {
-        return mOptionsMenuHasFrequents != hasFrequents();
-    }
-
-    // TODO krelease: Configure the menu items properly. Since the menu items show up as a PopupMenu
-    // rather than a normal actionbar menu, the initialization should be done there.
-    /*
-    @Override
-    public void onPrepareOptionsMenu(Menu menu) {
-        final MenuItem clearFrequents = menu.findItem(R.id.menu_clear_frequents);
-        mOptionsMenuHasFrequents = hasFrequents();
-        clearFrequents.setVisible(mOptionsMenuHasFrequents);
-    }*/
-
-    private boolean hasFrequents() {
+    public boolean hasFrequents() {
+        if (mContactTileAdapter == null) return false;
         return mContactTileAdapter.getNumFrequents() > 0;
     }