Move support for settings menu to UnifiedEmail

Move the base settings menu to UnifiedEmail

Bug: 9393150
Change-Id: Ifa69125d84802a0d7dd2275e4704ec7a4d1fb2f1
diff --git a/res/menu-sw600dp/account_settings_add_account_option.xml b/res/menu-sw600dp/account_settings_add_account_option.xml
deleted file mode 100644
index dc274d8..0000000
--- a/res/menu-sw600dp/account_settings_add_account_option.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 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.
--->
-
-<!-- A menu for Account Settings to provide the "Add Account" option -->
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:id="@+id/add_new_account"
-        android:title="@string/add_account_action"
-        android:showAsAction="ifRoom|withText"
-    />
-</menu>
-
diff --git a/res/menu/account_settings_add_account_option.xml b/res/menu/account_settings_add_account_option.xml
deleted file mode 100644
index e93a17b..0000000
--- a/res/menu/account_settings_add_account_option.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 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.
--->
-
-<!-- A menu for Account Settings to provide the "Add Account" option -->
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:id="@+id/add_new_account"
-        android:title="@string/add_account_action"
-        android:showAsAction="always"
-    />
-</menu>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ddd1173..6045759 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -90,8 +90,6 @@
     <!-- Menu item -->
     <string name="refresh_action">Refresh</string>
     <!-- Menu item -->
-    <string name="add_account_action">Add account</string>
-    <!-- Menu item -->
     <string name="compose_action">Compose</string>
     <!-- Menu item/button name -->
     <string name="search_action">Search</string>
diff --git a/src/com/android/email/activity/setup/AccountSettings.java b/src/com/android/email/activity/setup/AccountSettings.java
index 487f91b..f54d277 100644
--- a/src/com/android/email/activity/setup/AccountSettings.java
+++ b/src/com/android/email/activity/setup/AccountSettings.java
@@ -271,7 +271,7 @@
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         super.onCreateOptionsMenu(menu);
-        getMenuInflater().inflate(R.menu.account_settings_add_account_option, menu);
+        getMenuInflater().inflate(R.menu.settings_menu, menu);
         return true;
     }
 
diff --git a/src/com/android/email/activity/setup/AccountSettingsFragment.java b/src/com/android/email/activity/setup/AccountSettingsFragment.java
index de0405e..99e717f 100644
--- a/src/com/android/email/activity/setup/AccountSettingsFragment.java
+++ b/src/com/android/email/activity/setup/AccountSettingsFragment.java
@@ -39,6 +39,8 @@
 import android.provider.ContactsContract;
 import android.provider.Settings;
 import android.text.TextUtils;
+import android.view.Menu;
+import android.view.MenuInflater;
 
 import com.android.email.R;
 import com.android.email.SecurityPolicy;
@@ -410,6 +412,12 @@
         super.onSaveInstanceState(outState);
     }
 
+    @Override
+    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+        menu.clear();
+        inflater.inflate(R.menu.settings_fragment_menu, menu);
+    }
+
     /**
      * Activity provides callbacks here
      */