diff options
author | Greg Bullock <gregbullock@google.com> | 2014-08-13 16:02:59 +0200 |
---|---|---|
committer | Greg Bullock <gregbullock@google.com> | 2014-08-15 14:25:17 +0200 |
commit | d47a7043d685c69d30317245ac295f4cde5240d8 (patch) | |
tree | f58342d28a2ea4fc452b4b048aaac8b8579ffcd8 /src | |
parent | 39631c4a0ccee6aa401da00e4c3f75ef4df87b53 (diff) | |
download | android_packages_apps_UnifiedEmail-d47a7043d685c69d30317245ac295f4cde5240d8.tar.gz android_packages_apps_UnifiedEmail-d47a7043d685c69d30317245ac295f4cde5240d8.tar.bz2 android_packages_apps_UnifiedEmail-d47a7043d685c69d30317245ac295f4cde5240d8.zip |
Prevent "attach from Drive" menu showing for non-gmail
accounts.
Change-Id: I4f289e60082d372a1662372768890772fe0d7633
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/mail/compose/ComposeActivity.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java index 5779a79d3..af53fb959 100644 --- a/src/com/android/mail/compose/ComposeActivity.java +++ b/src/com/android/mail/compose/ComposeActivity.java @@ -2300,8 +2300,9 @@ public class ComposeActivity extends ActionBarActivity || Intent.ACTION_SENDTO.equals(action) || shouldSave())); - MenuItem helpItem = menu.findItem(R.id.help_info_menu_item); - MenuItem sendFeedbackItem = menu.findItem(R.id.feedback_menu_item); + final MenuItem helpItem = menu.findItem(R.id.help_info_menu_item); + final MenuItem sendFeedbackItem = menu.findItem(R.id.feedback_menu_item); + final MenuItem attachFromServiceItem = menu.findItem(R.id.attach_from_service_stub1); if (helpItem != null) { helpItem.setVisible(mAccount != null && mAccount.supportsCapability(AccountCapabilities.HELP_CONTENT)); @@ -2310,6 +2311,9 @@ public class ComposeActivity extends ActionBarActivity sendFeedbackItem.setVisible(mAccount != null && mAccount.supportsCapability(AccountCapabilities.SEND_FEEDBACK)); } + if (attachFromServiceItem != null) { + attachFromServiceItem.setVisible(shouldEnableAttachFromServiceMenu(mAccount)); + } // Show attach picture on pre-K devices. menu.findItem(R.id.add_photo_attachment).setVisible(!Utils.isRunningKitkatOrLater()); @@ -2800,6 +2804,13 @@ public class ComposeActivity extends ActionBarActivity } /** + * Returns whether the "Attach from Drive" menu item should be visible. + */ + protected boolean shouldEnableAttachFromServiceMenu(Account mAccount) { + return false; + } + + /** * Check if all fields are blank. * @return boolean */ @@ -3568,6 +3579,8 @@ public class ComposeActivity extends ActionBarActivity } mReplyFromChanged = true; initRecipients(); + + invalidateOptionsMenu(); } } |