rcs-service: change rcs api build

 - change rcs sevice API build from static build to dynamic build

  Change-Id: I8a6114878349907ce17251fec9ccb3052db8d071
  CRs-Fixed: 757950
diff --git a/rcs_service_aidl/Android.mk b/rcs_service_aidl/Android.mk
index 580b6c8..62fff5b 100644
--- a/rcs_service_aidl/Android.mk
+++ b/rcs_service_aidl/Android.mk
@@ -6,50 +6,114 @@
 
 # Important: Must not contain any aidl files for parcelables
 LOCAL_SRC_FILES := \
-	$(call all-java-files-under, src) \
-	src/com/suntek/mway/rcs/client/api/autoconfig/IAutoConfigApi.aidl \
-	src/com/suntek/mway/rcs/client/api/blacklist/IBlackListApi.aidl \
-	src/com/suntek/mway/rcs/client/api/capability/ICapabilityApi.aidl \
-	src/com/suntek/mway/rcs/client/api/capability/IRcsCapabilityApi.aidl \
-	src/com/suntek/mway/rcs/client/api/emoticon/IEmoticonApi.aidl \
-	src/com/suntek/mway/rcs/client/api/im/IGroupManagerApi.aidl \
-	src/com/suntek/mway/rcs/client/api/im/IInstantMessageApi.aidl \
-	src/com/suntek/mway/rcs/client/api/im/IPaMessageApi.aidl \
-	src/com/suntek/mway/rcs/client/api/IRCSServiceListener.aidl \
-	src/com/suntek/mway/rcs/client/api/login/ILoginApi.aidl \
-	src/com/suntek/mway/rcs/client/api/login/ILoginEventListener.aidl \
-	src/com/suntek/mway/rcs/client/api/mcloud/IMcloudFileApi.aidl \
-	src/com/suntek/mway/rcs/client/api/mcontact/IMcontactApi.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/ICapabiltyListener.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IConferenceCallback.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IEmoticonCallbackApi.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IEmoticonCanSendCallback.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IEmoticonPackagesNetCallbackApi.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IEmoticonSetSuccessDownListener.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudAuthListener.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudConfListener.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudFileListener.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudMsgListener.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudOperationCtrl.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudSdkListener.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudShareListener.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudTransListener.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IMContactSyncListener.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IProfileGetCallback.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IProfileListener.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IProfilePutCallback.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/callback/IPublicAccountCallbackAPI.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/IMcloudFileApi.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/IProfileApi.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/IPublicAccountAPI.aidl \
-	src/com/suntek/mway/rcs/client/api/plugin/IRichScreenApi.aidl \
-	src/com/suntek/mway/rcs/client/api/plugincenter/IPluginCenterApi.aidl \
-	src/com/suntek/mway/rcs/client/api/registration/IRegistrationApi.aidl \
-	src/com/suntek/mway/rcs/client/api/setting/callback/IAccountEventListener.aidl \
-	src/com/suntek/mway/rcs/client/api/setting/IRcsSettingApi.aidl \
-	src/com/suntek/mway/rcs/client/api/specialnumber/ISpecialServiceNumApi.aidl
+    $(call all-java-files-under, src) \
+    src/com/suntek/mway/rcs/client/api/autoconfig/IAutoConfigApi.aidl \
+    src/com/suntek/mway/rcs/client/api/blacklist/IBlackListApi.aidl \
+    src/com/suntek/mway/rcs/client/api/capability/ICapabilityApi.aidl \
+    src/com/suntek/mway/rcs/client/api/capability/IRcsCapabilityApi.aidl \
+    src/com/suntek/mway/rcs/client/api/emoticon/IEmoticonApi.aidl \
+    src/com/suntek/mway/rcs/client/api/im/IGroupManagerApi.aidl \
+    src/com/suntek/mway/rcs/client/api/im/IInstantMessageApi.aidl \
+    src/com/suntek/mway/rcs/client/api/im/IPaMessageApi.aidl \
+    src/com/suntek/mway/rcs/client/api/IRCSServiceListener.aidl \
+    src/com/suntek/mway/rcs/client/api/login/ILoginApi.aidl \
+    src/com/suntek/mway/rcs/client/api/login/ILoginEventListener.aidl \
+    src/com/suntek/mway/rcs/client/api/mcloud/IMcloudFileApi.aidl \
+    src/com/suntek/mway/rcs/client/api/mcontact/IMcontactApi.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/ICapabiltyListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IConferenceCallback.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IEmoticonCallbackApi.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IEmoticonCanSendCallback.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IEmoticonPackagesNetCallbackApi.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IEmoticonSetSuccessDownListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudAuthListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudConfListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudFileListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudMsgListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudOperationCtrl.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudSdkListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudShareListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudTransListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMContactSyncListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IProfileGetCallback.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IProfileListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IProfilePutCallback.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IPublicAccountCallbackAPI.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/IMcloudFileApi.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/IProfileApi.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/IPublicAccountAPI.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/IRichScreenApi.aidl \
+    src/com/suntek/mway/rcs/client/api/plugincenter/IPluginCenterApi.aidl \
+    src/com/suntek/mway/rcs/client/api/registration/IRegistrationApi.aidl \
+    src/com/suntek/mway/rcs/client/api/setting/callback/IAccountEventListener.aidl \
+    src/com/suntek/mway/rcs/client/api/setting/IRcsSettingApi.aidl \
+    src/com/suntek/mway/rcs/client/api/specialnumber/ISpecialServiceNumApi.aidl
 
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE := rcs_service_aidl
 
-include $(BUILD_STATIC_JAVA_LIBRARY)
\ No newline at end of file
+include $(BUILD_JAVA_LIBRARY)
+
+include $(CLEAR_VARS)
+
+LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/src
+
+# Important: Must not contain any aidl files for parcelables
+LOCAL_SRC_FILES := \
+    $(call all-java-files-under, src) \
+    src/com/suntek/mway/rcs/client/api/autoconfig/IAutoConfigApi.aidl \
+    src/com/suntek/mway/rcs/client/api/blacklist/IBlackListApi.aidl \
+    src/com/suntek/mway/rcs/client/api/capability/ICapabilityApi.aidl \
+    src/com/suntek/mway/rcs/client/api/capability/IRcsCapabilityApi.aidl \
+    src/com/suntek/mway/rcs/client/api/emoticon/IEmoticonApi.aidl \
+    src/com/suntek/mway/rcs/client/api/im/IGroupManagerApi.aidl \
+    src/com/suntek/mway/rcs/client/api/im/IInstantMessageApi.aidl \
+    src/com/suntek/mway/rcs/client/api/im/IPaMessageApi.aidl \
+    src/com/suntek/mway/rcs/client/api/IRCSServiceListener.aidl \
+    src/com/suntek/mway/rcs/client/api/login/ILoginApi.aidl \
+    src/com/suntek/mway/rcs/client/api/login/ILoginEventListener.aidl \
+    src/com/suntek/mway/rcs/client/api/mcloud/IMcloudFileApi.aidl \
+    src/com/suntek/mway/rcs/client/api/mcontact/IMcontactApi.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/ICapabiltyListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IConferenceCallback.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IEmoticonCallbackApi.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IEmoticonCanSendCallback.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IEmoticonPackagesNetCallbackApi.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IEmoticonSetSuccessDownListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudAuthListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudConfListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudFileListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudMsgListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudOperationCtrl.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudSdkListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudShareListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMcloudTransListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IMContactSyncListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IProfileGetCallback.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IProfileListener.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IProfilePutCallback.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/callback/IPublicAccountCallbackAPI.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/IMcloudFileApi.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/IProfileApi.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/IPublicAccountAPI.aidl \
+    src/com/suntek/mway/rcs/client/api/plugin/IRichScreenApi.aidl \
+    src/com/suntek/mway/rcs/client/api/plugincenter/IPluginCenterApi.aidl \
+    src/com/suntek/mway/rcs/client/api/registration/IRegistrationApi.aidl \
+    src/com/suntek/mway/rcs/client/api/setting/callback/IAccountEventListener.aidl \
+    src/com/suntek/mway/rcs/client/api/setting/IRcsSettingApi.aidl \
+    src/com/suntek/mway/rcs/client/api/specialnumber/ISpecialServiceNumApi.aidl
+
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE := rcs_service_aidl_static
+
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+#MAKE_XML
+include $(CLEAR_VARS)
+LOCAL_MODULE := rcs_service_aidl.xml
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+LOCAL_MODULE_TAGS := optional
+include $(BUILD_PREBUILT)
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/constant/BroadcastConstants.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/constant/BroadcastConstants.java
index 472cca8..519e1b9 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/constant/BroadcastConstants.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/constant/BroadcastConstants.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.api.constant;
 
 /**
@@ -55,6 +54,11 @@
     public static final String UI_GROUP_MANAGE_NOTIFY = "com.suntek.mway.rcs.ACTION_UI_GROUP_MANAGE_NOTIFY";
 
     /**
+     * Notify UI that group operation failed
+     */
+    public static final String UI_GROUP_ERROR = "com.suntek.mway.rcs.ACTION_UI_GROUP_ERROR";
+
+    /**
      * Notify UI that group state is invalid
      * contains parameter groupId, state
      */
@@ -66,6 +70,9 @@
     /** Notify UI that message has added to database */
     public static final String UI_MESSAGE_ADD_DATABASE = "com.suntek.mway.rcs.ACTION_UI_MESSAGE_ADD_TO_DATABASE";
 
+    /** Notify Native UI that message has been transfered to SMS */
+    public static final String UI_MESSAGE_TRANSFER_SMS = "com.suntek.mway.rcs.ACTION_UI_MESSAGE_TRANSFER_SMS";
+
     /** UI_MESSAGE_ADD_DATABASE broadcast passed parameter name chatMessage long. */
     public static final String BC_VAR_CHAT_MESSAGE = "chatMessage";
 
@@ -258,6 +265,12 @@
     /** UI_INVITE_TO_JOIN_GROUP broadcast passed parameter name alias String. */
     public static final String BC_VAR_ALIAS = "alias";
 
+    /** Error code of group operation */
+    public static final String BC_VAR_ERROR_CODE = "errorCode";
+
+    /** Description of code */
+    public static final String BC_VAR_ERROR_DESC = "errorDesc";
+
     /**
      * UI_GROUP_CHAT_MAXCOUNT_CHANGE broadcast passed parameter name maxCount String.
      */
@@ -379,6 +392,12 @@
      */
     public static final String UI_SHOW_GROUP_TRANSFER_CHAIRMAN_CONFIRM = "com.suntek.mway.rcs.ACTION_UI_SHOW_GROUP_TRANSFER_CHAIRMAN_CONFIRM";
 
+    /**
+     * The broadcast of group chairman transfer confirm
+     * parameter contains chaturi, subject, contributionId, conversationId
+     */
+    public static final String UI_SHOW_GROUP_TRANSFER_CHAIRMAN_TIMEOUT = "com.suntek.mway.rcs.ACTION_UI_SHOW_GROUP_TRANSFER_CHAIRMAN_TIMEOUT";
+
     /** ************************************** send group transfer chairman confirm broadcast end ******************************************************. */
 
     /** Invite to join a group chat timeout broadcast. */
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/im/IInstantMessageApi.aidl b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/im/IInstantMessageApi.aidl
index c7e2ae8..7c83b1c 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/im/IInstantMessageApi.aidl
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/im/IInstantMessageApi.aidl
@@ -45,7 +45,7 @@
     void sendLocation(long thread_id,long sms_id,String number, double lat,
             double lng,String text);
     void sendPaidEmo(long thread_id,long sms_id,String number, String emoid,
-            String emoImgFileName);
+            String emoName);
     void sendVCard(long thread_id,long sms_id,String number, in RCSContact rcsContact);
     void sendVCardByPath(long thread_id,long sms_id,String number, String vcardFilePath);
 
@@ -119,9 +119,9 @@
     List<MessageSessionModel> qryNonFriendMsgSessionList();
     
     void sendOne2ManyPaidEmoMessage(long thread_id, long sms_id, in List<String> numbers,
-            String emoid, String emoImgFileName);
+            String emoid, String emoName);
     void sendGroupPaidEmo(long thread_id, String conversationId, long sms_id, 
-            String emoid, String emoImgFileName, String groupId);
+            String emoid, String emoName, String groupId);
             
     List<ChatMessage> getMsgListGreatOrLessThanSpecifiedForBlack(long threadId, boolean less, int specifiedId, int number);
     MessageSessionModel getMessageSessionByThreadIdForBlack(String threadId);
@@ -195,4 +195,6 @@
     long getVideoFtMaxSize();
 
     void removeMsgWithNotificationByThread(long threadId);
+
+    void backupMessageList(in List<SimpleMsg> simpleMsgList);
 }
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/mcloud/IMcloudFileApi.aidl b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/mcloud/IMcloudFileApi.aidl
index cb26a3f..34d72e7 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/mcloud/IMcloudFileApi.aidl
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/mcloud/IMcloudFileApi.aidl
@@ -20,18 +20,17 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  * IN THE SOFTWARE.
  */
- 
 package com.suntek.mway.rcs.client.api.mcloud;
 
 interface IMcloudFileApi {
     void putFile(String localPath, String remotePath, int transOper);
     void shareFile(String fullPathInID, String shareDesc);
-    void shareFileAndSend(String fullPathInID, String shareDesc, String contact, long threadId, String beforeText, String afterText);
+    void shareFileAndSend(String fullPathInID, String shareDesc, String contact, long threadId, String smsContentTemp);
     void getShareFileList(int beginIndex, int endIndex);
     void downloadFileFromUrl(String remoteUrl, String fileName, int transOper);
 
-    void shareFileAndSendGroup(String fullPathInID, String shareDesc, long threadId, String conversationId, String groupId, String beforeText, String afterText);
-    void shareFileAndSendOne2Many(String fullPathInID, String shareDesc, in List<String> contacts, long threadId, String beforeText, String afterText);
+    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);
 
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/plugin/entity/emoticon/EmoticonBO.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/plugin/entity/emoticon/EmoticonBO.java
index 2bf0bcb..1e9a7d4 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/plugin/entity/emoticon/EmoticonBO.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/plugin/entity/emoticon/EmoticonBO.java
@@ -113,8 +113,8 @@
         emoticonStatic = source.readString();
         emoticonDynamic = source.readString();
         packageId = source.readString();
-        source.readByteArray( emoticonStaticByte );
-        source.readByteArray( emoticonDynamicByte );
+        emoticonStaticByte = source.createByteArray();
+        emoticonDynamicByte = source.createByteArray();
         userPhone = source.readString();
         boolean[] val = new boolean[ 1 ];
         source.readBooleanArray( val );
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/plugin/entity/emoticon/EmoticonConstant.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/plugin/entity/emoticon/EmoticonConstant.java
index 487b91a..6394365 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/plugin/entity/emoticon/EmoticonConstant.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/plugin/entity/emoticon/EmoticonConstant.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.api.plugin.entity.emoticon;
 
 /**
@@ -33,4 +32,7 @@
 
     /** The Constant EMO_DYNAMIC_FILE. */
     public static final int EMO_DYNAMIC_FILE = 2;
+
+    /** The Constant EMO_PACKAGE_FILE. */
+    public static final int EMO_PACKAGE_FILE = 3;
 }
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/plugin/entity/mcloudfile/TransNode.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/plugin/entity/mcloudfile/TransNode.java
index 1e8d282..4b980c5 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/plugin/entity/mcloudfile/TransNode.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/plugin/entity/mcloudfile/TransNode.java
@@ -332,7 +332,9 @@
 
         RESUME,
 
-        GET_INFO;
+        GET_INFO,
+
+        PAUSE;
 
         public static TransOper valueOf( int ordinal )
         {
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/provider/SuntekMessageData.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/provider/SuntekMessageData.java
index e2e4cd5..624351a 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/provider/SuntekMessageData.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/provider/SuntekMessageData.java
@@ -135,6 +135,9 @@
     /** Message type about paid emo. */
     public static final int MSG_TYPE_PAID_EMO = 11;
 
+    /** Message type about cloud file. */
+    public static final int MSG_TYPE_CLOUD_FILE = 12;
+
     /** Message type for MMS. */
     public static final int MSG_TYPE_MMS_SEND_REQ = 128;
 
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/provider/model/ChatMessage.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/provider/model/ChatMessage.java
index 31c382b..71632af 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/provider/model/ChatMessage.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/provider/model/ChatMessage.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.api.provider.model;
 
 import android.os.Parcel;
@@ -151,16 +150,22 @@
     /** public account message. */
     private PublicMessage publicMessage;
 
+    /** cloud file message. */
+    private CloudFileMessage cloudFileMessage;
+
     /**
      * Mark message that is blacklist message.
      */
     private int msgBlackFlag = 0;
 
-    /**
-     * Mark message need transfer continue
-     */
     private int continueFlag;
 
+    private int duration;
+
+    private String filepath;
+
+    private String thumbpath;
+
     /**
      * Instantiates a new Chat Messages.
      */
@@ -604,6 +609,24 @@
     }
 
     /**
+     * Gets the cloud file message.
+     *
+     * @return the cloud file message
+     */
+    public CloudFileMessage getCloudFileMessage() {
+        return cloudFileMessage;
+    }
+
+    /**
+     * Sets the cloud file message.
+     *
+     * @param cloudFileMessage the new cloud file message
+     */
+    public void setCloudFileMessage(CloudFileMessage cloudFileMessage) {
+        this.cloudFileMessage = cloudFileMessage;
+    }
+
+    /**
      * Get the message body.
      *
      * @return the body
@@ -675,6 +698,30 @@
         this.continueFlag = continueFlag;
     }
 
+    public int getDuration() {
+        return duration;
+    }
+
+    public void setDuration(int duration) {
+        this.duration = duration;
+    }
+
+    public String getFilepath() {
+        return filepath;
+    }
+
+    public void setFilepath(String filepath) {
+        this.filepath = filepath;
+    }
+
+    public String getThumbpath() {
+        return thumbpath;
+    }
+
+    public void setThumbpath(String thumbpath) {
+        this.thumbpath = thumbpath;
+    }
+
     /* (non-Javadoc)
      * @see android.os.Parcelable#describeContents()
      */
@@ -718,6 +765,11 @@
         dest.writeValue( publicMessage );
         dest.writeInt( msgBlackFlag );
         dest.writeInt( continueFlag );
+        dest.writeValue( cloudFileMessage );
+
+        dest.writeInt(duration);
+        dest.writeString(filepath);
+        dest.writeString(thumbpath);
 
     }
 
@@ -759,6 +811,11 @@
         publicMessage = (PublicMessage) source.readValue(PublicMessage.class.getClassLoader());
         msgBlackFlag = source.readInt();
         continueFlag = source.readInt();
+        cloudFileMessage = (CloudFileMessage) source.readValue(CloudFileMessage.class.getClassLoader());
+
+        duration = source.readInt();
+        filepath = source.readString();
+        thumbpath = source.readString();
     }
 
     /** The Constant CREATOR. */
@@ -780,22 +837,37 @@
      */
     @Override
     public String toString() {
-        return "ChatMessage [id=" + id + ", contact=" + contact
-                + ", messageId=" + messageId + ", data=" + data + ", time="
-                + time + ", filename=" + filename + ", filesize=" + filesize
-                + ", mimeType=" + mimeType + ", msgType=" + msgType
-                + ", sendReceive=" + sendReceive + ", isRead=" + isRead
-                + ", msgState=" + msgState + ", chatType=" + chatType
-                + ", threadId=" + threadId + ", conversationId="
-                + conversationId + ", contributionId=" + contributionId
-                + ", fileSelector=" + fileSelector + ", fileTransferExt="
-                + fileTransferExt + ", fileTransferId=" + fileTransferId
-                + ", fileIcon=" + fileIcon + ", msgBurnAfterReadFlag="
-                + msgBurnAfterReadFlag + ", barCycle=" + barCycle
+        StringBuffer buf = new StringBuffer();
+        buf.append("ChatMessage [id=").append(id).append(", contact=")
+            .append(contact).append(", messageId=").append(messageId)
+            .append(", data=").append(data).append(", time=").append(time)
+            .append(", filename=").append(filename).append(", filesize=").append(filesize)
+            .append(", mimeType=").append(mimeType).append(", msgType=").append(msgType)
+            .append(", sendReceive=").append(sendReceive).append(", isRead=").append(isRead)
+            .append(", msgState=").append(msgState).append(", chatType=").append(chatType)
+            .append(", threadId=").append(threadId)
+            .append(", conversationId=").append(conversationId)
+            .append(", contributionId=").append(contributionId)
+            .append(", fileSelector=").append(fileSelector)
+            .append(", fileTransferExt=").append(fileTransferExt)
+            .append(", fileTransferId=").append(fileTransferId)
+            .append(", fileIcon=").append(fileIcon)
+            .append(", msgBurnAfterReadFlag=").append(msgBurnAfterReadFlag)
+            .append(", barCycle=").append(barCycle
 //                + ", header=" + header + ", body=" + body
-                + ", publicMessage="
-                + publicMessage + "], msgBlackFlag = " + msgBlackFlag
-                + ", continueFlag = " + continueFlag;
+                    )
+            .append(", publicMessage=").append(publicMessage)
+            .append("], msgBlackFlag = ").append(msgBlackFlag)
+            .append(", continueFlag = ").append(continueFlag)
+            .append(", duration=").append(duration)
+            .append(", filepath=").append(filepath)
+            .append(", thumbpath=").append(thumbpath);
+
+        return buf.toString();
+    }
+
+    public String print() {
+        return super.toString();
     }
 
     @Override
diff --git a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/provider/model/GroupChatUser.java b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/provider/model/GroupChatUser.java
index 15e2bdb..68fd4e6 100644
--- a/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/provider/model/GroupChatUser.java
+++ b/rcs_service_aidl/src/com/suntek/mway/rcs/client/api/provider/model/GroupChatUser.java
@@ -135,7 +135,7 @@
     /**
      * Etype of user
      */
-    public static final String ETYPE_CAN_ASSIGN_AS_CHAIRMAN = "cmcccb";
+    public static final String ETYPE_CAN_ASSIGN_AS_CHAIRMAN = "gpmanage";
 
     public GroupChatUser(){
     }
diff --git a/rcs_service_api/Android.mk b/rcs_service_api/Android.mk
index 5e077e7..f372817 100644
--- a/rcs_service_api/Android.mk
+++ b/rcs_service_api/Android.mk
@@ -1,13 +1,18 @@
 LOCAL_PATH := $(call my-dir)
 
+# Make rcs_service_api.jar
 include $(CLEAR_VARS)
-
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE := rcs_service_api
+LOCAL_STATIC_JAVA_LIBRARIES := rcs_service_aidl_static
+include $(BUILD_JAVA_LIBRARY)
 
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    rcs_service_aidl
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
\ No newline at end of file
+# MAKE_XML
+include $(CLEAR_VARS)
+LOCAL_MODULE := rcs_service_api.xml
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+LOCAL_MODULE_TAGS := optional
+include $(BUILD_PREBUILT)
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 50821ca..3e17e4a 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
@@ -248,21 +248,21 @@
     }
 
     public void sendPaidEmo(long thread_id, long sms_id, String number,
-            String emoid, String emoImgFileName)
+            String emoid, String emoName)
             throws ServiceDisconnectedException {
         VerificationUtil.ApiIsNull(myApi);
         LogHelper
                 .i(String.format(
                         Locale.getDefault(),
-                        "enter method sendPaidEmo. [thread_id,sms_id,number,emoid,emoImgFileName]=%d,%d,%s,%s,%s",
-                        thread_id, sms_id, number, emoid, emoImgFileName));
+                        "enter method sendPaidEmo. [thread_id,sms_id,number,emoid,emoName]=%d,%d,%s,%s,%s",
+                        thread_id, sms_id, number, emoid, emoName));
         if (!VerificationUtil.isNumber(number)) {
             LogHelper.i("number field value error");
             return;
         }
         try {
             myApi.sendPaidEmo(thread_id, sms_id, number, emoid,
-                    emoImgFileName);
+                    emoName);
         } catch (Exception ex) {
             LogHelper.e(ex.getMessage(), ex);
         }
@@ -1014,40 +1014,40 @@
     }
 
     public void sendGroupPaidEmo(long thread_id, String conversationId,
-            long sms_id, String emoid, String emoImgFileName, String groupId)
+            long sms_id, String emoid, String emoName, String groupId)
             throws ServiceDisconnectedException {
         VerificationUtil.ApiIsNull(myApi);
         LogHelper
                 .i(String.format(
                         Locale.getDefault(),
-                        "enter method:sendGroupPaidEmo. [thread_id,conversationId,sms_id,emoid,emoImgFileName,groupId]=%d,%s,%d,%s,%s,%s",
+                        "enter method:sendGroupPaidEmo. [thread_id,conversationId,sms_id,emoid,emoName,groupId]=%d,%s,%d,%s,%s,%s",
                         thread_id, conversationId, sms_id, emoid,
-                        emoImgFileName, groupId));
+                        emoName, groupId));
         try {
             myApi.sendGroupPaidEmo(thread_id, conversationId, sms_id, emoid,
-                    emoImgFileName, groupId);
+                    emoName, groupId);
         } catch (Exception ex) {
             LogHelper.e(ex.getMessage(), ex);
         }
     }
 
     public void sendOne2ManyPaidEmoMessage(long thread_id, long sms_id,
-            List<String> numbers, String emoid, String emoImgFileName)
+            List<String> numbers, String emoid, String emoName)
             throws ServiceDisconnectedException {
         VerificationUtil.ApiIsNull(myApi);
         LogHelper
                 .i(String.format(
                         Locale.getDefault(),
-                        "enter method:sendOne2ManyPaidEmoMessage. [thread_id,sms_id,numbers,emoid,emoImgFileName]=%d,%d,%s,%s,%s",
+                        "enter method:sendOne2ManyPaidEmoMessage. [thread_id,sms_id,numbers,emoid,emoName]=%d,%d,%s,%s,%s",
                         thread_id, sms_id, numbers.toString(), emoid,
-                        emoImgFileName));
+                        emoName));
         if (!VerificationUtil.isAllNumber(numbers)) {
             LogHelper.i("number field value error");
             return;
         }
         try {
             myApi.sendOne2ManyPaidEmoMessage(thread_id, sms_id, VerificationUtil.formatNumbers(numbers), emoid,
-                    emoImgFileName);
+                    emoName);
         } catch (Exception ex) {
             LogHelper.e(ex.getMessage(), ex);
         }
@@ -1638,4 +1638,16 @@
             LogHelper.e(ex.getMessage(), ex);
         }
     }
+
+    public void backupMessageList(List<SimpleMsg> simpleMsgList)
+            throws ServiceDisconnectedException {
+        LogHelper.i(String.format(Locale.getDefault(),
+                "enter  method:backupMessageList. [simpleMsgList]=%s", simpleMsgList.toString()));
+        VerificationUtil.ApiIsNull(myApi);
+        try {
+            myApi.backupMessageList(simpleMsgList);
+        } 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 f7de0a8..d732dfd 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
@@ -120,55 +120,49 @@
     }
 
     public void shareFileAndSend(String fullPathInID, String shareDesc,
-            String contact, long threadId, String beforeText, String afterText)
+            String contact, long threadId, String smsContentTemp)
             throws ServiceDisconnectedException {
         VerificationUtil.ApiIsNull(myApi);
         LogHelper
                 .i(String.format(
                         Locale.getDefault(),
-                        "enter method:shareFileAndSend. [fullPathInID,shareDesc,contact,threadId,beforeText,afterText]=%s,%s,%s,%d,%s,%s",
-                        fullPathInID, shareDesc, contact, threadId, beforeText,
-                        afterText));
+                        "enter method:shareFileAndSend. [fullPathInID,shareDesc,contact,threadId,smsContentTemp]=%s,%s,%s,%d,%s",
+                        fullPathInID, shareDesc, contact, threadId, smsContentTemp));
         try {
-            myApi.shareFileAndSend(fullPathInID, shareDesc, contact, threadId,
-                    beforeText, afterText);
+            myApi.shareFileAndSend(fullPathInID, shareDesc, contact, threadId, smsContentTemp);
         } catch (Exception ex) {
             LogHelper.e(ex.getMessage(), ex);
         }
     }
 
     public void shareFileAndSendGroup(String fullPathInID, String shareDesc,
-            long threadId, String conversationId, String groupId,
-            String beforeText, String afterText)
+            long threadId, String conversationId, String groupId)
             throws ServiceDisconnectedException {
         VerificationUtil.ApiIsNull(myApi);
         LogHelper
                 .i(String.format(
                         Locale.getDefault(),
-                        "enter method:shareFileAndSendGroup. [fullPathInID,shareDesc,threadId,conversationId,groupId,beforeText,afterText]=%s,%s,%d,%s,%s,%s,%s",
-                        fullPathInID, shareDesc, threadId, conversationId,
-                        groupId, beforeText, afterText));
+                        "enter method:shareFileAndSendGroup. [fullPathInID,shareDesc,threadId,conversationId,groupId]=%s,%s,%d,%s,%s",
+                        fullPathInID, shareDesc, threadId, conversationId, groupId));
         try {
             myApi.shareFileAndSendGroup(fullPathInID, shareDesc, threadId,
-                    conversationId, groupId, beforeText, afterText);
+                    conversationId, groupId);
         } catch (Exception ex) {
             LogHelper.e(ex.getMessage(), ex);
         }
     }
 
     public void shareFileAndSendOne2Many(String fullPathInID, String shareDesc,
-            List<String> contacts, long threadId, String beforeText,
-            String afterText) throws ServiceDisconnectedException {
+            List<String> contacts, long threadId, String smsContentTemp) throws ServiceDisconnectedException {
         VerificationUtil.ApiIsNull(myApi);
         LogHelper
                 .i(String.format(
                         Locale.getDefault(),
-                        "enter method:shareFileAndSendOne2Many. [fullPathInID,shareDesc,contacts,threadId,beforeText,afterText]=%s,%s,%s,%d,%s,%s",
-                        fullPathInID, shareDesc, contacts.toString(), threadId,
-                        beforeText, afterText));
+                        "enter method:shareFileAndSendOne2Many. [fullPathInID,shareDesc,contacts,threadId,smsContentTemp]=%s,%s,%s,%d,%s",
+                        fullPathInID, shareDesc, contacts.toString(), threadId, smsContentTemp));
         try {
             myApi.shareFileAndSendOne2Many(fullPathInID, shareDesc, contacts,
-                    threadId, beforeText, afterText);
+                    threadId, smsContentTemp);
         } catch (Exception ex) {
             LogHelper.e(ex.getMessage(), ex);
         }