1761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang/******************************************************************************* 2761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * Copyright (C) 2013 Google Inc. 3761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * Licensed to The Android Open Source Project. 4761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * 5761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * Licensed under the Apache License, Version 2.0 (the "License"); 6761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * you may not use this file except in compliance with the License. 7761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * You may obtain a copy of the License at 8761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * 9761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * http://www.apache.org/licenses/LICENSE-2.0 10761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * 11761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * Unless required by applicable law or agreed to in writing, software 12761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * distributed under the License is distributed on an "AS IS" BASIS, 13761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * See the License for the specific language governing permissions and 15761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang * limitations under the License. 16761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang *******************************************************************************/ 17761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang 18761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huangpackage com.android.mail.analytics; 19761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang 20761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huangimport com.android.mail.R; 21761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang 22761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huangpublic class AnalyticsUtils { 232b55549d4fbe25e91f673a0727fc89ff755d9327Andy Huang // individual apps should chain this method call with their own lookup tables if they have 242b55549d4fbe25e91f673a0727fc89ff755d9327Andy Huang // app-specific menu items 25761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang public static String getMenuItemString(int id) { 26761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang final String s; 27761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang if (id == R.id.archive) { 28761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "archive"; 29761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.remove_folder) { 30761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "remove_folder"; 31761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.delete) { 32761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "delete"; 33761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.discard_drafts) { 34761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "discard_drafts"; 35512821c11d89d49908f3cfdee0b582601f500f3dJin Cao } else if (id == R.id.discard_outbox) { 36512821c11d89d49908f3cfdee0b582601f500f3dJin Cao s = "discard_outbox"; 37761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.mark_important) { 38761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "mark important"; 39761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.mark_not_important) { 40761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "mark not important"; 41761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.mute) { 42761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "mute"; 43e003b4cc4a23e6d394998bebe26430a361c5ac29Andy Huang } else if (id == R.id.report_phishing) { 44e003b4cc4a23e6d394998bebe26430a361c5ac29Andy Huang s = "report_phishing"; 45761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.report_spam) { 46761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "report_spam"; 47761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.mark_not_spam) { 48761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "mark_not_spam"; 49761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.compose) { 50761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "compose"; 51761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.refresh) { 52761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "refresh"; 53a6b45218b8d90d7fc3a5ca0901293c71df404553Jin Cao } else if (id == R.id.toggle_drawer) { 54a6b45218b8d90d7fc3a5ca0901293c71df404553Jin Cao s = "toggle_drawer"; 55761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.settings) { 56761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "settings"; 57761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.help_info_menu_item) { 58761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "help"; 59761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.feedback_menu_item) { 60761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "feedback"; 61761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.move_to) { 62761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "move_to"; 63761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.change_folders) { 64761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "change_folders"; 65761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.move_to_inbox) { 66761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "move_to_inbox"; 67761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.empty_trash) { 68761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "empty_trash"; 69761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.empty_spam) { 70761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "empty_spam"; 71761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == android.R.id.home) { 72761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "home"; 73761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.inside_conversation_unread) { 74761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "inside_conversation_unread"; 7523e2b8a59defe139c529fbd486afcb3b32272047Andy Huang } else if (id == R.id.read) { 7623e2b8a59defe139c529fbd486afcb3b32272047Andy Huang s = "mark_read"; 7723e2b8a59defe139c529fbd486afcb3b32272047Andy Huang } else if (id == R.id.unread) { 7823e2b8a59defe139c529fbd486afcb3b32272047Andy Huang s = "mark_unread"; 79a6b45218b8d90d7fc3a5ca0901293c71df404553Jin Cao } else if (id == R.id.toggle_read_unread) { 80a6b45218b8d90d7fc3a5ca0901293c71df404553Jin Cao s = "toggle_read_unread"; 81761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else if (id == R.id.show_original) { 82761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang s = "show_original"; 83e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.add_file_attachment) { 84e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "add_file_attachment"; 85dc97bf4509c450c9121b79ec4668e0f9b34f0690Andy Huang } else if (id == R.id.add_photo_attachment) { 86dc97bf4509c450c9121b79ec4668e0f9b34f0690Andy Huang s = "add_photo_attachment"; 87dc97bf4509c450c9121b79ec4668e0f9b34f0690Andy Huang } else if (id == R.id.add_cc_bcc) { 88dc97bf4509c450c9121b79ec4668e0f9b34f0690Andy Huang s = "add_cc_bcc"; 89dc97bf4509c450c9121b79ec4668e0f9b34f0690Andy Huang } else if (id == R.id.save) { 90dc97bf4509c450c9121b79ec4668e0f9b34f0690Andy Huang s = "save_draft"; 91dc97bf4509c450c9121b79ec4668e0f9b34f0690Andy Huang } else if (id == R.id.send) { 92dc97bf4509c450c9121b79ec4668e0f9b34f0690Andy Huang s = "send_message"; 93dc97bf4509c450c9121b79ec4668e0f9b34f0690Andy Huang } else if (id == R.id.discard) { 94dc97bf4509c450c9121b79ec4668e0f9b34f0690Andy Huang s = "compose_discard_draft"; 95d03347378e0eb563bcd350c238823f12fdb23684Jin Cao } else if (id == R.id.search) { 96d03347378e0eb563bcd350c238823f12fdb23684Jin Cao s = "search"; 97e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.print_all) { 98e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "print_all"; 99e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.print_message) { 100e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "print_message"; 101e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.star) { 102e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "star"; 103e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.remove_star) { 104e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "unstar"; 105e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.reply) { 106e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "reply"; 107e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.reply_all) { 108e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "reply_all"; 109e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.forward) { 110e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "forward"; 111e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.edit_draft) { 112e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "edit_draft"; 113de40dd3a292531c7dd8a5741eb0980f666a88b84Andrew Sapperstein } else if (id == R.id.send_date) { 114e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "expand_message_details"; 115de40dd3a292531c7dd8a5741eb0980f666a88b84Andrew Sapperstein } else if (id == R.id.details_expanded_content || id == R.id.hide_details) { 116e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "collapse_message_details"; 117e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.upper_header) { 118e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "message_upper_header"; 119e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.download_again || id == R.id.menu_download_again) { 120e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "download_again"; 121e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.menu_save) { 122e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "photo_save"; 123e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.menu_save_all) { 124e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "photo_save_all"; 125e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.menu_share) { 126e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "photo_share"; 127e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang } else if (id == R.id.menu_share_all) { 128e6c9fb6835247d98898e2af581ad9449ad7f3184Andy Huang s = "photo_share_all"; 1297a9759b167dfe48500da9d636834d32c1a311df1Andy Huang } else if (id == R.id.show_pictures_text) { 1307a9759b167dfe48500da9d636834d32c1a311df1Andy Huang s = "show_pictures"; 131761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } else { 1322b55549d4fbe25e91f673a0727fc89ff755d9327Andy Huang s = null; 133761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } 134761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang return s; 135761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang } 136761522c1ac7a8fa05acde714f0e26fde47f3415fAndy Huang} 137