Mms: Fix javacrash in com.android.mms due to memory leak

when the UriImage resize the picture. It will not close the
InputStream and OutputStream.

Change-Id: I80fa1eb3726308fe75d74357e0b9782759de3393
Author: Jianping Li <jianpingx.li@intel.com>
Signed-off-by: Jianping Li <jianpingx.li@intel.com>
Signed-off-by: Hongyu Zhang <hongyu.zhang@intel.com>
Signed-off-by: Frederic Predon <frederic.predon@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 28037
Mms: Process has stopped after dragging progress

testcase 1> create a slideshow mms and play it. Tap progress bar
                continuously until play finished.
         2> create a slideshow mms and play it. Tap progress bar
                continuously when rotate the screen

We have to set the seek bar change listener to null,otherwise if
the activity stop during tap progress bar continuously, window
will leak.

Change-Id: I206d35b91e04de06c2073c3fb0d9176da6adc81c
Author: Frederic Predon <frederic.predon@intel.com>
Signed-off-by: b533 <b533@borqs.com>
Signed-off-by: Frederic Predon <frederic.predon@intel.com>
Signed-off-by: Bin Yang <bin.y.yang@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 28634
Mms: Notify user of Send SMS failure due to FDN

Upon Send SMS failure due to destination number or
service center number not present in the FDN list,
failure is not notified to the MessageNotification.
Due to this Sms remains in Sending state even
after the SMS send has failed.

This patch fixes the issue by notifying the message
failure and also moving the message to respective folder.

Change-Id: I1f8dfe2d9b276c8c6f4d921c2c147a8ef90643e6
Author: Jeevaka Badrappan <jeevaka.badrappan@intel.com>
Signed-off-by: Jeevaka Badrappan <jeevaka.badrappan@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 48558
Mms: The time is not displayed on the progress bar when playing a slide

TestCase: 1> share some pictures from Gallery, preview and then
             check the media controller.
          2> receive a slideshow mms, play it and then check the
             media controller
The time is not displayed on the progress bar

We need to Use Theme_DeviceDefault to set the media controller's
theme.

Change-Id: I680e11902e517ba591a58ad99429f1c05ef31020
Author: b533 <b533@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: 25265
Fix reference to static fields through instance

START_TAG and END_DOCUMENT are static fields and should be
accessed in a static way as per notes in the official documentation
at http://docs.oracle.com/javase/tutorial/java/javaOO/classvars.html

Change-Id: I6a626f9efe33605d08ea136eca7be8fc9a7e402d
Signed-off-by: Manuel R. Ciosici <manuelrciosici@gmail.com>
Fix one NPE in Mms app

For tablet we usually declare not support mobile_* networkAttributes but ethernet,
wifi,bt in config.xml. this will trigger this NPE.

Change-Id: I761c8514f5569bef1242f9fddc321c0aed564d9e
Signed-off-by: Jianzheng Zhou <jianzheng.zhou@freescale.com>
Mms: Device crashes when sending message with attachment.

Need to handle IllegalStateException in addition of the
MMSException when creating draft MMS.

Change-Id: Ieb1618872d7faa472a6fea08c1b3ef1ae0cde183
Author: Jianli Zhang <jianli.zhang@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
mms: also load group message recipients from CC field

If group messaging is enabled by the user, the messaging framework should also
try to load any numbers in the CC PduHeader. Some devices initiate group
messaging by populating this field with the group members' phone numbers, and
they only place the first number in the TO header. This should solve threading
issues with these devices. loadRecipients() will handle the CC field correctly
if it is null.
Signed-off-by: Christian Gaetano <cgatno@gmail.com>

Change-Id: I955bb0912356f4d8fb648acd2bd9e6bba21c9a82

Conflicts:
	src/java/com/google/android/mms/pdu/PduPersister.java
Mms: Add a check on the Media model

In case there is no image and no video in the slideshow, the
media model might be null.
Add a check to avoid a null pointer access.

Change-Id: I55d63b226835acfa53199eee0d706b8c5ae553c2
Author: Hongyu Zhang <hongyu.zhang@intel.com>
Signed-off-by: Hongyu Zhang <hongyu.zhang@intel.com>
Signed-off-by: Frederic Predon <frederic.predon@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 28037
Mms: fix CRASH when the address contains only spaces

Rootcause: If the address contains spaces only,when Mms
format this address,it will get an address string the length
of which is -1. So crash happen when call span(object,0,-1,flag)
function.

Solution: When user press back key to restore the message.
This patch will check the address is valite or not, if it is
invalite,it show a dialog to tell user he can't restore the message.
So it avoid crashing when enter the message again.

Change-Id: Ia847ee6a7c9666376ea6fcc56d18105e6e5474a7
Author: Jianping Li <jianpingx.li@intel.com>
Signed-off-by: Jianping Li <jianpingx.li@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 56634
Mms: process stops after sharing a video through Messaging

Some logic should be added to deal with different MMS content uri.

testcase: 1> In the messaging application, create a new message
          2> Attach a recorded video
          3> View the video once
          4> View the video twice
          5> Share it through Messaging when playing it

Some logic should be added to deal with different MMS content uri.

Change-Id: I2d7f2ec034823a17ecc517f0861a00958bbb1b38
Author: Frederic Predon <frederic.predon@intel.com>
Signed-off-by: Frederic Predon <frederic.predon@intel.com>
Signed-off-by: Bin Yang <bin.y.yang@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 27059
Mms: Upon already initialized, return immediately

If the sInstance parameter is already initialized then there is
no need to create a new one, this will lead to memory leaks.
Just return immediately.

Change-Id: I68dc53766b5a7e37c591ad253fbd65cf6416658a
Author: Hongyu Zhang <hongyu.zhang@intel.com>
Signed-off-by: Hongyu Zhang <hongyu.zhang@intel.com>
Signed-off-by: Frederic Predon <frederic.predon@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 28037
Mms: Need to type twice on the back key

Display MMS edit, touch "Edit" item twice. We Need to touch back
key twice if we want to return to the MMS edit.

Disable the button when click the edit button.
And reset to enable the button when the activity onresume.

Change-Id: Icba0621d020cdd3dba14b86d2e51261022984874
Author: Lei Wu <b497@borqs.com>
Signed-off-by: Jeevaka Badrappan <jeevaka.badrappan@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: 20739
MMS: Create an entry in thread table for WAP PUSH

Messaging application displays the SMS/MMS based on
thread id. If WAP PUSH is present in DB but the actual
retrieval of MMS failed then Messaging app would not
show that message and hence user would never get a chance
to manually download that MMS. Hence is it required that
for every WAP PUSH we create thread id.

Bug: 10750917
Change-Id: I7e4b16072a8f2cd5d1424cd8b476ddd98cb9fbeb