Fix 2 bugs in Mms AppWidget - from AOSP

    1. Update all appwidgets instead of the first one.
    2. Notify the appwidgets to update after deleted messages.

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

    Conflicts:

    	src/com/android/mms/ui/ComposeMessageActivity.java
    	src/com/android/mms/ui/ConversationList.java
Mms: Cursor doesn't appear when pressing up/down/right/left key

When pressing up/down/right/left key on the keypad, the cursor
doesn't appear in the messagebox.
This is because the layout container is not focusable.

Change-Id: I82bfb417ce3b12ec55b5d8058e866282ab2dc66a
Author: b533 <b533@borqs.com>
Signed-off-by: edingX <erjunx.ding@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: 23638
Only delete the cache files if cache is null

No need to call getImageCacheService() to get the instance to delete
image cache files if the cache instance is null.
It will renew an instance for cache and lead to the memory leak
if renew too many instances by calling getImageCacheService()
multi-times.

Change-Id: I3ff83f49e9e8a8bc211dc26c773f3ccefc974881
Signed-off-by: Roger Chen <cxr514033970@gmail.com>
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>
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: 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: 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>
Let the text in Mms can be selected

Change-Id: I7420dfe552c848966cf7dce1ea54f5fc67645cff
Signed-off-by: Roger Chen <cxr514033970@gmail.com>
Recreate the options menu after drew the top panel

The onPrepareOptionsMenu will be called back before the
draft loaded, since the loading proccess has moved to
the non-UI-thread. We always need to notify CMA to
recreate the options menu after drew the top panel.

Change-Id: I91a56b9012a2934d474ceee3e499c559aa8e934b
Signed-off-by: Roger Chen <cxr514033970@gmail.com>
MMS app: fix crash when MMSC setting is NULL

An APN with a null MMSC column prevented the MMS app
to find the next APN in query.

Change-Id: I50abc7f0b80c1172e4bf7b1779c0efb8b79899bc
Mms: Consider only Inbox messages for reply path - CAF

    SMSC info is not filled in MO SMS even if MT SMS is having
    reply path (in GSM/WCDMA case). With current design Android telephony
    is considering latest SMS message in thread to know the reply path.

    Ex: If one MT message is available in Inbox and if User wants to
    send MO SMS as reply app stores MO SMS in queue and send the queued
    messages to lower layers. Now SMS app is having two messages - one is
    MT and one is MO (queued message). In this case before sending SMS the app
    is considering the latest queued message instead of MT message to get SMSC.

    Consider only Inbox messages to get SMSC.

    Change-Id: Ie29477fed8748abe6966c301ec7090bb8e331fd0
    CRs-Fixed: 371307
Mms: Take Ellipsis also in to consideration when comparing width

For initial comparison of Message width and available text field width
Ellipsis is not taken in to consideration so Mms app is crashing
if message width is between 435 to 450.

Modify to take Ellipsis also in to consideration when ever
comparing the message width.

Change-Id: I9238a5d10c1e9af55c0f6d960f68c6b4ac08405c
CRs-Fixed: 341158