Revert "Revert "Implement Help&Feedback. P1/2""

This reverts commit fb49bad9a90dcec8a71dfaebb2810a9af82992ef.

Change-Id: I42af6fccc81895f17dfab2f24ab3fb87d1be59b8
diff --git a/res/menu/quickcontact.xml b/res/menu/quickcontact.xml
index d1658fc..6cfe053 100644
--- a/res/menu/quickcontact.xml
+++ b/res/menu/quickcontact.xml
@@ -37,4 +37,8 @@
     <item
         android:id="@+id/menu_create_contact_shortcut"
         android:title="@string/menu_create_contact_shortcut" />
+
+    <item
+        android:id="@+id/menu_help"
+        android:title="@string/menu_help" />
 </menu>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ab28c0f..1324317 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -477,8 +477,8 @@
     <!-- Menu item for the settings activity [CHAR LIMIT=64] -->
     <string name="menu_settings" msgid="377929915873428211">Settings</string>
 
-    <!-- Menu item for invoking contextual help [CHAR LIMIT=64] -->
-    <string name="menu_help">Help</string>
+    <!-- Menu item for invoking contextual Help & Feedback [CHAR LIMIT=64] -->
+    <string name="menu_help">Help &amp; feedback</string>
 
     <!-- The preference section title for contact display options [CHAR LIMIT=128] -->
     <string name="preference_displayOptions">Display options</string>
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index b4fc096..09ef09f 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -80,7 +80,7 @@
 import com.android.contacts.util.AccountPromptUtils;
 import com.android.contacts.common.util.Constants;
 import com.android.contacts.util.DialogManager;
-import com.android.contacts.util.HelpUtils;
+import com.android.contactsbind.HelpUtils;
 
 import java.util.Locale;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -1028,7 +1028,7 @@
                     clearFrequentsMenu.setVisible(false);
                     break;
             }
-            HelpUtils.prepareHelpMenuItem(this, helpMenu, R.string.help_url_people_main);
+            helpMenu.setVisible(HelpUtils.isHelpAndFeedbackAvailable());
         }
         final boolean showMiscOptions = !isSearchMode;
         makeMenuItemVisible(menu, R.id.menu_search, showMiscOptions);
@@ -1107,6 +1107,9 @@
                 ClearFrequentsDialog.show(getFragmentManager());
                 return true;
             }
+            case R.id.menu_help:
+                HelpUtils.launchHelpAndFeedbackForMainScreen(this);
+                return true;
             case R.id.menu_accounts: {
                 final Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS);
                 intent.putExtra(Settings.EXTRA_AUTHORITIES, new String[] {
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 37161d1..d716339 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -144,6 +144,8 @@
 import com.android.contacts.widget.MultiShrinkScroller;
 import com.android.contacts.widget.MultiShrinkScroller.MultiShrinkScrollerListener;
 import com.android.contacts.widget.QuickContactImageView;
+import com.android.contactsbind.HelpUtils;
+
 import com.google.common.collect.Lists;
 
 import java.lang.SecurityException;
@@ -2289,6 +2291,9 @@
             final MenuItem shortcutMenuItem = menu.findItem(R.id.menu_create_contact_shortcut);
             shortcutMenuItem.setVisible(isShortcutCreatable());
 
+            final MenuItem helpMenu = menu.findItem(R.id.menu_help);
+            helpMenu.setVisible(HelpUtils.isHelpAndFeedbackAvailable());
+
             return true;
         }
         return false;
@@ -2371,6 +2376,9 @@
             case R.id.menu_create_contact_shortcut:
                 createLauncherShortcutWithContact();
                 return true;
+            case R.id.menu_help:
+                HelpUtils.launchHelpAndFeedbackForContactScreen(this);
+                return true;
             default:
                 return super.onOptionsItemSelected(item);
         }
diff --git a/src/com/android/contactsbind/HelpUtils.java b/src/com/android/contactsbind/HelpUtils.java
new file mode 100644
index 0000000..edec35a
--- /dev/null
+++ b/src/com/android/contactsbind/HelpUtils.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.contactsbind;
+
+import android.app.Activity;
+
+/**
+ * Utility for starting help and feedback activity. This stub class is designed to be overwritten
+ * by an overlay.
+ */
+public class HelpUtils {
+
+    /**
+     * Returns {@code TRUE} if {@link @launchHelpAndFeedbackForMainScreen} and
+     * {@link @launchHelpAndFeedbackForContactScreen} are implemented to start help and feedback
+     * activities.
+     */
+    public static boolean isHelpAndFeedbackAvailable() {
+        return false;
+    }
+
+    public static void launchHelpAndFeedbackForMainScreen(Activity activity) { }
+
+    public static void launchHelpAndFeedbackForContactScreen(Activity activity) { }
+
+}