summaryrefslogtreecommitdiff
path: root/src/com/android/mail/compose/ComposeActivity.java
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-7.1.1_r21' into cm-14.1Dan Pasanen2017-02-231-11/+7
|\ | | | | | | | | | | | | | | Android 7.1.1 release 21 # gpg: Signature made Wed 01 Feb 2017 04:40:30 PM CST # gpg: using DSA key E8AD3F819AB10E78 # gpg: Can't check signature: No public key
| * Don't allow file attachment from /data through GET_CONTENT.Ekin Oguz2016-12-191-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A custom picker can be used to attach files to Compose activity. With this change, we are disallowing files belonging to file:///data/... to be attached from custom pickers, in order not to expose internal application data. If the Intent Uri is a "file" and the file is in `Environment.getDataDirectory()`, then throw a AttachmentFailureException which is caught immediately and shows a toast to the user. Details b/31494146#comment13 Fix b/32615212 Change-Id: I037888b01fef1cdf5053602cdf9194286d5648df (cherry picked from commit eace8b43e8d1512a205554715ca840324bfbe35f)
* | UnifiledEmail: Email force close issue when Discarding an emailweitan2016-09-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | Email may force close with mDraft.uri is null while discarding the current message; need catch the NullPointerException in Application first, or else it may throw exception in framework checkNotNull method. CRs-Fixed: 1062768 Change-Id: I535286956c949c2fe9cd663c61383c8c6229b324
* | UnifiedEmail: Email attachment repetition increasesshiwan2016-08-241-9/+41
|/ | | | | | | fix Attachment repetition increases Change-Id: Ifa527850aaaa41e551f5125cc29dd516440a5ee4 CRs-Fixed: 1005832
* Don't allow cachedFile Attachments if the content Uri is pointing to ↵Sam Lee2016-03-231-1/+19
| | | | | | | | | | EmailProvider. This is to backport a security fix reported by b/27308057 and b/27335139. Also, add Analytics for these errors. Bug: b/27335139 Change-Id: I75f6d8f5feb9fc611aa2e429e2b22cbd07223ab9
* Don't allow file attachment from file:///data.Régis Décamps2016-02-231-30/+10
| | | | | | | | | | | | | | | | | | | Commit 24ed2941ab132e4156bd38f0ab734c81dae8fc2e allows file:// attachment on the /data directory if they are from the same process. This was done to work around applications that shared their internal data file. However, this is bad practice, and other apps should share content:// Uri instead. With this change, Email doesn't allow this anymore. This fixes security issue 199888. Also, add Analytics for these errors compose_errors > send_intent_attachment > data_dir https://code.google.com/p/android/issues/detail?id=199888 b/26989185 Change-Id: I7cae3389f4f7cf5f86600a58c6ccdffaf889d1c3
* Fix html conversion failure check to use trimJin Cao2014-10-141-1/+2
| | | | | | b/16489004 Change-Id: I6b4b998cae27fa8f0c20a3eff028b64977c15780
* Set title for ComposeActivity. Helps with a11y.Andrew Sapperstein2014-10-091-1/+3
| | | | | | | Fixes b/17934766. Now compose is read out when you enter compose instead of the app name. Change-Id: I3c41081b8c170a84f9ebf1b66b85673dd654a3c6
* Merge "Add autopan so FAB/other stuff won't get pushed up" into ↵Jin Cao2014-10-081-3/+4
|\ | | | | | | ub-gmail-ur14-dev
| * Add autopan so FAB/other stuff won't get pushed upJin Cao2014-10-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | Instead of using autoResize to resize when soft keyboard shows up, use a custom list view that takes visible display frame into account during onMeasure so that the listview itself will simply measure based on the available space. b/17916077 Change-Id: If2b771e59f67689a7431284a0ec05af6a04fd055
* | Change status bar color for searchJin Cao2014-10-071-16/+3
|/ | | | | | b/17546831 Change-Id: Ib72000b6a2bcaa325dc2b82a819a7c823454a0d8
* Log when html conversion failsJin Cao2014-10-021-2/+5
| | | | | | b/16489004 Change-Id: Iafebebd6dfab8a2e76a4405bfd87a3c7b0dc65f8
* Speculative fix for losing message bodyJin Cao2014-10-021-16/+22
| | | | | | | | | | | | | | | | | | | We make an assumption in ComposeActivity that a message's bodyHtml and bodyText are pretty much equivalent (bodyText is set from the raw content, and bodyHtml is set with spannedToHtml(content)). However, it's possible that for whatever the reason Html.toHtml might not return the correct result or errors out and returns an empty string. For example, looking at the implementation of Html.toHtml, it looks like if the html doesn't contain any <p> tags, then it will return an empty string. Use the actual bodyText as a fallback instead of setting the body based on the bodyHtml value. b/16489004 Change-Id: I4a05cd67b6c6e7c02404412da9fa27a14a486615
* Do not assume mAccount is the default emailJin Cao2014-09-291-12/+7
| | | | | | b/17530495 Change-Id: I74400454478049e17c002a35df798541df497c52
* Capture ctrl+enter for send shortcutJin Cao2014-09-241-0/+18
| | | | | | b/17596008 Change-Id: I077af88e432cd8f285f2207562759404adf1b506
* Expand drawer to be under status bar. b/17569398Andrew Sapperstein2014-09-181-1/+1
| | | | Change-Id: I345095c4679f83a315bb3d5909b9d2d7fbece111
* Merge "Properly implement requestIdToMessageId map" into ub-gmail-ur14-devJin Cao2014-09-171-45/+53
|\
| * Properly implement requestIdToMessageId mapJin Cao2014-09-151-45/+53
| | | | | | | | | | | | | | | | | | | | | | | | Use requestId to messageId map to keep track of requests that complete after the activity is destroyed. This way, we don't lose track of the newly created message id for the current draft which may cause two versions of the draft being saved. b/17425799 Change-Id: Ib03303c9b76cdee655c1217ce1fc65b2e414f8c1
* | Merge "Don't confirm if discarding empty message" into ub-gmail-ur14-devJin Cao2014-09-161-7/+13
|\ \
| * | Don't confirm if discarding empty messageJin Cao2014-09-161-7/+13
| |/ | | | | | | | | | | | | | | | | | | When the user chooses to discard a message in compose, don't ask for confirmation if the message has no content (subject, body, attachment). b/17496056 Change-Id: I597039dacf2afcb71d6dfd614c10e23025f901de
* / Set status bar color in CAB mode. b/17471621.Andrew Sapperstein2014-09-151-0/+28
|/ | | | Change-Id: If23bdce538aa647952d193a9976d6a27bcfd5829
* Forward uri permission for composeJin Cao2014-09-091-50/+90
| | | | | | | | | | | | | JB+, use setClipData to forward the permission to the Service so that we have the permission for the attachments for as long as the service is up. For pre-JB, call initializeAttachmentFds on the main thread to ensure that we get those attachments before the activity ends. b/17409336 Change-Id: Ic03c7fbfc39a6c54e96bff69a2c4914ac88361a8
* Refactor out SendOrSaveTaskJin Cao2014-09-091-200/+163
| | | | | | | | | | | | | | | | sendOrSaveInternal is already run on a handler, so there is now no need to have SendOrSaveTask. Change SendOrSaveCallback accordingly since some of the args are no longer needed. This is a speculative fix for b/17425799 since we were double posting tasks to the same handler. As a result, there can be a race condition where the first SAVE posts to handler, doesn't complete in time before the second SEND posts to handler. Thus, the SAVE's SendOrSaveTask is run after the SEND runnable. b/17425799 Change-Id: I3a2379cb254854598c0d01aef1993e3d21d13788
* Merge "Allow calling package to attach files from its data dir" into ↵Jin Cao2014-09-051-4/+31
|\ | | | | | | ub-gmail-ur14-dev
| * Allow calling package to attach files from its data dirJin Cao2014-09-021-4/+31
| | | | | | | | | | | | | | | | | | | | For incoming intents with attachment uris, allow for files in the data directory if the directory is part of the calling package's data directory. b/17345059 Change-Id: I0841ce8375380f1ae4f929c811e5e4abecff9763
* | Merge "[Quantum compose] move top padding into scrollview" into ↵Jin Cao2014-09-031-0/+9
|\ \ | | | | | | | | | ub-gmail-ur14-dev
| * | [Quantum compose] move top padding into scrollviewJin Cao2014-09-021-0/+9
| |/ | | | | | | | | | | | | | | | | | | | | | | | | - Move the top padding into the scrollview content so it scrolls with as the view fills up. - Add the click listener for composearea_tap_trap_bottom so whenever it is clicked it focuses the body and places the cursor at end of the body. It looks like this is what it's supposed to do, but I don't know where that code went. b/17363410 Change-Id: Ib7228cf88c853293602baed3eca45f78d5bddb12
* | Merge "Only run htmlToSpan task if the body wasn't restored" into ↵Jin Cao2014-09-031-0/+20
|\ \ | | | | | | | | | ub-gmail-ur14-dev
| * | Only run htmlToSpan task if the body wasn't restoredJin Cao2014-08-281-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the system restored our EditText by default, let's not override it by converting our saved HTML to Spanned because the framework's version will encompass everything we saved and more. Only do this for configuration change since we are ensured that the activity won't be destroyed. Also properly persist mTextChanged across screen rotations. b/16823273 b/17245535 Change-Id: Ib71cc2a240e4e77b08816a7e21a48548ae226b94
* | | More ComposeActivity loggingJin Cao2014-09-021-3/+5
| |/ |/| | | | | | | | | | | | | Change all calls of mBodyView.setText to use setBody, and log whenever setBody is called so we can better debug issues with ComposeActivity (e.g. people losing their draft contents). Change-Id: I5b3329f51029ad8d7d07a3fe008b8980aa278a4b
* | Do not allow attachment from data directoryJin Cao2014-08-291-68/+53
|/ | | | | | | | | When attaching files from intents, do not attach anything that belongs in the data directory. b/7154234 Change-Id: Ia68d626fcc9e734727424933d3f859ecc44bee78
* Add logging to sendsave for composeJin Cao2014-08-241-5/+9
| | | | Change-Id: I3ee2dedc35cf4b00fd355ce205653c516a1ce9c5
* Separate string for Compose action bar titleJin Cao2014-08-201-1/+1
| | | | | | | | | | Add new string and set limit to 10 chars (from my testing 10 is a the safe number depending on what characters are used). b/16873798 Change-Id: I9e98230267d6621abe2201077df8aee8d1f69928
* Prevent "attach from Drive" menu showing for non-gmailGreg Bullock2014-08-151-2/+15
| | | | | | accounts. Change-Id: I4f289e60082d372a1662372768890772fe0d7633
* Extract protected method to determine From field.Greg Bullock2014-08-151-3/+7
| | | | Change-Id: Icf8902d38139ab3725226d1fe05f0122a285fec1 Bug: 16968834
* Use themed context for navigation modesJin Cao2014-08-111-2/+4
| | | | | | b/16649947 Change-Id: I00ac831ec19f039d910ea5fdcdb4db1650514caf
* [Quantum compose] custom anchor for toJin Cao2014-08-081-0/+1
| | | | | | | | | Add custom anchor for To field so the popup will have the full width of the field. b/16851158 Change-Id: I54cbd601d46c8d2fb3ee37956fb560dcb31905f9
* switch to appcompat. b/16664350Andrew Sapperstein2014-08-041-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently only for MailActivity, ComposeActivity, and FolderSelectionActivity. Any activity that inherits from ActionBarActivity must use an Appcompat-derived style. Three styles currently exist: UnifiedEmail.Appcompat, UnifiedEmail.Appcompat.Toolbar, and ShortcutWidgetTheme are all based on appcompat. go/appcompat-material-doc contains the full migration guide. The fast version is: All MenuItem-related work that relates to actions must use the MenuItemCompat-equivalent. Any theming should use the appcompat versions which don't require a namespace prefix. For instance, use actionBarStyle instead of android:actionBarStyle. There are a few missing styles on views that can't use appcompat versions. Those still use style overrides for v21 changes. All others use appcompat versions. A few methods on activity should now use the support equivalents: getSupportActionBar() supportInvalidateOptionsMenu() startSupportActionMode() Change-Id: Ic6f5964f4115ab4bde49c19df5fe49c9086df965
* [Quantum compose] autoscroll to ccJin Cao2014-07-291-2/+22
| | | | | | | | | | On phones when the user taps on subject/body with cc/bcc, we autoscroll so that cc aligns with the top and the subject/ body have enough space to not feel clumped. b/15934812 Change-Id: I5c44b409fd89e9e810bfc07d935579d36626e87d
* [Quantum compose] Hide Cc/Bcc appropriatelyJin Cao2014-07-291-2/+16
| | | | | | | | | When subject/body is focused, hide cc/bcc if they are empty and show the addCcBccButton accordingly. b/15934812 Change-Id: Ia26faf09781eed5d117ee6e489025211179b366a
* Merge "Quantum compose" into ub-mail-masterJin Cao2014-07-261-13/+4
|\
| * Quantum composeJin Cao2014-07-251-13/+4
| | | | | | | | | | | | | | | | | | Temporarily using ic_forward_24dp as placeholder until I get the correct asset for the dropdown buttons. b/15934812 Change-Id: I760a1717a73f7c3ab1ad5a3368fac297e883231c
* | Merge "[Quantum] update compose action menu" into ub-mail-masterJin Cao2014-07-251-20/+0
|\ \ | |/ |/|
| * [Quantum] update compose action menuJin Cao2014-07-241-20/+0
| | | | | | | | | | | | | | | | Remove out-dated compose menu items. b/15934812 Change-Id: I6949c3d973e7bea0a265406aca6fc66ae221a68e
* | Always append signatureJin Cao2014-07-241-3/+1
|/ | | | | | b/16520039 Change-Id: I98f2c849cf5534fd9e84fd96c4ad86adc01cc206
* Potentially outdated code for saving message bodyJin Cao2014-07-231-2/+4
| | | | | | | | | | | | Use message.bodyText instead of basing textBody on htmlBody. Use refMessage format iff the refMessage has either one of bodyHtml or bodyText set to nonempty value. This ensures that we properly save the current message in the case of empty refmessage body. b/16489004 Change-Id: I7a783120c12719238deae071885c44e5b401b947
* Ensure that we always execute HtmlToSpannedTaskJin Cao2014-07-221-3/+3
| | | | | | | | | | | | | Speculative fix. There was one code path that doesn't execute HtmlToSpannedTask which is when the first quotedTextIndex check is > -1 but the second is not. This can definitely cause the body to not populate since the HtmlToSpannedTask is the only way to populate the body. b/16489004 Change-Id: Ieae789b38356d269a8f9dbb7bb7ae2aff29df1c5
* Delegate Account creation to builder class.Ray Chen2014-07-161-1/+1
| | | | | | | Account contructors are no longer public and clients need to use Account.builder().buildFrom(...) instead. Change-Id: I8f072e893b49b64d962fa7a075e5c15364c4c05f
* Fix action bar iconPaul Westbrook2014-07-011-5/+5
| | | | | | | The action bar app icon is now suppressed both on pre-L and in L Change-Id: Ifcf416505622ae72f260049c0b1e4a1e972e5431
* Don't try to format null in reply subjectsTony Mantler2014-06-301-8/+11
| | | | | | | | Tested on Email and Gmail b/11810597 Change-Id: I76887a32add769a609fa90a17daf469a47b0c760