Mms: Add Quick Message Support (1/2) - http://review.cyanogenmod.com/#/c/22188/

This adds the ability to display a pop-up Quick Message when a SMS
message is received.  The user can swipe between multiple messages
and reply to messages individually.

Depends on: http://review.cyanogenmod.com/#/c/22350/

Features:
  - Display pop-up Quick Message dialog when message received
  - Multi-message support with swipe between messages
  - Reply to individual messages
  - Mark individual messages as 'Read' or dismiss them all
  - 'Wake and unlock' device on message received

Known issues:
  - Notification light gets dismissed as message pops up when
    screen is locked and does not restart when screen times out
    without user interaction (i.e. message was not seen)

Notes:
  - This only supports SMS, I have no plan for adding MMS support

Screenshot:
  https://dl.dropbox.com/u/50993944/Screenshot_2012-08-26-13-45-10.png

Thank you to:
  - Blunden for the drawables
  - Devatwork for code review and help
  - Burnsra for testing

Patchset 2  - Fix whitespace errors and some cleanup
Patchset 3  - Fix orientation change editText reset
            - Initialize mCurrentQm to prevent NPE
Patchset 4  - Fix HDPI 9patch drawable
Patchset 5  - Rebase
Patchset 6  - Better EditText object handling
            - Better dismiss keyboard handling
            - Fix NPE and a few other minor bugs
Patchset 7  - More formatting changes
Patchset 8  - Fix EditText 'theme'
Patchset 9  - Update commit message to match framework message
Patchset 10 - Better 'Wake and unlock' handling
Patchset 11 - Fix layout for HDPI and MDPI devices
            - Fix small derps introduced by patchset 10
            - Remove WIP
Patchset 12 - Add a separate layout for XHDPI to make the dialog
              a bit bigger on high dpi screens (e.g. S3 and GN)

Change-Id: I0af06017a38b264d8ceda69b6fdfbd1f759bf2b5

Conflicts:

	res/values/strings.xml
	res/xml/preferences.xml
	src/com/android/mms/ui/MessagingPreferenceActivity.java
MMS: Remove Quick Message public API change (2/2)

Use local drawables rather than requiring a pubic api change

Change-Id: I8d2f6994563f3bbbd3871afdc815dd2a9603867b
Mms: Add 'Quick reply' notification action

This commit leverages the QuickMessage functionality to add a
'Quick reply' action to a SMS notification.

It will only display if:
 - The QuickMessage pop-up is disabled (no need showing the pop-up twice)
 - It is a SMS
 - It is a single message or a thread from a single user

Change-Id: I09f308fdc210c7acd599419106d02e3c14e700a1
Screenshot:
 https://dl.dropbox.com/u/50993944/Screenshot_2012-09-02-11-11-03.png

Thanks again to Blunden for the drawables

Conflicts:

	res/values/strings.xml

Conflicts:

	res/values/strings.xml
Fix drawable name on mdpi

Change-Id: Ia8ff9236ef3ace19b5f433dfd98a4842dc378b12
Rearrange MMS notification actions

Simply put "quick reply" on the left side since that would most likely
be the option used more often. I feel like it should be ordered in terms
of usability and common sense.

Change-Id: I320b948a2025c3bd4f8aa23f6ba15f0a06212118
Mms: Add Template support to QuickMessage pop-up

This commit adds native Messaging app templates support to the
QuickMessage pop-up.

Clicking on the icon to the left of the reply editor will display
a dialog with the  available templates allowing the user to select
one.  It will then append the selected text to the reply message.

Screenshot:
  https://dl.dropbox.com/u/50993944/Screenshot_2012-09-04-22-35-53.png

Patchset 2  - Remove holo.dark template drawables
Patchset 3  - Some cleanup and new drawables by Blunden
Patchset 4  - Fix layout derp

Change-Id: I669bf65e60c66d875276a711f76b602f4c3dd395
QuickMessage: Fix display of main app UI and remove from recents menu

This commit prevents the QuickMessage popup activity from launching the
main Mms app UI on incoming message and from showing up in the recents apps
list.

Change-Id: Ib5c72a180d7e3b1e7c884cebc34ea1be5492bed8
QuickMessage: Only display template button if templates defined (3 options)

This commit makes the display of the templates button conditional on
whether there are defined templates.

I implemented two options - not sure which is best.  Please comment

Patchset 1-2- Initial implementation: templates button hides if no templates
              always visible if there are templates defined
Patchset 3-4- Alternative implementation of the above: if templates exist
              button is visible until user starts typing text or insert a
              template

3rd option (not in a patchset) is a variation on Patchset 2 except that the
button becomes visible even if no templates exist, thus exposing the
functionality to the user.

Change-Id: Ife209c3f95de652e9dbc1216fda3afc688e30071
Use fallback MMS attachment name if can’t create file with received name

Received MMS location may be encoded using RFC 2047 (e.g. for messages
sent from old Nokia phones) or may contain characters illegal in file names.
RFC 2047 decoding is currently not implemented so fallback name
should be used in such case. I also changed fallback name to be
a human readable localized text instead of hex message id.

Change-Id: Id19fa127c0cfc68679232225bfb17b3c6514524b
Allow full themeing of mms via theme chooser

This redirects layouts to @color and replaces the hex that the theme chooser
cannot handle. It allows theme chooser themes the ability to theme the entire
app instead of just parts.

This is by @B_boytm I am just submitting it for him.

Change-Id: Id28ba9b783768a004a0dbc8c117c81ffc8446ae3
Signed-off-by: Kyle Teague <kwesley1020@gmail.com>

Conflicts:

	res/values/colors.xml
Mms: Send Messaging with attachment,repeat 10-20 times crash

ConcurrentModificationException occurs when you add the elements
while traversing a list with Iterator.
The issue is resolved by using CopyOnWriteArrayList instead of
ArrayList.

Change-Id: Ic717ed047475eae9a810d5767ed0a3fbf41ae86f
Author: Wenjie Qin <wenjie.qin@borqs.com>
Signed-off-by: Frederic Predon <frederic.predon@intel.com>
Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 7844
Initialize Timestamp to "" instead of NULL

The expired time shows NULL before PduLoadedMessageItemCallback
was executed.

It sometimes canbe reproduced in the expired time of Notification
IND.

Change-Id: Idac021d23e0807f61a5bcead8af1b369398dff26
Signed-off-by: Roger Chen <cxr514033970@gmail.com>
Mms: Searching result is not displayed when searching " "

When querying a double quote , there will be a SqliteException, so
the cursor wil be null.
When cursor is null, we have to set the title.

Change-Id: I6fc91ad5562ca770412968b19cbc45aa1a667bd4
Author: b533 <b533@borqs.com>
Signed-off-by: Kun Jiang <kunx.jiang@intel.com>
Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 25854
Mms: Correction to display the dial number of SMS

This patch fixes the display of the dial number of SMS, if the SMS
text contains the dial number.

Change-Id: Ia9f690106dc6ca084f2d04e33b2fdb4e1a004f36
Author: Emmanuel Delaude <emmanuelx.delaude@intel.com>
Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 26712
Mms: "Add slide" item is not displayed during Edit slideshow

With this patch the "Add Slide" item is added as the last item
when some items are removed during edit slide show.

Change-Id: I57fa159183b87628ff2908a4ad299b97031f2d41
Author: Arun Ravindran <arun.ravindran@intel.com>
Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 7875
We sometimes need a new thread id to update drafts

We are saving the draft in a conversation which had been
deleted all messages one by one(Now the thread id is orphaned).
The draft will be saved in a obseleted thread, so we lose them
and cann't find them in ConversationList. We need to get a new
thread id in this case.

Refer to ef3eb49cde359d36f9536dbaffe5c16f3639c1f2, it fixed this
issue while we are saving the Mms draft, but Sms.

Change-Id: I29b3c1abf373877924b1afb45027417a12a1ec68
Signed-off-by: Roger Chen <cxr514033970@gmail.com>
Mms: Fix the logging of the TransactionBundle

The byte array returned by the getPushData() function should be
properly converted before beeing logged.

Change-Id: If24a20bc636282bdab5631935f1bcc6eafc20d90
Author: Frederic Predon <frederic.predon@intel.com>
Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 28037
Mms: JAVACRASH in com.android.mms at android.os.AsyncTask$3.done

TestCase:
    1>"%1$" displays when Restore to default in SMS settings
    2> Fore close when there is no app that start activity
    3> manage sim messages
    4> Force close happened when open a MMS with vcard
    5>  Audio is inserted to MMS, and then user play it. If long pressing
    progress bar of the audio playback until play finished, messaging will crash

Change-Id: I04eec747029fe4d6d73e290dfa682c949a5930a8
Author: b497 <b497@borqs.com>
Signed-off-by: Fang, JiuX <jiux.fang@intel.com>
Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 25327
Mms: Two popups are displayed when Press Enter key on message screen.

When the framework transfers the KEY EVENT to MMS, both KEY UP and
KEY DOWN event trigger the onEditorAction.
We need to confirm the send message only when we have the KEY DONW
event.

Change-Id: Ia0fcbb9a915f7e6b9f6b0101293eeaae80b3bccd
Author: Kun Jiang <kunx.jiang@intel.com>
Signed-off-by: Xiaokang Qin <xiaokang.qin@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 20356
Support necessary options on non-trackball devices

Support move up/down, remove slide and add slide options
in context menu of SlideshowEditActivity.

We cannot move the position in ListView on the device
which hasn't the trackball, so we add the necessary
options in the context menu.

Change-Id: I5b9228b09d51a7ac571cf3fb9185644e211ad729
Signed-off-by: Roger Chen <cxr514033970@gmail.com>