public abstract class

MediaModel

extends Model
implements EventListener
java.lang.Object
   ↳ com.android.mms.model.Model
     ↳ com.android.mms.model.MediaModel
Known Direct Subclasses
Known Indirect Subclasses

Summary

Nested Classes
enum MediaModel.MediaAction  
Constants
String TAG
Fields
protected int mBegin
protected String mContentType
protected Context mContext
protected DrmWrapper mDrmObjectWrapper
protected int mDuration
protected short mFill
protected boolean mMediaResizeable
protected int mSeekTo
protected int mSize
protected String mSrc
protected String mTag
[Expand]
Inherited Fields
From class com.android.mms.model.Model
Public Constructors
MediaModel(Context context, String tag, String contentType, String src, Uri uri)
MediaModel(Context context, String tag, String contentType, String src, byte[] data)
MediaModel(Context context, String tag, String contentType, String src, DrmWrapper wrapper)
Public Methods
void appendAction(MediaModel.MediaAction action)
int getBegin()
String getContentType()
MediaModel.MediaAction getCurrentAction()
byte[] getData()
DrmWrapper getDrmObject()
int getDuration()
short getFill()
boolean getMediaResizable()
int getMediaSize()
int getSeekTo()
String getSrc()
String getTag()
Uri getUri()
Get the URI of the media without checking DRM rights.
Uri getUriWithDrmCheck()
Get the URI of the media with checking DRM rights.
boolean isAllowedToForward()
boolean isAudio()
boolean isDrmProtected()
boolean isImage()
static boolean isMmsUri(Uri uri)
boolean isText()
boolean isVideo()
void setBegin(int begin)
void setDuration(int duration)
void setFill(short fill)
Protected Methods
void initMediaDuration()
boolean isPlayable()
void pauseMusicPlayer()
void resizeMedia(int byteLimit, long messageId)
If the attached media is resizeable, resize it to fit within the byteLimit.
[Expand]
Inherited Methods
From class com.android.mms.model.Model
From class java.lang.Object
From interface org.w3c.dom.events.EventListener

Constants

protected static final String TAG

Constant Value: "Mms/media"

Fields

protected int mBegin

protected String mContentType

protected Context mContext

protected DrmWrapper mDrmObjectWrapper

protected int mDuration

protected short mFill

protected boolean mMediaResizeable

protected int mSeekTo

protected int mSize

protected String mSrc

protected String mTag

Public Constructors

public MediaModel (Context context, String tag, String contentType, String src, Uri uri)

Throws
MmsException

public MediaModel (Context context, String tag, String contentType, String src, byte[] data)

public MediaModel (Context context, String tag, String contentType, String src, DrmWrapper wrapper)

Throws
IOException

Public Methods

public void appendAction (MediaModel.MediaAction action)

public int getBegin ()

public String getContentType ()

public MediaModel.MediaAction getCurrentAction ()

public byte[] getData ()

Throws
DrmException

public DrmWrapper getDrmObject ()

public int getDuration ()

public short getFill ()

Returns
  • the mFill

public boolean getMediaResizable ()

Returns
  • whether the media is resizable or not. For instance, a picture can be resized to smaller dimensions or lower resolution. Other media, such as video and sounds, aren't currently able to be resized.

public int getMediaSize ()

Returns
  • the size of the attached media

public int getSeekTo ()

public String getSrc ()

Returns
  • the mSrc

public String getTag ()

public Uri getUri ()

Get the URI of the media without checking DRM rights. Use this method only if the media is NOT DRM protected.

Returns
  • The URI of the media.

public Uri getUriWithDrmCheck ()

Get the URI of the media with checking DRM rights. Use this method if the media is probably DRM protected.

Returns
  • The URI of the media.
Throws
Insufficient DRM rights detected.
DrmException

public boolean isAllowedToForward ()

public boolean isAudio ()

public boolean isDrmProtected ()

public boolean isImage ()

public static boolean isMmsUri (Uri uri)

public boolean isText ()

public boolean isVideo ()

public void setBegin (int begin)

public void setDuration (int duration)

public void setFill (short fill)

Parameters
fill the mFill to set

Protected Methods

protected void initMediaDuration ()

Throws
MmsException

protected boolean isPlayable ()

protected void pauseMusicPlayer ()

protected void resizeMedia (int byteLimit, long messageId)

If the attached media is resizeable, resize it to fit within the byteLimit. Save the new part in the pdu.

Parameters
byteLimit the max size of the media attachment
Throws
MmsException