Merge "Merge ba2d438d000537f8c2a08f8a79646739ea8d35a8 on remote branch"
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/constant/BroadcastConstants.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/constant/BroadcastConstants.java
index 781589c..ad745aa 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/constant/BroadcastConstants.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/constant/BroadcastConstants.java
@@ -134,6 +134,9 @@
 
     /** Group has disband. */
     public static final String ACTION_TYPE_DELETED = "deleted";
+    
+    /** Group has gone. */
+    public static final String ACTION_TYPE_GONE = "gone";
 
     /** Update the subject of group. */
     public static final String ACTION_TYPE_UPDATE_SUBJECT = "updateSubject";
@@ -188,6 +191,9 @@
 
     /** UPDATE_DOWN_PROGRESS broadcast passed parameter name total long. */
     public static final String BC_VAR_TRANSFER_PRG_TOTAL = "total";
+    
+    /** Warning file is too large broadcast. */
+    public static final String UI_ALERT_FILE_NOT_EXISTS = "com.suntek.mway.rcs.ACTION_UI_MESSAGE_ALERT_FILE_NOT_EXISTS";
 
     /** Warning file is too large broadcast. */
     public static final String UI_ALERT_FILE_TOO_LARGE = "com.suntek.mway.rcs.ACTION_UI_MESSAGE_ALERT_FILE_TOO_LARGE";
@@ -269,7 +275,10 @@
 
     /** Create group not complete. */
     public static final String BC_VAR_SEND_ERROR_GROUP_NOT_COMPLETED = "group_not_completed";
-
+    
+    /** Wait other to join */
+    public static final String BC_VAR_SEND_ERROR_GROUP_NOT_MEMBER = "group_wait_member_join";
+    
     /** Group has deleted. */
     public static final String BC_VAR_SEND_ERROR_GROUP_HAS_DELETED = "group_has_deleted";
 
@@ -516,8 +525,11 @@
 
     /** Mcloud broadcast passed parameter name remoteNodeList list<FileNode>. */
     public static final String BC_VAR_MC_REMOTE_NODE_LIST = "remoteNodeList";
+
+    /** Mcloud broadcast passed parameter name chatMessage id String. */
+    public static final String BC_VAR_MC_CHATMESSAGE_ID = "chatMessageId";
     
-    /** . */
+    /** Mcloud broadcast passed parameter name exclude suffix id String. */
     public static final String BC_VAR_MC_EXCLUDE_SUFFIX = "excludeSuffix";
 
     /** The mcloud event type STARTED. */
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/constant/MediaConstants.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/constant/MediaConstants.java
index 512110d..ddb5510 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/constant/MediaConstants.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/constant/MediaConstants.java
@@ -37,6 +37,9 @@
     public static final String VIDEO_SUFFIX = "3GP,MP4";
     
     /** The suffixs of video. */
+    public static final String VCARD_SUFFIX = "VCF";
+    
+    /** The suffixs of video. */
     public static final String CLOUD_FILE_EXCLUDE_SUFFIX = "EXE,BAT,APK,SH,IPA,DEB,PXL,XAP";
 
     /** Maximum default file size. */
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/im/IGroupManagerApi.aidl b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/im/IGroupManagerApi.aidl
index edbfe43..418957b 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/im/IGroupManagerApi.aidl
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/im/IGroupManagerApi.aidl
@@ -77,6 +77,7 @@
     
     GroupChatModel getGroupChatByThreadId(String threadId);
        GroupChatModel getGroupChatByChatUri(String chatUri);
+       GroupChatModel getGroupChatByChatUriIgnoreState(String chatUri);
 
     String getGroupChatDomainName();
 
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/im/IInstantMessageApi.aidl b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/im/IInstantMessageApi.aidl
index 1f11790..b98ac5d 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/im/IInstantMessageApi.aidl
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/im/IInstantMessageApi.aidl
@@ -199,4 +199,49 @@
     void backupMessageList(in List<SimpleMsg> simpleMsgList);
 
 	ChatMessage getMessageByTransferId(String transferId);
+	
+	void cancelBackup();
+	
+	long sendTextMessageSync(long thread_id,String number, String text,
+            int burnFlag, int barCycle);
+	
+	long sendImageFileSync(long thread_id,long sms_id,String number, String filePath,
+            int burnFlag, int barCycle,int quality);
+    
+    long sendAudioFileSync(long thread_id,long sms_id,String number, String filePath,
+            int recordTime,int burnFlag, int barCycle) ;
+    long sendVideoFileSync(long thread_id,long sms_id,String number, String filePath,
+            int length,int burnFlag, int barCycle);
+            
+    long sendOne2ManyTextMessageSync(long thread_id,in List<String> numbers, String text,
+            int burnFlag, int barCycle);  
+          
+    long sendOne2ManyImageFileSync(long thread_id,long sms_id, in List<String> numbers, String filePath,
+            int burnFlag, int barCycle,int quality);
+    
+    long sendOne2ManyAudioFileSync(long thread_id,long sms_id,in List<String> numbers, String filePath,
+            int recordTime,int burnFlag, int barCycle);
+    long sendOne2ManyVideoFileSync(long thread_id,long sms_id,in List<String> numbers, String filePath,
+            int length,int burnFlag, int barCycle);
+            
+    long sendGroupMessageSync(long thread_id, String conversationId,long sms_id,String msg,
+            String groupId);
+          
+    long sendOne2ManyVCardByPathSync(long thread_id, long sms_id, 
+            in List<String> numbers, String vcardFilePath);
+    long sendVCardByPathSync(long thread_id,long sms_id,String number, String vcardFilePath);
+    
+    
+    void forwardImageFile(long thread_id,long sms_id,String number, String id,
+            int burnFlag, int barCycle);
+    void forwardVideoFile(long thread_id,long sms_id,String number, String id,
+            int length,int burnFlag, int barCycle);
+    void forwardOne2ManyImageFile(long thread_id,long sms_id, in List<String> numbers, String id,
+            int burnFlag, int barCycle);
+    void forwardOne2ManyVideoFile(long thread_id,long sms_id,in List<String> numbers, String id,
+            int length,int burnFlag, int barCycle);
+    void forwardGroupImageFile(long thread_id, String conversationId,long sms_id,String id,
+            String groupId);
+    void forwardGroupVideoFile(long thread_id, String conversationId,long sms_id,String id,
+            int  length ,String groupId);
 }
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/im/IPaMessageApi.aidl b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/im/IPaMessageApi.aidl
index b0b0efa..1f53f2e 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/im/IPaMessageApi.aidl
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/im/IPaMessageApi.aidl
@@ -57,4 +57,13 @@
     long getVideoMaxTime();
 
     long getVideoFtMaxSize();
+    
+    
+    long sendTextMessageSync(long thread_id, long sms_id, String uuid, String text);
+        
+    long sendImageFileSync(long thread_id, long sms_id, String uuid , String filepath, int quality);
+    
+    long sendAudioFileSync(long thread_id, long sms_id, String uuid, String filepath, int recordTime);
+    
+    long sendVideoFileSync(long thread_id, long sms_id, String uuid, String filepath, int length);
 }
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/mcloud/IMcloudFileApi.aidl b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/mcloud/IMcloudFileApi.aidl
index 2d2aa07..4dc78a6 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/mcloud/IMcloudFileApi.aidl
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/mcloud/IMcloudFileApi.aidl
@@ -29,12 +29,12 @@
     void shareFile(String fullPathInID, String shareDesc);
     void shareFileAndSend(String fullPathInID, String shareDesc, String contact, long threadId, String smsContentTemp);
     void getShareFileList(int beginIndex, int endIndex);
-    IMcloudOperationCtrl downloadFileFromUrl(String remoteUrl, String fileName, int transOper);
+    IMcloudOperationCtrl downloadFileFromUrl(String remoteUrl, String fileName, int transOper, int chatMessageId);
 
     void shareFileAndSendGroup(String fullPathInID, String shareDesc, long threadId, String conversationId, String groupId);
     void shareFileAndSendOne2Many(String fullPathInID, String shareDesc, in List<String> contacts, long threadId, String smsContentTemp);
 
     void getRemoteFileList(String remotePath, int beginIndex, int endIndex, int fileNodeOrder);
-
+	String getLocalRootPath();
 }
 
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/callback/IMContactSyncListener.aidl b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/callback/IMContactSyncListener.aidl
index 967b89e..92ea420 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/callback/IMContactSyncListener.aidl
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/callback/IMContactSyncListener.aidl
@@ -48,7 +48,7 @@
     void onProgress(in Auth auth, int contactAction, int value, int max);
     void onHttpResponeText(String message, String resultcode);
     void onSync(in Auth auth, int syncAction, boolean success);
-    //void onThrowException(in Auth auth, int syncAction, Exception e);
+    void onThrowException(in Auth auth, int syncAction, String exceptionMessage);
     void onRunning();
 
 }
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/emoticon/EmoticonConstant.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/emoticon/EmoticonConstant.java
index e32932a..982b9bd 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/emoticon/EmoticonConstant.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/emoticon/EmoticonConstant.java
@@ -35,14 +35,14 @@
 
     /** The Constant EMO_PACKAGE_FILE. */
     public static final int EMO_PACKAGE_FILE = 3;
-
+    
     /** The Constant EMO_DOWNLOAD_SUCCESS. */
     public static final int EMO_DOWNLOAD_SUCCESS = 1;
-
+    
     /** The Constant EMO_DOWNLOAD_FAILURE. */
     public static final int EMO_DOWNLOAD_FAILURE = 0;
-
+    
     /** The Constant EMO_DOWNLOAD_LOADING. */
     public static final int EMO_DOWNLOAD_LOADING = 2;
-
+    
 }
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/MenuInfoMode.aidl b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/MenuInfoMode.aidl
index e80f04e..9cb1d80 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/MenuInfoMode.aidl
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/MenuInfoMode.aidl
@@ -20,7 +20,6 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  * IN THE SOFTWARE.
  */
-
 package com.suntek.mway.rcs.client.aidl.plugin.entity.pubacct;
 
 parcelable MenuInfoMode;
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/MenuInfoMode.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/MenuInfoMode.java
index c38b373..725fd8f 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/MenuInfoMode.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/MenuInfoMode.java
@@ -20,7 +20,6 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  * IN THE SOFTWARE.
  */
-
 package com.suntek.mway.rcs.client.aidl.plugin.entity.pubacct;
 
 import android.os.Parcel;
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/PublicAccountConstant.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/PublicAccountConstant.java
index 79949d0..8a699f9 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/PublicAccountConstant.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/PublicAccountConstant.java
@@ -27,7 +27,7 @@
  * The Class PublicAccountConstant.
  */
 public class PublicAccountConstant {
-
+    
     /** account pre number. */
     public static final int ACCOUNT_PRE_NUMBER = 8;
 
@@ -87,4 +87,11 @@
 
     /** The Constant MENU_TYPE_APPLICATION. */
     public static final int MENU_TYPE_APPLICATION = 3;
+    
+    /** The Constant MESSAGE_FORWARD_ABLE. */
+    public static final int MESSAGE_FORWARD_ABLE = 0;
+    
+    /** The Constant MESSAGE_FORWARD_UNABLE. */
+    public static final int MESSAGE_FORWARD_UNABLE = 1;
+    
 }
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/PublicAccounts.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/PublicAccounts.java
index 8c2364c..c08dfa2 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/PublicAccounts.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/PublicAccounts.java
@@ -25,6 +25,8 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 
+import java.io.UnsupportedEncodingException;
+
 /**
  * <p>
  * Title: The public account entity
@@ -43,7 +45,7 @@
  * @version 1.0
  *
  */
-public class PublicAccounts implements Parcelable
+public class PublicAccounts implements Parcelable, Comparable<PublicAccounts>
 {
     /** The logo url. */
     private String    logo;
@@ -281,4 +283,41 @@
 
         return sbuffer.toString();
     }
+
+    @Override
+    public int compareTo(PublicAccounts account) {
+        int lenA = name.length();
+        int lenB = account.getName().length();
+        int lenComp = lenA >= lenB ? lenB : lenA;
+        int result = 0;
+        for(int i = 0; i < lenComp; i++){
+            result = getHexString(name.charAt(0)).compareTo(getHexString(account.getName().charAt(0)));
+            if(result == 0){
+                continue;
+            }else{
+                return result;
+            }
+        }
+        if(lenA > lenB){
+            return 1;
+        }else if(lenA == lenB){
+            return 0;
+        }else{
+            return -1;
+        }
+    }
+    
+    public static String getHexString(char c) {
+        byte[] b = null;
+        StringBuffer sb = new StringBuffer();
+        try {
+            b = new String(new char[] {c}).getBytes("gb2312");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        for (int i = 0; i < b.length; i++) {
+            sb.append(Integer.toHexString(b[i] & 0xFF));
+        }
+        return sb.toString();
+    }
 }
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/PublicAccountsDetail.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/PublicAccountsDetail.java
index 74608f7..02db2bf 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/PublicAccountsDetail.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/plugin/entity/pubacct/PublicAccountsDetail.java
@@ -103,7 +103,7 @@
 
     /** The sip uri. */
 //    private String    sipUri;
-
+    
     /** The number. */
     private String    number;
 
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/SuntekMessageData.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/SuntekMessageData.java
index c713de7..78c5669 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/SuntekMessageData.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/SuntekMessageData.java
@@ -72,6 +72,9 @@
     /** The Constant CHAT_GROUP_CONTENT_URI. */
     public static final Uri CHAT_GROUP_CONTENT_URI = Uri.parse("content://" + MESSAGE_AUTHORITY + "/" + TABLE_CHAT_GROUP);
     
+    /** The Constant CHAT_THREAD_CONTENT_URI. */
+    public static final Uri CHAT_THREAD_CONTENT_URI = Uri.parse("content://" + MESSAGE_AUTHORITY + "/" + TABLE_MESSAGE_THREAD);
+    
     /** The Constant GROUP_CHAT_DIVICE_API_CONTENT_URI. */
     public static final Uri GROUP_CHAT_DIVICE_API_CONTENT_URI = Uri.parse("content://" + MESSAGE_AUTHORITY + "/" + TABLE_DIVICE_API_CHAT_GROUP);
     
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/GroupChatUser.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/GroupChatUser.java
index 5235ec1..ef678ea 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/GroupChatUser.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/GroupChatUser.java
@@ -432,7 +432,7 @@
      * @return
      */
     public String getAlias() {
-        return alias;
+        return alias == null ? "" : alias;
     }
 
     /**
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/GroupNotificationConst.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/GroupNotificationConst.java
index 2b1417e..d36e49a 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/GroupNotificationConst.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/GroupNotificationConst.java
@@ -45,6 +45,8 @@
     public static final String MEMBER_QUIT = "quit";
 
     public static final String DISBAND = "disband";
+    
+    public static final String GONE = "gone";
 
 
 }
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicMediaMessage.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicMediaMessage.java
index 9707136..1d15029 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicMediaMessage.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicMediaMessage.java
@@ -30,18 +30,6 @@
  */
 public class PublicMediaMessage extends PublicMessage implements Parcelable{
 
-    /** The createtime. */
-    private String createtime;
-
-    /** The forwardable. */
-//    private String forwardable;
-
-    /** The msgtype. */
-    private String msgtype;
-
-    /** The msg id. */
-//    private String msgId;
-
     /** The media. */
     private PublicMediaContent media;
 
@@ -74,9 +62,10 @@
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         dest.writeString( createtime );
-//        dest.writeString( forwardable );
+        dest.writeInt( forwardable );
         dest.writeString( msgtype );
-//        dest.writeString( msgId );
+        dest.writeInt( activeStatus );
+        dest.writeString( paUuid );
         dest.writeValue( media );
     }
 
@@ -88,9 +77,10 @@
     public void readFromParcel( Parcel source )
     {
         createtime = source.readString();
-//        forwardable = source.readString();
+        forwardable = source.readInt();
         msgtype = source.readString();
-//        msgId = source.readString();
+        activeStatus = source.readInt();
+        paUuid = source.readString();
         media = (PublicMediaContent) source.readValue(this.getClass().getClassLoader());
     }
 
@@ -110,78 +100,6 @@
                                                                             };
 
     /**
-     * Gets the createtime.
-     *
-     * @return the createtime
-     */
-    public String getCreatetime() {
-        return createtime;
-    }
-
-    /**
-     * Sets the createtime.
-     *
-     * @param createtime the new createtime
-     */
-    public void setCreatetime(String createtime) {
-        this.createtime = createtime;
-    }
-
-    /**
-     * Gets the forwardable.
-     *
-     * @return the forwardable
-     */
-//    public String getForwardable() {
-//        return forwardable;
-//    }
-
-    /**
-     * Sets the forwardable.
-     *
-     * @param forwardable the new forwardable
-     */
-//    public void setForwardable(String forwardable) {
-//        this.forwardable = forwardable;
-//    }
-
-    /**
-     * Gets the msgtype.
-     *
-     * @return the msgtype
-     */
-    public String getMsgtype() {
-        return msgtype;
-    }
-
-    /**
-     * Sets the msgtype.
-     *
-     * @param msgtype the new msgtype
-     */
-    public void setMsgtype(String msgtype) {
-        this.msgtype = msgtype;
-    }
-
-    /**
-     * Gets the msg id.
-     *
-     * @return the msg id
-     */
-//    public String getMsgId() {
-//        return msgId;
-//    }
-
-    /**
-     * Sets the msg id.
-     *
-     * @param msgId the new msg id
-     */
-//    public void setMsgId(String msgId) {
-//        this.msgId = msgId;
-//    }
-
-    /**
      * Gets the media.
      *
      * @return the media
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicMessage.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicMessage.java
index 39bb182..c5361af 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicMessage.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicMessage.java
@@ -57,6 +57,22 @@
     /** The Constant VCARD. */
     public static final String VCARD = "18";
 
+    
+    /** The createtime. */
+    protected String createtime;
+
+    /** The forwardable. */
+    protected int forwardable;
+
+    /** The msgtype. */
+    protected String msgtype;
+
+    /** The activeStatus. */
+    protected int activeStatus;
+    
+    /** The paUuid. */
+    protected String paUuid;
+    
     /**
      * Instantiates a new public message.
      */
@@ -70,7 +86,47 @@
      * @param source the source
      */
     public PublicMessage(Parcel source) {
+        readFromParcel( source );
+    }
+    
+    public String getCreatetime() {
+        return createtime;
+    }
 
+    public void setCreatetime(String createtime) {
+        this.createtime = createtime;
+    }
+
+    public int getForwardable() {
+        return forwardable;
+    }
+
+    public void setForwardable(int forwardable) {
+        this.forwardable = forwardable;
+    }
+
+    public String getMsgtype() {
+        return msgtype;
+    }
+
+    public void setMsgtype(String msgtype) {
+        this.msgtype = msgtype;
+    }
+
+    public int getActiveStatus() {
+        return activeStatus;
+    }
+
+    public void setActiveStatus(int activeStatus) {
+        this.activeStatus = activeStatus;
+    }
+
+    public String getPaUuid() {
+        return paUuid;
+    }
+
+    public void setPaUuid(String paUuid) {
+        this.paUuid = paUuid;
     }
 
     /* (non-Javadoc)
@@ -85,10 +141,19 @@
      * @see android.os.Parcelable#writeToParcel(android.os.Parcel, int)
      */
     @Override
-    public void writeToParcel(Parcel arg0, int arg1) {
-
+    public void writeToParcel(Parcel dest, int flags) {
+        
     }
 
+    /**
+     * Read from parcel.
+     *
+     * @param source the source
+     */
+    public void readFromParcel( Parcel source ){
+        
+    }
+    
     /** The Constant CREATOR. */
     public static final Parcelable.Creator<PublicMessage> CREATOR = new Parcelable.Creator<PublicMessage>() {
         public PublicMessage createFromParcel(Parcel in) {
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicTextMessage.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicTextMessage.java
index 67f1270..7bf3cf8 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicTextMessage.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicTextMessage.java
@@ -30,21 +30,9 @@
  */
 public class PublicTextMessage extends PublicMessage implements Parcelable{
 
-    /** The createtime. */
-    private String createtime;
-
-    /** The forwardable. */
-//    private String forwardable;
-
-    /** The msgtype. */
-    private String msgtype;
-
     /** The content. */
     private String content;
 
-    /** The msg id. */
-//    private String msgId;
-
     /**
      * Instantiates a new public text message.
      */
@@ -60,18 +48,25 @@
         readFromParcel( source );
     }
 
+    /* (non-Javadoc)
+     * @see com.suntek.mway.rcs.client.aidl.provider.model.PublicMessage#describeContents()
+     */
     @Override
     public int describeContents() {
         return 0;
     }
 
+    /* (non-Javadoc)
+     * @see com.suntek.mway.rcs.client.aidl.provider.model.PublicMessage#writeToParcel(android.os.Parcel, int)
+     */
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         dest.writeString( createtime );
-//        dest.writeString( forwardable );
+        dest.writeInt( forwardable );
         dest.writeString( msgtype );
         dest.writeString( content );
-//        dest.writeString( msgId );
+        dest.writeInt( activeStatus );
+        dest.writeString( paUuid );
     }
 
     /**
@@ -82,10 +77,11 @@
     public void readFromParcel( Parcel source )
     {
         createtime = source.readString();
-//        forwardable = source.readString();
+        forwardable = source.readInt();
         msgtype = source.readString();
         content = source.readString();
-//        msgId = source.readString();
+        activeStatus = source.readInt();
+        paUuid = source.readString();
     }
 
     /** The parcel creator. */
@@ -103,59 +99,6 @@
                                                                                 }
                                                                             };
 
-    /**
-     * Gets the createtime.
-     *
-     * @return the createtime
-     */
-    public String getCreatetime() {
-        return createtime;
-    }
-
-    /**
-     * Sets the createtime.
-     *
-     * @param createtime the new createtime
-     */
-    public void setCreatetime(String createtime) {
-        this.createtime = createtime;
-    }
-
-    /**
-     * Gets the forwardable.
-     *
-     * @return the forwardable
-     */
-//    public String getForwardable() {
-//        return forwardable;
-//    }
-
-    /**
-     * Sets the forwardable.
-     *
-     * @param forwardable the new forwardable
-     */
-//    public void setForwardable(String forwardable) {
-//        this.forwardable = forwardable;
-//    }
-
-    /**
-     * Gets the msgtype.
-     *
-     * @return the msgtype
-     */
-    public String getMsgtype() {
-        return msgtype;
-    }
-
-    /**
-     * Sets the msgtype.
-     *
-     * @param msgtype the new msgtype
-     */
-    public void setMsgtype(String msgtype) {
-        this.msgtype = msgtype;
-    }
 
     /**
      * Gets the content.
@@ -175,22 +118,4 @@
         this.content = content;
     }
 
-    /**
-     * Gets the msg id.
-     *
-     * @return the msg id
-     */
-//    public String getMsgId() {
-//        return msgId;
-//    }
-
-    /**
-     * Sets the msg id.
-     *
-     * @param msgId the new msg id
-     */
-//    public void setMsgId(String msgId) {
-//        this.msgId = msgId;
-//    }
-
 }
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicTopicMessage.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicTopicMessage.java
index a1f1bcb..fcbfcf6 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicTopicMessage.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/provider/model/PublicTopicMessage.java
@@ -33,24 +33,6 @@
  */
 public class PublicTopicMessage extends PublicMessage implements Parcelable{
 
-    /** The createtime. */
-    private String createtime;
-
-    /** The forwardable. */
-//    private String forwardable;
-
-    /** The msgtype. */
-    private String msgtype;
-
-    /** The msg id. */
-//    private String msgId;
-
-    /** The smscontent. */
-//    private String smscontent;
-
-    /** The sectioncount. */
-//    private String sectioncount;
-
     /** The topics. */
     private List<PublicTopicContent> topics;
 
@@ -83,11 +65,10 @@
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         dest.writeString( createtime );
-//        dest.writeString( forwardable );
+        dest.writeInt( forwardable );
         dest.writeString( msgtype );
-//        dest.writeString( msgId );
-//        dest.writeString( smscontent );
-//        dest.writeString( sectioncount );
+        dest.writeInt( activeStatus );
+        dest.writeString( paUuid );
         dest.writeList( topics );
     }
 
@@ -99,11 +80,10 @@
     public void readFromParcel( Parcel source )
     {
         createtime = source.readString();
-//        forwardable = source.readString();
+        forwardable = source.readInt();
         msgtype = source.readString();
-//        msgId = source.readString();
-//        smscontent = source.readString();
-//        sectioncount = source.readString();
+        activeStatus = source.readInt();
+        paUuid = source.readString();
         topics = new LinkedList<PublicTopicContent>();
         source.readList( topics, this.getClass().getClassLoader() );
     }
@@ -123,115 +103,6 @@
                                                                                 }
                                                                             };
 
-
-    /**
-     * Gets the createtime.
-     *
-     * @return the createtime
-     */
-    public String getCreatetime() {
-        return createtime;
-    }
-
-    /**
-     * Sets the createtime.
-     *
-     * @param createtime the new createtime
-     */
-    public void setCreatetime(String createtime) {
-        this.createtime = createtime;
-    }
-
-    /**
-     * Gets the forwardable.
-     *
-     * @return the forwardable
-     */
-//    public String getForwardable() {
-//        return forwardable;
-//    }
-
-    /**
-     * Sets the forwardable.
-     *
-     * @param forwardable the new forwardable
-     */
-//    public void setForwardable(String forwardable) {
-//        this.forwardable = forwardable;
-//    }
-
-    /**
-     * Gets the msgtype.
-     *
-     * @return the msgtype
-     */
-    public String getMsgtype() {
-        return msgtype;
-    }
-
-    /**
-     * Sets the msgtype.
-     *
-     * @param msgtype the new msgtype
-     */
-    public void setMsgtype(String msgtype) {
-        this.msgtype = msgtype;
-    }
-
-    /**
-     * Gets the msg id.
-     *
-     * @return the msg id
-     */
-//    public String getMsgId() {
-//        return msgId;
-//    }
-
-    /**
-     * Sets the msg id.
-     *
-     * @param msgId the new msg id
-     */
-//    public void setMsgId(String msgId) {
-//        this.msgId = msgId;
-//    }
-
-    /**
-     * Gets the smscontent.
-     *
-     * @return the smscontent
-     */
-//    public String getSmscontent() {
-//        return smscontent;
-//    }
-
-    /**
-     * Sets the smscontent.
-     *
-     * @param smscontent the new smscontent
-     */
-//    public void setSmscontent(String smscontent) {
-//        this.smscontent = smscontent;
-//    }
-
-    /**
-     * Gets the sectioncount.
-     *
-     * @return the sectioncount
-     */
-//    public String getSectioncount() {
-//        return sectioncount;
-//    }
-
-    /**
-     * Sets the sectioncount.
-     *
-     * @param sectioncount the new sectioncount
-     */
-//    public void setSectioncount(String sectioncount) {
-//        this.sectioncount = sectioncount;
-//    }
-
     /**
      * Gets the topics.
      *
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/utils/MediaUtils.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/utils/MediaUtils.java
index 4b15dd3..e468775 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/utils/MediaUtils.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/aidl/utils/MediaUtils.java
@@ -96,6 +96,26 @@
             return false;
         }
     }
+    
+    /**
+     * Checks if is vcard file.
+     *
+     * @param fileName the file name
+     * @return true, if is vcard file
+     */
+    public static boolean isVcardFile(String fileName){
+        if(TextUtils.isEmpty(fileName)){
+            return false;
+        }
+        
+        int suffixIndex = fileName.lastIndexOf(".");
+        if(suffixIndex != -1){
+            String suffix = fileName.substring(suffixIndex + 1);
+            return isVcardSuffix(suffix);
+        }else{
+            return false;
+        }
+    }
 
     /**
      * Checks if is video file.
@@ -160,6 +180,20 @@
     }
     
     /**
+     * Checks if is vcard suffix.
+     *
+     * @param suffix the suffix
+     * @return true, if is vcard suffix
+     */
+    public static boolean isVcardSuffix(String suffix){
+        if(TextUtils.isEmpty(suffix)){
+            return false;
+        }
+        
+        return MediaConstants.VCARD_SUFFIX.indexOf(suffix.toUpperCase(Locale.getDefault())) != -1;
+    }
+    
+    /**
      * Checks if is cloud file exclude suffix.
      *
      * @param suffix the suffix
diff --git a/rcs_service_api/src/com/suntek/mway/rcs/client/api/im/impl/MessageApi.java b/rcs_service_api/src/com/suntek/mway/rcs/client/api/im/impl/MessageApi.java
index e634e11..02d0542 100644
--- a/rcs_service_api/src/com/suntek/mway/rcs/client/api/im/impl/MessageApi.java
+++ b/rcs_service_api/src/com/suntek/mway/rcs/client/api/im/impl/MessageApi.java
@@ -29,6 +29,7 @@
 import android.content.ComponentName;
 import android.content.ServiceConnection;
 import android.os.IBinder;
+import android.text.TextUtils;
 
 import com.suntek.mway.rcs.client.api.ClientApi;
 import com.suntek.mway.rcs.client.aidl.constant.APIConstant;
@@ -1607,4 +1608,199 @@
         }
         return null;
     }
+    
+    public void cancelBackup() throws ServiceDisconnectedException {
+        LogHelper.i("enter method:cancelBackup.");
+        VerificationUtil.ApiIsNull(myApi);
+        try {
+            myApi.cancelBackup();
+        } catch (Exception ex) {
+            LogHelper.e(ex.getMessage(), ex);
+        }
+    }
+    
+    public void forwardImageFile(long thread_id, long sms_id, String number, String id,
+            int burnFlag, int barCycle) throws ServiceDisconnectedException {
+        VerificationUtil.ApiIsNull(myApi);
+        LogHelper
+                .i(String.format(
+                        Locale.getDefault(),
+                        "enter method forwardImageFile. [thread_id,sms_id,number,id,burnFlag,barCycle]=%d,%d,%s,%s,%d,%d",
+                        thread_id, sms_id, number, id, burnFlag, barCycle));
+
+        if(TextUtils.isEmpty(id)){
+            LogHelper.i("id field value error");
+            return;
+        }
+        
+        if (!VerificationUtil.isNumber(number)) {
+            LogHelper.i("number field value error");
+            return;
+        }
+        if (!VerificationUtil.isBurnFlagCorrect(burnFlag)) {
+            LogHelper.i("burnFlag field must be 0 or 1");
+            return;
+        }
+        if (barCycle < 0) {
+            LogHelper.i("barCycle field must be a positive int");
+            return;
+        }
+
+        try {
+            myApi.forwardImageFile(thread_id, sms_id, VerificationUtil.formatNumber(number), id,
+                    burnFlag, barCycle);
+        } catch (Exception ex) {
+            LogHelper.e(ex.getMessage(), ex);
+        }
+    }
+    
+    public void forwardVideoFile(long thread_id, long sms_id, String number, String id,
+            int length, int burnFlag, int barCycle, boolean isRecord)
+            throws ServiceDisconnectedException {
+        VerificationUtil.ApiIsNull(myApi);
+        LogHelper
+                .i(String.format(
+                        Locale.getDefault(),
+                        "enter method forwardVideoFile. [thread_id,sms_id,number,id,length,burnFlag,barCycle,isRecord]=%d,%d,%s,%s,%d,%d,%d,%b",
+                        thread_id, sms_id, number, id, length, burnFlag, barCycle, isRecord));
+
+        if(TextUtils.isEmpty(id)){
+            LogHelper.i("id field value error");
+            return;
+        }
+        
+        if (!VerificationUtil.isNumber(number)) {
+            LogHelper.i("number field value error");
+            return;
+        }
+        if (!VerificationUtil.isBurnFlagCorrect(burnFlag)) {
+            LogHelper.i("burnFlag field must be 0 or 1");
+            return;
+        }
+        if (barCycle < 0) {
+            LogHelper.i("barCycle field must be a positive int");
+            return;
+        }
+        try {
+            myApi.forwardVideoFile(thread_id, sms_id, VerificationUtil.formatNumber(number), id,
+                    length, burnFlag, barCycle);
+        } catch (Exception ex) {
+            LogHelper.e(ex.getMessage(), ex);
+        }
+    }
+
+    public void forwardOne2ManyImageFile(long thread_id, long sms_id, List<String> numbers,
+            String id, int burnFlag, int barCycle)
+            throws ServiceDisconnectedException {
+        VerificationUtil.ApiIsNull(myApi);
+        LogHelper
+                .i(String.format(
+                        Locale.getDefault(),
+                        "enter method forwardOne2ManyImageFile. [thread_id,sms_id,numbers,id,burnFlag,barCycle]=%d,%d,%s,%s,%d,%d",
+                        thread_id, sms_id, numbers.toString(), id, burnFlag, barCycle));
+        
+        if(TextUtils.isEmpty(id)){
+            LogHelper.i("id field value error");
+            return;
+        }
+        
+        if (!VerificationUtil.isAllNumber(numbers)) {
+            LogHelper.i("number field value error");
+            return;
+        }
+        if (!VerificationUtil.isBurnFlagCorrect(burnFlag)) {
+            LogHelper.i("burnFlag field must be 0 or 1");
+            return;
+        }
+        if (barCycle < 0) {
+            LogHelper.i("barCycle field must be a positive int");
+            return;
+        }
+        
+        try {
+            myApi.forwardOne2ManyImageFile(thread_id, sms_id, VerificationUtil.formatNumbers(numbers),
+                    id, burnFlag, barCycle);
+        } catch (Exception ex) {
+            LogHelper.e(ex.getMessage(), ex);
+        }
+    }
+    
+    public void forwardOne2ManyVideoFile(long thread_id, long sms_id, List<String> numbers,
+            String id, int length, int burnFlag, int barCycle, boolean isRecord)
+            throws ServiceDisconnectedException {
+        VerificationUtil.ApiIsNull(myApi);
+        LogHelper
+                .i(String.format(
+                        Locale.getDefault(),
+                        "enter method forwardOne2ManyVideoFile. [thread_id,sms_id,numbers,id,length,burnFlag,barCycle,isRecord]=%d,%d,%s,%s,%d,%d,%d,%b",
+                        thread_id, sms_id, numbers.toString(), id, length, burnFlag,
+                        barCycle, isRecord));
+        
+        if(TextUtils.isEmpty(id)){
+            LogHelper.i("id field value error");
+            return;
+        }
+        
+        if (!VerificationUtil.isAllNumber(numbers)) {
+            LogHelper.i("number field value error");
+            return;
+        }
+        if (!VerificationUtil.isBurnFlagCorrect(burnFlag)) {
+            LogHelper.i("burnFlag field must be 0 or 1");
+            return;
+        }
+        if (barCycle < 0) {
+            LogHelper.i("barCycle field must be a positive int");
+            return;
+        }
+        try {
+            myApi.forwardOne2ManyVideoFile(thread_id, sms_id, VerificationUtil.formatNumbers(numbers),
+                    id, length, burnFlag, barCycle);
+        } catch (Exception ex) {
+            LogHelper.e(ex.getMessage(), ex);
+        }
+    }
+    
+    public void forwardGroupImageFile(long thread_id, String conversationId, long sms_id,
+            String id, String groupId) throws ServiceDisconnectedException {
+        VerificationUtil.ApiIsNull(myApi);
+        LogHelper
+                .i(String.format(
+                        Locale.getDefault(),
+                        "enter method forwardGroupImageFile. [thread_id,conversationId,sms_id,id,groupId]=%d,%s,%d,%s,%s",
+                        thread_id, conversationId, sms_id, id, groupId));
+        
+        if(TextUtils.isEmpty(id)){
+            LogHelper.i("id field value error");
+            return;
+        }
+
+        try {
+            myApi.forwardGroupImageFile(thread_id, conversationId, sms_id, id, groupId);
+        } catch (Exception ex) {
+            LogHelper.e(ex.getMessage(), ex);
+        }
+    }
+
+    public void forwardGroupVideoFile(long thread_id, String conversationId, long sms_id,
+            String id, int length, String groupId, boolean isRecord)
+            throws ServiceDisconnectedException {
+        VerificationUtil.ApiIsNull(myApi);
+        LogHelper
+                .i(String.format(
+                        Locale.getDefault(),
+                        "enter method forwardGroupVideoFile. [thread_id,conversationId,sms_id,id,length,groupId,isRecord]=%d,%s,%d,%s,%d,%s,%b",
+                        thread_id, conversationId, sms_id, id, length, groupId, isRecord));
+        
+        if(TextUtils.isEmpty(id)){
+            LogHelper.i("id field value error");
+            return;
+        }
+
+        try {
+            myApi.forwardGroupVideoFile(thread_id, conversationId, sms_id, id, length, groupId);
+        } catch (Exception ex) {
+            LogHelper.e(ex.getMessage(), ex);
+        }
+    }
 }
diff --git a/rcs_service_api/src/com/suntek/mway/rcs/client/api/mcloud/McloudFileApi.java b/rcs_service_api/src/com/suntek/mway/rcs/client/api/mcloud/McloudFileApi.java
index e109c02..7b55d3f 100644
--- a/rcs_service_api/src/com/suntek/mway/rcs/client/api/mcloud/McloudFileApi.java
+++ b/rcs_service_api/src/com/suntek/mway/rcs/client/api/mcloud/McloudFileApi.java
@@ -74,12 +74,14 @@
         super.initServiceConnect(mConnection);
     }
 
-    public IMcloudOperationCtrl downloadFileFromUrl(String remoteUrl, String fileName, TransNode.TransOper transOper) throws ServiceDisconnectedException {
+    public IMcloudOperationCtrl downloadFileFromUrl(String remoteUrl, String fileName, TransNode.TransOper transOper, int chatMessageId) throws ServiceDisconnectedException {
         VerificationUtil.ApiIsNull(myApi);
         LogHelper.i(String.format(Locale.getDefault(),
-                "enter method:downloadFileFromUrl. [remoteUrl,fileName,transOper]=%s,%d", remoteUrl, fileName, transOper.ordinal()));
+                "enter method:downloadFileFromUrl. [remoteUrl,fileName,transOper,chatMessageId]=%s,%s,%d,%d", remoteUrl, fileName, transOper.ordinal(), chatMessageId));
         try {
-            return myApi.downloadFileFromUrl(remoteUrl, fileName, transOper.ordinal());
+            IMcloudOperationCtrl operation = myApi.downloadFileFromUrl(remoteUrl, fileName, transOper.ordinal(), chatMessageId);
+            LogHelper.d("operation=" + operation);
+            return operation;
         } catch (Exception ex) {
             LogHelper.e(ex.getMessage(), ex);
             return null;
@@ -105,7 +107,9 @@
                 localPath, remotePath, transOper.ordinal()));
         VerificationUtil.isCloudFile(localPath);
         try {
-            return myApi.putFile(localPath, remotePath, transOper.ordinal());
+            IMcloudOperationCtrl operation = myApi.putFile(localPath, remotePath, transOper.ordinal());
+            LogHelper.d("operation=" + operation);
+            return operation;
         } catch (Exception ex) {
             LogHelper.e(ex.getMessage(), ex);
             return null;
@@ -184,4 +188,15 @@
             LogHelper.e(ex.getMessage(), ex);
         }
     }
+    
+    public String getLocalRootPath() throws ServiceDisconnectedException {
+        VerificationUtil.ApiIsNull(myApi);
+        LogHelper.i("enter method:getLocalRootPath");
+        try {
+            return myApi.getLocalRootPath();
+        } catch (Exception ex) {
+            LogHelper.e(ex.getMessage(), ex);
+            return "";
+        }
+    }
 }