OSDN Git Service

auto import from //depot/cupcake/@135843
authorThe Android Open Source Project <initial-contribution@android.com>
Wed, 4 Mar 2009 02:28:50 +0000 (18:28 -0800)
committerThe Android Open Source Project <initial-contribution@android.com>
Wed, 4 Mar 2009 02:28:50 +0000 (18:28 -0800)
287 files changed:
Android.mk [deleted file]
AndroidManifest.xml [deleted file]
MODULE_LICENSE_APACHE2 [deleted file]
NOTICE [deleted file]
libwbxml/Android.mk [deleted file]
libwbxml/include/csp13_data.h [deleted file]
libwbxml/include/csp13_hash.h [deleted file]
libwbxml/include/expat_parser.h [deleted file]
libwbxml/include/imps_encoder.h [deleted file]
libwbxml/include/syncml_data.h [deleted file]
libwbxml/include/wbxml_const.h [deleted file]
libwbxml/include/wbxml_encoder.h [deleted file]
libwbxml/include/wbxml_parser.h [deleted file]
libwbxml/include/wbxml_stl.h [deleted file]
libwbxml/include/wbxml_tabledef.h [deleted file]
libwbxml/include/xml2wbxml.h [deleted file]
libwbxml/include/xml_handler.h [deleted file]
libwbxml/src/csp13inttags_hash.c [deleted file]
libwbxml/src/csp13tags_hash.c [deleted file]
libwbxml/src/csp13values_hash.c [deleted file]
libwbxml/src/expat_parser.cpp [deleted file]
libwbxml/src/gperf/csp13inttags.gperf [deleted file]
libwbxml/src/gperf/csp13tags.gperf [deleted file]
libwbxml/src/gperf/csp13values.gperf [deleted file]
libwbxml/src/imps_encoder.cpp [deleted file]
libwbxml/src/wbxml_jni.cpp [deleted file]
libwbxml/src/wbxml_parser.cpp [deleted file]
libwbxml/src/xml2wbxml.cpp [deleted file]
libwbxml/test/alltests.c [deleted file]
libwbxml/test/imps_encoder_test.cpp [deleted file]
libwbxml/test/imps_parser_test.cpp [deleted file]
libwbxml/test/syncml_parser_test.cpp [deleted file]
plugin/Android.mk [deleted file]
plugin/com/android/im/plugin/BrandingResourceIDs.java [deleted file]
plugin/com/android/im/plugin/IImPlugin.aidl [deleted file]
plugin/com/android/im/plugin/IPasswordDigest.aidl [deleted file]
plugin/com/android/im/plugin/IPresenceMapping.aidl [deleted file]
plugin/com/android/im/plugin/ImConfigNames.java [deleted file]
plugin/com/android/im/plugin/ImPluginConstants.java [deleted file]
plugin/com/android/im/plugin/ImPluginInfo.aidl [deleted file]
plugin/com/android/im/plugin/ImPluginInfo.java [deleted file]
plugin/com/android/im/plugin/ImpsConfigNames.java [deleted file]
res/drawable/avatar_unknown.png [deleted file]
res/drawable/background_textfield.9.png [deleted file]
res/drawable/chat_history_selector.xml [deleted file]
res/drawable/dashboard_background.xml [deleted file]
res/drawable/dashboard_highlight.xml [deleted file]
res/drawable/dashboard_highlight_selected.9.png [deleted file]
res/drawable/group_chat.png [deleted file]
res/drawable/group_chat_new.png [deleted file]
res/drawable/ic_im_block.png [deleted file]
res/drawable/ic_im_message_not_sent.png [deleted file]
res/drawable/ic_launcher_im.png [deleted file]
res/drawable/ic_menu_my_profile.png [deleted file]
res/drawable/ic_menu_view_profile.png [deleted file]
res/drawable/im_logo.png [deleted file]
res/drawable/imlogo_s.png [deleted file]
res/drawable/list_item_im_bubble.9.png [deleted file]
res/drawable/picture_frame_background.9.png [deleted file]
res/drawable/shape_separator.xml [deleted file]
res/drawable/status_chat.png [deleted file]
res/drawable/status_chat_new.png [deleted file]
res/drawable/text_divider_horizontal.9.png [deleted file]
res/drawable/textfield_im_pressed.9.png [deleted file]
res/drawable/textfield_im_received.9.png [deleted file]
res/drawable/textfield_im_selected.9.png [deleted file]
res/layout/account_activity.xml [deleted file]
res/layout/add_contact_activity.xml [deleted file]
res/layout/blocked_contact_view.xml [deleted file]
res/layout/blocked_contacts_activity.xml [deleted file]
res/layout/chat_view.xml [deleted file]
res/layout/contact_list_filter_view.xml [deleted file]
res/layout/contact_list_view.xml [deleted file]
res/layout/contact_presence_activity.xml [deleted file]
res/layout/contact_view.xml [deleted file]
res/layout/contacts_picker_activity.xml [deleted file]
res/layout/dashboard.xml [deleted file]
res/layout/dashboard_item.xml [deleted file]
res/layout/empty_contact_group_view.xml [deleted file]
res/layout/empty_conversation_group_view.xml [deleted file]
res/layout/group_view.xml [deleted file]
res/layout/imglist_item.xml [deleted file]
res/layout/new_message_item.xml [deleted file]
res/layout/preference_activity.xml [deleted file]
res/layout/signing_in_activity.xml [deleted file]
res/layout/simple_input_activity.xml [deleted file]
res/layout/smiley_menu_item.xml [deleted file]
res/menu/chat_screen_menu.xml [deleted file]
res/menu/contact_list_menu.xml [deleted file]
res/values-cs/strings.xml [deleted file]
res/values-de/strings.xml [deleted file]
res/values-es/strings.xml [deleted file]
res/values-fr/strings.xml [deleted file]
res/values-it/strings.xml [deleted file]
res/values-ja/strings.xml [deleted file]
res/values-ko/strings.xml [deleted file]
res/values-nb/strings.xml [deleted file]
res/values-nl/strings.xml [deleted file]
res/values-pl/strings.xml [deleted file]
res/values-ru/strings.xml [deleted file]
res/values-zh-rCN/strings.xml [deleted file]
res/values-zh-rTW/strings.xml [deleted file]
res/values/colors.xml [deleted file]
res/values/strings.xml [deleted file]
res/xml/preferences.xml [deleted file]
samples/PluginDemo/Android.mk [deleted file]
samples/PluginDemo/AndroidManifest.xml [deleted file]
samples/PluginDemo/res/drawable/chat.png [deleted file]
samples/PluginDemo/res/drawable/chat_new.png [deleted file]
samples/PluginDemo/res/drawable/im_logo.png [deleted file]
samples/PluginDemo/res/drawable/im_logo_splashscr.png [deleted file]
samples/PluginDemo/res/values-cs/strings.xml [deleted file]
samples/PluginDemo/res/values-de/strings.xml [deleted file]
samples/PluginDemo/res/values-es/strings.xml [deleted file]
samples/PluginDemo/res/values-fr/strings.xml [deleted file]
samples/PluginDemo/res/values-it/strings.xml [deleted file]
samples/PluginDemo/res/values-ja/strings.xml [deleted file]
samples/PluginDemo/res/values-ko/strings.xml [deleted file]
samples/PluginDemo/res/values-nb/strings.xml [deleted file]
samples/PluginDemo/res/values-nl/strings.xml [deleted file]
samples/PluginDemo/res/values-pl/strings.xml [deleted file]
samples/PluginDemo/res/values-ru/strings.xml [deleted file]
samples/PluginDemo/res/values-zh-rCN/strings.xml [deleted file]
samples/PluginDemo/res/values-zh-rTW/strings.xml [deleted file]
samples/PluginDemo/res/values/strings.xml [deleted file]
samples/PluginDemo/src/com/android/im/plugin/demo/DemoImPlugin.java [deleted file]
samples/PluginDemo/src/com/android/im/plugin/demo/DemoPresenceMapping.java [deleted file]
src/com/android/im/IChatListener.aidl [deleted file]
src/com/android/im/IChatSession.aidl [deleted file]
src/com/android/im/IChatSessionListener.aidl [deleted file]
src/com/android/im/IChatSessionManager.aidl [deleted file]
src/com/android/im/IConnectionCreationListener.aidl [deleted file]
src/com/android/im/IConnectionListener.aidl [deleted file]
src/com/android/im/IContactList.aidl [deleted file]
src/com/android/im/IContactListListener.aidl [deleted file]
src/com/android/im/IContactListManager.aidl [deleted file]
src/com/android/im/IImConnection.aidl [deleted file]
src/com/android/im/IInvitationListener.aidl [deleted file]
src/com/android/im/IRemoteImService.aidl [deleted file]
src/com/android/im/ISubscriptionListener.aidl [deleted file]
src/com/android/im/app/AccountActivity.java [deleted file]
src/com/android/im/app/AddContactActivity.java [deleted file]
src/com/android/im/app/BlockedContactView.java [deleted file]
src/com/android/im/app/BlockedContactsActivity.java [deleted file]
src/com/android/im/app/BrandingResources.java [deleted file]
src/com/android/im/app/ChatBackgroundMaker.java [deleted file]
src/com/android/im/app/ChatView.java [deleted file]
src/com/android/im/app/ChooseAccountActivity.java [deleted file]
src/com/android/im/app/ContactListActivity.java [deleted file]
src/com/android/im/app/ContactListFilterView.java [deleted file]
src/com/android/im/app/ContactListTreeAdapter.java [deleted file]
src/com/android/im/app/ContactListView.java [deleted file]
src/com/android/im/app/ContactPresenceActivity.java [deleted file]
src/com/android/im/app/ContactView.java [deleted file]
src/com/android/im/app/ContactsPickerActivity.java [deleted file]
src/com/android/im/app/Dashboard.java [deleted file]
src/com/android/im/app/DatabaseUtils.java [deleted file]
src/com/android/im/app/ErrorResUtils.java [deleted file]
src/com/android/im/app/FrontDoorPlugin.java [deleted file]
src/com/android/im/app/ImApp.java [deleted file]
src/com/android/im/app/ImRingtonePreference.java [deleted file]
src/com/android/im/app/ImUrlActivity.java [deleted file]
src/com/android/im/app/ImageListAdapter.java [deleted file]
src/com/android/im/app/ImpsAddressUtils.java [deleted file]
src/com/android/im/app/IntTrie.java [deleted file]
src/com/android/im/app/Markup.java [deleted file]
src/com/android/im/app/MessageView.java [deleted file]
src/com/android/im/app/NewChatActivity.java [deleted file]
src/com/android/im/app/PreferenceActivity.java [deleted file]
src/com/android/im/app/PresenceUtils.java [deleted file]
src/com/android/im/app/ProviderDef.java [deleted file]
src/com/android/im/app/SettingActivity.java [deleted file]
src/com/android/im/app/SigningInActivity.java [deleted file]
src/com/android/im/app/SignoutActivity.java [deleted file]
src/com/android/im/app/SimpleAlertHandler.java [deleted file]
src/com/android/im/app/SimpleInputActivity.java [deleted file]
src/com/android/im/app/Ticker.java [deleted file]
src/com/android/im/app/UserPresenceView.java [deleted file]
src/com/android/im/app/adapter/ChatListenerAdapter.java [deleted file]
src/com/android/im/app/adapter/ChatSessionListenerAdapter.java [deleted file]
src/com/android/im/app/adapter/ConnectionListenerAdapter.java [deleted file]
src/com/android/im/app/adapter/ContactListListenerAdapter.java [deleted file]
src/com/android/im/engine/Address.java [deleted file]
src/com/android/im/engine/AddressParcelHelper.java [deleted file]
src/com/android/im/engine/ChatGroup.java [deleted file]
src/com/android/im/engine/ChatGroupManager.java [deleted file]
src/com/android/im/engine/ChatSession.java [deleted file]
src/com/android/im/engine/ChatSessionListener.java [deleted file]
src/com/android/im/engine/ChatSessionManager.java [deleted file]
src/com/android/im/engine/ConnectionConfig.java [deleted file]
src/com/android/im/engine/ConnectionFactory.java [deleted file]
src/com/android/im/engine/ConnectionListener.java [deleted file]
src/com/android/im/engine/Contact.aidl [deleted file]
src/com/android/im/engine/Contact.java [deleted file]
src/com/android/im/engine/ContactList.java [deleted file]
src/com/android/im/engine/ContactListListener.java [deleted file]
src/com/android/im/engine/ContactListManager.java [deleted file]
src/com/android/im/engine/GroupListener.java [deleted file]
src/com/android/im/engine/GroupMemberListener.java [deleted file]
src/com/android/im/engine/HeartbeatService.java [deleted file]
src/com/android/im/engine/ImConnection.java [deleted file]
src/com/android/im/engine/ImEntity.java [deleted file]
src/com/android/im/engine/ImErrorInfo.aidl [deleted file]
src/com/android/im/engine/ImErrorInfo.java [deleted file]
src/com/android/im/engine/ImException.java [deleted file]
src/com/android/im/engine/Invitation.aidl [deleted file]
src/com/android/im/engine/Invitation.java [deleted file]
src/com/android/im/engine/InvitationListener.java [deleted file]
src/com/android/im/engine/LoginInfo.java [deleted file]
src/com/android/im/engine/Message.aidl [deleted file]
src/com/android/im/engine/Message.java [deleted file]
src/com/android/im/engine/MessageListener.java [deleted file]
src/com/android/im/engine/PrefManager.java [deleted file]
src/com/android/im/engine/Presence.aidl [deleted file]
src/com/android/im/engine/Presence.java [deleted file]
src/com/android/im/engine/SmsService.java [deleted file]
src/com/android/im/engine/SubscriptionRequestListener.java [deleted file]
src/com/android/im/engine/SystemService.java [deleted file]
src/com/android/im/imps/AsyncCompletion.java [deleted file]
src/com/android/im/imps/AsyncTransaction.java [deleted file]
src/com/android/im/imps/CirChannel.java [deleted file]
src/com/android/im/imps/CustomPasswordDigest.java [deleted file]
src/com/android/im/imps/CustomPresenceMapping.java [deleted file]
src/com/android/im/imps/DataChannel.java [deleted file]
src/com/android/im/imps/DefaultPresenceMapping.java [deleted file]
src/com/android/im/imps/HttpCirChannel.java [deleted file]
src/com/android/im/imps/HttpDataChannel.java [deleted file]
src/com/android/im/imps/ImpsAddress.java [deleted file]
src/com/android/im/imps/ImpsChatGroupManager.java [deleted file]
src/com/android/im/imps/ImpsChatSessionManager.java [deleted file]
src/com/android/im/imps/ImpsClientCapability.java [deleted file]
src/com/android/im/imps/ImpsConnection.java [deleted file]
src/com/android/im/imps/ImpsConnectionConfig.java [deleted file]
src/com/android/im/imps/ImpsConstants.java [deleted file]
src/com/android/im/imps/ImpsContactListAddress.java [deleted file]
src/com/android/im/imps/ImpsContactListManager.java [deleted file]
src/com/android/im/imps/ImpsErrorInfo.java [deleted file]
src/com/android/im/imps/ImpsGroupAddress.java [deleted file]
src/com/android/im/imps/ImpsLog.java [deleted file]
src/com/android/im/imps/ImpsPresenceUtils.java [deleted file]
src/com/android/im/imps/ImpsSession.java [deleted file]
src/com/android/im/imps/ImpsTags.java [deleted file]
src/com/android/im/imps/ImpsTransaction.java [deleted file]
src/com/android/im/imps/ImpsTransactionManager.java [deleted file]
src/com/android/im/imps/ImpsUserAddress.java [deleted file]
src/com/android/im/imps/ImpsUtils.java [deleted file]
src/com/android/im/imps/MultiPhaseTransaction.java [deleted file]
src/com/android/im/imps/ParserException.java [deleted file]
src/com/android/im/imps/PasswordDigest.java [deleted file]
src/com/android/im/imps/PresenceMapping.java [deleted file]
src/com/android/im/imps/PresencePollingManager.java [deleted file]
src/com/android/im/imps/Primitive.java [deleted file]
src/com/android/im/imps/PrimitiveContentHandler.java [deleted file]
src/com/android/im/imps/PrimitiveElement.java [deleted file]
src/com/android/im/imps/PrimitiveParser.java [deleted file]
src/com/android/im/imps/PrimitiveSerializer.java [deleted file]
src/com/android/im/imps/PtsCodes.java [deleted file]
src/com/android/im/imps/PtsPrimitiveParser.java [deleted file]
src/com/android/im/imps/PtsPrimitiveSerializer.java [deleted file]
src/com/android/im/imps/SerializerException.java [deleted file]
src/com/android/im/imps/ServerTransaction.java [deleted file]
src/com/android/im/imps/ServerTransactionListener.java [deleted file]
src/com/android/im/imps/SimpleAsyncTransaction.java [deleted file]
src/com/android/im/imps/SmsAssembler.java [deleted file]
src/com/android/im/imps/SmsCirChannel.java [deleted file]
src/com/android/im/imps/SmsDataChannel.java [deleted file]
src/com/android/im/imps/SmsSplitter.java [deleted file]
src/com/android/im/imps/StandardPasswordDigest.java [deleted file]
src/com/android/im/imps/TcpCirChannel.java [deleted file]
src/com/android/im/imps/WbxmlParser.java [deleted file]
src/com/android/im/imps/WbxmlPrimitiveParser.java [deleted file]
src/com/android/im/imps/WbxmlPrimitiveSerializer.java [deleted file]
src/com/android/im/imps/WbxmlSerializer.java [deleted file]
src/com/android/im/imps/XmlPrimitiveParser.java [deleted file]
src/com/android/im/imps/XmlPrimitiveSerializer.java [deleted file]
src/com/android/im/receiver/ImServiceAutoStarter.java [deleted file]
src/com/android/im/service/AndroidHeartBeatService.java [deleted file]
src/com/android/im/service/AndroidSmsService.java [deleted file]
src/com/android/im/service/AndroidSystemService.java [deleted file]
src/com/android/im/service/ChatSessionAdapter.java [deleted file]
src/com/android/im/service/ChatSessionManagerAdapter.java [deleted file]
src/com/android/im/service/ContactListAdapter.java [deleted file]
src/com/android/im/service/ContactListManagerAdapter.java [deleted file]
src/com/android/im/service/ImConnectionAdapter.java [deleted file]
src/com/android/im/service/ImServiceConstants.java [deleted file]
src/com/android/im/service/RemoteImService.java [deleted file]
src/com/android/im/service/StatusBarNotifier.java [deleted file]

diff --git a/Android.mk b/Android.mk
deleted file mode 100644 (file)
index ee5fe32..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := eng 
-
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files) \
-                       src/com/android/im/IChatSession.aidl \
-                       src/com/android/im/IChatSessionListener.aidl \
-                       src/com/android/im/IInvitationListener.aidl \
-                       src/com/android/im/IChatSessionManager.aidl \
-                       src/com/android/im/IConnectionListener.aidl \
-                       src/com/android/im/IContactList.aidl \
-                       src/com/android/im/IContactListListener.aidl \
-                       src/com/android/im/IContactListManager.aidl \
-                       src/com/android/im/IImConnection.aidl \
-                       src/com/android/im/IChatListener.aidl \
-                       src/com/android/im/IRemoteImService.aidl \
-                       src/com/android/im/ISubscriptionListener.aidl \
-                       src/com/android/im/IConnectionCreationListener.aidl \
-
-# Filter out the plugin and samples when build IM.apk
-LOCAL_SRC_FILES := $(filter-out \
-                       plugin/% samples/% \
-                       ,$(LOCAL_SRC_FILES))
-
-LOCAL_PACKAGE_NAME := IM
-
-# TODO: Remove dependency of application on the test runner (android.test.runner)
-# library.
-LOCAL_JAVA_LIBRARIES := android.test.runner \
-                        com.android.im.plugin \
-#                        com.android.providers.im.plugin
-
-# LOCAL_REQUIRED_MODULES must go before BUILD_PACKAGE
-LOCAL_REQUIRED_MODULES := libwbxml libwbxml_jni ImProvider
-
-include $(BUILD_PACKAGE)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
deleted file mode 100644 (file)
index 09038af..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/IM/AndroidManifest.xml
- *
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.android.im" android:sharedUserId="android.uid.im"
-    android:sharedUserLabel="@string/perm_label">
-
-    <uses-permission android:name="com.android.providers.im.permission.READ_ONLY" />
-    <uses-permission android:name="com.android.providers.im.permission.WRITE_ONLY" />
-    <uses-permission android:name="android.permission.WAKE_LOCK" />
-    <uses-permission android:name="android.permission.VIBRATE" />
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.SEND_SMS" />
-    <uses-permission android:name="android.permission.RECEIVE_SMS" />
-    <uses-permission android:name="android.permission.READ_CONTACTS" />
-    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
-    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
-    <uses-permission android:name="com.android.im.permission.IM_SERVICE" />
-
-    <permission android:name="com.android.im.permission.IM_SERVICE"
-            android:permissionGroup="android.permission-group.MESSAGES"
-            android:protectionLevel="dangerous"
-            android:label="@string/perm_label"
-            android:description="@string/perm_desc" />
-
-    <application android:name=".app.ImApp"
-             android:label="@string/im_label"
-             android:icon="@drawable/ic_launcher_im"
-             android:taskAffinity="android.task.im">
-        <uses-library android:name="com.android.im.plugin" />
-        <!-- TODO: Remove dependency of application on the test runner
-             (android.test) library. -->
-        <uses-library android:name="android.test.runner" />
-
-        <service android:name=".app.FrontDoorPlugin">
-            <intent-filter>
-                <action android:name="android.im.plugin" />
-            </intent-filter>
-        </service>
-
-        <service android:name=".service.RemoteImService"
-            android:process="android.process.im"
-            android:exported="true"
-            android:permission="com.android.im.permission.IM_SERVICE">
-            <intent-filter>
-                <action android:name="com.android.im.IRemoteImService" />
-                <action android:name="com.android.im.SERVICE" />
-            </intent-filter>
-        </service>
-
-        <activity android:name=".app.ChooseAccountActivity"
-                android:theme="@android:style/Theme.NoDisplay">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <action android:name="android.intent.action.VIEW" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".app.ImUrlActivity" >
-            <intent-filter>
-                <action android:name="android.intent.action.SENDTO" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="com.android.im.category.AIM" />
-                <category android:name="com.android.im.category.MSN" />
-                <category android:name="com.android.im.category.YAHOO" />
-                <data android:scheme="im" />
-            </intent-filter>
-
-            <intent-filter>
-                <action android:name="android.intent.action.SENDTO" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <data android:scheme="imto" android:host="aim"/>
-                <data android:scheme="imto" android:host="yahoo"/>
-                <data android:scheme="imto" android:host="msn"/>
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".app.AccountActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.EDIT" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="com.android.im.IMPS_CATEGORY" />
-                <data android:mimeType="vnd.android.cursor.item/im-accounts" />
-            </intent-filter>
-            <intent-filter>
-                <action android:name="android.intent.action.INSERT" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="com.android.im.IMPS_CATEGORY" />
-                <data android:mimeType="vnd.android.cursor.item/im-providers" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".app.SigningInActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".app.SignoutActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".app.ContactListActivity" android:launchMode="singleTop">
-            <intent-filter>
-                <action android:name="android.intent.action.VIEW"/>
-                <category android:name="android.intent.category.DEFAULT"/>
-                <category android:name="com.android.im.IMPS_CATEGORY" />
-                <data android:mimeType="vnd.android.cursor.dir/im-contacts"/>
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".app.AddContactActivity"
-            android:label="@string/add_contact_title"/>
-
-        <activity android:name=".app.NewChatActivity"
-                android:configChanges="orientation|keyboardHidden"
-                android:windowSoftInputMode="stateHidden">
-            <intent-filter>
-                <action android:name="android.intent.action.VIEW" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="com.android.im.IMPS_CATEGORY" />
-                <data android:mimeType="vnd.android.cursor.item/im-chats" />
-            </intent-filter>
-            <intent-filter>
-                <action android:name="android.intent.action.VIEW" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <data android:mimeType="vnd.android.cursor.item/im-invitations" />
-            </intent-filter>
-            <intent-filter>
-                <action android:name="android.intent.action.IM_MANAGE_SUBSCRIPTION"/>
-                <category android:name="android.intent.category.DEFAULT"/>
-                <data android:mimeType="vnd.android.cursor.item/im-contacts"/>
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".app.ContactsPickerActivity" android:label="@string/contacts_picker_title">
-            <intent-filter>
-                <action android:name="android.intent.action.PICK" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <data android:mimeType="vnd.android.cursor.dir/im-contacts" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".app.BlockedContactsActivity" android:label="@string/blocked_list_title">
-            <intent-filter>
-                <action android:name="android.intent.action.VIEW" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <data android:mimeType="vnd.android.cursor.dir/im-blockedList" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".app.ContactPresenceActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.VIEW" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <data android:mimeType="vnd.android.cursor.item/im-contacts" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".app.PreferenceActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.VIEW" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".app.SettingActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.VIEW" />
-                <category android:name="com.android.im.IMPS_CATEGORY" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <data android:mimeType="vnd.android-dir/im-providerSettings" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".app.SimpleInputActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.VIEW" />
-            </intent-filter>
-        </activity>
-
-        <receiver android:name=".receiver.ImServiceAutoStarter"
-            android:process="android.process.im">
-            <intent-filter>
-                <action android:name="android.intent.action.BOOT_COMPLETED"/>
-            </intent-filter>
-        </receiver>
-
-    </application>
-
-</manifest>
diff --git a/MODULE_LICENSE_APACHE2 b/MODULE_LICENSE_APACHE2
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/NOTICE b/NOTICE
deleted file mode 100644 (file)
index 6f6e49d..0000000
--- a/NOTICE
+++ /dev/null
@@ -1,191 +0,0 @@
-
-   Copyright (c) 2007-2008, Esmertec AG.
-   Copyright (c) 2005-2008, The Android Open Source Project
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/libwbxml/Android.mk b/libwbxml/Android.mk
deleted file mode 100644 (file)
index 5f32056..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-# Tags shared by all non-test wbxml modules
-wbxml_module_tags := eng user
-
-# wbxml core library: libwbxml.so
-# ---------------------------------------
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES :=          \
-    src/wbxml_parser.cpp    \
-    src/imps_encoder.cpp    \
-    src/csp13tags_hash.c    \
-    src/csp13values_hash.c  \
-    src/csp13inttags_hash.c
-
-LOCAL_C_INCLUDES :=         \
-    $(LOCAL_PATH)/include
-
-LOCAL_CFLAGS += -DPLATFORM_ANDROID
-
-# SyncML support
-LOCAL_CFLAGS += -DSUPPORT_SYNCML
-
-LOCAL_SHARED_LIBRARIES +=   \
-    libutils
-
-LOCAL_MODULE_TAGS := $(wbxml_module_tags)
-
-LOCAL_MODULE := libwbxml
-
-include $(BUILD_SHARED_LIBRARY)
-
-# xml2wbxml library: libxml2wbxml.so
-# ---------------------------------------
-include $(CLEAR_VARS)
-
-# This requires expat
-
-LOCAL_SRC_FILES :=          \
-    src/xml2wbxml.cpp       \
-    src/expat_parser.cpp
-
-LOCAL_C_INCLUDES :=         \
-    $(LOCAL_PATH)/include   \
-    external/expat/lib
-
-LOCAL_CFLAGS += -DPLATFORM_ANDROID
-
-LOCAL_SHARED_LIBRARIES +=   \
-    libutils                \
-    libwbxml                \
-    libexpat
-
-LOCAL_MODULE_TAGS := $(wbxml_module_tags)
-
-LOCAL_MODULE := libxml2wbxml
-
-include $(BUILD_SHARED_LIBRARY)
-
-# wbxml unit test: wbxml_test
-# ---------------------------------------
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES :=              \
-    test/alltests.c             \
-    test/imps_encoder_test.cpp  \
-    test/imps_parser_test.cpp
-
-LOCAL_C_INCLUDES :=             \
-    $(LOCAL_PATH)/include       \
-    external/embunit/inc         \
-    external/expat/lib
-
-LOCAL_CFLAGS += -DPLATFORM_ANDROID
-
-# SyncML support
-LOCAL_CFLAGS += -DSUPPORT_SYNCML
-LOCAL_SRC_FILES += test/syncml_parser_test.cpp
-
-LOCAL_SHARED_LIBRARIES +=   \
-    libwbxml                \
-    libxml2wbxml            \
-    libembunit              \
-    libutils                \
-    libexpat
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_MODULE := wbxmltest
-
-include $(BUILD_EXECUTABLE)
-
-# wbxml JNI: libwbxml_jni.so
-# ------------------------------------------------
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES :=      \
-    src/wbxml_jni.cpp
-
-LOCAL_C_INCLUDES :=         \
-    $(LOCAL_PATH)/include   \
-    external/expat/lib \
-    $(JNI_H_INCLUDE)
-
-LOCAL_CFLAGS += -DPLATFORM_ANDROID
-
-LOCAL_SHARED_LIBRARIES +=   \
-    libwbxml                \
-    libutils                \
-    libcutils                \
-    libexpat
-
-LOCAL_MODULE_TAGS := $(wbxml_module_tags)
-
-LOCAL_MODULE := libwbxml_jni
-
-include $(BUILD_SHARED_LIBRARY)
-
diff --git a/libwbxml/include/csp13_data.h b/libwbxml/include/csp13_data.h
deleted file mode 100644 (file)
index 9737295..0000000
+++ /dev/null
@@ -1,763 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IMPS_CSP13_H
-#define IMPS_CSP13_H
-
-#include "wbxml_tabledef.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Extracted from OMA-TS-IMPS_CSP_WBXML-V1_3-20070123-A.pdf
- * Note:
- *   - IMPS 1.2 tags that have been removed in IMPS_CSP_WBXML-V1_3-20070123:
- *     - tag page 0 value 0x18 "InUse" and tag page 7 value 0x1F "Users"
- *     - tag page 2 value 0x06 "AttListFunc", 0x08 "CAAUT" and 0x30 "REACT"
- *     - tag page 3 value 0x05 "AcceptedCharset" and 0x06 "AcceptedContentLength"
- *     - tag page 4 value 0x05 "CancelAuth-Request", value 0x19 "PresenceAuth-Request",
- *                  value 0x1A "PresenceAuth-User", value 0x1F "GetReactiveAuthStatus-Request",
- *                  value 0x20 "GetReactiveAuthStatus-Response" and value 0x1E "AutoSubscribe"
- *
- *     We keep them in order to support IMPS 1.2
- *
- *   - value token "History" has a same value 0x3D as "GROUP_ID".
- */
-
-/* Common code page (0x00) */
-static const TokenData csp13TagPage0[] = {
-    { 0x05, "Acceptance" },
-    { 0x06, "AddList" },
-    { 0x07, "AddNickList" },
-    { 0x08, "SName" },
-    { 0x09, "WV-CSP-Message" },
-    { 0x0A, "ClientID" },
-    { 0x0B, "Code" },
-    { 0x0C, "ContactList" },
-    { 0x0D, "ContentData" },
-    { 0x0E, "ContentEncoding" },
-    { 0x0F, "ContentSize" },
-    { 0x10, "ContentType" },
-    { 0x11, "DateTime" },
-    { 0x12, "Description" },
-    { 0x13, "DetailedResult" },
-    { 0x14, "EntityList" },
-    { 0x15, "Group" },
-    { 0x16, "GroupID" },
-    { 0x17, "GroupList" },
-    { 0x18, "InUse" },  /* Removed in IMPS_CSP_WBXML-V1_3-20070123 */
-    { 0x19, "Logo" },
-    { 0x1A, "MessageCount" },
-    { 0x1B, "MessageID" },
-    { 0x1C, "MessageURI" },
-    { 0x1D, "MSISDN" },
-    { 0x1E, "Name" },
-    { 0x1F, "NickList" },
-    { 0x20, "NickName" },
-    { 0x21, "Poll" },
-    { 0x22, "Presence" },
-    { 0x23, "PresenceSubList" },
-    { 0x24, "PresenceValue" },
-    { 0x25, "Property" },
-    { 0x26, "Qualifier" },
-    { 0x27, "Recipient" },
-    { 0x28, "RemoveList" },
-    { 0x29, "RemoveNickList" },
-    { 0x2A, "Result" },
-    { 0x2B, "ScreenName" },
-    { 0x2C, "Sender" },
-    { 0x2D, "Session" },
-    { 0x2E, "SessionDescriptor" },
-    { 0x2F, "SessionID" },
-    { 0x30, "SessionType" },
-    { 0x31, "Status" },
-    { 0x32, "Transaction" },
-    { 0x33, "TransactionContent" },
-    { 0x34, "TransactionDescriptor" },
-    { 0x35, "TransactionID" },
-    { 0x36, "TransactionMode" },
-    { 0x37, "URL" },
-    { 0x38, "URLList" },
-    { 0x39, "User" },
-    { 0x3A, "UserID" },
-    { 0x3B, "UserList" },
-    { 0x3C, "Validity" },
-    { 0x3D, "Value" },
-};
-
-/* Access code page (0x01) */
-static const TokenData csp13TagPage1[] = {
-    { 0x05, "AllFunctions" },
-    { 0x06, "AllFunctionsRequest" },
-    { 0x07, "CancelInvite-Request" },
-    { 0x08, "CancelInviteUser-Request" },
-    { 0x0A, "CapabilityList" },
-    { 0x0B, "CapabilityRequest" },
-    { 0x0C, "ClientCapability-Request" },
-    { 0x0D, "ClientCapability-Response" },
-    { 0x0E, "DigestBytes" },
-    { 0x0F, "DigestSchema" },
-    { 0x10, "Disconnect" },
-    { 0x11, "Functions" },
-    { 0x12, "GetSPInfo-Request" },
-    { 0x13, "GetSPInfo-Response" },
-    { 0x14, "InviteID" },
-    { 0x15, "InviteNote" },
-    { 0x16, "Invite-Request" },
-    { 0x17, "Invite-Response" },
-    { 0x18, "InviteType" },
-    { 0x19, "InviteUser-Request" },
-    { 0x1A, "InviteUser-Response" },
-    { 0x1B, "KeepAlive-Request" },
-    { 0x1C, "KeepAliveTime" },
-    { 0x1D, "Login-Request" },
-    { 0x1E, "Login-Response" },
-    { 0x1F, "Logout-Request" },
-    { 0x20, "Nonce" },
-    { 0x21, "Password" },
-    { 0x22, "Polling-Request" },
-    { 0x23, "ResponseNote" },
-    { 0x24, "SearchElement" },
-    { 0x25, "SearchFindings" },
-    { 0x26, "SearchID" },
-    { 0x27, "SearchIndex" },
-    { 0x28, "SearchLimit" },
-    { 0x29, "KeepAlive-Response" },
-    { 0x2A, "SearchPairList" },
-    { 0x2B, "Search-Request" },
-    { 0x2C, "Search-Response" },
-    { 0x2D, "SearchResult" },
-    { 0x2E, "Service-Request" },
-    { 0x2F, "Service-Response" },
-    { 0x30, "SessionCookie" },
-    { 0x31, "StopSearch-Request" },
-    { 0x32, "TimeToLive" },
-    { 0x33, "SearchString" },
-    { 0x34, "CompletionFlag" },
-    { 0x36, "ReceiveList" },
-    { 0x37, "VerifyID-Request" },
-    { 0x38, "Extended-Request" },
-    { 0x39, "Extended-Response" },
-    { 0x3A, "AgreedCapabilityList" },
-    { 0x3B, "ExtendedData" },
-    { 0x3C, "OtherServer" },
-    { 0x3D, "PresenceAttributeNSName" },
-    { 0x3E, "SessionNSName" },
-    { 0x3F, "TransactionNSName" },
-};
-
-/* Service code page (0x02) */
-static const TokenData csp13TagPage2[] = {
-    { 0x05, "ADDGM" },
-    { 0x06, "AttListFunc" }, /* Removed in IMPS_CSP_WBXML-V1_3-20070123 */
-    { 0x07, "BLENT" },
-    { 0x08, "CAAUT" }, /* Removed in IMPS_CSP_WBXML-V1_3-20070123 */
-    { 0x09, "CAINV" },
-    { 0x0B, "CCLI" },
-    { 0x0C, "ContListFunc" },
-    { 0x0D, "CREAG" },
-    { 0x0F, "DCLI" },
-    { 0x10, "DELGR" },
-    { 0x11, "FundamentalFeat" },
-    { 0x12, "FWMSG" },
-    { 0x14, "GCLI" },
-    { 0x15, "GETGM" },
-    { 0x16, "GETGP" },
-    { 0x17, "GETLM" },
-    { 0x18, "GETM" },
-    { 0x19, "GETPR" },
-    { 0x1A, "GETSPI" },
-    { 0x1B, "GETWL" },
-    { 0x1C, "GLBLU" },
-    { 0x1D, "GRCHN" },
-    { 0x1E, "GroupAuthFunc" },
-    { 0x1F, "GroupFeat" },
-    { 0x20, "GroupMgmtFunc" },
-    { 0x21, "GroupUseFunc" },
-    { 0x22, "IMAuthFunc" },
-    { 0x23, "IMFeat" },
-    { 0x24, "IMReceiveFunc" },
-    { 0x25, "IMSendFunc" },
-    { 0x26, "INVIT" },
-    { 0x27, "InviteFunc" },
-    { 0x28, "MBRAC" },
-    { 0x29, "MCLS" },
-    { 0x2A, "MDELIV" },
-    { 0x2B, "NEWM" },
-    { 0x2C, "NOTIF" },
-    { 0x2D, "PresenceAuthFunc" },
-    { 0x2E, "PresenceDeliverFunc" },
-    { 0x2F, "PresenceFeat" },
-    { 0x30, "REACT" }, /* Removed in IMPS_CSP_WBXML-V1_3-20070123 */
-    { 0x31, "REJCM" },
-    { 0x32, "REJEC" },
-    { 0x33, "RMVGM" },
-    { 0x34, "SearchFunc" },
-    { 0x35, "ServiceFunc" },
-    { 0x36, "SETD" },
-    { 0x37, "SETGP" },
-    { 0x38, "SRCH" },
-    { 0x39, "STSRC" },
-    { 0x3A, "SUBGCN" },
-    { 0x3B, "UPDPR" },
-    { 0x3C, "WVCSPFeat" },
-    { 0x3D, "MF" },
-    { 0x3E, "MG" },
-    { 0x3F, "MM" },
-};
-
-/* Client capability code page (0x03) */
-static const TokenData csp13TagPage3[] = {
-    { 0x05, "AcceptedCharset" },            /* IMPS 1.2 only */
-    { 0x06, "AcceptedContentLength" },      /* IMPS 1.2 only */
-    { 0x07, "AcceptedContentType" },
-    { 0x08, "AcceptedTransferEncoding" },
-    { 0x09, "AnyContent" },
-    { 0x0A, "DefaultLanguage" },
-    { 0x0B, "InitialDeliveryMethod" },
-    { 0x0C, "MultiTrans" },
-    { 0x0D, "ParserSize" },
-    { 0x0E, "ServerPollMin" },
-    { 0x0F, "SupportedBearer" },
-    { 0x10, "SupportedCIRMethod" },
-    { 0x11, "TCPAddress" },
-    { 0x12, "TCPPort" },
-    { 0x13, "UDPPort" },
-    { 0x14, "CIRHTTPAddress" },
-    { 0x15, "UDPAddress" },
-    { 0x16, "AcceptedPullLength" },
-    { 0x17, "AcceptedPushLength" },
-    { 0x18, "AcceptedRichContentLength" },
-    { 0x19, "AcceptedTextContentLength" },
-    { 0x1A, "OfflineETEMHandling" },
-    { 0x1B, "PlainTextCharset" },
-    { 0x1C, "SessionPriority" },
-    { 0x1D, "SupportedOfflineBearer" },
-    { 0x1F, "UserSessionLimit" },
-    { 0x20, "CIRSMSAddress" },
-    { 0x21, "MultiTransPerMessage" },
-    { 0x22, "OnlineETEMHandling" },
-    { 0x23, "ContentPolicy" },
-    { 0x24, "ContentPolicyLimit" },
-};
-
-/* Presence primitive code page (0x04) */
-static const TokenData csp13TagPage4[] = {
-    { 0x05, "CancelAuth-Request" },             /* IMPS 1.2 only */
-    { 0x06, "ContactListProperties" },
-    { 0x07, "CreateAttributeList-Request" },
-    { 0x08, "CreateList-Request" },
-    { 0x09, "DefaultAttributeList" },
-    { 0x0A, "DefaultContactList" },
-    { 0x0B, "DefaultList" },
-    { 0x0C, "DeleteAttributeList-Request" },
-    { 0x0D, "DeleteList-Request" },
-    { 0x0E, "GetAttributeList-Request" },
-    { 0x0F, "GetAttributeList-Response" },
-    { 0x10, "GetList-Request" },
-    { 0x11, "GetList-Response" },
-    { 0x12, "GetPresence-Request" },
-    { 0x13, "GetPresence-Response" },
-    { 0x14, "GetWatcherList-Request" },
-    { 0x15, "GetWatcherList-Response" },
-    { 0x16, "ListManage-Request" },
-    { 0x17, "ListManage-Response" },
-    { 0x18, "UnsubscribePresence-Request" },
-    { 0x19, "PresenceAuth-Request" },            /* IMPS 1.2 only */
-    { 0x1A, "PresenceAuth-User" },               /* IMPS 1.2 only */
-    { 0x1B, "PresenceNotification-Request" },
-    { 0x1C, "UpdatePresence-Request" },
-    { 0x1D, "SubscribePresence-Request" },
-    { 0x1E, "AutoSubscribe" },
-    { 0x1F, "GetReactiveAuthStatus-Request" },   /* IMPS 1.2 only */
-    { 0x20, "GetReactiveAuthStatus-Response" },  /* IMPS 1.2 only */
-    { 0x21, "CreateList-Response" },
-};
-
-/* Presence attribute code page (0x05) */
-static const TokenData csp13TagPage5[] = {
-    { 0x05, "Accuracy" },
-    { 0x06, "Address" },
-    { 0x07, "AddrPref" },
-    { 0x08, "Alias" },
-    { 0x09, "Altitude" },
-    { 0x0A, "Building" },
-    { 0x0B, "Caddr" },
-    { 0x0C, "City" },
-    { 0x0D, "ClientInfo" },
-    { 0x0E, "ClientProducer" },
-    { 0x0F, "ClientType" },
-    { 0x10, "ClientVersion" },
-    { 0x11, "CommC" },
-    { 0x12, "CommCap" },
-    { 0x13, "ContactInfo" },
-    { 0x14, "ContainedvCard" },
-    { 0x15, "Country" },
-    { 0x16, "Crossing1" },
-    { 0x17, "Crossing2" },
-    { 0x18, "DevManufacturer" },
-    { 0x19, "DirectContent" },
-    { 0x1A, "FreeTextLocation" },
-    { 0x1B, "GeoLocation" },
-    { 0x1C, "Language" },
-    { 0x1D, "Latitude" },
-    { 0x1E, "Longitude" },
-    { 0x1F, "Model" },
-    { 0x20, "NamedArea" },
-    { 0x21, "OnlineStatus" },
-    { 0x22, "PLMN" },
-    { 0x23, "PrefC" },
-    { 0x24, "PreferredContacts" },
-    { 0x25, "PreferredLanguage" },
-    { 0x26, "ReferredContent" },
-    { 0x27, "ReferredvCard" },
-    { 0x28, "Registration" },
-    { 0x29, "StatusContent" },
-    { 0x2A, "StatusMood" },
-    { 0x2B, "StatusText" },
-    { 0x2C, "Street" },
-    { 0x2D, "TimeZone" },
-    { 0x2E, "UserAvailability" },
-    { 0x2F, "Cap" },
-    { 0x30, "Cname" },
-    { 0x31, "Contact" },
-    { 0x32, "Cpriority" },
-    { 0x33, "Cstatus" },
-    { 0x34, "Note" },
-    { 0x35, "Zone" },
-    { 0x37, "Inf_link" },
-    { 0x38, "InfoLink" },
-    { 0x39, "Link" },
-    { 0x3A, "Text" },
-    { 0x3B, "ClientContentLimit" },
-    { 0x3C, "ClientIMPriority" },
-    { 0x3D, "MaxPullLength" },
-    { 0x3E, "MaxPushLength" },
-};
-
-/* Messaging code page (0x06) */
-static const TokenData csp13TagPage6[] = {
-    { 0x05, "BlockList" },
-    { 0x06, "BlockEntity-Request" },
-    { 0x07, "DeliveryMethod" },
-    { 0x08, "DeliveryReport" },
-    { 0x09, "DeliveryReport-Request" },
-    { 0x0A, "ForwardMessage-Request" },
-    { 0x0B, "GetBlockedList-Request" },
-    { 0x0C, "GetBlockedList-Response" },
-    { 0x0D, "GetMessageList-Request" },
-    { 0x0E, "GetMessageList-Response" },
-    { 0x0F, "GetMessage-Request" },
-    { 0x10, "GetMessage-Response" },
-    { 0x11, "GrantList" },
-    { 0x12, "MessageDelivered" },
-    { 0x13, "MessageInfo" },
-    { 0x14, "MessageNotification" },
-    { 0x15, "NewMessage" },
-    { 0x16, "RejectMessage-Request" },
-    { 0x17, "SendMessage-Request" },
-    { 0x18, "SendMessage-Response" },
-    { 0x19, "SetDeliveryMethod-Request" },
-    { 0x1A, "DeliveryTime" },
-    { 0x20, "MessageInfoList" },
-    { 0x21, "ForwardMessage-Response" },
-};
-
-/* Group code page (0x07) */
-static const TokenData csp13TagPage7[] = {
-    { 0x05, "AddGroupMembers-Request" },
-    { 0x06, "Admin" },
-    { 0x07, "CreateGroup-Request" },
-    { 0x08, "DeleteGroup-Request" },
-    { 0x09, "GetGroupMembers-Request" },
-    { 0x0A, "GetGroupMembers-Response" },
-    { 0x0B, "GetGroupProps-Request" },
-    { 0x0C, "GetGroupProps-Response" },
-    { 0x0D, "GroupChangeNotice" },
-    { 0x0E, "GroupProperties" },
-    { 0x0F, "Joined" },
-    { 0x10, "JoinedRequest" },
-    { 0x11, "JoinGroup-Request" },
-    { 0x12, "JoinGroup-Response" },
-    { 0x13, "LeaveGroup-Request" },
-    { 0x14, "LeaveGroup-Response" },
-    { 0x15, "Left" },
-    { 0x16, "MemberAccess-Request" },
-    { 0x17, "Mod" },
-    { 0x18, "OwnProperties" },
-    { 0x19, "RejectList-Request" },
-    { 0x1A, "RejectList-Response" },
-    { 0x1B, "RemoveGroupMembers-Request" },
-    { 0x1C, "SetGroupProps-Request" },
-    { 0x1D, "SubscribeGroupNotice-Request" },
-    { 0x1E, "SubscribeGroupNotice-Response" },
-    { 0x1F, "Users" }, /* Removed in IMPS_CSP_WBXML-V1_3-20070123 */
-    { 0x20, "WelcomeNote" },
-    { 0x21, "JoinGroup" },
-    { 0x22, "SubscribeNotification" },
-    { 0x23, "SubscribeType" },
-    { 0x24, "GetJoinedUsers-Request" },
-    { 0x25, "GetJoinedUsers-Response" },
-    { 0x26, "AdminMapList" },
-    { 0x27, "AdminMapping" },
-    { 0x28, "Mapping" },
-    { 0x29, "ModMapping" },
-    { 0x2A, "UserMapList" },
-    { 0x2B, "UserMapping" },
-    { 0x2C, "JoinedBlocked" },
-    { 0x2D, "LeftBlocked" },
-};
-
-/* Service code page - continued (0x08) */
-static const TokenData csp13TagPage8[] = {
-    { 0x05, "MP" },
-    { 0x06, "GETAUT" },
-    { 0x07, "GETJU" },
-    { 0x08, "VRID" },
-    { 0x09, "VerifyIDFunc" },
-    { 0x0A, "GETMAP" },
-    { 0x0B, "SGMNT" },
-    { 0x0C, "EXCON" },
-    { 0x0D, "OFFNOTIF" },
-    { 0x0E, "ADVSR" },
-};
-
-/* Common code page - continued (0x09) */
-static const TokenData csp13TagPage9[] = {
-    { 0x05, "CIR" },
-    { 0x06, "Domain" },
-    { 0x07, "ExtBlock" },
-    { 0x08, "HistoryPeriod" },
-    { 0x09, "IDList" },
-    { 0x0A, "MaxWatcherList" },
-    { 0x0B, "AnswerOptionText" },
-    { 0x0E, "Watcher" },
-    { 0x0F, "WatcherStatus" },
-    { 0x10, "Font" },
-    { 0x11, "Size" },
-    { 0x12, "Style" },
-    { 0x13, "Color" },
-    { 0x14, "ContentName" },
-    { 0x15, "Map" },
-    { 0x16, "NotificationType" },
-    { 0x17, "NotificationTypeList" },
-    { 0x18, "FriendlyName" },
-    { 0x19, "ClearPublicProfile" },
-    { 0x1A, "PublicProfile" },
-    { 0x1B, "AnswerOption" },
-    { 0x1C, "AnswerOptionID" },
-    { 0x1D, "AnswerOptions" },
-    { 0x1E, "ApplicationID" },
-    { 0x1F, "AuthorizeAndGrant" },
-    { 0x20, "ChosenOptionID" },
-    { 0x21, "ContactListNotify" },
-    { 0x22, "DefaultNotify" },
-    { 0x23, "ExtendConversationUser" },
-    { 0x24, "InText" },
-    { 0x25, "SegmentCount" },
-    { 0x26, "SegmentID" },
-    { 0x27, "SegmentInfo" },
-    { 0x28, "SegmentReference" },
-    { 0x29, "SystemMessage" },
-    { 0x2A, "SystemMessageID" },
-    { 0x2B, "SystemMessageList" },
-    { 0x2C, "SystemMessageResponse" },
-    { 0x2D, "SystemMessageResponseList" },
-    { 0x2F, "SystemMessageText" },
-    { 0x30, "TryAgainTimeout" },
-    { 0x31, "UserNotify" },
-    { 0x32, "VerificationKey" },
-    { 0x33, "VerificationMechanism" },
-    { 0x34, "GetMap-Request" },
-    { 0x35, "GetMap-Response" },
-    { 0x36, "ExtendConversationID" },
-    { 0x37, "WatcherCount" },
-    { 0x38, "RequiresResponse" },
-    { 0x39, "ExtBlockETEM" },
-    { 0x3A, "GroupContentLimit" },
-    { 0x3B, "MessageTotalCount" },
-    { 0x3C, "UnrecognizedUserID" },
-    { 0x3D, "UserIDPair" },
-    { 0x3E, "ValidUserID" },
-    { 0x3F, "UserIDList" },
-};
-
-/* Access code page - continued (0x0A) */
-static const TokenData csp13TagPageA[] = {
-    { 0x05, "WV-CSP-VersionDiscovery-Request" },
-    { 0x06, "WV-CSP-VersionDiscovery-Response" },
-    { 0x07, "VersionList" },
-    { 0x08, "SubscribeNotification-Request" },
-    { 0x09, "UnsubscribeNotification-Request" },
-    { 0x0A, "Notification-Request" },
-    { 0x0B, "AdvancedCriteria" },
-    { 0x0C, "PairID" },
-    { 0x0D, "GetPublicProfile-Request" },
-    { 0x0E, "GetPublicProfile-Response" },
-    { 0x0F, "UpdatePublicProfile-Request" },
-    { 0x10, "DropSegment-Request" },
-    { 0x11, "ExtendConversation-Response" },
-    { 0x12, "ExtendConversation-Request" },
-    { 0x13, "GetSegment-Request" },
-    { 0x14, "GetSegment-Response" },
-    { 0x15, "SystemMessage-Request" },
-    { 0x16, "SystemMessage-User" },
-    { 0x17, "SearchPair" },
-    { 0x18, "SegmentContent" },
-};
-
-/* Common code page - continued (0x0B) */
-static const TokenData csp13TagPageB[] = {
-    { 0x05, "GrantListInUse" },
-    { 0x06, "BlockListInUse" },
-    { 0x07, "ContactListIDList" },
-    { 0x08, "AnswerOptionsText" },
-};
-
-static const TagCodePage csp13TagPages[] = {
-    PAGE_DATA(0, csp13TagPage0),
-    PAGE_DATA(1, csp13TagPage1),
-    PAGE_DATA(2, csp13TagPage2),
-    PAGE_DATA(3, csp13TagPage3),
-    PAGE_DATA(4, csp13TagPage4),
-    PAGE_DATA(5, csp13TagPage5),
-    PAGE_DATA(6, csp13TagPage6),
-    PAGE_DATA(7, csp13TagPage7),
-    PAGE_DATA(8, csp13TagPage8),
-    PAGE_DATA(9, csp13TagPage9),
-    PAGE_DATA(0x0A, csp13TagPageA),
-    PAGE_DATA(0x0B, csp13TagPageB),
-};
-
-static const AttrData csp13AttrPage0[] = {
-    { 0x05, "xmlns", "http://www.wireless-village.org/CSP" },
-    { 0x06, "xmlns", "http://www.wireless-village.org/PA" },
-    { 0x07, "xmlns", "http://www.wireless-village.org/TRC" },
-    { 0x08, "xmlns", "http://www.openmobilealliance.org/DTD/WV-CSP" },
-    { 0x09, "xmlns", "http://www.openmobilealliance.org/DTD/WV-PA" },
-    { 0x0A, "xmlns", "http://www.openmobilealliance.org/DTD/WV-TRC" },
-    { 0x0B, "xmlns", "http://www.openmobilealliance.org/DTD/IMPS-CSP" },
-    { 0x0C, "xmlns", "http://www.openmobilealliance.org/DTD/IMPS-PA" },
-    { 0x0D, "xmlns", "http://www.openmobilealliance.org/DTD/IMPS-TRC" },
-};
-
-static const AttrCodePage csp13AttrPages[] = {
-    PAGE_DATA(0, csp13AttrPage0),
-};
-
-/*
- * Value tokens defined for EXT_T_0
- */
-static const TokenData csp13ExtValueTokens[] = {
-    { 0x00, "AccessType" },
-    { 0x01, "ActiveUsers" },
-    { 0x02, "Admin" },
-    { 0x03, "application/" },
-    { 0x04, "application/vnd.wap.mms-message" },
-    { 0x05, "application/x-sms" },
-    { 0x06, "AutoJoin" },
-    { 0x07, "BASE64" },
-    { 0x08, "Closed" },
-    { 0x09, "Default" },
-    { 0x0A, "DisplayName" },
-    { 0x0B, "F" },
-    { 0x0C, "G" },
-    { 0x0D, "GR" },
-    { 0x0E, "http://" },
-    { 0x0F, "https://" },
-    { 0x10, "image/" },
-    { 0x11, "Inband" },
-    { 0x12, "IM" },
-    { 0x13, "MaxActiveUsers" },
-    { 0x14, "Mod" },
-    { 0x15, "Name" },
-    { 0x16, "None" },
-    { 0x17, "N" },
-    { 0x18, "Open" },
-    { 0x19, "Outband" },
-    { 0x1A, "PR" },
-    { 0x1B, "Private" },
-    { 0x1C, "PrivateMessaging" },
-    { 0x1D, "PrivilegeLevel" },
-    { 0x1E, "Public" },
-    { 0x1F, "P" },
-    { 0x20, "Request" },
-    { 0x21, "Response" },
-    { 0x22, "Restricted" },
-    { 0x23, "ScreenName" },
-    { 0x24, "Searchable" },
-    { 0x25, "S" },
-    { 0x26, "SC" },
-    { 0x27, "text/" },
-    { 0x28, "text/plain" },
-    { 0x29, "text/x-vCalendar" },
-    { 0x2A, "text/x-vCard" },
-    { 0x2B, "Topic" },
-    { 0x2C, "T" },
-    { 0x2D, "Type" },
-    { 0x2E, "U" },
-    { 0x2F, "US" },
-    { 0x30, "www.wireless-village.org" },
-    { 0x31, "AutoDelete" },
-    { 0x32, "GM" },
-    { 0x33, "Validity" },
-    { 0x34, "DENIED" },
-    { 0x35, "GRANTED" },
-    { 0x36, "PENDING" },
-    { 0x37, "ShowID" },
-    { 0x38, "RequireInvitation" },
-    { 0x39, "Tiny" },
-    { 0x3A, "PPU" },
-    { 0x3B, "SPA" },
-    { 0x3C, "ANC" },
-    { 0x3D, "GROUP_ID" },
-    /* { 0x3D, "History" }, */ /* FIXME */
-    { 0x3E, "GROUP_NAME" },
-    { 0x3F, "GROUP_TOPIC" },
-    { 0x40, "GROUP_USER_ID_JOINED" },
-    { 0x41, "GROUP_USER_ID_OWNER" },
-    { 0x42, "HTTP" },
-    { 0x43, "SMS" },
-    { 0x44, "STCP" },
-    { 0x45, "SUDP" },
-    { 0x46, "USER_ALIAS" },
-    { 0x47, "USER_EMAIL_ADDRESS" },
-    { 0x48, "USER_FIRST_NAME" },
-    { 0x49, "USER_ID" },
-    { 0x4A, "USER_LAST_NAME" },
-    { 0x4B, "USER_MOBILE_NUMBER" },
-    { 0x4C, "USER_ONLINE_STATUS" },
-    { 0x4D, "WAPSMS" },
-    { 0x4E, "WAPUDP" },
-    { 0x4F, "WSP" },
-    { 0x50, "GROUP_USER_ID_AUTOJOIN" },
-    { 0x51, "AND" },
-    { 0x52, "AC" },
-    { 0x53, "BLC" },
-    { 0x54, "BLUC" },
-    { 0x55, "CLCR" },
-    { 0x56, "CLD" },
-    { 0x57, "GC" },
-    { 0x58, "GD" },
-    { 0x59, "GLC" },
-    { 0x5A, "ANU" },
-    { 0x5B, "ANGRY" },
-    { 0x5C, "ANXIOUS" },
-    { 0x5D, "ASHAMED" },
-    { 0x5F, "AVAILABLE" },
-    { 0x60, "BORED" },
-    { 0x61, "CALL" },
-    { 0x62, "CLI" },
-    { 0x63, "COMPUTER" },
-    { 0x64, "DISCREET" },
-    { 0x65, "EMAIL" },
-    { 0x66, "EXCITED" },
-    { 0x67, "HAPPY" },
-    { 0x68, "AP" },
-    { 0x6B, "IN_LOVE" },
-    { 0x6C, "INVINCIBLE" },
-    { 0x6D, "JEALOUS" },
-    { 0x6E, "MMS" },
-    { 0x6F, "MOBILE_PHONE" },
-    { 0x70, "NOT_AVAILABLE" },
-    { 0x71, "OTHER" },
-    { 0x72, "PDA" },
-    { 0x73, "SAD" },
-    { 0x74, "SLEEPY" },
-    { 0x75, "SMS" },
-    { 0x78, "www.openmobilealliance.org" },
-    { 0x79, "Small" },
-    { 0x7A, "Medium" },
-    { 0x7B, "Big" },
-    { 0x7C, "Huge" },
-    { 0x7D, "Bold" },
-    { 0x7E, "Italic" },
-    { 0x7F, "Underline" },
-    { 0x80, "Black" },
-    { 0x81, "Silver" },
-    { 0x82, "Gray" },
-    { 0x83, "White" },
-    { 0x84, "Maroon" },
-    { 0x85, "Red" },
-    { 0x86, "Purple" },
-    { 0x87, "Fuchsia" },
-    { 0x88, "Green" },
-    { 0x89, "Lime" },
-    { 0x8A, "Olive" },
-    { 0x8B, "Yellow" },
-    { 0x8C, "Navy" },
-    { 0x8D, "Blue" },
-    { 0x8E, "Teal" },
-    { 0x8F, "Aqua" },
-    { 0x90, "ATCL" },
-    { 0x91, "CLC" },
-    { 0x93, "USER_CITY" },
-    { 0x94, "USER_COUNTRY" },
-    { 0x95, "USER_FRIENDLY_NAME" },
-    { 0x96, "USER_GENDER" },
-    { 0x97, "USER_INTENTION" },
-    { 0x98, "USER_INTERESTS_HOBBIES" },
-    { 0x99, "USER_MARITAL_STATUS" },
-    { 0x9A, "PRIORITYREJECT" },
-    { 0x9B, "PRIORITYSTORE" },
-    { 0x9C, "REJECT" },
-    { 0x9D, "SENDREJECT" },
-    { 0x9E, "SENDSTORE" },
-    { 0x9F, "IR" },
-    { 0xA0, "EC" },
-    { 0xA1, "GLUC" },
-    { 0xA2, "IA" },
-    { 0xA3, "IC" },
-    { 0xA4, "SSMS" },  /* The values of SSMS and SHTTP were wrong in IMPS 1.3
-                          20060606-C but get fixed in 1.3 20070123-A */
-    { 0xA5, "SHTTP" },
-    { 0xA6, "DoNotNotify" },
-    { 0xA7, "GMAU" },
-    { 0xA8, "GMG" },
-    { 0xA9, "GMR" },
-    { 0xAA, "GMU" },
-    { 0xAB, "DETECT" },
-    { 0xAC, "FORKALL" },
-    { 0xAD, "OEU" },
-    { 0xAE, "SERVERLOGIC" },
-    { 0xAF, "PP_AGE" },
-    { 0xB0, "PP_CITY" },
-    { 0xB1, "PP_COUNTRY" },
-    { 0xB2, "PP_FRIENDLY_NAME" },
-    { 0xB3, "PP_FREE_TEXT" },
-    { 0xB4, "PP_GENDER" },
-    { 0xB5, "PP_INTENTION" },
-    { 0xB6, "PP_INTERESTS" },
-    { 0xB7, "PP_MARITAL_STATUS" },
-    { 0xB8, "USER_AGE_MAX" },
-    { 0xB9, "USER_AGE_MIN" },
-    { 0xBA, "EG" },
-    { 0xBB, "MinimumAge" },
-    { 0xBC, "C" },
-    { 0xBD, "CURRENT_SUBSCRIBER" },
-    { 0xBE, "FORMER_SUBSCRIBER" },
-    { 0xBF, "PRESENCE_ACCESS" },
-    { 0xC0, "R" },
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/libwbxml/include/csp13_hash.h b/libwbxml/include/csp13_hash.h
deleted file mode 100644 (file)
index 0c22aed..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef CSP13_HASH_H
-#define CSP13_HASH_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @param str Tag name
- * @return integer value with code page in bit 8-15 and tag token in bit 0-7; -1 if not a CSP 1.3 tag
- */
-int csp13TagNameToKey(const char * str);
-
-/**
- * @param str Tag name
- * @return 1 if <code>str</code> is a CSP 1.3 tag of Integer type; 0 if not
- */
-int csp13IsIntegerTag(const char * str);
-
-/**
- * @param str Value token string
- * @param len Length of the value token
- * @return token value ; -1 if not a valid CSP 1.3 value token
- */
-int csp13ValueTokenToKey(const char * str, int len);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/libwbxml/include/expat_parser.h b/libwbxml/include/expat_parser.h
deleted file mode 100644 (file)
index e69407e..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef EXPAT_PARSER_H
-#define EXPAT_PARSER_H
-
-#include <expat.h>
-#include "xml_handler.h"
-
-class ExpatParser
-{
-public:
-    ExpatParser();
-    virtual ~ExpatParser();
-
-    void setContentHandler(XmlContentHandler *handler)
-    {
-        mHandler = handler;
-    }
-    int parse(const char * data, int len, bool end);
-
-private:
-    XML_Parser mExpat;
-    XmlContentHandler * mHandler;
-
-    static void startElementWrapper(void *userData, const char *name, const char **atts);
-    static void endElementWrapper(void *userData, const char *name);
-    static void charactersWrapper(void *userData, const char *data, int len);
-    static void startDoctypeWrapper(void *userData,
-            const char *doctypeName,
-            const char *sysid,
-            const char *pubid,
-            int has_internal_subset);
-    static void endDoctypeWrapper(void *userData);
-};
-
-#endif
-
-
diff --git a/libwbxml/include/imps_encoder.h b/libwbxml/include/imps_encoder.h
deleted file mode 100644 (file)
index c7300b0..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IMPS_ENCODER_H
-#define IMPS_ENCODER_H
-
-#include "wbxml_encoder.h"
-#include "wbxml_stl.h"
-
-class ImpsWbxmlEncoder : public WbxmlEncoder
-{
-public:
-    ImpsWbxmlEncoder(int publicid) :
-        mPublicId(publicid)
-    {
-        reset();
-    }
-
-    /**
-     * Reset the encoder so it can be used for encoding next document.
-     */
-    void reset();
-
-    EncoderError startElement(const char *name, const char **atts);
-
-    EncoderError characters(const char *chars, int len);
-
-    /**
-     * Send OPAQUE data to the encoder. Should only be used for ContentData.
-     * The application should choose to encode ContentData either by characters()
-     * when the ContentType is text (e.g. text/plain) or by opaque() if the
-     * ContentType is of some binary types.
-     * WBXML Integer and DateTime are automatically converted to opaque data
-     * in characters() so there's no need for the application to use opaque()
-     * for these types.
-     */
-    EncoderError opaque(const char *chars, int len);
-
-    EncoderError endElement();
-
-private:
-    int mPublicId;
-    int mTagCodePage;
-    string mResult;
-    string mCurrElement;
-    int mDepth;
-
-    EncoderError encodeInteger(const char *chars, int len);
-    EncoderError encodeDatetime(const char *chars, int len);
-    EncoderError encodeString(const char *chars, int len);
-    EncoderError encodeAttrib(const char *name, const char *value);
-    void encodeInlinedStr(const char *s, int len);
-    void encodeMbuint(uint32_t i);
-
-    void appendResult(int ch)
-    {
-        mResult += (char)ch;
-    }
-
-    void appendResult(const char *s, int len)
-    {
-        mResult.append(s, len);
-    }
-};
-
-#endif
-
diff --git a/libwbxml/include/syncml_data.h b/libwbxml/include/syncml_data.h
deleted file mode 100644 (file)
index f2773d7..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SYNCML_DATA_H
-#define SYNCML_DATA_H
-
-#include "wbxml_tabledef.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* SyncML code page (0x00) */
-static const TokenData syncmlTagPage0[] = {
-    {0x05, "Add"},
-    {0x06, "Alert"},
-    {0x07, "Archive"},
-    {0x08, "Atomic"},
-    {0x09, "Chal"},
-    {0x0A, "Cmd"},
-    {0x0B, "CmdID"},
-    {0x0C, "CmdRef"},
-    {0x0D, "Copy"},
-    {0x0E, "Cred"},
-    {0x0F, "Data"},
-    {0x10, "Delete"},
-    {0x11, "Exec"},
-    {0x12, "Final"},
-    {0x13, "Get"},
-    {0x14, "Item"},
-    {0x15, "Lang"},
-    {0x16, "LocName"},
-    {0x17, "LocURI"},
-    {0x18, "Map"},
-    {0x19, "MapItem"},
-    {0x1A, "Meta"},
-    {0x1B, "MsgID"},
-    {0x1C, "MsgRef"},
-    {0x1D, "NoResp"},
-    {0x1E, "NoResults"},
-    {0x1F, "Put"},
-    {0x20, "Replace"},
-    {0x21, "RespURI"},
-    {0x22, "Results"},
-    {0x23, "Search"},
-    {0x24, "Sequence"},
-    {0x25, "SessionID"},
-    {0x26, "SftDel"},
-    {0x27, "Source"},
-    {0x28, "SourceRef"},
-    {0x29, "Status"},
-    {0x2A, "Sync"},
-    {0x2B, "SyncBody"},
-    {0x2C, "SyncHdr"},
-    {0x2D, "SyncML"},
-    {0x2E, "Target"},
-    {0x2F, "TargetRef"},
-    {0x31, "VerDTD"},
-    {0x32, "VerProto"},
-    {0x33, "NumberOfChanges"},
-    {0x34, "MoreData"},
-    {0x35, "Field"},
-    {0x36, "Filter"},
-    {0x37, "Record"},
-    {0x38, "FilterType"},
-    {0x39, "SourceParent"},
-    {0x3A, "TargetParent"},
-    {0x3B, "Move"},
-    {0x3C, "Correlator"},
-};
-
-/* MetInf code page (0x01) */
-static const TokenData syncmlTagPage1[] = {
-    {0x05, "Anchor"},
-    {0x06, "EMI"},
-    {0x07, "Format"},
-    {0x08, "FreeID"},
-    {0x09, "FreeMem"},
-    {0x0A, "Last"},
-    {0x0B, "Mark"},
-    {0x0C, "MaxMsgSize"},
-    {0x0D, "Mem"},
-    {0x0E, "MetInf"},
-    {0x0F, "Next"},
-    {0x10, "NextNonce"},
-    {0x11, "SharedMem"},
-    {0x12, "Size"},
-    {0x13, "Type"},
-    {0x14, "Version"},
-    {0x15, "MaxObjSize"},
-    {0x16, "FieldLevel"},
-};
-
-/* DevInf code page (0x00) */
-static const TokenData syncmlDevInfTagPage[] = {
-    {0x05, "CTCap"},
-    {0x06, "CTType"},
-    {0x07, "DataStore"},
-    {0x08, "DataType"},
-    {0x09, "DevID"},
-    {0x0A, "DevInf"},
-    {0x0B, "DevTyp"},
-    {0x0C, "DisplayName"},
-    {0x0D, "DSMem"},
-    {0x0E, "Ext"},
-    {0x0F, "FwV"},
-    {0x10, "HwV"},
-    {0x11, "Man"},
-    {0x12, "MaxGUIDSize"},
-    {0x13, "MaxID"},
-    {0x14, "MaxMem"},
-    {0x15, "Mod"},
-    {0x16, "OEM"},
-    {0x17, "ParamName"},
-    {0x18, "PropName"},
-    {0x19, "Rx"},
-    {0x1A, "Rx-Pref"},
-    {0x1B, "SharedMem"},
-    {0x1C, "MaxSize"},
-    {0x1D, "SourceRef"},
-    {0x1E, "SwV"},
-    {0x1F, "SyncCap"},
-    {0x20, "SyncType"},
-    {0x21, "Tx"},
-    {0x22, "Tx-Pref"},
-    {0x23, "ValEnum"},
-    {0x24, "VerCT"},
-    {0x25, "VerDTD"},
-    {0x26, "Xnam"},
-    {0x27, "Xval"},
-    {0x28, "UTC"},
-    {0x29, "SupportNumberOfChanges"},
-    {0x2A, "SupportLargeObjs"},
-    {0x2B, "Property"},
-    {0x2C, "PropParam"},
-    {0x2D, "MaxOccur"},
-    {0x2E, "NoTruncate"},
-    {0x30, "Filter-Rx"},
-    {0x31, "FilterCap"},
-    {0x32, "FilterKeyword"},
-    {0x33, "FieldLevel"},
-    {0x34, "SupportHierarchicalSync"},
-};
-
-static const TagCodePage syncmlTagPages[] = {
-    PAGE_DATA(0, syncmlTagPage0),
-    PAGE_DATA(1, syncmlTagPage1),
-};
-
-static const TagCodePage syncmlDevInfTagPages[] = {
-    PAGE_DATA(0, syncmlDevInfTagPage),
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/libwbxml/include/wbxml_const.h b/libwbxml/include/wbxml_const.h
deleted file mode 100644 (file)
index 48cb1ed..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef WBXML_CONST_H
-#define WBXML_CONST_H
-
-enum WbxmlStatus
-{
-    WBXML_STATUS_ERROR = 0,
-    WBXML_STATUS_OK = 1,
-};
-
-enum IanaCharset
-{
-    CHARSET_UNKNOWN = 0,
-    CHARSET_UTF8 = 0x6a,
-};
-
-enum PublicId
-{
-    PUBLICID_IMPS_1_3 = 0x12,
-    PUBLICID_IMPS_1_2 = 0x11,
-    PUBLICID_IMPS_1_1 = 0x10,
-    PUBLICID_SYNCML_1_0 = 0xFD1,
-    PUBLICID_SYNCML_1_1 = 0xFD3,
-    PUBLICID_SYNCML_1_2 = 0x1201,
-    PUBLICID_SYNCML_METINF_1_2 = 0x1202,
-    PUBLICID_SYNCML_DEVINF_1_2 = 0x1203,
-};
-
-enum WbxmlToken {
-    TOKEN_SWITCH_PAGE   = 0,
-    TOKEN_END           = 1,
-    TOKEN_ENTITY        = 2,
-    TOKEN_STR_I         = 3,
-    TOKEN_LITERAL       = 4,
-    TOKEN_EXT_I_0       = 0x40,
-    TOKEN_EXT_I_1       = 0x41,
-    TOKEN_EXT_I_2       = 0x42,
-    TOKEN_PI            = 0x43,
-    TOKEN_LITERAL_C     = 0x44,
-    TOKEN_EXT_T_0       = 0x80,
-    TOKEN_EXT_T_1       = 0x81,
-    TOKEN_EXT_T_2       = 0x82,
-    TOKEN_STR_T         = 0x83,
-    TOKEN_LITERAL_A     = 0x84,
-    TOKEN_EXT_0         = 0xC0,
-    TOKEN_EXT_1         = 0xC1,
-    TOKEN_EXT_2         = 0xC2,
-    TOKEN_OPAQUE        = 0xC3,
-    TOKEN_LITERAL_AC    = 0xC4,
-};
-
-#endif
-
diff --git a/libwbxml/include/wbxml_encoder.h b/libwbxml/include/wbxml_encoder.h
deleted file mode 100644 (file)
index a1b653a..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef WBXML_ENCODER_H
-#define WBXML_ENCODER_H
-
-#include <stdint.h>
-#include "wbxml_const.h"
-
-class WbxmlHandler
-{
-public:
-    virtual ~WbxmlHandler() {}
-    virtual void wbxmlData(const char *data, uint32_t len) = 0;
-};
-
-enum EncoderError {
-    NO_ERROR = 0,
-    ERROR_NO_PUBLIC_ID = 1,
-    ERROR_UNSUPPORTED_DOCTYPE,
-    ERROR_UNSUPPORTED_TAG,
-    ERROR_UNSUPPORTED_ATTR,
-    ERROR_INVALID_DATA,
-    ERROR_INVALID_INTEGER_VALUE,
-    ERROR_INVALID_DATETIME_VALUE,
-    ERROR_INVALID_END_ELEMENT,
-};
-
-class WbxmlEncoder
-{
-public:
-    virtual ~WbxmlEncoder() {}
-
-    void setWbxmlHandler(WbxmlHandler * handler)
-    {
-        mHandler = handler;
-    }
-
-    virtual EncoderError startElement(const char *name, const char **atts) = 0;
-    virtual EncoderError characters(const char *chars, int len) = 0;
-    virtual EncoderError endElement() = 0;
-
-    /**
-     * Reset the encoder so that it may be used again. The WbxmlHandler is
-     * NOT cleared by reset().
-     */
-    virtual void reset() = 0;
-
-protected:
-    WbxmlHandler * mHandler;
-};
-
-#endif
-
diff --git a/libwbxml/include/wbxml_parser.h b/libwbxml/include/wbxml_parser.h
deleted file mode 100644 (file)
index adb5d9a..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef WBXML_PARSER_H
-#define WBXML_PARSER_H
-
-#include <setjmp.h>
-#include <stdint.h>
-#include "wbxml_const.h"
-#include "wbxml_stl.h"
-#include "wbxml_tabledef.h"
-
-struct Attribute
-{
-    string name;
-    string value;
-};
-
-class WbxmlContentHandler
-{
-public:
-    virtual ~WbxmlContentHandler() {}
-    virtual void handlePublicId(uint32_t id) = 0;
-    virtual void startElement(const char * name, const vector<Attribute> & attribs) = 0;
-    virtual void endElement(const char * name) = 0;
-    virtual void characters(const char * data, int len) = 0;
-    virtual void opaque(const char * data, int len) = 0;
-};
-
-class DefaultWbxmlContentHandler: public WbxmlContentHandler
-{
-public:
-    DefaultWbxmlContentHandler()
-    {
-        mPublicId = -1;
-    }
-
-    void handlePublicId(uint32_t id)
-    {
-        mPublicId = id;
-    }
-
-    // @return public ID or -1 if no public ID seen
-    int getPublicId(void) const
-    {
-        return mPublicId;
-    }
-
-    void startElement(const char * name, const vector<Attribute> & attribs)
-    {
-    }
-
-    void endElement(const char * name)
-    {
-    }
-
-    void characters(const char * data, int len)
-    {
-    }
-
-    void opaque(const char * data, int len)
-    {
-    }
-
-private:
-    int mPublicId;
-};
-
-class WbxmlParser
-{
-public:
-    WbxmlParser(uint32_t transportEncoding);
-    ~WbxmlParser();
-
-    void setContentHandler(WbxmlContentHandler * handler);
-
-    //void setTokenMappings(uint32_t publicId, TagTable tagTable, AttrTable attrTable);
-    int parse(const char * data, uint32_t len, bool end);
-
-    void reset(void);
-
-    int getError(void) const
-    {
-        return mLastError;
-    }
-
-private:
-    enum ParserState {
-        EXPECT_HEADER,
-        EXPECT_STRING_TABLE,
-        EXPECT_BODY_START,
-        EXPECT_ELEMENT_START,
-        EXPECT_ELEMENT_END,
-        ELEMENT_END,
-        EXPECT_CONTENT,
-        EXPECT_BODY_END,
-    };
-    enum ParserError {
-        ERROR_NO_ERROR = 0,
-        ERROR_INVALID_DATA = 1,
-        ERROR_NEED_MORE_DATA,
-        ERROR_UNSUPPORTED_PUBID,
-        ERROR_UNSUPPORTED_CHARSET,
-        ERROR_INVALID_STRING_TABLE,
-        ERROR_INVALID_STRING_TABLE_REFERENCE,
-        ERROR_INVALID_EXT_TOKEN,
-        ERROR_INVALID_MBUINT,
-        ERROR_INVALID_ENTITY,
-        ERROR_UNRECOGNIZED_TAG,
-        ERROR_UNRECOGNIZED_ATTR,
-        ERROR_MISSING_ATTR,
-        ERROR_MISSING_TOKEN_END,
-        ERROR_NOT_SUPPORTED_YET   = 999,
-    };
-
-    int readByte();
-    int peekByte();
-    uint32_t readMbuint32();
-    void readString(string & str);
-    const char * resolveStrTableRef(void);
-
-    const char * lookupTagName(int tag) const;
-    const char * lookupAttrName(int tag, const char **valuePrefix) const;
-    void readAttribute(Attribute * attrib);
-
-    jmp_buf mJmpbuf;
-
-    string mLastChunk;
-    const char * mExternalChunk;
-    uint32_t mExternalChunkLen;
-    uint32_t mDataOffset;
-    bool mIsDataEnd;
-
-    int getReadPos(void) const
-    {
-        return mDataOffset;
-    }
-    void setReadPos(int pos)
-    {
-        mDataOffset = pos;
-    }
-    void appendData(const char * data, uint32_t len, bool end);
-    void saveRemainingData();
-    uint32_t availDataSize(void) const
-    {
-        return mLastChunk.size() + mExternalChunkLen - mDataOffset;
-    }
-
-    bool selectTokenMapping(int publicId);
-
-    const TagCodePage * mTagPages;
-    uint32_t mNumTagPages;
-    const AttrCodePage * mAttrPages;
-    uint32_t mNumAttrPages;
-
-    uint32_t mTransportEncoding;
-    WbxmlContentHandler * mContentHandler;
-
-    vector<string> mStartElemStack;
-    string mStringTable;
-    uint32_t mCurrTagPage;
-    uint32_t mCurrAttrPage;
-
-    ParserState mState;
-    ParserError mLastError;
-
-    int mDocVersion;
-    uint32_t mPublicId;
-    uint32_t mCharset;
-};
-
-#endif
-
diff --git a/libwbxml/include/wbxml_stl.h b/libwbxml/include/wbxml_stl.h
deleted file mode 100644 (file)
index 7382cfa..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef WBXML_STL_H
-#define WBXML_STL_H
-
-#ifdef PLATFORM_ANDROID
-
-#include <utils/String8.h>
-#include <utils/Vector.h>
-using android::String8;
-using android::Vector;
-
-class string: public String8
-{
-public:
-    string() {}
-    string(const string& o) :
-        String8(o)
-    {
-    }
-    string(const char* o) :
-        String8(o)
-    {
-    }
-    string(const char* o, size_t len) :
-        String8(o, len)
-    {
-    }
-    string & operator=(const char* other)
-    {
-        setTo(other);
-        return *this;
-    }
-    string & assign(const char* other, int len)
-    {
-        setTo(other, len);
-        return *this;
-    }
-    bool empty(void) const
-    {
-        return size() == 0;
-    }
-    const char *c_str(void) const
-    {
-        return String8::string();
-    }
-    string & operator+=(const string & o)
-    {
-        append(o);
-        return *this;
-    }
-    string & operator+=(const char * other)
-    {
-        append(other);
-        return *this;
-    }
-    string & operator+=(char ch)
-    {
-        char c[2] = {ch, 0};    // temporary workaround for String8.append(str, len) bug
-        append(c, 1);
-        return *this;
-    }
-    void clear(void)
-    {
-        setTo("");
-    }
-};
-
-template <class T>
-class vector: public Vector<T>
-{
-public:
-    T & back(void)
-    {
-        return Vector<T>::editTop();
-    }
-    const T & back(void) const
-    {
-        return Vector<T>::top();
-    }
-    void push_back(const T& val)
-    {
-        Vector<T>::push(val);
-    }
-    void pop_back(void)
-    {
-        Vector<T>::pop();
-    }
-    bool empty(void) const
-    {
-        return Vector<T>::isEmpty();
-    }
-};
-
-#else
-
-#include <string>
-#include <vector>
-using std::string;
-using std::vector;
-
-#endif
-
-#endif
-
diff --git a/libwbxml/include/wbxml_tabledef.h b/libwbxml/include/wbxml_tabledef.h
deleted file mode 100644 (file)
index bbf0a5d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef WBXML_TABLEDEF_H
-#define WBXML_TABLEDEF_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct tagTokenData
-{
-    int token;
-    const char * tagName;
-} TokenData;
-
-typedef struct tagAttrData
-{
-    int token;
-    const char * attrName;
-    const char * attrValuePrefix;
-} AttrData;
-
-typedef struct tagTagCodePage
-{
-    int page;
-    int numTokens;
-    const TokenData * tags;
-} TagCodePage;
-
-typedef struct tagAttrCodePage
-{
-    int page;
-    int numTokens;
-    const AttrData * attrs;
-} AttrCodePage;
-
-#define PAGE_DATA(page, dataArray)  \
-    { page, sizeof(dataArray) / sizeof(dataArray[0]), dataArray }
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/libwbxml/include/xml2wbxml.h b/libwbxml/include/xml2wbxml.h
deleted file mode 100644 (file)
index 4da6c13..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef XML_TO_WBXML_ENCODER_H
-#define XML_TO_WBXML_ENCODER_H
-
-#include <expat.h>
-#include "wbxml_encoder.h"
-#include "wbxml_stl.h"
-#include "expat_parser.h"
-
-class Xml2WbxmlEncoder: public XmlContentHandler
-{
-public:
-    Xml2WbxmlEncoder();
-    ~Xml2WbxmlEncoder();
-
-    void setWbxmlHandler(WbxmlHandler * handler);
-
-    int encode(const char * data, uint32_t len, bool end);
-
-    void startElement(const char *name, const char **atts);
-    void endElement(const char *name);
-    void characters(const char *data, int len);
-    void startDoctype(const char *doctypeName, const char *sysid, const char *pubid,
-            int has_internal_subset);
-    void endDoctype(void) {}
-
-private:
-    WbxmlHandler * mWbxmlHandler;
-    WbxmlEncoder * mEncoder;
-    ExpatParser * mExpatParser;
-
-    int mPublicId;
-    int mDepth;
-    int mErrorCode;
-
-    bool detectPublicId(const char * pubid);
-    bool detectPublicIdByXmlns(const char * xmlnsUri);
-    bool isPublicIdSet(void) const
-    {
-        return mPublicId != -1;
-    }
-    void setPublicId(int id)
-    {
-        mPublicId = id;
-    }
-    int getErrorCode(void) const
-    {
-        return mErrorCode;
-    }
-    void setError(int err)
-    {
-        mErrorCode = err;
-    }
-};
-
-#endif
-
diff --git a/libwbxml/include/xml_handler.h b/libwbxml/include/xml_handler.h
deleted file mode 100644 (file)
index 3e4c040..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef XML_HANDLER_H
-#define XML_HANDLER_H
-
-class XmlContentHandler
-{
-public:
-    virtual ~XmlContentHandler() {}
-
-    virtual void startElement(const char *name, const char **atts) = 0;
-    virtual void endElement(const char *name) = 0;
-    virtual void characters(const char *data, int len) = 0;
-    virtual void startDoctype(const char *doctypeName, const char *sysid, const char *pubid,
-            int has_internal_subset) = 0;
-    virtual void endDoctype(void) = 0;
-};
-
-#endif
-
diff --git a/libwbxml/src/csp13inttags_hash.c b/libwbxml/src/csp13inttags_hash.c
deleted file mode 100644 (file)
index 5e935c7..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-/* C code produced by gperf version 3.0.1 */
-/* Command-line: gperf -G -C gperf/csp13inttags.gperf  */
-/* Computed positions: -k'1,11' */
-
-#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
-      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
-      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
-      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
-      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
-      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
-      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
-      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
-      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
-      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
-      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
-      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
-      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
-      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
-      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
-      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
-      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
-      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
-      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
-      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
-      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
-      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
-      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
-/* The character set is not based on ISO-646.  */
-error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
-#endif
-
-#line 1 "gperf/csp13inttags.gperf"
-
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include "csp13_hash.h"
-
-
-#define TOTAL_KEYWORDS 34
-#define MIN_WORD_LENGTH 4
-#define MAX_WORD_LENGTH 25
-#define MIN_HASH_VALUE 4
-#define MAX_HASH_VALUE 45
-/* maximum key range = 42, duplicates = 0 */
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static unsigned int
-hash (str, len)
-     register const char *str;
-     register unsigned int len;
-{
-  static const unsigned char asso_values[] =
-    {
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46,  5, 46,  0, 46, 46,
-      46, 25, 25, 46, 46, 20, 15,  0, 46, 46,
-       5, 46, 46,  5, 20, 15,  0, 25, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 15, 46, 15,
-      46,  5, 46, 46, 20,  5, 46, 46, 10,  5,
-       0,  0, 46, 46, 46,  5, 20, 46, 46, 46,
-       5, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-      46, 46, 46, 46, 46, 46
-    };
-  register int hval = len;
-
-  switch (hval)
-    {
-      default:
-        hval += asso_values[(unsigned char)str[10]];
-      /*FALLTHROUGH*/
-      case 10:
-      case 9:
-      case 8:
-      case 7:
-      case 6:
-      case 5:
-      case 4:
-      case 3:
-      case 2:
-      case 1:
-        hval += asso_values[(unsigned char)str[0]];
-        break;
-    }
-  return hval;
-}
-
-static const char * const wordlist[] =
-  {
-    "", "", "", "",
-    "Code",
-    "", "", "",
-    "Validity",
-    "",
-    "MultiTrans",
-    "PairID",
-    "MessageCount",
-    "",
-    "ChosenOptionID",
-    "ParserSize",
-    "ContentSize",
-    "SegmentCount",
-    "ServerPollMin",
-    "AnswerOptionID",
-    "SessionPriority",
-    "SearchIndex",
-    "UDPPort",
-    "ContentPolicyLimit",
-    "SearchFindings",
-    "MultiTransPerMessage",
-    "SegmentReference",
-    "TCPPort",
-    "AcceptedPushLength",
-    "MaxWatcherList",
-    "TimeToLive",
-    "UserSessionLimit",
-    "MessageTotalCount",
-    "AcceptedPullLength",
-    "",
-    "AcceptedTextContentLength",
-    "SearchLimit",
-    "WatcherCount",
-    "KeepAliveTime",
-    "",
-    "TryAgainTimeout",
-    "PlainTextCharSet",
-    "GroupContentLimit",
-    "HistoryPeriod",
-    "",
-    "AcceptedRichContentLength"
-  };
-
-#ifdef __GNUC__
-__inline
-#endif
-const char *
-in_word_set (str, len)
-     register const char *str;
-     register unsigned int len;
-{
-  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
-    {
-      register int key = hash (str, len);
-
-      if (key <= MAX_HASH_VALUE && key >= 0)
-        {
-          register const char *s = wordlist[key];
-
-          if (*str == *s && !strcmp (str + 1, s + 1))
-            return s;
-        }
-    }
-  return 0;
-}
-#line 58 "gperf/csp13inttags.gperf"
-
-
-int csp13IsIntegerTag(const char * str)
-{
-    const char * s = in_word_set(str, strlen(str));
-    return s ? 1 : 0;
-}
-
diff --git a/libwbxml/src/csp13tags_hash.c b/libwbxml/src/csp13tags_hash.c
deleted file mode 100644 (file)
index 36bc7cf..0000000
+++ /dev/null
@@ -1,1398 +0,0 @@
-/* C code produced by gperf version 3.0.1 */
-/* Command-line: gperf -G -C -F ,0 -t -NfindTag gperf/csp13tags.gperf  */
-/* Computed positions: -k'1-2,4,6,8,11,14,$' */
-
-#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
-      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
-      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
-      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
-      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
-      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
-      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
-      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
-      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
-      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
-      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
-      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
-      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
-      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
-      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
-      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
-      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
-      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
-      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
-      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
-      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
-      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
-      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
-/* The character set is not based on ISO-646.  */
-error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
-#endif
-
-#line 1 "gperf/csp13tags.gperf"
-
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include "csp13_hash.h"
-
-#line 23 "gperf/csp13tags.gperf"
-struct TagEntry {
-    const char * name;
-    int key;
-};
-
-#define TOTAL_KEYWORDS 442
-#define MIN_WORD_LENGTH 2
-#define MAX_WORD_LENGTH 32
-#define MIN_HASH_VALUE 9
-#define MAX_HASH_VALUE 1542
-/* maximum key range = 1534, duplicates = 0 */
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static unsigned int
-hash (str, len)
-     register const char *str;
-     register unsigned int len;
-{
-  static const unsigned short asso_values[] =
-    {
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543,  300, 1543, 1543, 1543,   20,
-        10, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543,   25,   50,   40,    5,  495,
-       130,  125,   35,  145,  385,    0,   35,  215,  305,   20,
-        15,    5,   90,  285,  350,    0,  365,  270,    5, 1543,
-         5, 1543, 1543, 1543, 1543,   10, 1543,   15,  435,   35,
-       165,    0,   50,  360,  210,    0, 1543,  190,   20,  160,
-        10,    5,  260,  320,    0,    5,    0,  105,  365,   75,
-        80,  260,    0, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543,
-      1543, 1543, 1543, 1543, 1543, 1543
-    };
-  register int hval = len;
-
-  switch (hval)
-    {
-      default:
-        hval += asso_values[(unsigned char)str[13]];
-      /*FALLTHROUGH*/
-      case 13:
-      case 12:
-      case 11:
-        hval += asso_values[(unsigned char)str[10]];
-      /*FALLTHROUGH*/
-      case 10:
-      case 9:
-      case 8:
-        hval += asso_values[(unsigned char)str[7]];
-      /*FALLTHROUGH*/
-      case 7:
-      case 6:
-        hval += asso_values[(unsigned char)str[5]];
-      /*FALLTHROUGH*/
-      case 5:
-      case 4:
-        hval += asso_values[(unsigned char)str[3]];
-      /*FALLTHROUGH*/
-      case 3:
-      case 2:
-        hval += asso_values[(unsigned char)str[1]];
-      /*FALLTHROUGH*/
-      case 1:
-        hval += asso_values[(unsigned char)str[0]];
-        break;
-    }
-  return hval + asso_values[(unsigned char)str[len - 1]];
-}
-
-static const struct TagEntry wordlist[] =
-  {
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0},
-#line 81 "gperf/csp13tags.gperf"
-    {"User", 0x0039},
-    {"",0}, {"",0}, {"",0},
-#line 83 "gperf/csp13tags.gperf"
-    {"UserList", 0x003b},
-#line 307 "gperf/csp13tags.gperf"
-    {"Zone", 0x0535},
-#line 366 "gperf/csp13tags.gperf"
-    {"Users", 0x071f},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 446 "gperf/csp13tags.gperf"
-    {"UserIDList", 0x093f},
-#line 82 "gperf/csp13tags.gperf"
-    {"UserID", 0x003a},
-    {"",0},
-#line 279 "gperf/csp13tags.gperf"
-    {"DirectContent", 0x0519},
-    {"",0}, {"",0}, {"",0},
-#line 213 "gperf/csp13tags.gperf"
-    {"UDPPort", 0x0313},
-#line 41 "gperf/csp13tags.gperf"
-    {"DateTime", 0x0011},
-    {"",0}, {"",0}, {"",0},
-#line 237 "gperf/csp13tags.gperf"
-    {"DeleteAttributeList-Request", 0x040c},
-    {"",0}, {"",0},
-#line 444 "gperf/csp13tags.gperf"
-    {"UserIDPair", 0x093d},
-    {"",0}, {"",0},
-#line 58 "gperf/csp13tags.gperf"
-    {"Presence", 0x0022},
-#line 356 "gperf/csp13tags.gperf"
-    {"Left", 0x0715},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 207 "gperf/csp13tags.gperf"
-    {"ParserSize", 0x030d},
-#line 454 "gperf/csp13tags.gperf"
-    {"PairID", 0x0a0c},
-#line 251 "gperf/csp13tags.gperf"
-    {"PresenceAuth-User", 0x041a},
-    {"",0},
-#line 35 "gperf/csp13tags.gperf"
-    {"Code", 0x000b},
-    {"",0},
-#line 392 "gperf/csp13tags.gperf"
-    {"Domain", 0x0906},
-    {"",0},
-#line 443 "gperf/csp13tags.gperf"
-    {"UnrecognizedUserID", 0x093c},
-#line 49 "gperf/csp13tags.gperf"
-    {"Logo", 0x0019},
-#line 403 "gperf/csp13tags.gperf"
-    {"Color", 0x0913},
-    {"",0},
-#line 182 "gperf/csp13tags.gperf"
-    {"PresenceFeat", 0x022f},
-#line 252 "gperf/csp13tags.gperf"
-    {"PresenceNotification-Request", 0x041b},
-    {"",0},
-#line 96 "gperf/csp13tags.gperf"
-    {"Disconnect", 0x0110},
-    {"",0}, {"",0},
-#line 60 "gperf/csp13tags.gperf"
-    {"PresenceValue", 0x0024},
-#line 57 "gperf/csp13tags.gperf"
-    {"Poll", 0x0021},
-    {"",0},
-#line 377 "gperf/csp13tags.gperf"
-    {"UserMapList", 0x072a},
-    {"",0}, {"",0}, {"",0},
-#line 262 "gperf/csp13tags.gperf"
-    {"Alias", 0x0508},
-#line 42 "gperf/csp13tags.gperf"
-    {"Description", 0x0012},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 34 "gperf/csp13tags.gperf"
-    {"ClientID", 0x000a},
-    {"",0},
-#line 29 "gperf/csp13tags.gperf"
-    {"Acceptance", 0x0005},
-    {"",0},
-#line 232 "gperf/csp13tags.gperf"
-    {"CreateAttributeList-Request", 0x0407},
-#line 270 "gperf/csp13tags.gperf"
-    {"ClientVersion", 0x0510},
-    {"",0},
-#line 267 "gperf/csp13tags.gperf"
-    {"ClientInfo", 0x050d},
-#line 236 "gperf/csp13tags.gperf"
-    {"DefaultList", 0x040b},
-#line 303 "gperf/csp13tags.gperf"
-    {"Contact", 0x0531},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 203 "gperf/csp13tags.gperf"
-    {"AnyContent", 0x0309},
-    {"",0}, {"",0},
-#line 235 "gperf/csp13tags.gperf"
-    {"DefaultContactList", 0x040a},
-    {"",0}, {"",0},
-#line 37 "gperf/csp13tags.gperf"
-    {"ContentData", 0x000d},
-#line 149 "gperf/csp13tags.gperf"
-    {"ContListFunc", 0x020c},
-    {"",0},
-#line 181 "gperf/csp13tags.gperf"
-    {"PresenceDeliverFunc", 0x022e},
-#line 64 "gperf/csp13tags.gperf"
-    {"RemoveList", 0x0028},
-    {"",0},
-#line 290 "gperf/csp13tags.gperf"
-    {"PreferredContacts", 0x0524},
-    {"",0},
-#line 63 "gperf/csp13tags.gperf"
-    {"Recipient", 0x0027},
-#line 289 "gperf/csp13tags.gperf"
-    {"PrefC", 0x0523},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 312 "gperf/csp13tags.gperf"
-    {"ClientContentLimit", 0x053b},
-#line 90 "gperf/csp13tags.gperf"
-    {"CapabilityList", 0x010a},
-    {"",0}, {"",0}, {"",0},
-#line 229 "gperf/csp13tags.gperf"
-    {"ContentPolicyLimit", 0x0324},
-    {"",0},
-#line 194 "gperf/csp13tags.gperf"
-    {"UPDPR", 0x023b},
-#line 36 "gperf/csp13tags.gperf"
-    {"ContactList", 0x000c},
-    {"",0},
-#line 79 "gperf/csp13tags.gperf"
-    {"URL", 0x0037},
-    {"",0}, {"",0}, {"",0},
-#line 294 "gperf/csp13tags.gperf"
-    {"Registration", 0x0528},
-#line 359 "gperf/csp13tags.gperf"
-    {"OwnProperties", 0x0718},
-    {"",0}, {"",0}, {"",0},
-#line 80 "gperf/csp13tags.gperf"
-    {"URLList", 0x0038},
-    {"",0},
-#line 400 "gperf/csp13tags.gperf"
-    {"Font", 0x0910},
-#line 250 "gperf/csp13tags.gperf"
-    {"PresenceAuth-Request", 0x0419},
-    {"",0}, {"",0}, {"",0},
-#line 65 "gperf/csp13tags.gperf"
-    {"RemoveNickList", 0x0029},
-    {"",0},
-#line 231 "gperf/csp13tags.gperf"
-    {"ContactListProperties", 0x0406},
-#line 249 "gperf/csp13tags.gperf"
-    {"UnsubscribePresence-Request", 0x0418},
-    {"",0},
-#line 89 "gperf/csp13tags.gperf"
-    {"CancelInviteUser-Request", 0x0108},
-    {"",0},
-#line 451 "gperf/csp13tags.gperf"
-    {"UnsubscribeNotification-Request", 0x0a09},
-#line 287 "gperf/csp13tags.gperf"
-    {"OnlineStatus", 0x0521},
-    {"",0},
-#line 316 "gperf/csp13tags.gperf"
-    {"BlockList", 0x0605},
-    {"",0},
-#line 395 "gperf/csp13tags.gperf"
-    {"IDList", 0x0909},
-    {"",0},
-#line 263 "gperf/csp13tags.gperf"
-    {"Altitude", 0x0509},
-#line 243 "gperf/csp13tags.gperf"
-    {"GetPresence-Request", 0x0412},
-#line 244 "gperf/csp13tags.gperf"
-    {"GetPresence-Response", 0x0413},
-#line 420 "gperf/csp13tags.gperf"
-    {"InText", 0x0924},
-    {"",0},
-#line 283 "gperf/csp13tags.gperf"
-    {"Latitude", 0x051d},
-    {"",0},
-#line 48 "gperf/csp13tags.gperf"
-    {"InUse", 0x0018},
-    {"",0},
-#line 469 "gperf/csp13tags.gperf"
-    {"ContactListIDList", 0x0b07},
-    {"",0},
-#line 468 "gperf/csp13tags.gperf"
-    {"BlockListInUse", 0x0b06},
-#line 101 "gperf/csp13tags.gperf"
-    {"InviteNote", 0x0115},
-    {"",0}, {"",0},
-#line 100 "gperf/csp13tags.gperf"
-    {"InviteID", 0x0114},
-#line 239 "gperf/csp13tags.gperf"
-    {"GetAttributeList-Request", 0x040e},
-#line 240 "gperf/csp13tags.gperf"
-    {"GetAttributeList-Response", 0x040f},
-    {"",0},
-#line 305 "gperf/csp13tags.gperf"
-    {"Cstatus", 0x0533},
-    {"",0},
-#line 268 "gperf/csp13tags.gperf"
-    {"ClientProducer", 0x050e},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 328 "gperf/csp13tags.gperf"
-    {"GrantList", 0x0611},
-    {"",0},
-#line 180 "gperf/csp13tags.gperf"
-    {"PresenceAuthFunc", 0x022d},
-    {"",0},
-#line 410 "gperf/csp13tags.gperf"
-    {"PublicProfile", 0x091a},
-#line 62 "gperf/csp13tags.gperf"
-    {"Qualifier", 0x0026},
-#line 234 "gperf/csp13tags.gperf"
-    {"DefaultAttributeList", 0x0409},
-#line 280 "gperf/csp13tags.gperf"
-    {"FreeTextLocation", 0x051a},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 224 "gperf/csp13tags.gperf"
-    {"UserSessionLimit", 0x031f},
-    {"",0}, {"",0},
-#line 467 "gperf/csp13tags.gperf"
-    {"GrantListInUse", 0x0b05},
-#line 163 "gperf/csp13tags.gperf"
-    {"GLBLU", 0x021c},
-#line 66 "gperf/csp13tags.gperf"
-    {"Result", 0x002a},
-#line 291 "gperf/csp13tags.gperf"
-    {"PreferredLanguage", 0x0525},
-    {"",0}, {"",0},
-#line 341 "gperf/csp13tags.gperf"
-    {"Admin", 0x0706},
-    {"",0},
-#line 260 "gperf/csp13tags.gperf"
-    {"Address", 0x0506},
-    {"",0}, {"",0},
-#line 215 "gperf/csp13tags.gperf"
-    {"UDPAddress", 0x0315},
-    {"",0},
-#line 86 "gperf/csp13tags.gperf"
-    {"AllFunctions", 0x0105},
-    {"",0},
-#line 87 "gperf/csp13tags.gperf"
-    {"AllFunctionsRequest", 0x0106},
-#line 302 "gperf/csp13tags.gperf"
-    {"Cname", 0x0530},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0},
-#line 43 "gperf/csp13tags.gperf"
-    {"DetailedResult", 0x0013},
-#line 265 "gperf/csp13tags.gperf"
-    {"Caddr", 0x050b},
-#line 281 "gperf/csp13tags.gperf"
-    {"GeoLocation", 0x051b},
-#line 95 "gperf/csp13tags.gperf"
-    {"DigestSchema", 0x010f},
-#line 394 "gperf/csp13tags.gperf"
-    {"HistoryPeriod", 0x0908},
-    {"",0},
-#line 88 "gperf/csp13tags.gperf"
-    {"CancelInvite-Request", 0x0107},
-#line 439 "gperf/csp13tags.gperf"
-    {"RequiresResponse", 0x0938},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 30 "gperf/csp13tags.gperf"
-    {"AddList", 0x0006},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 285 "gperf/csp13tags.gperf"
-    {"Model", 0x051f},
-#line 273 "gperf/csp13tags.gperf"
-    {"ContactInfo", 0x0513},
-#line 381 "gperf/csp13tags.gperf"
-    {"MP", 0x0805},
-    {"",0}, {"",0},
-#line 271 "gperf/csp13tags.gperf"
-    {"CommC", 0x0511},
-    {"",0}, {"",0}, {"",0},
-#line 111 "gperf/csp13tags.gperf"
-    {"Logout-Request", 0x011f},
-#line 199 "gperf/csp13tags.gperf"
-    {"AcceptedCharset", 0x0305},
-    {"",0}, {"",0},
-#line 255 "gperf/csp13tags.gperf"
-    {"AutoSubscribe", 0x041E},
-#line 256 "gperf/csp13tags.gperf"
-    {"GetReactiveAuthStatus-Request", 0x041f},
-#line 257 "gperf/csp13tags.gperf"
-    {"GetReactiveAuthStatus-Response", 0x0420},
-    {"",0}, {"",0}, {"",0},
-#line 201 "gperf/csp13tags.gperf"
-    {"AcceptedContentType", 0x0307},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 349 "gperf/csp13tags.gperf"
-    {"GroupProperties", 0x070e},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 144 "gperf/csp13tags.gperf"
-    {"AttListFunc", 0x0206},
-    {"",0},
-#line 391 "gperf/csp13tags.gperf"
-    {"CIR", 0x0905},
-#line 47 "gperf/csp13tags.gperf"
-    {"GroupList", 0x0017},
-#line 432 "gperf/csp13tags.gperf"
-    {"UserNotify", 0x0931},
-    {"",0},
-#line 91 "gperf/csp13tags.gperf"
-    {"CapabilityRequest", 0x010b},
-    {"",0},
-#line 343 "gperf/csp13tags.gperf"
-    {"DeleteGroup-Request", 0x0708},
-#line 150 "gperf/csp13tags.gperf"
-    {"CREAG", 0x020d},
-#line 94 "gperf/csp13tags.gperf"
-    {"DigestBytes", 0x010e},
-#line 168 "gperf/csp13tags.gperf"
-    {"GroupUseFunc", 0x0221},
-    {"",0},
-#line 401 "gperf/csp13tags.gperf"
-    {"Size", 0x0911},
-#line 292 "gperf/csp13tags.gperf"
-    {"ReferredContent", 0x0526},
-#line 298 "gperf/csp13tags.gperf"
-    {"Street", 0x052c},
-    {"",0}, {"",0},
-#line 97 "gperf/csp13tags.gperf"
-    {"Functions", 0x0111},
-#line 278 "gperf/csp13tags.gperf"
-    {"DevManufacturer", 0x0518},
-    {"",0},
-#line 253 "gperf/csp13tags.gperf"
-    {"UpdatePresence-Request", 0x041c},
-#line 261 "gperf/csp13tags.gperf"
-    {"AddrPref", 0x0507},
-    {"",0},
-#line 297 "gperf/csp13tags.gperf"
-    {"StatusText", 0x052b},
-#line 73 "gperf/csp13tags.gperf"
-    {"Status", 0x0031},
-#line 348 "gperf/csp13tags.gperf"
-    {"GroupChangeNotice", 0x070d},
-    {"",0}, {"",0},
-#line 174 "gperf/csp13tags.gperf"
-    {"InviteFunc", 0x0227},
-    {"",0},
-#line 441 "gperf/csp13tags.gperf"
-    {"GroupContentLimit", 0x093a},
-#line 295 "gperf/csp13tags.gperf"
-    {"StatusContent", 0x0529},
-    {"",0},
-#line 402 "gperf/csp13tags.gperf"
-    {"Style", 0x0912},
-    {"",0},
-#line 69 "gperf/csp13tags.gperf"
-    {"Session", 0x002d},
-    {"",0},
-#line 306 "gperf/csp13tags.gperf"
-    {"Note", 0x0534},
-    {"",0},
-#line 139 "gperf/csp13tags.gperf"
-    {"OtherServer", 0x013c},
-    {"",0},
-#line 301 "gperf/csp13tags.gperf"
-    {"Cap", 0x052f},
-    {"",0}, {"",0}, {"",0},
-#line 275 "gperf/csp13tags.gperf"
-    {"Country", 0x0515},
-    {"",0},
-#line 54 "gperf/csp13tags.gperf"
-    {"Name", 0x001e},
-    {"",0}, {"",0},
-#line 398 "gperf/csp13tags.gperf"
-    {"Watcher", 0x090e},
-    {"",0}, {"",0},
-#line 269 "gperf/csp13tags.gperf"
-    {"ClientType", 0x050f},
-    {"",0}, {"",0}, {"",0},
-#line 342 "gperf/csp13tags.gperf"
-    {"CreateGroup-Request", 0x0707},
-#line 175 "gperf/csp13tags.gperf"
-    {"MBRAC", 0x0228},
-    {"",0}, {"",0}, {"",0},
-#line 151 "gperf/csp13tags.gperf"
-    {"DCLI", 0x020f},
-    {"",0}, {"",0}, {"",0},
-#line 228 "gperf/csp13tags.gperf"
-    {"ContentPolicy", 0x0323},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 112 "gperf/csp13tags.gperf"
-    {"Nonce", 0x0120},
-#line 39 "gperf/csp13tags.gperf"
-    {"ContentSize", 0x000f},
-    {"",0},
-#line 109 "gperf/csp13tags.gperf"
-    {"Login-Request", 0x011d},
-#line 311 "gperf/csp13tags.gperf"
-    {"Text", 0x053a},
-#line 67 "gperf/csp13tags.gperf"
-    {"ScreenName", 0x002b},
-    {"",0}, {"",0}, {"",0},
-#line 110 "gperf/csp13tags.gperf"
-    {"Login-Response", 0x011e},
-    {"",0},
-#line 205 "gperf/csp13tags.gperf"
-    {"InitialDeliveryMethod", 0x030b},
-    {"",0},
-#line 299 "gperf/csp13tags.gperf"
-    {"TimeZone", 0x052d},
-#line 102 "gperf/csp13tags.gperf"
-    {"Invite-Request", 0x0116},
-#line 130 "gperf/csp13tags.gperf"
-    {"TimeToLive", 0x0132},
-#line 170 "gperf/csp13tags.gperf"
-    {"IMFeat", 0x0223},
-#line 415 "gperf/csp13tags.gperf"
-    {"AuthorizeAndGrant", 0x091f},
-#line 414 "gperf/csp13tags.gperf"
-    {"ApplicationID", 0x091e},
-#line 286 "gperf/csp13tags.gperf"
-    {"NamedArea", 0x0520},
-    {"",0},
-#line 404 "gperf/csp13tags.gperf"
-    {"ContentName", 0x0914},
-#line 115 "gperf/csp13tags.gperf"
-    {"ResponseNote", 0x0123},
-    {"",0},
-#line 148 "gperf/csp13tags.gperf"
-    {"CCLI", 0x020b},
-#line 143 "gperf/csp13tags.gperf"
-    {"ADDGM", 0x0205},
-    {"",0}, {"",0},
-#line 113 "gperf/csp13tags.gperf"
-    {"Password", 0x0121},
-#line 258 "gperf/csp13tags.gperf"
-    {"CreateList-Response", 0x0421},
-    {"",0}, {"",0},
-#line 438 "gperf/csp13tags.gperf"
-    {"WatcherCount", 0x0937},
-    {"",0},
-#line 166 "gperf/csp13tags.gperf"
-    {"GroupFeat", 0x021f},
-    {"",0}, {"",0},
-#line 46 "gperf/csp13tags.gperf"
-    {"GroupID", 0x0016},
-#line 358 "gperf/csp13tags.gperf"
-    {"Mod", 0x0717},
-#line 248 "gperf/csp13tags.gperf"
-    {"ListManage-Response", 0x0417},
-    {"",0},
-#line 397 "gperf/csp13tags.gperf"
-    {"AnswerOptionText", 0x090b},
-#line 417 "gperf/csp13tags.gperf"
-    {"ContactListNotify", 0x0921},
-#line 413 "gperf/csp13tags.gperf"
-    {"AnswerOptions", 0x091d},
-    {"",0}, {"",0}, {"",0},
-#line 411 "gperf/csp13tags.gperf"
-    {"AnswerOption", 0x091b},
-    {"",0},
-#line 412 "gperf/csp13tags.gperf"
-    {"AnswerOptionID", 0x091c},
-    {"",0},
-#line 445 "gperf/csp13tags.gperf"
-    {"ValidUserID", 0x093e},
-    {"",0},
-#line 77 "gperf/csp13tags.gperf"
-    {"TransactionID", 0x0035},
-    {"",0}, {"",0},
-#line 74 "gperf/csp13tags.gperf"
-    {"Transaction", 0x0032},
-#line 457 "gperf/csp13tags.gperf"
-    {"UpdatePublicProfile-Request", 0x0a0f},
-#line 165 "gperf/csp13tags.gperf"
-    {"GroupAuthFunc", 0x021e},
-    {"",0},
-#line 390 "gperf/csp13tags.gperf"
-    {"ADVSR", 0x080e},
-#line 76 "gperf/csp13tags.gperf"
-    {"TransactionDescriptor", 0x0034},
-#line 212 "gperf/csp13tags.gperf"
-    {"TCPPort", 0x0312},
-#line 75 "gperf/csp13tags.gperf"
-    {"TransactionContent", 0x0033},
-#line 361 "gperf/csp13tags.gperf"
-    {"RejectList-Response", 0x071a},
-    {"",0},
-#line 40 "gperf/csp13tags.gperf"
-    {"ContentType", 0x0010},
-#line 324 "gperf/csp13tags.gperf"
-    {"GetMessageList-Request", 0x060d},
-#line 325 "gperf/csp13tags.gperf"
-    {"GetMessageList-Response", 0x060e},
-#line 310 "gperf/csp13tags.gperf"
-    {"Link", 0x0539},
-#line 146 "gperf/csp13tags.gperf"
-    {"CAAUT", 0x0208},
-#line 449 "gperf/csp13tags.gperf"
-    {"VersionList", 0x0a07},
-    {"",0}, {"",0},
-#line 277 "gperf/csp13tags.gperf"
-    {"Crossing2", 0x0517},
-#line 104 "gperf/csp13tags.gperf"
-    {"InviteType", 0x0118},
-#line 333 "gperf/csp13tags.gperf"
-    {"RejectMessage-Request", 0x0616},
-#line 322 "gperf/csp13tags.gperf"
-    {"GetBlockedList-Request", 0x060b},
-#line 323 "gperf/csp13tags.gperf"
-    {"GetBlockedList-Response", 0x060c},
-#line 274 "gperf/csp13tags.gperf"
-    {"ContainedvCard", 0x0514},
-    {"",0},
-#line 380 "gperf/csp13tags.gperf"
-    {"LeftBlocked", 0x072d},
-    {"",0},
-#line 282 "gperf/csp13tags.gperf"
-    {"Language", 0x051c},
-#line 276 "gperf/csp13tags.gperf"
-    {"Crossing1", 0x0516},
-    {"",0},
-#line 453 "gperf/csp13tags.gperf"
-    {"AdvancedCriteria", 0x0a0b},
-#line 337 "gperf/csp13tags.gperf"
-    {"DeliveryTime", 0x061a},
-    {"",0}, {"",0},
-#line 452 "gperf/csp13tags.gperf"
-    {"Notification-Request", 0x0a0a},
-    {"",0}, {"",0}, {"",0},
-#line 458 "gperf/csp13tags.gperf"
-    {"DropSegment-Request", 0x0a10},
-    {"",0}, {"",0}, {"",0},
-#line 293 "gperf/csp13tags.gperf"
-    {"ReferredvCard", 0x0527},
-#line 191 "gperf/csp13tags.gperf"
-    {"SRCH", 0x0238},
-    {"",0}, {"",0},
-#line 321 "gperf/csp13tags.gperf"
-    {"ForwardMessage-Request", 0x060a},
-#line 339 "gperf/csp13tags.gperf"
-    {"ForwardMessage-Response", 0x0621},
-#line 71 "gperf/csp13tags.gperf"
-    {"SessionID", 0x002f},
-    {"",0},
-#line 68 "gperf/csp13tags.gperf"
-    {"Sender", 0x002c},
-    {"",0},
-#line 217 "gperf/csp13tags.gperf"
-    {"AcceptedPushLength", 0x0317},
-#line 155 "gperf/csp13tags.gperf"
-    {"GCLI", 0x0214},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 197 "gperf/csp13tags.gperf"
-    {"MG", 0x023e},
-    {"",0},
-#line 384 "gperf/csp13tags.gperf"
-    {"VRID", 0x0808},
-#line 296 "gperf/csp13tags.gperf"
-    {"StatusMood", 0x052a},
-    {"",0}, {"",0},
-#line 216 "gperf/csp13tags.gperf"
-    {"AcceptedPullLength", 0x0316},
-#line 334 "gperf/csp13tags.gperf"
-    {"SendMessage-Request", 0x0617},
-#line 335 "gperf/csp13tags.gperf"
-    {"SendMessage-Response", 0x0618},
-#line 200 "gperf/csp13tags.gperf"
-    {"AcceptedContentLength", 0x0306},
-#line 196 "gperf/csp13tags.gperf"
-    {"MF", 0x023d},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 106 "gperf/csp13tags.gperf"
-    {"InviteUser-Response", 0x011a},
-#line 59 "gperf/csp13tags.gperf"
-    {"PresenceSubList", 0x0023},
-    {"",0},
-#line 272 "gperf/csp13tags.gperf"
-    {"CommCap", 0x0512},
-#line 140 "gperf/csp13tags.gperf"
-    {"PresenceAttributeNSName", 0x013d},
-    {"",0},
-#line 85 "gperf/csp13tags.gperf"
-    {"Value", 0x003d},
-    {"",0}, {"",0},
-#line 405 "gperf/csp13tags.gperf"
-    {"Map", 0x0915},
-    {"",0},
-#line 45 "gperf/csp13tags.gperf"
-    {"Group", 0x0015},
-#line 242 "gperf/csp13tags.gperf"
-    {"GetList-Response", 0x0411},
-    {"",0}, {"",0}, {"",0},
-#line 218 "gperf/csp13tags.gperf"
-    {"AcceptedRichContentLength", 0x0318},
-#line 133 "gperf/csp13tags.gperf"
-    {"ReceiveList", 0x0136},
-    {"",0},
-#line 55 "gperf/csp13tags.gperf"
-    {"NickList", 0x001f},
-    {"",0}, {"",0},
-#line 120 "gperf/csp13tags.gperf"
-    {"SearchLimit", 0x0128},
-    {"",0}, {"",0},
-#line 466 "gperf/csp13tags.gperf"
-    {"SegmentContent", 0x0a18},
-    {"",0}, {"",0}, {"",0},
-#line 118 "gperf/csp13tags.gperf"
-    {"SearchID", 0x0126},
-    {"",0}, {"",0}, {"",0},
-#line 421 "gperf/csp13tags.gperf"
-    {"SegmentCount", 0x0925},
-#line 56 "gperf/csp13tags.gperf"
-    {"NickName", 0x0020},
-#line 117 "gperf/csp13tags.gperf"
-    {"SearchFindings", 0x0125},
-#line 465 "gperf/csp13tags.gperf"
-    {"SearchPair", 0x0a17},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 103 "gperf/csp13tags.gperf"
-    {"Invite-Response", 0x0117},
-    {"",0},
-#line 125 "gperf/csp13tags.gperf"
-    {"SearchResult", 0x012d},
-#line 116 "gperf/csp13tags.gperf"
-    {"SearchElement", 0x0124},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 92 "gperf/csp13tags.gperf"
-    {"ClientCapability-Request", 0x010c},
-#line 93 "gperf/csp13tags.gperf"
-    {"ClientCapability-Response", 0x010d},
-    {"",0}, {"",0},
-#line 128 "gperf/csp13tags.gperf"
-    {"SessionCookie", 0x0130},
-#line 319 "gperf/csp13tags.gperf"
-    {"DeliveryReport", 0x0608},
-    {"",0},
-#line 362 "gperf/csp13tags.gperf"
-    {"RemoveGroupMembers-Request", 0x071b},
-#line 371 "gperf/csp13tags.gperf"
-    {"GetJoinedUsers-Request", 0x0724},
-#line 372 "gperf/csp13tags.gperf"
-    {"GetJoinedUsers-Response", 0x0725},
-    {"",0},
-#line 219 "gperf/csp13tags.gperf"
-    {"AcceptedTextContentLength", 0x0319},
-    {"",0},
-#line 320 "gperf/csp13tags.gperf"
-    {"DeliveryReport-Request", 0x0609},
-#line 309 "gperf/csp13tags.gperf"
-    {"InfoLink", 0x0538},
-    {"",0},
-#line 332 "gperf/csp13tags.gperf"
-    {"NewMessage", 0x0615},
-#line 313 "gperf/csp13tags.gperf"
-    {"ClientIMPriority", 0x053c},
-    {"",0},
-#line 308 "gperf/csp13tags.gperf"
-    {"Inf_link", 0x0537},
-#line 416 "gperf/csp13tags.gperf"
-    {"ChosenOptionID", 0x0920},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 122 "gperf/csp13tags.gperf"
-    {"SearchPairList", 0x012a},
-#line 164 "gperf/csp13tags.gperf"
-    {"GRCHN", 0x021d},
-    {"",0}, {"",0}, {"",0},
-#line 266 "gperf/csp13tags.gperf"
-    {"City", 0x050c},
-#line 78 "gperf/csp13tags.gperf"
-    {"TransactionMode", 0x0036},
-#line 434 "gperf/csp13tags.gperf"
-    {"VerificationMechanism", 0x0933},
-    {"",0}, {"",0},
-#line 304 "gperf/csp13tags.gperf"
-    {"Cpriority", 0x0532},
-    {"",0},
-#line 424 "gperf/csp13tags.gperf"
-    {"SegmentReference", 0x0928},
-    {"",0}, {"",0},
-#line 284 "gperf/csp13tags.gperf"
-    {"Longitude", 0x051e},
-    {"",0},
-#line 31 "gperf/csp13tags.gperf"
-    {"AddNickList", 0x0007},
-    {"",0},
-#line 351 "gperf/csp13tags.gperf"
-    {"JoinedRequest", 0x0710},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 409 "gperf/csp13tags.gperf"
-    {"ClearPublicProfile", 0x0919},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 222 "gperf/csp13tags.gperf"
-    {"SessionPriority", 0x031c},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 211 "gperf/csp13tags.gperf"
-    {"TCPAddress", 0x0311},
-    {"",0}, {"",0}, {"",0},
-#line 455 "gperf/csp13tags.gperf"
-    {"GetPublicProfile-Request", 0x0a0d},
-#line 456 "gperf/csp13tags.gperf"
-    {"GetPublicProfile-Response", 0x0a0e},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 179 "gperf/csp13tags.gperf"
-    {"NOTIF", 0x022c},
-#line 406 "gperf/csp13tags.gperf"
-    {"NotificationType", 0x0916},
-    {"",0}, {"",0},
-#line 318 "gperf/csp13tags.gperf"
-    {"DeliveryMethod", 0x0607},
-#line 407 "gperf/csp13tags.gperf"
-    {"NotificationTypeList", 0x0917},
-    {"",0},
-#line 70 "gperf/csp13tags.gperf"
-    {"SessionDescriptor", 0x002e},
-    {"",0},
-#line 422 "gperf/csp13tags.gperf"
-    {"SegmentID", 0x0926},
-    {"",0}, {"",0}, {"",0},
-#line 418 "gperf/csp13tags.gperf"
-    {"DefaultNotify", 0x0922},
-#line 214 "gperf/csp13tags.gperf"
-    {"CIRHTTPAddress", 0x0314},
-#line 153 "gperf/csp13tags.gperf"
-    {"FundamentalFeat", 0x0211},
-#line 423 "gperf/csp13tags.gperf"
-    {"SegmentInfo", 0x0927},
-    {"",0},
-#line 399 "gperf/csp13tags.gperf"
-    {"WatcherStatus", 0x090f},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 141 "gperf/csp13tags.gperf"
-    {"SessionNSName", 0x013e},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 50 "gperf/csp13tags.gperf"
-    {"MessageCount", 0x001a},
-#line 238 "gperf/csp13tags.gperf"
-    {"DeleteList-Request", 0x040d},
-    {"",0},
-#line 187 "gperf/csp13tags.gperf"
-    {"SearchFunc", 0x0234},
-#line 134 "gperf/csp13tags.gperf"
-    {"VerifyID-Request", 0x0137},
-#line 198 "gperf/csp13tags.gperf"
-    {"MM", 0x023f},
-    {"",0}, {"",0},
-#line 186 "gperf/csp13tags.gperf"
-    {"RMVGM", 0x0233},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 72 "gperf/csp13tags.gperf"
-    {"SessionType", 0x0030},
-    {"",0},
-#line 108 "gperf/csp13tags.gperf"
-    {"KeepAliveTime", 0x011c},
-    {"",0},
-#line 433 "gperf/csp13tags.gperf"
-    {"VerificationKey", 0x0932},
-    {"",0},
-#line 245 "gperf/csp13tags.gperf"
-    {"GetWatcherList-Request", 0x0414},
-#line 246 "gperf/csp13tags.gperf"
-    {"GetWatcherList-Response", 0x0415},
-#line 288 "gperf/csp13tags.gperf"
-    {"PLMN", 0x0522},
-#line 209 "gperf/csp13tags.gperf"
-    {"SupportedBearer", 0x030f},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0},
-#line 202 "gperf/csp13tags.gperf"
-    {"AcceptedTransferEncoding", 0x0308},
-#line 172 "gperf/csp13tags.gperf"
-    {"IMSendFunc", 0x0225},
-#line 119 "gperf/csp13tags.gperf"
-    {"SearchIndex", 0x0127},
-    {"",0}, {"",0}, {"",0},
-#line 431 "gperf/csp13tags.gperf"
-    {"TryAgainTimeout", 0x0930},
-    {"",0},
-#line 373 "gperf/csp13tags.gperf"
-    {"AdminMapList", 0x0726},
-    {"",0},
-#line 327 "gperf/csp13tags.gperf"
-    {"GetMessage-Response", 0x0610},
-    {"",0}, {"",0},
-#line 385 "gperf/csp13tags.gperf"
-    {"VerifyIDFunc", 0x0809},
-    {"",0}, {"",0},
-#line 114 "gperf/csp13tags.gperf"
-    {"Polling-Request", 0x0122},
-    {"",0}, {"",0},
-#line 233 "gperf/csp13tags.gperf"
-    {"CreateList-Request", 0x0408},
-    {"",0}, {"",0},
-#line 221 "gperf/csp13tags.gperf"
-    {"PlainTextCharset", 0x031b},
-    {"",0},
-#line 344 "gperf/csp13tags.gperf"
-    {"GetGroupMembers-Request", 0x0709},
-#line 345 "gperf/csp13tags.gperf"
-    {"GetGroupMembers-Response", 0x070a},
-#line 206 "gperf/csp13tags.gperf"
-    {"MultiTrans", 0x030c},
-    {"",0}, {"",0},
-#line 247 "gperf/csp13tags.gperf"
-    {"ListManage-Request", 0x0416},
-#line 123 "gperf/csp13tags.gperf"
-    {"Search-Request", 0x012b},
-    {"",0}, {"",0},
-#line 142 "gperf/csp13tags.gperf"
-    {"TransactionNSName", 0x013f},
-#line 259 "gperf/csp13tags.gperf"
-    {"Accuracy", 0x0505},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0},
-#line 352 "gperf/csp13tags.gperf"
-    {"JoinGroup-Request", 0x0711},
-    {"",0}, {"",0},
-#line 152 "gperf/csp13tags.gperf"
-    {"DELGR", 0x0210},
-    {"",0},
-#line 223 "gperf/csp13tags.gperf"
-    {"SupportedOfflineBearer", 0x031d},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 408 "gperf/csp13tags.gperf"
-    {"FriendlyName", 0x0918},
-#line 360 "gperf/csp13tags.gperf"
-    {"RejectList-Request", 0x0719},
-    {"",0},
-#line 160 "gperf/csp13tags.gperf"
-    {"GETPR", 0x0219},
-    {"",0}, {"",0},
-#line 425 "gperf/csp13tags.gperf"
-    {"SystemMessage", 0x0929},
-    {"",0},
-#line 52 "gperf/csp13tags.gperf"
-    {"MessageURI", 0x001c},
-#line 350 "gperf/csp13tags.gperf"
-    {"Joined", 0x070f},
-    {"",0}, {"",0},
-#line 51 "gperf/csp13tags.gperf"
-    {"MessageID", 0x001b},
-#line 147 "gperf/csp13tags.gperf"
-    {"CAINV", 0x0209},
-    {"",0},
-#line 470 "gperf/csp13tags.gperf"
-    {"AnswerOptionsText", 0x0b08},
-    {"",0}, {"",0},
-#line 145 "gperf/csp13tags.gperf"
-    {"BLENT", 0x0207},
-#line 330 "gperf/csp13tags.gperf"
-    {"MessageInfo", 0x0613},
-    {"",0}, {"",0}, {"",0},
-#line 338 "gperf/csp13tags.gperf"
-    {"MessageInfoList", 0x0620},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 32 "gperf/csp13tags.gperf"
-    {"SName", 0x0008},
-    {"",0}, {"",0},
-#line 167 "gperf/csp13tags.gperf"
-    {"GroupMgmtFunc", 0x0220},
-#line 396 "gperf/csp13tags.gperf"
-    {"MaxWatcherList", 0x090a},
-    {"",0}, {"",0}, {"",0},
-#line 340 "gperf/csp13tags.gperf"
-    {"AddGroupMembers-Request", 0x0705},
-    {"",0},
-#line 157 "gperf/csp13tags.gperf"
-    {"GETGP", 0x0216},
-#line 329 "gperf/csp13tags.gperf"
-    {"MessageDelivered", 0x0612},
-    {"",0}, {"",0}, {"",0},
-#line 192 "gperf/csp13tags.gperf"
-    {"STSRC", 0x0239},
-    {"",0},
-#line 427 "gperf/csp13tags.gperf"
-    {"SystemMessageList", 0x092b},
-    {"",0},
-#line 368 "gperf/csp13tags.gperf"
-    {"JoinGroup", 0x0721},
-#line 44 "gperf/csp13tags.gperf"
-    {"EntityList", 0x0014},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 367 "gperf/csp13tags.gperf"
-    {"WelcomeNote", 0x0720},
-#line 419 "gperf/csp13tags.gperf"
-    {"ExtendConversationUser", 0x0923},
-    {"",0}, {"",0},
-#line 437 "gperf/csp13tags.gperf"
-    {"ExtendConversationID", 0x0936},
-#line 460 "gperf/csp13tags.gperf"
-    {"ExtendConversation-Request", 0x0a12},
-#line 459 "gperf/csp13tags.gperf"
-    {"ExtendConversation-Response", 0x0a11},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 189 "gperf/csp13tags.gperf"
-    {"SETD", 0x0236},
-    {"",0}, {"",0}, {"",0},
-#line 105 "gperf/csp13tags.gperf"
-    {"InviteUser-Request", 0x0119},
-    {"",0},
-#line 357 "gperf/csp13tags.gperf"
-    {"MemberAccess-Request", 0x0716},
-    {"",0}, {"",0},
-#line 61 "gperf/csp13tags.gperf"
-    {"Property", 0x0025},
-    {"",0},
-#line 241 "gperf/csp13tags.gperf"
-    {"GetList-Request", 0x0410},
-    {"",0}, {"",0}, {"",0},
-#line 435 "gperf/csp13tags.gperf"
-    {"GetMap-Request", 0x0934},
-#line 204 "gperf/csp13tags.gperf"
-    {"DefaultLanguage", 0x030a},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 154 "gperf/csp13tags.gperf"
-    {"FWMSG", 0x0212},
-    {"",0},
-#line 98 "gperf/csp13tags.gperf"
-    {"GetSPInfo-Request", 0x0112},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 169 "gperf/csp13tags.gperf"
-    {"IMAuthFunc", 0x0222},
-    {"",0}, {"",0}, {"",0},
-#line 176 "gperf/csp13tags.gperf"
-    {"MCLS", 0x0229},
-#line 388 "gperf/csp13tags.gperf"
-    {"EXCON", 0x080c},
-#line 428 "gperf/csp13tags.gperf"
-    {"SystemMessageResponse", 0x092c},
-    {"",0}, {"",0}, {"",0},
-#line 429 "gperf/csp13tags.gperf"
-    {"SystemMessageResponseList", 0x092d},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 346 "gperf/csp13tags.gperf"
-    {"GetGroupProps-Request", 0x070b},
-#line 347 "gperf/csp13tags.gperf"
-    {"GetGroupProps-Response", 0x070c},
-    {"",0}, {"",0},
-#line 184 "gperf/csp13tags.gperf"
-    {"REJCM", 0x0231},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 230 "gperf/csp13tags.gperf"
-    {"CancelAuth-Request", 0x0405},
-#line 355 "gperf/csp13tags.gperf"
-    {"LeaveGroup-Response", 0x0714},
-#line 254 "gperf/csp13tags.gperf"
-    {"SubscribePresence-Request", 0x041d},
-    {"",0},
-#line 107 "gperf/csp13tags.gperf"
-    {"KeepAlive-Request", 0x011b},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 124 "gperf/csp13tags.gperf"
-    {"Search-Response", 0x012c},
-    {"",0},
-#line 375 "gperf/csp13tags.gperf"
-    {"Mapping", 0x0728},
-#line 315 "gperf/csp13tags.gperf"
-    {"MaxPushLength", 0x053e},
-    {"",0}, {"",0},
-#line 386 "gperf/csp13tags.gperf"
-    {"GETMAP", 0x080a},
-    {"",0},
-#line 353 "gperf/csp13tags.gperf"
-    {"JoinGroup-Response", 0x0712},
-    {"",0},
-#line 158 "gperf/csp13tags.gperf"
-    {"GETLM", 0x0217},
-    {"",0},
-#line 131 "gperf/csp13tags.gperf"
-    {"SearchString", 0x0133},
-#line 171 "gperf/csp13tags.gperf"
-    {"IMReceiveFunc", 0x0224},
-#line 317 "gperf/csp13tags.gperf"
-    {"BlockEntity-Request", 0x0606},
-    {"",0}, {"",0}, {"",0},
-#line 314 "gperf/csp13tags.gperf"
-    {"MaxPullLength", 0x053d},
-    {"",0},
-#line 426 "gperf/csp13tags.gperf"
-    {"SystemMessageID", 0x092a},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 208 "gperf/csp13tags.gperf"
-    {"ServerPollMin", 0x030e},
-    {"",0}, {"",0},
-#line 188 "gperf/csp13tags.gperf"
-    {"ServiceFunc", 0x0235},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 264 "gperf/csp13tags.gperf"
-    {"Building", 0x050a},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 84 "gperf/csp13tags.gperf"
-    {"Validity", 0x003c},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 450 "gperf/csp13tags.gperf"
-    {"SubscribeNotification-Request", 0x0a08},
-    {"",0},
-#line 369 "gperf/csp13tags.gperf"
-    {"SubscribeNotification", 0x0722},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 135 "gperf/csp13tags.gperf"
-    {"Extended-Request", 0x0138},
-    {"",0}, {"",0},
-#line 33 "gperf/csp13tags.gperf"
-    {"WV-CSP-Message", 0x0009},
-#line 190 "gperf/csp13tags.gperf"
-    {"SETGP", 0x0237},
-    {"",0},
-#line 136 "gperf/csp13tags.gperf"
-    {"Extended-Response", 0x0139},
-    {"",0}, {"",0},
-#line 162 "gperf/csp13tags.gperf"
-    {"GETWL", 0x021b},
-    {"",0},
-#line 138 "gperf/csp13tags.gperf"
-    {"ExtendedData", 0x013b},
-    {"",0}, {"",0},
-#line 226 "gperf/csp13tags.gperf"
-    {"MultiTransPerMessage", 0x0321},
-    {"",0}, {"",0},
-#line 225 "gperf/csp13tags.gperf"
-    {"CIRSMSAddress", 0x0320},
-    {"",0},
-#line 38 "gperf/csp13tags.gperf"
-    {"ContentEncoding", 0x000e},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0},
-#line 331 "gperf/csp13tags.gperf"
-    {"MessageNotification", 0x0614},
-#line 173 "gperf/csp13tags.gperf"
-    {"INVIT", 0x0226},
-    {"",0}, {"",0},
-#line 379 "gperf/csp13tags.gperf"
-    {"JoinedBlocked", 0x072c},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 227 "gperf/csp13tags.gperf"
-    {"OnlineETEMHandling", 0x0322},
-    {"",0},
-#line 336 "gperf/csp13tags.gperf"
-    {"SetDeliveryMethod-Request", 0x0619},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 156 "gperf/csp13tags.gperf"
-    {"GETGM", 0x0215},
-    {"",0},
-#line 442 "gperf/csp13tags.gperf"
-    {"MessageTotalCount", 0x093b},
-    {"",0}, {"",0},
-#line 436 "gperf/csp13tags.gperf"
-    {"GetMap-Response", 0x0935},
-    {"",0}, {"",0},
-#line 99 "gperf/csp13tags.gperf"
-    {"GetSPInfo-Response", 0x0113},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 210 "gperf/csp13tags.gperf"
-    {"SupportedCIRMethod", 0x0310},
-    {"",0},
-#line 183 "gperf/csp13tags.gperf"
-    {"REACT", 0x0230},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0},
-#line 177 "gperf/csp13tags.gperf"
-    {"MDELIV", 0x022a},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 326 "gperf/csp13tags.gperf"
-    {"GetMessage-Request", 0x060f},
-    {"",0}, {"",0},
-#line 363 "gperf/csp13tags.gperf"
-    {"SetGroupProps-Request", 0x071c},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0},
-#line 383 "gperf/csp13tags.gperf"
-    {"GETJU", 0x0807},
-#line 378 "gperf/csp13tags.gperf"
-    {"UserMapping", 0x072b},
-    {"",0},
-#line 121 "gperf/csp13tags.gperf"
-    {"KeepAlive-Response", 0x0129},
-    {"",0}, {"",0},
-#line 127 "gperf/csp13tags.gperf"
-    {"Service-Response", 0x012f},
-    {"",0},
-#line 393 "gperf/csp13tags.gperf"
-    {"ExtBlock", 0x0907},
-    {"",0},
-#line 137 "gperf/csp13tags.gperf"
-    {"AgreedCapabilityList", 0x013a},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 193 "gperf/csp13tags.gperf"
-    {"SUBGCN", 0x023a},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 464 "gperf/csp13tags.gperf"
-    {"SystemMessage-User", 0x0a16},
-    {"",0}, {"",0},
-#line 463 "gperf/csp13tags.gperf"
-    {"SystemMessage-Request", 0x0a15},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 374 "gperf/csp13tags.gperf"
-    {"AdminMapping", 0x0727},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 159 "gperf/csp13tags.gperf"
-    {"GETM", 0x0218},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0},
-#line 376 "gperf/csp13tags.gperf"
-    {"ModMapping", 0x0729},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 387 "gperf/csp13tags.gperf"
-    {"SGMNT", 0x080b},
-    {"",0}, {"",0},
-#line 389 "gperf/csp13tags.gperf"
-    {"OFFNOTIF", 0x080d},
-#line 195 "gperf/csp13tags.gperf"
-    {"WVCSPFeat", 0x023c},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 300 "gperf/csp13tags.gperf"
-    {"UserAvailability", 0x052e},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 430 "gperf/csp13tags.gperf"
-    {"SystemMessageText", 0x092f},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 462 "gperf/csp13tags.gperf"
-    {"GetSegment-Response", 0x0a14},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 447 "gperf/csp13tags.gperf"
-    {"WV-CSP-VersionDiscovery-Request", 0x0a05},
-#line 448 "gperf/csp13tags.gperf"
-    {"WV-CSP-VersionDiscovery-Response", 0x0a06},
-#line 370 "gperf/csp13tags.gperf"
-    {"SubscribeType", 0x0723},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 364 "gperf/csp13tags.gperf"
-    {"SubscribeGroupNotice-Request", 0x071d},
-#line 365 "gperf/csp13tags.gperf"
-    {"SubscribeGroupNotice-Response", 0x071e},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 185 "gperf/csp13tags.gperf"
-    {"REJEC", 0x0232},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 354 "gperf/csp13tags.gperf"
-    {"LeaveGroup-Request", 0x0713},
-#line 132 "gperf/csp13tags.gperf"
-    {"CompletionFlag", 0x0134},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 129 "gperf/csp13tags.gperf"
-    {"StopSearch-Request", 0x0131},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0},
-#line 220 "gperf/csp13tags.gperf"
-    {"OfflineETEMHandling", 0x031a},
-    {"",0},
-#line 161 "gperf/csp13tags.gperf"
-    {"GETSPI", 0x021a},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 178 "gperf/csp13tags.gperf"
-    {"NEWM", 0x022b},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 126 "gperf/csp13tags.gperf"
-    {"Service-Request", 0x012e},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 382 "gperf/csp13tags.gperf"
-    {"GETAUT", 0x0806},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 53 "gperf/csp13tags.gperf"
-    {"MSISDN", 0x001d},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 461 "gperf/csp13tags.gperf"
-    {"GetSegment-Request", 0x0a13},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 440 "gperf/csp13tags.gperf"
-    {"ExtBlockETEM", 0x0939}
-  };
-
-#ifdef __GNUC__
-__inline
-#endif
-const struct TagEntry *
-findTag (str, len)
-     register const char *str;
-     register unsigned int len;
-{
-  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
-    {
-      register int key = hash (str, len);
-
-      if (key <= MAX_HASH_VALUE && key >= 0)
-        {
-          register const char *s = wordlist[key].name;
-
-          if (*str == *s && !strcmp (str + 1, s + 1))
-            return &wordlist[key];
-        }
-    }
-  return 0;
-}
-#line 471 "gperf/csp13tags.gperf"
-
-int csp13TagNameToKey(const char * str)
-{
-    const struct TagEntry * tag = findTag(str, strlen(str));
-    return tag ? tag->key : -1;
-}
diff --git a/libwbxml/src/csp13values_hash.c b/libwbxml/src/csp13values_hash.c
deleted file mode 100644 (file)
index fc55c44..0000000
+++ /dev/null
@@ -1,617 +0,0 @@
-/* C code produced by gperf version 3.0.2 */
-/* Command-line: gperf -G -C -F ,0 -c -t -NfindToken gperf/csp13values.gperf  */
-/* Computed positions: -k'1-2,6,$' */
-
-#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
-      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
-      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
-      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
-      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
-      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
-      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
-      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
-      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
-      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
-      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
-      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
-      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
-      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
-      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
-      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
-      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
-      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
-      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
-      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
-      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
-      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
-      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
-/* The character set is not based on ISO-646.  */
-error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
-#endif
-
-#line 1 "gperf/csp13values.gperf"
-
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include "csp13_hash.h"
-
-#line 23 "gperf/csp13values.gperf"
-struct TokenEntry {
-    const char * name;
-    int key;
-};
-
-#define TOTAL_KEYWORDS 187
-#define MIN_WORD_LENGTH 1
-#define MAX_WORD_LENGTH 31
-#define MIN_HASH_VALUE 1
-#define MAX_HASH_VALUE 477
-/* maximum key range = 477, duplicates = 0 */
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static unsigned int
-hash (str, len)
-     register const char *str;
-     register unsigned int len;
-{
-  static const unsigned short asso_values[] =
-    {
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 100, 478, 478,
-      478, 478,   0, 478, 478, 478, 478, 478,   0, 478,
-      478, 478, 478, 478, 478,  50,  30,  20,  70,   5,
-       35, 115,  70,  45,   0, 478, 145,  40,  40, 145,
-        5, 478,  25,   0,  10,  15,  45,  40,  75,  75,
-      478, 478, 478, 478, 478,   0, 478,  85, 478,  10,
-       35,   0, 478,  40,  15,  80, 478,  30,  30,   0,
-        0,  25,  20,   0,  25, 140,  70,   5, 478,  50,
-       65,  95, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478, 478, 478, 478, 478,
-      478, 478, 478, 478, 478, 478
-    };
-  register int hval = len;
-
-  switch (hval)
-    {
-      default:
-        hval += asso_values[(unsigned char)str[5]];
-      /*FALLTHROUGH*/
-      case 5:
-      case 4:
-      case 3:
-      case 2:
-        hval += asso_values[(unsigned char)str[1]];
-      /*FALLTHROUGH*/
-      case 1:
-        hval += asso_values[(unsigned char)str[0]];
-        break;
-    }
-  return hval + asso_values[(unsigned char)str[len - 1]];
-}
-
-static const struct TokenEntry wordlist[] =
-  {
-    {"",0},
-#line 66 "gperf/csp13values.gperf"
-    {"S", 0x25},
-    {"",0}, {"",0},
-#line 187 "gperf/csp13values.gperf"
-    {"SSMS", 0xA4},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 60 "gperf/csp13values.gperf"
-    {"P", 0x1F},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 158 "gperf/csp13values.gperf"
-    {"Purple", 0x86},
-#line 76 "gperf/csp13values.gperf"
-    {"US", 0x2F},
-    {"",0},
-#line 98 "gperf/csp13values.gperf"
-    {"STCP", 0x44},
-#line 64 "gperf/csp13values.gperf"
-    {"ScreenName", 0x23},
-#line 73 "gperf/csp13values.gperf"
-    {"T", 0x2C},
-    {"",0}, {"",0},
-#line 99 "gperf/csp13values.gperf"
-    {"SUDP", 0x45},
-#line 65 "gperf/csp13values.gperf"
-    {"Searchable", 0x24},
-#line 198 "gperf/csp13values.gperf"
-    {"PP_AGE", 0xAF},
-#line 136 "gperf/csp13values.gperf"
-    {"JEALOUS", 0x6D},
-#line 87 "gperf/csp13values.gperf"
-    {"PPU", 0x3A},
-#line 181 "gperf/csp13values.gperf"
-    {"SENDSTORE", 0x9E},
-#line 180 "gperf/csp13values.gperf"
-    {"SENDREJECT", 0x9D},
-#line 75 "gperf/csp13values.gperf"
-    {"U", 0x2E},
-#line 205 "gperf/csp13values.gperf"
-    {"PP_INTERESTS", 0xB6},
-#line 62 "gperf/csp13values.gperf"
-    {"Response", 0x21},
-    {"",0},
-#line 145 "gperf/csp13values.gperf"
-    {"Small", 0x79},
-#line 59 "gperf/csp13values.gperf"
-    {"Public", 0x1E},
-#line 202 "gperf/csp13values.gperf"
-    {"PP_FREE_TEXT", 0xB3},
-#line 101 "gperf/csp13values.gperf"
-    {"USER_EMAIL_ADDRESS", 0x47},
-    {"",0}, {"",0},
-#line 211 "gperf/csp13values.gperf"
-    {"C", 0xBC},
-#line 67 "gperf/csp13values.gperf"
-    {"SC", 0x26},
-#line 97 "gperf/csp13values.gperf"
-    {"SMS", 0x43},
-#line 166 "gperf/csp13values.gperf"
-    {"Teal", 0x8E},
-    {"",0},
-#line 146 "gperf/csp13values.gperf"
-    {"Medium", 0x7A},
-#line 183 "gperf/csp13values.gperf"
-    {"EC", 0xA0},
-#line 109 "gperf/csp13values.gperf"
-    {"WSP", 0x4F},
-    {"",0},
-#line 72 "gperf/csp13values.gperf"
-    {"Topic", 0x2B},
-#line 215 "gperf/csp13values.gperf"
-    {"R", 0xC0},
-#line 206 "gperf/csp13values.gperf"
-    {"PP_MARITAL_STATUS", 0xB7},
-    {"",0},
-#line 151 "gperf/csp13values.gperf"
-    {"Underline", 0x7F},
-    {"",0},
-#line 179 "gperf/csp13values.gperf"
-    {"REJECT", 0x9C},
-#line 55 "gperf/csp13values.gperf"
-    {"PR", 0x1A},
-#line 88 "gperf/csp13values.gperf"
-    {"SPA", 0x3B},
-    {"",0},
-#line 155 "gperf/csp13values.gperf"
-    {"White", 0x83},
-#line 197 "gperf/csp13values.gperf"
-    {"SERVERLOGIC", 0xAE},
-#line 133 "gperf/csp13values.gperf"
-    {"AP", 0x68},
-#line 157 "gperf/csp13values.gperf"
-    {"Red", 0x85},
-#line 165 "gperf/csp13values.gperf"
-    {"Blue", 0x8D},
-#line 78 "gperf/csp13values.gperf"
-    {"AutoDelete", 0x31},
-    {"",0},
-#line 85 "gperf/csp13values.gperf"
-    {"RequireInvitation", 0x38},
-    {"",0},
-#line 51 "gperf/csp13values.gperf"
-    {"None", 0x16},
-#line 102 "gperf/csp13values.gperf"
-    {"USER_FIRST_NAME", 0x48},
-#line 40 "gperf/csp13values.gperf"
-    {"F", 0x0B},
-#line 204 "gperf/csp13values.gperf"
-    {"PP_INTENTION", 0xB5},
-#line 172 "gperf/csp13values.gperf"
-    {"USER_FRIENDLY_NAME", 0x95},
-#line 176 "gperf/csp13values.gperf"
-    {"USER_MARITAL_STATUS", 0x99},
-#line 100 "gperf/csp13values.gperf"
-    {"USER_ALIAS", 0x46},
-#line 201 "gperf/csp13values.gperf"
-    {"PP_FRIENDLY_NAME", 0xB2},
-    {"",0}, {"",0},
-#line 148 "gperf/csp13values.gperf"
-    {"Huge", 0x7C},
-#line 188 "gperf/csp13values.gperf"
-    {"SHTTP", 0xA5},
-#line 52 "gperf/csp13values.gperf"
-    {"N", 0x17},
-#line 175 "gperf/csp13values.gperf"
-    {"USER_INTERESTS_HOBBIES", 0x98},
-#line 137 "gperf/csp13values.gperf"
-    {"MMS", 0x6E},
-#line 203 "gperf/csp13values.gperf"
-    {"PP_GENDER", 0xB4},
-#line 214 "gperf/csp13values.gperf"
-    {"PRESENCE_ACCESS", 0xBF},
-#line 36 "gperf/csp13values.gperf"
-    {"BASE64", 0x07},
-#line 186 "gperf/csp13values.gperf"
-    {"IC", 0xA3},
-#line 35 "gperf/csp13values.gperf"
-    {"AutoJoin", 0x06},
-#line 96 "gperf/csp13values.gperf"
-    {"HTTP", 0x42},
-#line 31 "gperf/csp13values.gperf"
-    {"Admin", 0x02},
-    {"",0},
-#line 112 "gperf/csp13values.gperf"
-    {"AC", 0x52},
-#line 178 "gperf/csp13values.gperf"
-    {"PRIORITYSTORE", 0x9B},
-#line 149 "gperf/csp13values.gperf"
-    {"Bold", 0x7D},
-#line 152 "gperf/csp13values.gperf"
-    {"Black", 0x80},
-#line 107 "gperf/csp13values.gperf"
-    {"WAPSMS", 0x4D},
-#line 182 "gperf/csp13values.gperf"
-    {"IR", 0x9F},
-#line 105 "gperf/csp13values.gperf"
-    {"USER_MOBILE_NUMBER", 0x4B},
-#line 177 "gperf/csp13values.gperf"
-    {"PRIORITYREJECT", 0x9A},
-#line 69 "gperf/csp13values.gperf"
-    {"text/plain", 0x28},
-#line 194 "gperf/csp13values.gperf"
-    {"DETECT", 0xAB},
-#line 199 "gperf/csp13values.gperf"
-    {"PP_CITY", 0xB0},
-#line 49 "gperf/csp13values.gperf"
-    {"Mod", 0x14},
-#line 58 "gperf/csp13values.gperf"
-    {"PrivilegeLevel", 0x1D},
-    {"",0},
-#line 108 "gperf/csp13values.gperf"
-    {"WAPUDP", 0x4E},
-#line 56 "gperf/csp13values.gperf"
-    {"Private", 0x1B},
-#line 120 "gperf/csp13values.gperf"
-    {"ANU", 0x5A},
-#line 74 "gperf/csp13values.gperf"
-    {"Type", 0x2D},
-#line 200 "gperf/csp13values.gperf"
-    {"PP_COUNTRY", 0xB1},
-    {"",0},
-#line 122 "gperf/csp13values.gperf"
-    {"ANXIOUS", 0x5C},
-#line 89 "gperf/csp13values.gperf"
-    {"ANC", 0x3C},
-#line 174 "gperf/csp13values.gperf"
-    {"USER_INTENTION", 0x97},
-    {"",0}, {"",0},
-#line 208 "gperf/csp13values.gperf"
-    {"USER_AGE_MIN", 0xB9},
-#line 212 "gperf/csp13values.gperf"
-    {"CURRENT_SUBSCRIBER", 0xBD},
-#line 170 "gperf/csp13values.gperf"
-    {"USER_CITY", 0x93},
-#line 135 "gperf/csp13values.gperf"
-    {"INVINCIBLE", 0x6C},
-#line 46 "gperf/csp13values.gperf"
-    {"Inband", 0x11},
-#line 171 "gperf/csp13values.gperf"
-    {"USER_COUNTRY", 0x94},
-#line 142 "gperf/csp13values.gperf"
-    {"SAD", 0x73},
-    {"",0}, {"",0},
-#line 37 "gperf/csp13values.gperf"
-    {"Closed", 0x08},
-#line 47 "gperf/csp13values.gperf"
-    {"IM", 0x12},
-#line 141 "gperf/csp13values.gperf"
-    {"PDA", 0x72},
-#line 50 "gperf/csp13values.gperf"
-    {"Name", 0x15},
-    {"",0},
-#line 156 "gperf/csp13values.gperf"
-    {"Maroon", 0x84},
-#line 123 "gperf/csp13values.gperf"
-    {"ASHAMED", 0x5D},
-    {"",0}, {"",0},
-#line 210 "gperf/csp13values.gperf"
-    {"MinimumAge", 0xBB},
-#line 153 "gperf/csp13values.gperf"
-    {"Silver", 0x81},
-#line 103 "gperf/csp13values.gperf"
-    {"USER_ID", 0x49},
-#line 129 "gperf/csp13values.gperf"
-    {"DISCREET", 0x64},
-#line 167 "gperf/csp13values.gperf"
-    {"Aqua", 0x8F},
-    {"",0},
-#line 150 "gperf/csp13values.gperf"
-    {"Italic", 0x7E},
-#line 134 "gperf/csp13values.gperf"
-    {"IN_LOVE", 0x6B},
-    {"",0}, {"",0},
-#line 160 "gperf/csp13values.gperf"
-    {"Green", 0x88},
-#line 33 "gperf/csp13values.gperf"
-    {"application/vnd.wap.mms-message", 0x04},
-#line 185 "gperf/csp13values.gperf"
-    {"IA", 0xA2},
-    {"",0}, {"",0},
-#line 63 "gperf/csp13values.gperf"
-    {"Restricted", 0x22},
-    {"",0},
-#line 207 "gperf/csp13values.gperf"
-    {"USER_AGE_MAX", 0xB8},
-#line 147 "gperf/csp13values.gperf"
-    {"Big", 0x7B},
-    {"",0},
-#line 92 "gperf/csp13values.gperf"
-    {"GROUP_NAME", 0x3E},
-#line 57 "gperf/csp13values.gperf"
-    {"PrivateMessaging", 0x1C},
-#line 117 "gperf/csp13values.gperf"
-    {"GC", 0x57},
-    {"",0},
-#line 124 "gperf/csp13values.gperf"
-    {"AVAILABLE", 0x5F},
-    {"",0},
-#line 84 "gperf/csp13values.gperf"
-    {"ShowID", 0x37},
-#line 131 "gperf/csp13values.gperf"
-    {"EXCITED", 0x66},
-#line 111 "gperf/csp13values.gperf"
-    {"AND", 0x51},
-    {"",0}, {"",0},
-#line 173 "gperf/csp13values.gperf"
-    {"USER_GENDER", 0x96},
-#line 42 "gperf/csp13values.gperf"
-    {"GR", 0x0D},
-#line 196 "gperf/csp13values.gperf"
-    {"OEU", 0xAD},
-#line 53 "gperf/csp13values.gperf"
-    {"Open", 0x18},
-#line 121 "gperf/csp13values.gperf"
-    {"ANGRY", 0x5B},
-#line 93 "gperf/csp13values.gperf"
-    {"GROUP_TOPIC", 0x3F},
-#line 83 "gperf/csp13values.gperf"
-    {"PENDING", 0x36},
-#line 193 "gperf/csp13values.gperf"
-    {"GMU", 0xAA},
-#line 190 "gperf/csp13values.gperf"
-    {"GMAU", 0xA7},
-#line 68 "gperf/csp13values.gperf"
-    {"text/", 0x27},
-#line 70 "gperf/csp13values.gperf"
-    {"text/x-vCalendar", 0x29},
-#line 38 "gperf/csp13values.gperf"
-    {"Default", 0x09},
-#line 106 "gperf/csp13values.gperf"
-    {"USER_ONLINE_STATUS", 0x4C},
-#line 104 "gperf/csp13values.gperf"
-    {"USER_LAST_NAME", 0x4A},
-#line 162 "gperf/csp13values.gperf"
-    {"Olive", 0x8A},
-#line 163 "gperf/csp13values.gperf"
-    {"Yellow", 0x8B},
-#line 71 "gperf/csp13values.gperf"
-    {"text/x-vCard", 0x2A},
-#line 192 "gperf/csp13values.gperf"
-    {"GMR", 0xA9},
-#line 95 "gperf/csp13values.gperf"
-    {"GROUP_USER_ID_OWNER", 0x41},
-#line 140 "gperf/csp13values.gperf"
-    {"OTHER", 0x71},
-#line 144 "gperf/csp13values.gperf"
-    {"www.openmobilealliance.org", 0x78},
-    {"",0},
-#line 169 "gperf/csp13values.gperf"
-    {"CLC", 0x91},
-#line 86 "gperf/csp13values.gperf"
-    {"Tiny", 0x39},
-    {"",0}, {"",0},
-#line 54 "gperf/csp13values.gperf"
-    {"Outband", 0x19},
-#line 44 "gperf/csp13values.gperf"
-    {"https://", 0x0F},
-#line 115 "gperf/csp13values.gperf"
-    {"CLCR", 0x55},
-#line 130 "gperf/csp13values.gperf"
-    {"EMAIL", 0x65},
-    {"",0},
-#line 79 "gperf/csp13values.gperf"
-    {"GM", 0x32},
-#line 113 "gperf/csp13values.gperf"
-    {"BLC", 0x53},
-#line 114 "gperf/csp13values.gperf"
-    {"BLUC", 0x54},
-#line 132 "gperf/csp13values.gperf"
-    {"HAPPY", 0x67},
-    {"",0},
-#line 110 "gperf/csp13values.gperf"
-    {"GROUP_USER_ID_AUTOJOIN", 0x50},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 138 "gperf/csp13values.gperf"
-    {"MOBILE_PHONE", 0x6F},
-#line 128 "gperf/csp13values.gperf"
-    {"COMPUTER", 0x63},
-#line 168 "gperf/csp13values.gperf"
-    {"ATCL", 0x90},
-#line 29 "gperf/csp13values.gperf"
-    {"AccessType", 0x00},
-#line 30 "gperf/csp13values.gperf"
-    {"ActiveUsers", 0x01},
-#line 159 "gperf/csp13values.gperf"
-    {"Fuchsia", 0x87},
-#line 127 "gperf/csp13values.gperf"
-    {"CLI", 0x62},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 90 "gperf/csp13values.gperf"
-    {"GROUP_ID", 0x3D},
-#line 126 "gperf/csp13values.gperf"
-    {"CALL", 0x61},
-    {"",0},
-#line 81 "gperf/csp13values.gperf"
-    {"DENIED", 0x34},
-#line 82 "gperf/csp13values.gperf"
-    {"GRANTED", 0x35},
-    {"",0},
-#line 164 "gperf/csp13values.gperf"
-    {"Navy", 0x8C},
-    {"",0}, {"",0},
-#line 32 "gperf/csp13values.gperf"
-    {"application/", 0x03},
-    {"",0},
-#line 161 "gperf/csp13values.gperf"
-    {"Lime", 0x89},
-#line 94 "gperf/csp13values.gperf"
-    {"GROUP_USER_ID_JOINED", 0x40},
-#line 41 "gperf/csp13values.gperf"
-    {"G", 0x0C},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 209 "gperf/csp13values.gperf"
-    {"EG", 0xBA},
-#line 116 "gperf/csp13values.gperf"
-    {"CLD", 0x56},
-#line 154 "gperf/csp13values.gperf"
-    {"Gray", 0x82},
-    {"",0},
-#line 189 "gperf/csp13values.gperf"
-    {"DoNotNotify", 0xA6},
-#line 61 "gperf/csp13values.gperf"
-    {"Request", 0x20},
-    {"",0},
-#line 77 "gperf/csp13values.gperf"
-    {"www.wireless-village.org", 0x30},
-    {"",0},
-#line 39 "gperf/csp13values.gperf"
-    {"DisplayName", 0x0A},
-#line 213 "gperf/csp13values.gperf"
-    {"FORMER_SUBSCRIBER", 0xBE},
-#line 139 "gperf/csp13values.gperf"
-    {"NOT_AVAILABLE", 0x70},
-    {"",0},
-#line 125 "gperf/csp13values.gperf"
-    {"BORED", 0x60},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 118 "gperf/csp13values.gperf"
-    {"GD", 0x58},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 34 "gperf/csp13values.gperf"
-    {"application/x-sms", 0x05},
-#line 191 "gperf/csp13values.gperf"
-    {"GMG", 0xA8},
-    {"",0}, {"",0}, {"",0},
-#line 91 "gperf/csp13values.gperf"
-    {"History", 0x3D},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 119 "gperf/csp13values.gperf"
-    {"GLC", 0x59},
-#line 184 "gperf/csp13values.gperf"
-    {"GLUC", 0xA1},
-    {"",0},
-#line 45 "gperf/csp13values.gperf"
-    {"image/", 0x10},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 43 "gperf/csp13values.gperf"
-    {"http://", 0x0E},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0},
-#line 143 "gperf/csp13values.gperf"
-    {"SLEEPY", 0x74},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0},
-#line 80 "gperf/csp13values.gperf"
-    {"Validity", 0x33},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-#line 48 "gperf/csp13values.gperf"
-    {"MaxActiveUsers", 0x13},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0},
-    {"",0},
-#line 195 "gperf/csp13values.gperf"
-    {"FORKALL", 0xAC}
-  };
-
-#ifdef __GNUC__
-__inline
-#endif
-const struct TokenEntry *
-findToken (str, len)
-     register const char *str;
-     register unsigned int len;
-{
-  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
-    {
-      register int key = hash (str, len);
-
-      if (key <= MAX_HASH_VALUE && key >= 0)
-        {
-          register const char *s = wordlist[key].name;
-
-          if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
-            return &wordlist[key];
-        }
-    }
-  return 0;
-}
-#line 216 "gperf/csp13values.gperf"
-
-
-int csp13ValueTokenToKey(const char * str, int len)
-{
-    const struct TokenEntry * tag = findToken(str, len);
-    return tag ? tag->key : -1;
-}
-
diff --git a/libwbxml/src/expat_parser.cpp b/libwbxml/src/expat_parser.cpp
deleted file mode 100644 (file)
index 7ef15e4..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "expat_parser.h"
-
-ExpatParser::ExpatParser() :
-    mHandler(NULL)
-{
-    mExpat = XML_ParserCreate(NULL);
-    if (mExpat) {
-        XML_SetUserData(mExpat, this);
-        XML_SetDoctypeDeclHandler(mExpat, startDoctypeWrapper, endDoctypeWrapper);
-        XML_SetElementHandler(mExpat, startElementWrapper, endElementWrapper);
-        XML_SetCharacterDataHandler(mExpat, charactersWrapper);
-    }
-}
-
-ExpatParser::~ExpatParser()
-{
-    if (mExpat) {
-        XML_ParserFree(mExpat);
-    }
-}
-
-void ExpatParser::startElementWrapper(void *userData, const char *name, const char **atts)
-{
-    ExpatParser * self = (ExpatParser *)userData;
-    if (self->mHandler) {
-        self->mHandler->startElement(name, atts);
-    }
-}
-
-void ExpatParser::endElementWrapper(void *userData, const char *name)
-{
-    ExpatParser * self = (ExpatParser *)userData;
-    if (self->mHandler) {
-        self->mHandler->endElement(name);
-    }
-}
-
-void ExpatParser::charactersWrapper(void *userData, const char *data, int len)
-{
-    ExpatParser * self = (ExpatParser *)userData;
-    if (self->mHandler) {
-        self->mHandler->characters(data, len);
-    }
-}
-
-void ExpatParser::startDoctypeWrapper(void *userData,
-            const char *doctypeName,
-            const char *sysid,
-            const char *pubid,
-            int has_internal_subset)
-{
-    ExpatParser * self = (ExpatParser *)userData;
-    if (self->mHandler) {
-        self->mHandler->startDoctype(doctypeName, sysid, pubid, has_internal_subset);
-    }
-}
-
-void ExpatParser::endDoctypeWrapper(void *userData)
-{
-    ExpatParser * self = (ExpatParser *)userData;
-    if (self->mHandler) {
-        self->mHandler->endDoctype();
-    }
-}
-
-int ExpatParser::parse(const char * data, int len, bool end)
-{
-    return XML_Parse(mExpat, data, len, end);
-}
-
diff --git a/libwbxml/src/gperf/csp13inttags.gperf b/libwbxml/src/gperf/csp13inttags.gperf
deleted file mode 100644 (file)
index 3a07b5d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-%{
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include "csp13_hash.h"
-
-%}
-
-%%
-AcceptedPullLength
-AcceptedPushLength
-AcceptedRichContentLength
-AcceptedTextContentLength
-AnswerOptionID
-ChosenOptionID
-Code
-ContentPolicyLimit
-ContentSize
-GroupContentLimit
-HistoryPeriod
-KeepAliveTime
-MaxWatcherList
-MessageCount
-MessageTotalCount
-MultiTrans
-MultiTransPerMessage
-PairID
-ParserSize
-PlainTextCharSet
-SearchFindings
-SearchIndex
-SearchLimit
-SegmentCount
-SegmentReference
-ServerPollMin
-SessionPriority
-TCPPort
-TimeToLive
-TryAgainTimeout
-UDPPort
-UserSessionLimit
-Validity
-WatcherCount
-%%
-
-int csp13IsIntegerTag(const char * str)
-{
-    const char * s = in_word_set(str, strlen(str));
-    return s ? 1 : 0;
-}
-
diff --git a/libwbxml/src/gperf/csp13tags.gperf b/libwbxml/src/gperf/csp13tags.gperf
deleted file mode 100644 (file)
index 91a3a7e..0000000
+++ /dev/null
@@ -1,479 +0,0 @@
-%{
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include "csp13_hash.h"
-
-%}
-
-struct TagEntry {
-    const char * name;
-    int key;
-};
-
-%%
-Acceptance, 0x0005
-AddList, 0x0006
-AddNickList, 0x0007
-SName, 0x0008
-WV-CSP-Message, 0x0009
-ClientID, 0x000a
-Code, 0x000b
-ContactList, 0x000c
-ContentData, 0x000d
-ContentEncoding, 0x000e
-ContentSize, 0x000f
-ContentType, 0x0010
-DateTime, 0x0011
-Description, 0x0012
-DetailedResult, 0x0013
-EntityList, 0x0014
-Group, 0x0015
-GroupID, 0x0016
-GroupList, 0x0017
-InUse, 0x0018
-Logo, 0x0019
-MessageCount, 0x001a
-MessageID, 0x001b
-MessageURI, 0x001c
-MSISDN, 0x001d
-Name, 0x001e
-NickList, 0x001f
-NickName, 0x0020
-Poll, 0x0021
-Presence, 0x0022
-PresenceSubList, 0x0023
-PresenceValue, 0x0024
-Property, 0x0025
-Qualifier, 0x0026
-Recipient, 0x0027
-RemoveList, 0x0028
-RemoveNickList, 0x0029
-Result, 0x002a
-ScreenName, 0x002b
-Sender, 0x002c
-Session, 0x002d
-SessionDescriptor, 0x002e
-SessionID, 0x002f
-SessionType, 0x0030
-Status, 0x0031
-Transaction, 0x0032
-TransactionContent, 0x0033
-TransactionDescriptor, 0x0034
-TransactionID, 0x0035
-TransactionMode, 0x0036
-URL, 0x0037
-URLList, 0x0038
-User, 0x0039
-UserID, 0x003a
-UserList, 0x003b
-Validity, 0x003c
-Value, 0x003d
-AllFunctions, 0x0105
-AllFunctionsRequest, 0x0106
-CancelInvite-Request, 0x0107
-CancelInviteUser-Request, 0x0108
-CapabilityList, 0x010a
-CapabilityRequest, 0x010b
-ClientCapability-Request, 0x010c
-ClientCapability-Response, 0x010d
-DigestBytes, 0x010e
-DigestSchema, 0x010f
-Disconnect, 0x0110
-Functions, 0x0111
-GetSPInfo-Request, 0x0112
-GetSPInfo-Response, 0x0113
-InviteID, 0x0114
-InviteNote, 0x0115
-Invite-Request, 0x0116
-Invite-Response, 0x0117
-InviteType, 0x0118
-InviteUser-Request, 0x0119
-InviteUser-Response, 0x011a
-KeepAlive-Request, 0x011b
-KeepAliveTime, 0x011c
-Login-Request, 0x011d
-Login-Response, 0x011e
-Logout-Request, 0x011f
-Nonce, 0x0120
-Password, 0x0121
-Polling-Request, 0x0122
-ResponseNote, 0x0123
-SearchElement, 0x0124
-SearchFindings, 0x0125
-SearchID, 0x0126
-SearchIndex, 0x0127
-SearchLimit, 0x0128
-KeepAlive-Response, 0x0129
-SearchPairList, 0x012a
-Search-Request, 0x012b
-Search-Response, 0x012c
-SearchResult, 0x012d
-Service-Request, 0x012e
-Service-Response, 0x012f
-SessionCookie, 0x0130
-StopSearch-Request, 0x0131
-TimeToLive, 0x0132
-SearchString, 0x0133
-CompletionFlag, 0x0134
-ReceiveList, 0x0136
-VerifyID-Request, 0x0137
-Extended-Request, 0x0138
-Extended-Response, 0x0139
-AgreedCapabilityList, 0x013a
-ExtendedData, 0x013b
-OtherServer, 0x013c
-PresenceAttributeNSName, 0x013d
-SessionNSName, 0x013e
-TransactionNSName, 0x013f
-ADDGM, 0x0205
-AttListFunc, 0x0206
-BLENT, 0x0207
-CAAUT, 0x0208
-CAINV, 0x0209
-CCLI, 0x020b
-ContListFunc, 0x020c
-CREAG, 0x020d
-DCLI, 0x020f
-DELGR, 0x0210
-FundamentalFeat, 0x0211
-FWMSG, 0x0212
-GCLI, 0x0214
-GETGM, 0x0215
-GETGP, 0x0216
-GETLM, 0x0217
-GETM, 0x0218
-GETPR, 0x0219
-GETSPI, 0x021a
-GETWL, 0x021b
-GLBLU, 0x021c
-GRCHN, 0x021d
-GroupAuthFunc, 0x021e
-GroupFeat, 0x021f
-GroupMgmtFunc, 0x0220
-GroupUseFunc, 0x0221
-IMAuthFunc, 0x0222
-IMFeat, 0x0223
-IMReceiveFunc, 0x0224
-IMSendFunc, 0x0225
-INVIT, 0x0226
-InviteFunc, 0x0227
-MBRAC, 0x0228
-MCLS, 0x0229
-MDELIV, 0x022a
-NEWM, 0x022b
-NOTIF, 0x022c
-PresenceAuthFunc, 0x022d
-PresenceDeliverFunc, 0x022e
-PresenceFeat, 0x022f
-REACT, 0x0230
-REJCM, 0x0231
-REJEC, 0x0232
-RMVGM, 0x0233
-SearchFunc, 0x0234
-ServiceFunc, 0x0235
-SETD, 0x0236
-SETGP, 0x0237
-SRCH, 0x0238
-STSRC, 0x0239
-SUBGCN, 0x023a
-UPDPR, 0x023b
-WVCSPFeat, 0x023c
-MF, 0x023d
-MG, 0x023e
-MM, 0x023f
-AcceptedCharset, 0x0305
-AcceptedContentLength, 0x0306
-AcceptedContentType, 0x0307
-AcceptedTransferEncoding, 0x0308
-AnyContent, 0x0309
-DefaultLanguage, 0x030a
-InitialDeliveryMethod, 0x030b
-MultiTrans, 0x030c
-ParserSize, 0x030d
-ServerPollMin, 0x030e
-SupportedBearer, 0x030f
-SupportedCIRMethod, 0x0310
-TCPAddress, 0x0311
-TCPPort, 0x0312
-UDPPort, 0x0313
-CIRHTTPAddress, 0x0314
-UDPAddress, 0x0315
-AcceptedPullLength, 0x0316
-AcceptedPushLength, 0x0317
-AcceptedRichContentLength, 0x0318
-AcceptedTextContentLength, 0x0319
-OfflineETEMHandling, 0x031a
-PlainTextCharset, 0x031b
-SessionPriority, 0x031c
-SupportedOfflineBearer, 0x031d
-UserSessionLimit, 0x031f
-CIRSMSAddress, 0x0320
-MultiTransPerMessage, 0x0321
-OnlineETEMHandling, 0x0322
-ContentPolicy, 0x0323
-ContentPolicyLimit, 0x0324
-CancelAuth-Request, 0x0405
-ContactListProperties, 0x0406
-CreateAttributeList-Request, 0x0407
-CreateList-Request, 0x0408
-DefaultAttributeList, 0x0409
-DefaultContactList, 0x040a
-DefaultList, 0x040b
-DeleteAttributeList-Request, 0x040c
-DeleteList-Request, 0x040d
-GetAttributeList-Request, 0x040e
-GetAttributeList-Response, 0x040f
-GetList-Request, 0x0410
-GetList-Response, 0x0411
-GetPresence-Request, 0x0412
-GetPresence-Response, 0x0413
-GetWatcherList-Request, 0x0414
-GetWatcherList-Response, 0x0415
-ListManage-Request, 0x0416
-ListManage-Response, 0x0417
-UnsubscribePresence-Request, 0x0418
-PresenceAuth-Request, 0x0419
-PresenceAuth-User, 0x041a
-PresenceNotification-Request, 0x041b
-UpdatePresence-Request, 0x041c
-SubscribePresence-Request, 0x041d
-AutoSubscribe, 0x041E
-GetReactiveAuthStatus-Request, 0x041f
-GetReactiveAuthStatus-Response, 0x0420
-CreateList-Response, 0x0421
-Accuracy, 0x0505
-Address, 0x0506
-AddrPref, 0x0507
-Alias, 0x0508
-Altitude, 0x0509
-Building, 0x050a
-Caddr, 0x050b
-City, 0x050c
-ClientInfo, 0x050d
-ClientProducer, 0x050e
-ClientType, 0x050f
-ClientVersion, 0x0510
-CommC, 0x0511
-CommCap, 0x0512
-ContactInfo, 0x0513
-ContainedvCard, 0x0514
-Country, 0x0515
-Crossing1, 0x0516
-Crossing2, 0x0517
-DevManufacturer, 0x0518
-DirectContent, 0x0519
-FreeTextLocation, 0x051a
-GeoLocation, 0x051b
-Language, 0x051c
-Latitude, 0x051d
-Longitude, 0x051e
-Model, 0x051f
-NamedArea, 0x0520
-OnlineStatus, 0x0521
-PLMN, 0x0522
-PrefC, 0x0523
-PreferredContacts, 0x0524
-PreferredLanguage, 0x0525
-ReferredContent, 0x0526
-ReferredvCard, 0x0527
-Registration, 0x0528
-StatusContent, 0x0529
-StatusMood, 0x052a
-StatusText, 0x052b
-Street, 0x052c
-TimeZone, 0x052d
-UserAvailability, 0x052e
-Cap, 0x052f
-Cname, 0x0530
-Contact, 0x0531
-Cpriority, 0x0532
-Cstatus, 0x0533
-Note, 0x0534
-Zone, 0x0535
-Inf_link, 0x0537
-InfoLink, 0x0538
-Link, 0x0539
-Text, 0x053a
-ClientContentLimit, 0x053b
-ClientIMPriority, 0x053c
-MaxPullLength, 0x053d
-MaxPushLength, 0x053e
-BlockList, 0x0605
-BlockEntity-Request, 0x0606
-DeliveryMethod, 0x0607
-DeliveryReport, 0x0608
-DeliveryReport-Request, 0x0609
-ForwardMessage-Request, 0x060a
-GetBlockedList-Request, 0x060b
-GetBlockedList-Response, 0x060c
-GetMessageList-Request, 0x060d
-GetMessageList-Response, 0x060e
-GetMessage-Request, 0x060f
-GetMessage-Response, 0x0610
-GrantList, 0x0611
-MessageDelivered, 0x0612
-MessageInfo, 0x0613
-MessageNotification, 0x0614
-NewMessage, 0x0615
-RejectMessage-Request, 0x0616
-SendMessage-Request, 0x0617
-SendMessage-Response, 0x0618
-SetDeliveryMethod-Request, 0x0619
-DeliveryTime, 0x061a
-MessageInfoList, 0x0620
-ForwardMessage-Response, 0x0621
-AddGroupMembers-Request, 0x0705
-Admin, 0x0706
-CreateGroup-Request, 0x0707
-DeleteGroup-Request, 0x0708
-GetGroupMembers-Request, 0x0709
-GetGroupMembers-Response, 0x070a
-GetGroupProps-Request, 0x070b
-GetGroupProps-Response, 0x070c
-GroupChangeNotice, 0x070d
-GroupProperties, 0x070e
-Joined, 0x070f
-JoinedRequest, 0x0710
-JoinGroup-Request, 0x0711
-JoinGroup-Response, 0x0712
-LeaveGroup-Request, 0x0713
-LeaveGroup-Response, 0x0714
-Left, 0x0715
-MemberAccess-Request, 0x0716
-Mod, 0x0717
-OwnProperties, 0x0718
-RejectList-Request, 0x0719
-RejectList-Response, 0x071a
-RemoveGroupMembers-Request, 0x071b
-SetGroupProps-Request, 0x071c
-SubscribeGroupNotice-Request, 0x071d
-SubscribeGroupNotice-Response, 0x071e
-Users, 0x071f
-WelcomeNote, 0x0720
-JoinGroup, 0x0721
-SubscribeNotification, 0x0722
-SubscribeType, 0x0723
-GetJoinedUsers-Request, 0x0724
-GetJoinedUsers-Response, 0x0725
-AdminMapList, 0x0726
-AdminMapping, 0x0727
-Mapping, 0x0728
-ModMapping, 0x0729
-UserMapList, 0x072a
-UserMapping, 0x072b
-JoinedBlocked, 0x072c
-LeftBlocked, 0x072d
-MP, 0x0805
-GETAUT, 0x0806
-GETJU, 0x0807
-VRID, 0x0808
-VerifyIDFunc, 0x0809
-GETMAP, 0x080a
-SGMNT, 0x080b
-EXCON, 0x080c
-OFFNOTIF, 0x080d
-ADVSR, 0x080e
-CIR, 0x0905
-Domain, 0x0906
-ExtBlock, 0x0907
-HistoryPeriod, 0x0908
-IDList, 0x0909
-MaxWatcherList, 0x090a
-AnswerOptionText, 0x090b
-Watcher, 0x090e
-WatcherStatus, 0x090f
-Font, 0x0910
-Size, 0x0911
-Style, 0x0912
-Color, 0x0913
-ContentName, 0x0914
-Map, 0x0915
-NotificationType, 0x0916
-NotificationTypeList, 0x0917
-FriendlyName, 0x0918
-ClearPublicProfile, 0x0919
-PublicProfile, 0x091a
-AnswerOption, 0x091b
-AnswerOptionID, 0x091c
-AnswerOptions, 0x091d
-ApplicationID, 0x091e
-AuthorizeAndGrant, 0x091f
-ChosenOptionID, 0x0920
-ContactListNotify, 0x0921
-DefaultNotify, 0x0922
-ExtendConversationUser, 0x0923
-InText, 0x0924
-SegmentCount, 0x0925
-SegmentID, 0x0926
-SegmentInfo, 0x0927
-SegmentReference, 0x0928
-SystemMessage, 0x0929
-SystemMessageID, 0x092a
-SystemMessageList, 0x092b
-SystemMessageResponse, 0x092c
-SystemMessageResponseList, 0x092d
-SystemMessageText, 0x092f
-TryAgainTimeout, 0x0930
-UserNotify, 0x0931
-VerificationKey, 0x0932
-VerificationMechanism, 0x0933
-GetMap-Request, 0x0934
-GetMap-Response, 0x0935
-ExtendConversationID, 0x0936
-WatcherCount, 0x0937
-RequiresResponse, 0x0938
-ExtBlockETEM, 0x0939
-GroupContentLimit, 0x093a
-MessageTotalCount, 0x093b
-UnrecognizedUserID, 0x093c
-UserIDPair, 0x093d
-ValidUserID, 0x093e
-UserIDList, 0x093f
-WV-CSP-VersionDiscovery-Request, 0x0a05
-WV-CSP-VersionDiscovery-Response, 0x0a06
-VersionList, 0x0a07
-SubscribeNotification-Request, 0x0a08
-UnsubscribeNotification-Request, 0x0a09
-Notification-Request, 0x0a0a
-AdvancedCriteria, 0x0a0b
-PairID, 0x0a0c
-GetPublicProfile-Request, 0x0a0d
-GetPublicProfile-Response, 0x0a0e
-UpdatePublicProfile-Request, 0x0a0f
-DropSegment-Request, 0x0a10
-ExtendConversation-Response, 0x0a11
-ExtendConversation-Request, 0x0a12
-GetSegment-Request, 0x0a13
-GetSegment-Response, 0x0a14
-SystemMessage-Request, 0x0a15
-SystemMessage-User, 0x0a16
-SearchPair, 0x0a17
-SegmentContent, 0x0a18
-GrantListInUse, 0x0b05
-BlockListInUse, 0x0b06
-ContactListIDList, 0x0b07
-AnswerOptionsText, 0x0b08
-%%
-
-int csp13TagNameToKey(const char * str)
-{
-    const struct TagEntry * tag = findTag(str, strlen(str));
-    return tag ? tag->key : -1;
-}
-
diff --git a/libwbxml/src/gperf/csp13values.gperf b/libwbxml/src/gperf/csp13values.gperf
deleted file mode 100644 (file)
index baedd3c..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-%{
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include "csp13_hash.h"
-
-%}
-
-struct TokenEntry {
-    const char * name;
-    int key;
-};
-
-%%
-AccessType, 0x00
-ActiveUsers, 0x01
-Admin, 0x02
-application/, 0x03
-application/vnd.wap.mms-message, 0x04
-application/x-sms, 0x05
-AutoJoin, 0x06
-BASE64, 0x07
-Closed, 0x08
-Default, 0x09
-DisplayName, 0x0A
-F, 0x0B
-G, 0x0C
-GR, 0x0D
-http://, 0x0E
-https://, 0x0F
-image/, 0x10
-Inband, 0x11
-IM, 0x12
-MaxActiveUsers, 0x13
-Mod, 0x14
-Name, 0x15
-None, 0x16
-N, 0x17
-Open, 0x18
-Outband, 0x19
-PR, 0x1A
-Private, 0x1B
-PrivateMessaging, 0x1C
-PrivilegeLevel, 0x1D
-Public, 0x1E
-P, 0x1F
-Request, 0x20
-Response, 0x21
-Restricted, 0x22
-ScreenName, 0x23
-Searchable, 0x24
-S, 0x25
-SC, 0x26
-text/, 0x27
-text/plain, 0x28
-text/x-vCalendar, 0x29
-text/x-vCard, 0x2A
-Topic, 0x2B
-T, 0x2C
-Type, 0x2D
-U, 0x2E
-US, 0x2F
-www.wireless-village.org, 0x30
-AutoDelete, 0x31
-GM, 0x32
-Validity, 0x33
-DENIED, 0x34
-GRANTED, 0x35
-PENDING, 0x36
-ShowID, 0x37
-RequireInvitation, 0x38
-Tiny, 0x39
-PPU, 0x3A
-SPA, 0x3B
-ANC, 0x3C
-GROUP_ID, 0x3D
-History, 0x3D
-GROUP_NAME, 0x3E
-GROUP_TOPIC, 0x3F
-GROUP_USER_ID_JOINED, 0x40
-GROUP_USER_ID_OWNER, 0x41
-HTTP, 0x42
-SMS, 0x43
-STCP, 0x44
-SUDP, 0x45
-USER_ALIAS, 0x46
-USER_EMAIL_ADDRESS, 0x47
-USER_FIRST_NAME, 0x48
-USER_ID, 0x49
-USER_LAST_NAME, 0x4A
-USER_MOBILE_NUMBER, 0x4B
-USER_ONLINE_STATUS, 0x4C
-WAPSMS, 0x4D
-WAPUDP, 0x4E
-WSP, 0x4F
-GROUP_USER_ID_AUTOJOIN, 0x50
-AND, 0x51
-AC, 0x52
-BLC, 0x53
-BLUC, 0x54
-CLCR, 0x55
-CLD, 0x56
-GC, 0x57
-GD, 0x58
-GLC, 0x59
-ANU, 0x5A
-ANGRY, 0x5B
-ANXIOUS, 0x5C
-ASHAMED, 0x5D
-AVAILABLE, 0x5F
-BORED, 0x60
-CALL, 0x61
-CLI, 0x62
-COMPUTER, 0x63
-DISCREET, 0x64
-EMAIL, 0x65
-EXCITED, 0x66
-HAPPY, 0x67
-AP, 0x68
-IN_LOVE, 0x6B
-INVINCIBLE, 0x6C
-JEALOUS, 0x6D
-MMS, 0x6E
-MOBILE_PHONE, 0x6F
-NOT_AVAILABLE, 0x70
-OTHER, 0x71
-PDA, 0x72
-SAD, 0x73
-SLEEPY, 0x74
-www.openmobilealliance.org, 0x78
-Small, 0x79
-Medium, 0x7A
-Big, 0x7B
-Huge, 0x7C
-Bold, 0x7D
-Italic, 0x7E
-Underline, 0x7F
-Black, 0x80
-Silver, 0x81
-Gray, 0x82
-White, 0x83
-Maroon, 0x84
-Red, 0x85
-Purple, 0x86
-Fuchsia, 0x87
-Green, 0x88
-Lime, 0x89
-Olive, 0x8A
-Yellow, 0x8B
-Navy, 0x8C
-Blue, 0x8D
-Teal, 0x8E
-Aqua, 0x8F
-ATCL, 0x90
-CLC, 0x91
-USER_CITY, 0x93
-USER_COUNTRY, 0x94
-USER_FRIENDLY_NAME, 0x95
-USER_GENDER, 0x96
-USER_INTENTION, 0x97
-USER_INTERESTS_HOBBIES, 0x98
-USER_MARITAL_STATUS, 0x99
-PRIORITYREJECT, 0x9A
-PRIORITYSTORE, 0x9B
-REJECT, 0x9C
-SENDREJECT, 0x9D
-SENDSTORE, 0x9E
-IR, 0x9F
-EC, 0xA0
-GLUC, 0xA1
-IA, 0xA2
-IC, 0xA3
-SSMS, 0xA4
-SHTTP, 0xA5
-DoNotNotify, 0xA6
-GMAU, 0xA7
-GMG, 0xA8
-GMR, 0xA9
-GMU, 0xAA
-DETECT, 0xAB
-FORKALL, 0xAC
-OEU, 0xAD
-SERVERLOGIC, 0xAE
-PP_AGE, 0xAF
-PP_CITY, 0xB0
-PP_COUNTRY, 0xB1
-PP_FRIENDLY_NAME, 0xB2
-PP_FREE_TEXT, 0xB3
-PP_GENDER, 0xB4
-PP_INTENTION, 0xB5
-PP_INTERESTS, 0xB6
-PP_MARITAL_STATUS, 0xB7
-USER_AGE_MAX, 0xB8
-USER_AGE_MIN, 0xB9
-EG, 0xBA
-MinimumAge, 0xBB
-C, 0xBC
-CURRENT_SUBSCRIBER, 0xBD
-FORMER_SUBSCRIBER, 0xBE
-PRESENCE_ACCESS, 0xBF
-R, 0xC0
-%%
-
-int csp13ValueTokenToKey(const char * str, int len)
-{
-    const struct TokenEntry * tag = findToken(str, len);
-    return tag ? tag->key : -1;
-}
-
diff --git a/libwbxml/src/imps_encoder.cpp b/libwbxml/src/imps_encoder.cpp
deleted file mode 100644 (file)
index 959486c..0000000
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "imps_encoder.h"
-#include "csp13_hash.h"
-
-/* TODOs:
- * - use string table?
- * - move common WBXML routines to WbxmlEncoder
- * - so called "token" based IMPS value encoding
- */
-
-struct XmlnsPrefix {
-    const char * prefix;
-    int attrToken;
-};
-static const XmlnsPrefix csp13xmlns[] = {
-    { "http://www.wireless-village.org/CSP",        0x05 },
-    { "http://www.wireless-village.org/PA",         0x06 },
-    { "http://www.wireless-village.org/TRC",        0x07 },
-    { "http://www.openmobilealliance.org/DTD/WV-CSP",   0x08 },
-    { "http://www.openmobilealliance.org/DTD/WV-PA",    0x09 },
-    { "http://www.openmobilealliance.org/DTD/WV-TRC",   0x0a },
-    { "http://www.openmobilealliance.org/DTD/IMPS-CSP", 0x0b },
-    { "http://www.openmobilealliance.org/DTD/IMPS-PA",  0x0c },
-    { "http://www.openmobilealliance.org/DTD/IMPS-TRC", 0x0d },
-};
-
-static bool isXmlWhitespace(int ch)
-{
-    return ch == ' ' || ch == 9 || ch == 0xd || ch == 0xa;
-}
-
-static bool isDatetimeElement(const char *name)
-{
-    return (strcmp("DateTime", name) == 0 || strcmp("DeliveryTime", name) == 0);
-}
-
-static bool parseUint(const char * s, int len, uint32_t *res)
-{
-    string str(s, len);
-    char *end;
-    long long val = strtoll(str.c_str(), &end, 10);
-    if (*end != 0 || val < 0 || val > 0xFFFFFFFFU) {
-        return false;
-    }
-    *res = (uint32_t)val;
-    return true;
-}
-
-void ImpsWbxmlEncoder::reset()
-{
-    // WBXML 1.3, UTF-8, no string table
-    char header[4] = {0x03, (char)mPublicId, 0x6A, 0x00};
-    mResult.clear();
-    mResult.append(header, sizeof(header));
-
-    mTagCodePage = 0;
-    mCurrElement.clear();
-    mDepth = 0;
-}
-
-EncoderError ImpsWbxmlEncoder::startElement(const char *name, const char **atts)
-{
-    if (name == NULL) {
-        return ERROR_INVALID_DATA;
-    }
-
-    int stag = csp13TagNameToKey(name);
-    if (stag == -1) {
-        return ERROR_UNSUPPORTED_TAG;
-    }
-    mDepth++;
-    mCurrElement = name;
-
-    if (((stag >> 8) & 0xff) != mTagCodePage) {
-        // SWITCH_PAGE
-        mTagCodePage = (stag >> 8) & 0xff;
-        appendResult(TOKEN_SWITCH_PAGE);
-        appendResult(mTagCodePage);
-    }
-    stag &= 0xff;
-    stag |= 0x40;       // TODO: assuming we always have content
-
-    if (atts && atts[0]) {
-        stag |= 0x80;   // has attribute
-    }
-    appendResult(stag);
-    if (stag & 0x80) {
-        for (size_t i = 0; atts[i]; i += 2) {
-            EncoderError err = encodeAttrib(atts[i], atts[i + 1]);
-            if (err != NO_ERROR) {
-                return err;
-            }
-        }
-        appendResult(TOKEN_END);
-    }
-    return NO_ERROR;
-}
-
-EncoderError ImpsWbxmlEncoder::characters(const char *chars, int len)
-{
-    if (chars == NULL || len < 0) {
-        return ERROR_INVALID_DATA;
-    }
-    if (!len) {
-        return NO_ERROR;
-    }
-    while (len && isXmlWhitespace(*chars)) {
-        chars++;
-        len--;
-    }
-    while (len && isXmlWhitespace(chars[len - 1])) {
-        len--;
-    }
-    if (!len) {
-        return NO_ERROR;
-    }
-
-    if (csp13IsIntegerTag(mCurrElement.c_str())) {
-        return encodeInteger(chars, len);
-    } else if (isDatetimeElement(mCurrElement.c_str())) {
-        return encodeDatetime(chars, len);
-    } else {
-        return encodeString(chars, len);
-    }
-}
-
-EncoderError ImpsWbxmlEncoder::opaque(const char *chars, int len)
-{
-    if (chars == NULL || len < 0) {
-        return ERROR_INVALID_DATA;
-    }
-    if (!len) {
-        return NO_ERROR;
-    }
-    appendResult(TOKEN_OPAQUE);
-    encodeMbuint((uint32_t)len);
-    appendResult(chars, len);
-    return NO_ERROR;
-}
-
-EncoderError ImpsWbxmlEncoder::endElement()
-{
-    mDepth--;
-    if (mDepth < 0) {
-        return ERROR_INVALID_END_ELEMENT;
-    }
-    appendResult(TOKEN_END);
-    mCurrElement.clear();
-    if (mDepth == 0 && mHandler) {
-        mHandler->wbxmlData(mResult.c_str(), mResult.size());
-    }
-    return NO_ERROR;
-}
-
-EncoderError ImpsWbxmlEncoder::encodeInteger(const char *chars, int len)
-{
-    uint32_t val;
-    if (!parseUint(chars, len, &val)) {
-        return ERROR_INVALID_INTEGER_VALUE;
-    }
-
-    appendResult(TOKEN_OPAQUE);
-    uint32_t mask = 0xff000000U;
-    int numBytes = 4;
-    while (!(val & mask) && mask) {
-        numBytes--;
-        mask >>= 8;
-    }
-    if (!numBytes) {
-        // Zero value. We generate at least 1 byte OPAQUE data.
-        // libwbxml2 generates 0 byte long OPAQUE data (0xC3 0x00) in this case.
-        numBytes = 1;
-    }
-
-    appendResult(numBytes);
-    while (numBytes) {
-        numBytes--;
-        appendResult((val >> (numBytes * 8)) & 0xff);
-    }
-
-    return NO_ERROR;
-}
-
-EncoderError ImpsWbxmlEncoder::encodeDatetime(const char *chars, int len)
-{
-    // to make life easier we accept only yyyymmddThhmmssZ
-    if (len != 16 || chars[8] != 'T' || chars[15] != 'Z') {
-        return ERROR_INVALID_DATETIME_VALUE;
-    }
-    appendResult(TOKEN_OPAQUE);
-    appendResult(6);
-
-    uint32_t year, month, day, hour, min, sec;
-    if (!parseUint(chars, 4, &year)
-            || !parseUint(chars + 4, 2, &month)
-            || !parseUint(chars + 6, 2, &day)
-            || !parseUint(chars + 9, 2, &hour)
-            || !parseUint(chars + 11,2, &min)
-            || !parseUint(chars + 13,2, &sec)) {
-        return ERROR_INVALID_DATETIME_VALUE;
-    }
-    if (year > 4095 || month > 12 || day > 31 || hour > 23 || min > 59 || sec > 59) {
-        return ERROR_INVALID_DATETIME_VALUE;
-    }
-
-    appendResult(year >> 6);
-    appendResult(((year & 0x3f) << 2) | (month >> 2));
-    appendResult(((month & 0x3) << 6) | (day << 1) | (hour >> 4));
-    appendResult(((hour & 0xf) << 4) | (min >> 2));
-    appendResult(((min & 0x2) << 6) | sec);
-    appendResult('Z');
-    return NO_ERROR;
-}
-
-EncoderError ImpsWbxmlEncoder::encodeString(const char *chars, int len)
-{
-    // FIXME: should match and replace based on tokens (words)
-    int token = csp13ValueTokenToKey(chars, len);
-    if (token == -1) {
-        encodeInlinedStr(chars, len);
-    } else {
-        appendResult(TOKEN_EXT_T_0);
-        encodeMbuint(token);
-    }
-    return NO_ERROR;
-}
-
-EncoderError ImpsWbxmlEncoder::encodeAttrib(const char *name, const char *value)
-{
-    // IMPS so far has only "xmlns" attribute.
-    // TODO: rewrite in a more generic way and move this to WbxmlEncoder
-    if (strcmp(name, "xmlns")) {
-        return ERROR_UNSUPPORTED_ATTR;
-    }
-    int valueLen = strlen(value);
-    for (size_t i = 0; i < sizeof(csp13xmlns) / sizeof(csp13xmlns[0]); i++) {
-        const char * prefix = csp13xmlns[i].prefix;
-        int prefixLen = strlen(csp13xmlns[i].prefix);
-        if (strncmp(prefix, value, prefixLen) == 0) {
-            appendResult(csp13xmlns[i].attrToken);
-            if (valueLen > prefixLen) {
-                encodeInlinedStr(value + prefixLen, valueLen - prefixLen);
-            }
-            return NO_ERROR;
-        }
-    }
-    encodeInlinedStr(value, valueLen);
-    return NO_ERROR;
-}
-
-void ImpsWbxmlEncoder::encodeInlinedStr(const char *s, int len)
-{
-    // TODO: move this to WbxmlEncoder
-    // TODO: handle ENTITY
-    appendResult(TOKEN_STR_I);
-    appendResult(s, len);
-    appendResult('\0');
-}
-
-void ImpsWbxmlEncoder::encodeMbuint(uint32_t val)
-{
-    char buf[32 / 7 + 1];   // each byte holds up to 7 bits
-    int i = sizeof(buf);
-
-    buf[--i] = val & 0x7f;
-    val >>= 7;
-    while ((i > 0) && (val & 0x7f)) {
-        buf[--i] = 0x80 | (val & 0x7f);
-        val >>= 7;
-    }
-
-    appendResult(buf + i, sizeof(buf) - i);
-}
-
diff --git a/libwbxml/src/wbxml_jni.cpp b/libwbxml/src/wbxml_jni.cpp
deleted file mode 100644 (file)
index e2e6aae..0000000
+++ /dev/null
@@ -1,623 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "wbxml"
-
-#include <jni.h>
-#include <cutils/jstring.h>
-
-#include "wbxml_parser.h"
-#include "imps_encoder.h"
-#include "csp13_hash.h"
-
-// FIXME: dalvik seems to have problem throwing non-system exceptions. Use IAE for now.
-#if 1
-#define PARSER_EXCEPTION_CLASS      "java/lang/IllegalArgumentException"
-#define SERIALIZER_EXCEPTION_CLASS  "java/lang/IllegalArgumentException"
-#else
-#define PARSER_EXCEPTION_CLASS      "com/android/im/imps/ParserException"
-#define SERIALIZER_EXCEPTION_CLASS  "com/android/im/imps/SerializerException"
-#endif
-
-class JniWbxmlContentHandler;
-class JniWbxmlDataHandler;
-
-struct WbxmlParsingContext
-{
-    /** The JNI enviromenet. */
-    JNIEnv * env;
-    /** The Java parser object. */
-    jobject object;
-    /** The wbxml parser. */
-    WbxmlParser * parser;
-    /** The content handler.*/
-    JniWbxmlContentHandler * contentHandler;
-};
-
-struct WbxmlEncodingContext
-{
-    /** The JNI enviroment. */
-    JNIEnv * env;
-    /** The Java encoder object. */
-    jobject object;
-    /** The wbxml encoder. */
-    WbxmlEncoder * encoder;
-    /** The handler to get encoding result. */
-    JniWbxmlDataHandler * handler;
-};
-
-static jmethodID parserCallbackStartElement;
-static jmethodID parserCallbackEndElement;
-static jmethodID parserCallbackCharacters;
-static jmethodID encoderCallbackWbxmlData;
-static jclass stringClass;
-
-/**
- * Copies UTF-8 characters into the buffer.
- */
-static jcharArray bytesToCharArray(JNIEnv * env, const char *data, int length, size_t * out_len)
-{
-    // TODO: store the buffer in ParsingContext to reuse it instead create a
-    // new one everytime.
-    jcharArray buffer = env->NewCharArray(length);
-    if(buffer == NULL) {
-        return NULL;
-    }
-
-    // Get a native reference to the buffer.
-    jboolean copy;
-    jchar *nativeBuffer = env->GetCharArrayElements(buffer, &copy);
-    if (copy) {
-        jclass clazz = env->FindClass("java/lang/AssertionError");
-        env->ThrowNew(clazz, "Unexpected copy");
-        return NULL;
-    }
-
-    // Decode UTF-8 characters into the buffer.
-    strcpylen8to16((char16_t *) nativeBuffer, data, length, out_len);
-
-    // Release our native reference.
-    env->ReleaseCharArrayElements(buffer, nativeBuffer, JNI_ABORT);
-
-    return buffer;
-}
-
-class JniWbxmlContentHandler : public DefaultWbxmlContentHandler
-{
-public:
-    JniWbxmlContentHandler(WbxmlParsingContext * context):mContext(context)
-    {
-    }
-
-    void reset(void)
-    {
-        mCurTag.clear();
-    }
-
-    void startElement(const char * name, const vector<Attribute> & atts)
-    {
-        JNIEnv * env = mContext->env;
-
-        if(env->ExceptionCheck()) return;
-
-        mCurTag = name;
-
-        //TODO cache jstrings for later use?
-        jstring localName = env->NewStringUTF(name);
-        jobjectArray attrNames = NULL;
-        jobjectArray attrValues = NULL;
-        int count = atts.size();
-        if(count > 0) {
-            attrNames = env->NewObjectArray(count, stringClass, NULL);
-            attrValues = env->NewObjectArray(count, stringClass, NULL);
-        }
-
-        for(int i = 0; i < count; i++) {
-            jstring attrName = env->NewStringUTF(atts[i].name.c_str());
-            jstring attrValue = env->NewStringUTF(atts[i].value.c_str());
-            env->SetObjectArrayElement(attrNames, i, attrName);
-            env->SetObjectArrayElement(attrValues, i, attrValue);
-        }
-
-        jobject javaParser = mContext->object;
-        env->CallVoidMethod(javaParser, parserCallbackStartElement, localName, attrNames, attrValues);
-        env->DeleteLocalRef(localName);
-        for(int i = 0; i < count; i++) {
-            env->DeleteLocalRef(env->GetObjectArrayElement(attrNames, i));
-            env->DeleteLocalRef(env->GetObjectArrayElement(attrValues, i));
-        }
-    }
-
-    void endElement(const char * name)
-    {
-        JNIEnv * env = mContext->env;
-
-        if(env->ExceptionCheck()) return;
-
-        mCurTag.clear();
-
-        jstring localName = env->NewStringUTF(name);
-        jobject javaParser = mContext->object;
-
-        env->CallVoidMethod(javaParser, parserCallbackEndElement, localName);
-        env->DeleteLocalRef(localName);
-    }
-
-    void characters(const char * data, int len)
-    {
-        JNIEnv * env = mContext->env;
-
-        if(env->ExceptionCheck()) return;
-
-        size_t utf16length;
-        jcharArray buffer = bytesToCharArray(env, data, len, &utf16length);
-        jobject javaParser = mContext->object;
-        env->CallVoidMethod(javaParser, parserCallbackCharacters, buffer, utf16length);
-        env->DeleteLocalRef(buffer);
-    }
-
-    void opaque(const char * data, int len)
-    {
-        JNIEnv * env = mContext->env;
-
-        if(env->ExceptionCheck()) return;
-
-        int val = 0;
-        if (csp13IsIntegerTag(mCurTag.c_str())) {
-            while (len--){
-                val <<= 8;
-                val |= (unsigned char)*data++;
-            }
-
-            char buf[20];
-            sprintf(buf, "%d", val);
-            size_t utf16length;
-            jcharArray buffer = bytesToCharArray(env, buf, strlen(buf), &utf16length);
-            jobject javaParser = mContext->object;
-            env->CallVoidMethod(javaParser, parserCallbackCharacters, buffer, utf16length);
-            env->DeleteLocalRef(buffer);
-        }
-        // FIXME: handle DateTime and binary data too
-    }
-private:
-    WbxmlParsingContext * mContext;
-    string mCurTag;
-};
-
-static void parserStaticInitialize(JNIEnv * env, jclass clazz)
-{
-    parserCallbackStartElement = env->GetMethodID((jclass) clazz, "startElement",
-        "(Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;)V");
-
-    parserCallbackEndElement = env->GetMethodID((jclass) clazz, "endElement",
-        "(Ljava/lang/String;)V");
-
-    parserCallbackCharacters = env->GetMethodID((jclass) clazz, "characters",
-        "([CI)V");
-
-    stringClass = env->FindClass("java/lang/String");
-}
-
-static jint parserCreate(JNIEnv * env, jobject thisObj, jstring encoding)
-{
-    // TODO: encoding
-    WbxmlParsingContext * context = NULL;
-    WbxmlParser * parser = NULL;
-    JniWbxmlContentHandler * handler = NULL;
-
-    context = new WbxmlParsingContext();
-    if (!context) {
-        goto error;
-    }
-
-    parser = new WbxmlParser(0);
-    if (!parser) {
-        goto error;
-    }
-
-    handler = new JniWbxmlContentHandler(context);
-    if (!handler) {
-        goto error;
-    }
-
-    parser->setContentHandler(handler);
-    context->parser = parser;
-    context->contentHandler = handler;
-    context->env = env;
-    context->object = thisObj;
-
-    return (jint)context;
-
-error:
-    // C++ is OK with deleting NULL ptr.
-    delete context;
-    delete parser;
-    return 0;
-}
-
-static void parserDelete(JNIEnv * env, jobject thisObj, jint nativeParser)
-{
-    WbxmlParsingContext * context = (WbxmlParsingContext *)nativeParser;
-    delete context->parser;
-    delete context->contentHandler;
-    delete context;
-}
-
-static void parserReset(JNIEnv * env, jobject thisObj, jint nativeParser)
-{
-    WbxmlParsingContext * context = (WbxmlParsingContext *)nativeParser;
-    WbxmlParser * parser = context->parser;
-    JniWbxmlContentHandler * handler = context->contentHandler;
-
-    parser->reset();
-    handler->reset();
-    parser->setContentHandler(handler);
-}
-
-static void parserParse(JNIEnv * env, jobject thisObj, jint nativeParser,
-        jbyteArray buf, jint len, jboolean isEnd)
-{
-    WbxmlParsingContext * context = (WbxmlParsingContext *)nativeParser;
-    WbxmlParser * parser = context->parser;
-    context->env = env;
-
-    jboolean copy;
-    jbyte * bytes = env->GetByteArrayElements(buf, &copy);
-    if(copy) {
-        jclass clazz = env->FindClass("java/lang/AssertionError");
-        env->ThrowNew(clazz, "Unexpected copy");
-        return;
-    }
-
-    // make sure the context is updated because we may get called from
-    // a different thread
-    context->env = env;
-    context->object = thisObj;
-
-    if (parser->parse((char*)bytes, len, isEnd) != WBXML_STATUS_OK) {
-        LOGW("WbxmlParser parse error %d\n", parser->getError());
-        jclass clazz = env->FindClass(PARSER_EXCEPTION_CLASS);
-        if (clazz == NULL) {
-            LOGE("Can't find class " PARSER_EXCEPTION_CLASS "\n");
-            return;
-        }
-        env->ThrowNew(clazz, NULL);
-    }
-
-    jthrowable exception = env->ExceptionOccurred();
-    if (exception) {
-        env->ExceptionClear();
-        env->ReleaseByteArrayElements(buf, bytes, JNI_ABORT);
-        env->Throw(exception);
-    } else {
-        env->ReleaseByteArrayElements(buf, bytes, JNI_ABORT);
-    }
-    context->env = NULL;
-}
-
-class JniWbxmlDataHandler : public WbxmlHandler
-{
-public:
-    JniWbxmlDataHandler(WbxmlEncodingContext * context) : mContext(context)
-    {
-    }
-
-    void reset()
-    {
-        // nothing to do
-    }
-
-    void wbxmlData(const char *data, uint32_t len)
-    {
-        JNIEnv * env = mContext->env;
-
-        if (env->ExceptionCheck()) {
-            return;
-        }
-
-        if (encoderCallbackWbxmlData == NULL) {
-            jclass clazz = env->GetObjectClass(mContext->object);
-            encoderCallbackWbxmlData = env->GetMethodID(clazz, "onWbxmlData", "([BI)V");
-        }
-        jbyteArray byteArray = env->NewByteArray(len);
-        if (byteArray == NULL) {
-            return;
-        }
-
-        env->SetByteArrayRegion(byteArray, 0, len, (const jbyte*)data);
-
-        env->CallVoidMethod(mContext->object, encoderCallbackWbxmlData, byteArray, len);
-    }
-
-private:
-    WbxmlEncodingContext * mContext;
-};
-
-static jint encoderCreate(JNIEnv * env, jobject thisObj, int publicId)
-{
-    WbxmlEncodingContext * context = NULL;
-    WbxmlEncoder * encoder = NULL;
-    JniWbxmlDataHandler * handler = NULL;
-
-    context = new WbxmlEncodingContext();
-    if (!context) {
-        goto error;
-    }
-
-    encoder = new ImpsWbxmlEncoder(publicId);
-    if (!encoder) {
-        goto error;
-    }
-
-    handler = new JniWbxmlDataHandler(context);
-    if (!handler) {
-        goto error;
-    }
-
-    encoder->setWbxmlHandler(handler);
-
-    context->encoder = encoder;
-    context->handler = handler;
-    context->env = env;
-    context->object = thisObj;
-
-    return (jint)context;
-
-error:
-    // C++ is OK with deleting NULL ptr.
-    delete context;
-    delete encoder;
-    return 0;
-}
-
-static void encoderDelete(JNIEnv * env, jobject thisObj, jint nativeEncoder)
-{
-    WbxmlEncodingContext * context = (WbxmlEncodingContext *)nativeEncoder;
-    delete context->encoder;
-    delete context->handler;
-    delete context;
-}
-
-static void encoderReset(JNIEnv * env, jobject thisObj, jint nativeEncoder)
-{
-    WbxmlEncodingContext * context = (WbxmlEncodingContext *)nativeEncoder;
-    WbxmlEncoder * encoder = context->encoder;
-    JniWbxmlDataHandler * handler = context->handler;
-
-    encoder->reset();
-    handler->reset();
-    encoder->setWbxmlHandler(handler);
-}
-
-static void encoderStartElement(JNIEnv * env, jobject thisObj, jint nativeEncoder,
-        jstring name, jobjectArray atts)
-{
-    WbxmlEncodingContext * context = (WbxmlEncodingContext *)nativeEncoder;
-    WbxmlEncoder * encoder = context->encoder;
-
-    const char ** c_atts = NULL;
-    int count = atts ? env->GetArrayLength(atts) : 0;
-    // TODO: handle out of memory.
-    c_atts = new const char *[count + 1];
-    if (atts != NULL) {
-        for(int i = 0; i < count; i++) {
-            jstring str = (jstring)env->GetObjectArrayElement(atts, i);
-            c_atts[i] = env->GetStringUTFChars(str, NULL);
-        }
-    }
-    c_atts[count] = NULL;
-    const char * c_name = env->GetStringUTFChars(name, NULL);
-
-    // make sure the context is updated because we may get called from
-    // a different thread
-    context->env = env;
-    context->object = thisObj;
-
-    EncoderError ret = encoder->startElement(c_name, c_atts);
-
-    // encoder->startElement() may result in a call to WbxmlHandler.wbxmlData()
-    // which in turns call back to the Java side. Therefore we might have
-    // a pending Java exception here. Although current WbxmlEncoder always
-    // call WbxmlHandler.wbxmlData() only after a successful complete parsing
-    // but this may change later.
-
-    if (env->ExceptionCheck() == JNI_FALSE && ret != NO_ERROR) {
-        // only throw a new exception when there is no pending one
-        LOGW("WbxmlEncoder startElement error:%d\n", ret);
-        jclass clazz = env->FindClass(SERIALIZER_EXCEPTION_CLASS);
-        if (clazz == NULL) {
-            LOGE("Can't find class " SERIALIZER_EXCEPTION_CLASS);
-            return;
-        }
-        env->ThrowNew(clazz, "Wbxml encode error");
-    }
-
-    jthrowable exception = env->ExceptionOccurred();
-    if(exception) {
-        env->ExceptionClear();
-    }
-
-    env->ReleaseStringUTFChars(name, c_name);
-    for (int i = 0; i < count; i++) {
-        jstring str = (jstring)env->GetObjectArrayElement(atts, i);
-        env->ReleaseStringUTFChars(str, c_atts[i]);
-    }
-    delete[] c_atts;
-    if (exception) {
-        env->Throw(exception);
-    }
-}
-
-static void encoderCharacters(JNIEnv * env, jobject thisObj, jint nativeEncoder, jstring chars)
-{
-    WbxmlEncodingContext * context = (WbxmlEncodingContext *)nativeEncoder;
-    WbxmlEncoder * encoder = context->encoder;
-
-    const char * c_chars = env->GetStringUTFChars(chars, NULL);
-
-    // make sure the context is updated because we may get called from
-    // a different thread
-    context->env = env;
-    context->object = thisObj;
-
-    EncoderError ret = encoder->characters(c_chars, env->GetStringUTFLength(chars));
-
-    // encoder->characters() may result in a call to WbxmlHandler.wbxmlData()
-    // which in turns call back to the Java side. Therefore we might have
-    // a pending Java exception here. Although current WbxmlEncoder always
-    // call WbxmlHandler.wbxmlData() only after a successful complete parsing
-    // but this may change later.
-
-    if (env->ExceptionCheck() == JNI_FALSE && ret != NO_ERROR) {
-        // only throw a new exception when there is no pending one
-        LOGE("WbxmlEncoder characters error:%d\n", ret);
-        jclass clazz = env->FindClass(SERIALIZER_EXCEPTION_CLASS);
-        if (clazz == NULL) {
-            LOGE("Can't find class " SERIALIZER_EXCEPTION_CLASS);
-            return;
-        }
-        env->ThrowNew(clazz, "Wbxml encode error");
-    }
-    jthrowable exception = env->ExceptionOccurred();
-    if (exception) {
-        env->ExceptionClear();
-        env->ReleaseStringUTFChars(chars, c_chars);
-        env->Throw(exception);
-    } else {
-        env->ReleaseStringUTFChars(chars, c_chars);
-    }
-}
-
-static void encoderEndElement(JNIEnv * env, jobject thisObj, jint nativeEncoder)
-{
-    WbxmlEncodingContext * context = (WbxmlEncodingContext *)nativeEncoder;
-    WbxmlEncoder * encoder = context->encoder;
-
-    // make sure the context is updated because we may get called from
-    // a different thread
-    context->env = env;
-    context->object = thisObj;
-
-    EncoderError ret = encoder->endElement();
-
-    // encoder->endElement() may result in a call to WbxmlHandler.wbxmlData()
-    // which in turns call back to the Java side. Therefore we might have
-    // a pending Java exception here.
-    if (env->ExceptionCheck() == JNI_FALSE && ret != NO_ERROR) {
-        // only throw a new exception when there is no pending one
-        LOGE("WbxmlEncoder endElement error:%d\n", ret);
-        jclass clazz = env->FindClass(SERIALIZER_EXCEPTION_CLASS);
-        if (clazz == NULL) {
-            LOGE("Can't find class " SERIALIZER_EXCEPTION_CLASS);
-            return;
-        }
-        env->ThrowNew(clazz, "Wbxml encode error");
-    }
-}
-
-/**
- * Table of methods associated with WbxmlParser.
- */
-static JNINativeMethod parserMethods[] = {
-    /* name, signature, funcPtr */
-    { "nativeStaticInitialize", "()V",                      (void*) parserStaticInitialize },
-    { "nativeCreate",           "(Ljava/lang/String;)I",    (void*) parserCreate },
-    { "nativeRelease",          "(I)V",                     (void*) parserDelete },
-    { "nativeReset",            "(I)V",                     (void*) parserReset },
-    { "nativeParse",            "(I[BIZ)V",                 (void*) parserParse },
-};
-
-/**
- * Table of methods associated with WbxmlSerializer.
- */
-static JNINativeMethod encoderMethods[] = {
-    /* name, signature, funcPtr */
-    { "nativeCreate",       "(I)I",                                     (void*) encoderCreate },
-    { "nativeRelease",      "(I)V",                                     (void*) encoderDelete },
-    { "nativeReset",        "(I)V",                                     (void*) encoderReset },
-    { "nativeStartElement", "(ILjava/lang/String;[Ljava/lang/String;)V", (void*) encoderStartElement },
-    { "nativeCharacters",   "(ILjava/lang/String;)V",                   (void*) encoderCharacters },
-    { "nativeEndElement",   "(I)V",                                     (void*) encoderEndElement },
-};
-
-/*
- * Register several native methods for one class.
- */
-static int registerNativeMethods(JNIEnv* env, const char* className,
-    JNINativeMethod* methods, int numMethods)
-{
-    jclass clazz;
-
-    clazz = env->FindClass(className);
-    if (clazz == NULL) {
-        LOGE("Native registration unable to find class '%s'\n", className);
-        return JNI_FALSE;
-    }
-    if (env->RegisterNatives(clazz, methods, numMethods) < 0) {
-        LOGE("RegisterNatives failed for '%s'\n", className);
-        return JNI_FALSE;
-    }
-
-    return JNI_TRUE;
-}
-
-/*
- * Register native methods.
- */
-static int registerNatives(JNIEnv* env)
-{
-    if (!registerNativeMethods(env, "com/android/im/imps/WbxmlParser",
-            parserMethods, sizeof(parserMethods) / sizeof(parserMethods[0])))
-        return JNI_FALSE;
-
-    if (!registerNativeMethods(env, "com/android/im/imps/WbxmlSerializer",
-            encoderMethods, sizeof(encoderMethods) / sizeof(encoderMethods[0])))
-        return JNI_FALSE;
-
-    return JNI_TRUE;
-}
-
-/*
- * Set some test stuff up.
- *
- * Returns the JNI version on success, -1 on failure.
- */
-jint JNI_OnLoad(JavaVM* vm, void* reserved)
-{
-    JNIEnv* env = NULL;
-    jint result = -1;
-
-    if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
-        LOGE("ERROR: GetEnv failed\n");
-        goto bail;
-    }
-    assert(env != NULL);
-
-    // LOGI("In WbxmlParser JNI_OnLoad\n");
-
-    if (!registerNatives(env)) {
-        LOGE("ERROR: WbxmlParser native registration failed\n");
-        goto bail;
-    }
-
-    /* success -- return valid version number */
-    result = JNI_VERSION_1_4;
-
-bail:
-    return result;
-}
-
diff --git a/libwbxml/src/wbxml_parser.cpp b/libwbxml/src/wbxml_parser.cpp
deleted file mode 100644 (file)
index 091611e..0000000
+++ /dev/null
@@ -1,708 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <setjmp.h>
-#include <assert.h>
-#include "wbxml_parser.h"
-#include "csp13_data.h"
-#ifdef SUPPORT_SYNCML
-#include "syncml_data.h"
-#endif
-
-#ifdef PLATFORM_ANDROID
-extern "C" void *bsearch(const void *key, const void *base0, size_t nmemb,
-        size_t size, int (*compar)(const void *, const void *));
-#endif
-
-#define ARRAY_SIZE(a)   (sizeof(a) / sizeof(a[0]))
-
-//#define WBXML_DEBUG 1
-
-/* Major TODO items:
-   - Attribute value tokens (not used by IMPS CSP)
-   - EXT_* except EXT_T_0 (not used by IMPS CSP)
-   - PI (not used by IMPS CSP)
-   - cleanups
-
-   Other TODO:
-   - Support more public ID? Only IMPS is supported now.
-   - Support other charsets than UTF-8
- */
-
-static int compareTokenData(const void * t1, const void * t2)
-{
-    return ((TokenData *)t1)->token - ((TokenData *)t2)->token;
-}
-
-static int compareAttrData(const void * t1, const void * t2)
-{
-    return ((AttrData *)t1)->token - ((AttrData *)t2)->token;
-}
-
-static bool isTagStart(int token)
-{
-    if (token == TOKEN_SWITCH_PAGE)
-        return true;
-
-    token &= 0x3f;
-    return (token >= TOKEN_LITERAL && token < TOKEN_EXT_I_0);
-}
-
-static bool isAttrStart(int token)
-{
-    return (token >= TOKEN_LITERAL && token < TOKEN_EXT_I_0) ||
-        (token > TOKEN_LITERAL_C && token < 0x80);
-}
-
-WbxmlParser::WbxmlParser(uint32_t transportEncoding) :
-    mTransportEncoding(transportEncoding)
-{
-    reset();
-}
-
-WbxmlParser::~WbxmlParser()
-{
-}
-
-void WbxmlParser::reset(void)
-{
-    mContentHandler = NULL;
-
-    mExternalChunk = NULL;
-    mExternalChunkLen = 0;
-    mLastChunk.clear();
-    mDataOffset = 0;
-    mIsDataEnd = false;
-
-    mStartElemStack.clear();
-    mStringTable.clear();
-
-    mCurrTagPage = mCurrAttrPage = 0;
-    mPublicId = 0;
-
-    mState = EXPECT_HEADER;
-    mLastError = ERROR_NO_ERROR;
-}
-
-void WbxmlParser::setContentHandler(WbxmlContentHandler * handler)
-{
-    mContentHandler = handler;
-}
-
-int WbxmlParser::parse(const char * data, uint32_t dataLen, bool end)
-{
-    if (data == NULL) {
-        mLastError = ERROR_INVALID_DATA;
-        return WBXML_STATUS_ERROR;
-    }
-
-    // All temporary C++ varaibles must be declared before setjmp to make
-    // sure they get properly destructed after longjmp.
-    vector<Attribute> attribs;
-    Attribute attrib;
-    string tagName;
-    string characters;
-    string opaque;
-
-#ifdef WBXML_DEBUG
-    printf("\nparse dataLen %d; end %d; readPos %d; availData %d\n",
-        dataLen, end, getReadPos(), availDataSize());
-#endif
-    appendData(data, dataLen, end);
-    volatile int readPos = getReadPos();
-    int setjmpRet;
-    switch (setjmpRet = setjmp(mJmpbuf)) {
-        case 0:
-            break;
-
-        case ERROR_NEED_MORE_DATA:
-            if (!mIsDataEnd) {
-#ifdef WBXML_DEBUG
-                printf("\nneed more data: readPos %d\n", readPos);
-#endif
-                setReadPos(readPos);
-                saveRemainingData();
-                return WBXML_STATUS_OK;
-            } else {
-#ifdef WBXML_DEBUG
-                printf("wbxml parser error: unexpected data end\n");
-#endif
-                mLastError = ERROR_NEED_MORE_DATA;
-                return WBXML_STATUS_ERROR;
-            }
-            break;
-
-        case ERROR_UNSUPPORTED_PUBID:
-        case ERROR_UNSUPPORTED_CHARSET:
-        case ERROR_INVALID_STRING_TABLE:
-        case ERROR_INVALID_STRING_TABLE_REFERENCE:
-        case ERROR_INVALID_EXT_TOKEN:
-        case ERROR_INVALID_MBUINT:
-        case ERROR_INVALID_ENTITY:
-        case ERROR_UNRECOGNIZED_TAG:
-        case ERROR_UNRECOGNIZED_ATTR:
-        case ERROR_MISSING_ATTR:
-        case ERROR_MISSING_TOKEN_END:
-#ifdef WBXML_DEBUG
-            printf("wbxml parser error %d\n", setjmpRet);
-#endif
-            mLastError = ParserError(setjmpRet);
-            return WBXML_STATUS_ERROR;
-            break;
-
-        case ERROR_NOT_SUPPORTED_YET:
-            printf("wbxml parser error: Not implemented feature.\n");
-            mLastError = ParserError(setjmpRet);
-            return WBXML_STATUS_ERROR;
-            break;
-
-        default:
-            printf("wbxml parser error: Impossible execution path.\n");
-            mLastError = ParserError(setjmpRet);
-            return WBXML_STATUS_ERROR;
-            break;
-    }
-
-    for (;;) {
-        // save readPos for error recovery
-        readPos = getReadPos();
-
-        switch (mState) {
-            case EXPECT_HEADER:
-                mDocVersion = readByte();
-
-                mPublicId = readMbuint32();
-                if (mPublicId != 0) {
-                    if (!selectTokenMapping(mPublicId)) {
-#ifdef WBXML_DEBUG
-                        printf("wbxml parser error: unsupported public id \n");
-#endif
-                        longjmp(mJmpbuf, ERROR_UNSUPPORTED_PUBID);
-                    }
-                } else {
-                    mPublicId = -readMbuint32();
-                }
-                mCharset = readMbuint32();
-                if (!mCharset) {
-                    mCharset = mTransportEncoding;
-                    if (!mCharset) {
-                        mCharset = CHARSET_UTF8;
-                    }
-                }
-                // TODO: support more charsets other than UTF-8
-                if (mCharset != CHARSET_UTF8) {
-#ifdef WBXML_DEBUG
-                    printf("wbxml parser error: unsupported charset\n");
-#endif
-                    longjmp(mJmpbuf, ERROR_UNSUPPORTED_CHARSET);
-                }
-
-                // now advance to next state
-                if (mContentHandler) {
-                    mContentHandler->handlePublicId(mPublicId);
-                }
-                mState = EXPECT_STRING_TABLE;
-                break;
-
-            case EXPECT_STRING_TABLE:
-            {
-                uint32_t len = readMbuint32();
-                if (availDataSize() < len) {
-                    longjmp(mJmpbuf, ERROR_NEED_MORE_DATA);
-                }
-                mStringTable.clear();
-                // TODO: optimize this
-                while (len--) {
-                    mStringTable += readByte();
-                }
-                if (mStringTable.size()) {
-                    if (mStringTable[mStringTable.size() - 1] != 0) {
-                        // must have an ending \0
-                        //TODO:the byte array returned by SCTS does not contain '\0' at the
-                        //end,should this be fixed accordingly?
-#ifdef WBXML_DEBUG
-                        printf("wbxml parser error: invalid string table\n");
-#endif
-                        longjmp(mJmpbuf, ERROR_INVALID_STRING_TABLE);
-                    }
-                }
-                mState = EXPECT_BODY_START;
-                if (mPublicId <= 0) {
-                    const char * s = mStringTable.c_str() + (-mPublicId);
-#ifdef SUPPORT_SYNCML
-                    if (strcmp(s, "-//SYNCML//DTD SyncML 1.2//EN") == 0) {
-                        mPublicId = PUBLICID_SYNCML_1_2;
-                    } else if (strcmp(s, "-//SYNCML//DTD SyncML 1.1//EN") == 0) {
-                        mPublicId = PUBLICID_SYNCML_1_1;
-                    } else if (strcmp(s, "-//SYNCML//DTD SyncML 1.0//EN") == 0) {
-                        mPublicId = PUBLICID_SYNCML_1_0;
-                    }
-#endif
-                    if ((mPublicId <= 0) || !selectTokenMapping(mPublicId)) {
-                        longjmp(mJmpbuf, ERROR_UNSUPPORTED_PUBID);
-                    }
-                }
-                break;
-            }
-
-            case EXPECT_BODY_START:
-                //TODO: handle possible PIs
-                mState = EXPECT_ELEMENT_START;
-                break;
-
-            case EXPECT_ELEMENT_START:
-            {
-                int stag = readByte();
-                const char * name;
-                if ((stag & 0x3f) == TOKEN_LITERAL) {
-                    name = resolveStrTableRef();
-                } else {
-                    if (stag == TOKEN_SWITCH_PAGE) {
-                        mCurrTagPage = readByte();
-                        stag = readByte();
-                    }
-                    name = lookupTagName(stag);
-                }
-                if (name == NULL) {
-#ifdef WBXML_DEBUG
-                    printf("wbxml parser error: unrecognized tag\n");
-#endif
-                    longjmp(mJmpbuf, ERROR_UNRECOGNIZED_TAG);
-                }
-                attribs.clear();
-                if (stag & 0x80) {
-                    // followed by 1 or more attributes
-                    while (peekByte() != TOKEN_END) {
-                        readAttribute(&attrib);
-                        attribs.push_back(attrib);
-                    }
-                    if (!attribs.size()) {
-#ifdef WBXML_DEBUG
-                        printf("wbxml parser error: missing attributes\n");
-#endif
-                        longjmp(mJmpbuf, ERROR_MISSING_ATTR);
-                    }
-                    // TOKEN_END
-                    readByte();
-                }
-                if (mContentHandler) {
-                    mContentHandler->startElement(name, attribs);
-                }
-                if (stag & 0x40) {
-                    mState = EXPECT_CONTENT;
-                } else {
-                    mState = ELEMENT_END;
-                }
-                tagName = name;
-                mStartElemStack.push_back(name);
-                break;
-            }
-
-            case EXPECT_CONTENT:
-            {
-                int byte = peekByte();
-                if (byte == TOKEN_SWITCH_PAGE) {
-                    readByte();
-                    mCurrTagPage = readByte();
-                    byte = peekByte();
-                }
-                if (isTagStart(byte) || byte == TOKEN_END) {
-                    if (characters.size() && mContentHandler) {
-                        mContentHandler->characters(characters.c_str(), characters.size());
-                        characters.clear();
-                    }
-                    if (byte == TOKEN_END) {
-                        mState = EXPECT_ELEMENT_END;
-                    } else {
-                        mState = EXPECT_ELEMENT_START;
-                    }
-                } else {
-                    // TODO: handle extension and pi
-                    switch (byte) {
-                        case TOKEN_ENTITY:
-                        case TOKEN_STR_I:
-                        case TOKEN_STR_T:
-                            readString(characters);
-                            break;
-
-                        case TOKEN_EXT_T_0:
-                        {
-                            readByte();
-                            uint32_t valueToken = readMbuint32();
-                            if (mPublicId == PUBLICID_IMPS_1_1
-                                    || mPublicId == PUBLICID_IMPS_1_2
-                                    || mPublicId == PUBLICID_IMPS_1_3) {
-                                TokenData t = {valueToken, NULL};
-                                const TokenData * res = (TokenData *)bsearch(&t,
-                                        csp13ExtValueTokens, ARRAY_SIZE(csp13ExtValueTokens),
-                                        sizeof(csp13ExtValueTokens[0]), compareTokenData);
-                                if (res) {
-                                    characters.append(res->tagName);
-                                } else {
-                                    longjmp(mJmpbuf, ERROR_INVALID_EXT_TOKEN);
-                                }
-                            } else {
-                                printf ("Token 0x%x\n", byte);
-                                longjmp(mJmpbuf, ERROR_NOT_SUPPORTED_YET);
-                            }
-                            break;
-                        }
-
-                        case TOKEN_OPAQUE:
-                        {
-                            readByte();
-                            uint32_t opaqueDataLen = readMbuint32();
-                            opaque.clear();
-                            while (opaqueDataLen--) {
-                                opaque += (char)readByte();
-                            }
-                            if (mContentHandler) {
-                                mContentHandler->opaque(opaque.c_str(), opaque.size());
-                            }
-                            break;
-                        }
-
-                        default:
-                            printf ("Token 0x%x\n", byte);
-                            longjmp(mJmpbuf, ERROR_NOT_SUPPORTED_YET);
-                            break;
-                    }
-                }
-                break;
-            }
-
-            case EXPECT_ELEMENT_END:
-                if (readByte() != TOKEN_END) {
-#ifdef WBXML_DEBUG
-                    printf("wbxml parser error: TOKEN_END expected\n");
-#endif
-                    longjmp(mJmpbuf, ERROR_MISSING_TOKEN_END);
-                }
-                mState = ELEMENT_END;
-                break;
-
-            case ELEMENT_END:
-                assert(!mStartElemStack.empty());
-
-                tagName = mStartElemStack.back();
-                mStartElemStack.pop_back();
-                if (mContentHandler) {
-                    mContentHandler->endElement(tagName.c_str());
-                }
-                if (mStartElemStack.empty()) {
-                    mState = EXPECT_BODY_END;
-                } else {
-                    mState = EXPECT_CONTENT;
-                }
-                break;
-
-            case EXPECT_BODY_END:
-                // TODO: handle possible PIs
-
-                // we're done
-                return WBXML_STATUS_OK;
-                break;
-        }
-    }
-}
-
-/*
- * We don't make a copy of the data chunk for the current parse() until
- * it returns.
- * The remaining data will be saved in saveRemainingData() before parse()
- * returns.
- */
-void WbxmlParser::appendData(const char * data, uint32_t len, bool end)
-{
-    mExternalChunk = data;
-    mExternalChunkLen = len;
-    mIsDataEnd = end;
-}
-
-void WbxmlParser::saveRemainingData()
-{
-    if (mDataOffset > mLastChunk.size()) {
-        uint32_t offsetToExtChunk = mDataOffset - mLastChunk.size();
-        assert(offsetToExtChunk <= mExternalChunkLen);
-        mLastChunk.assign(mExternalChunk + offsetToExtChunk,
-                mExternalChunkLen - offsetToExtChunk);
-        mDataOffset = 0;
-    } else {
-        mLastChunk.append(mExternalChunk, mExternalChunkLen);
-    }
-    mExternalChunk = NULL;
-    mExternalChunkLen = 0;
-}
-
-int WbxmlParser::readByte()
-{
-    if (mDataOffset < mLastChunk.size()) {
-#ifdef WBXML_DEBUG
-        printf ("rb 0x%x; ", (unsigned char)mLastChunk[mDataOffset]);
-#endif
-        return (unsigned char)mLastChunk[mDataOffset++];
-    } else {
-        uint32_t offsetToExtChunk = mDataOffset - mLastChunk.size();
-        if (offsetToExtChunk < mExternalChunkLen) {
-            mDataOffset++;
-#ifdef WBXML_DEBUG
-            printf ("rb 0x%x; ", (unsigned char)mExternalChunk[offsetToExtChunk]);
-#endif
-            return (unsigned char)mExternalChunk[offsetToExtChunk];
-        }
-        longjmp(mJmpbuf, ERROR_NEED_MORE_DATA);
-    }
-}
-
-int WbxmlParser::peekByte()
-{
-    if (mDataOffset < mLastChunk.size()) {
-        return (unsigned char)mLastChunk[mDataOffset];
-    } else {
-        uint32_t offsetToExtChunk = mDataOffset - mLastChunk.size();
-        if (offsetToExtChunk < mExternalChunkLen) {
-            return (unsigned char)mExternalChunk[offsetToExtChunk];
-        }
-        longjmp(mJmpbuf, ERROR_NEED_MORE_DATA);
-    }
-}
-
-uint32_t WbxmlParser::readMbuint32()
-{
-    uint32_t value = 0;
-    uint32_t byte;
-    do {
-        if ((value >> 25) != 0) {
-            // would go overflow. not a valid uint32.
-            longjmp(mJmpbuf, ERROR_INVALID_MBUINT);
-        }
-        byte = readByte();
-        value = (value << 7) | (byte & 0x7f);
-    } while (byte & 0x80);
-    return value;
-}
-
-/**
- * Read STR_I | STR_T | ENTITY and *append* to str.
- * Yes this looks ugly...
- */
-void WbxmlParser::readString(string & str)
-{
-    int byte = readByte();
-    switch (byte) {
-        case TOKEN_STR_I:
-            //TODO: assuming UTF-8
-            while ((byte = readByte()) != 0) {
-                str += (char)byte;
-            }
-            break;
-
-        case TOKEN_ENTITY:
-        {
-            uint32_t ch = readMbuint32();
-            //TODO: assuming UTF-8 for now.
-            if (ch <= 0x7f) {
-                str += (char)ch;
-            } else if (ch <= 0x7ff) {
-                str += (char)((ch >> 6) | 0xc0);
-                str += (char)((ch & 0x3f) | 0x80);
-            } else if (ch <= 0xffff) {
-                str += (char)((ch >> 12) | 0xe0);
-                str += (char)(((ch >> 6) & 0x3f) | 0x80);
-                str += (char)((ch & 0x3f) | 0x80);
-            } else if (ch <= 0x10ffff) {
-                // 010000 - 10FFFF
-                str += (char)((ch >> 18) | 0xf0);
-                str += (char)(((ch >> 12) & 0x3f) | 0x80);
-                str += (char)(((ch >> 6) & 0x3f) | 0x80);
-                str += (char)((ch & 0x3f) | 0x80);
-            } else {
-                // not a valid UCS-4 character
-                longjmp(mJmpbuf, ERROR_INVALID_ENTITY);
-            }
-            break;
-        }
-
-        case TOKEN_STR_T:
-        {
-            const char * s = resolveStrTableRef();
-            str.append(s, strlen(s));
-            break;
-        }
-
-        default:
-            // impossible
-            printf ("Unknown token 0x%02x\n", byte);
-            longjmp(mJmpbuf, ERROR_NOT_SUPPORTED_YET);
-            break;
-    }
-}
-
-const char * WbxmlParser::resolveStrTableRef(void)
-{
-    uint32_t offset = readMbuint32();
-    if (offset >= mStringTable.size()) {
-        longjmp(mJmpbuf, ERROR_INVALID_STRING_TABLE_REFERENCE);
-    }
-    return mStringTable.c_str() + offset;
-}
-
-bool WbxmlParser::selectTokenMapping(int publicId)
-{
-    switch (publicId) {
-        case PUBLICID_IMPS_1_3:
-        case PUBLICID_IMPS_1_2:
-        case PUBLICID_IMPS_1_1:
-            mTagPages = csp13TagPages;
-            mNumTagPages = ARRAY_SIZE(csp13TagPages);
-            mAttrPages = csp13AttrPages;
-            mNumAttrPages = ARRAY_SIZE(csp13AttrPages);
-            break;
-
-#ifdef SUPPORT_SYNCML
-        case PUBLICID_SYNCML_1_0:
-        case PUBLICID_SYNCML_1_1:
-        case PUBLICID_SYNCML_1_2:
-        case PUBLICID_SYNCML_METINF_1_2:
-            mTagPages = syncmlTagPages;
-            mNumTagPages = ARRAY_SIZE(syncmlTagPages);
-            mAttrPages = NULL;
-            mNumAttrPages = 0;
-            break;
-
-        case PUBLICID_SYNCML_DEVINF_1_2:
-            mTagPages = syncmlDevInfTagPages;
-            mNumTagPages = ARRAY_SIZE(syncmlDevInfTagPages);
-            mAttrPages = NULL;
-            mNumAttrPages = 0;
-            break;
-#endif
-        default:
-            return false;
-    }
-    return true;
-}
-
-const char * WbxmlParser::lookupTagName(int tag) const
-{
-    tag = tag & 0x3f;
-
-    // TODO: optimize this
-    if (mCurrTagPage >= mNumTagPages) {
-        return NULL;
-    }
-    const TagCodePage * page = &mTagPages[mCurrTagPage];
-    if (page == NULL) {
-        return NULL;
-    }
-
-    TokenData t = {tag, NULL};
-    const TokenData * res = (TokenData *)bsearch(&t, page->tags, page->numTokens,
-            sizeof(TokenData), compareTokenData);
-    if (res) {
-        return res->tagName;
-    }
-
-    return NULL;
-}
-
-const char * WbxmlParser::lookupAttrName(int token, const char **prefix) const
-{
-    // TODO: optimize this
-    if (mCurrAttrPage >= mNumAttrPages) {
-        return NULL;
-    }
-    const AttrCodePage * page = &mAttrPages[mCurrAttrPage];
-    if (page == NULL) {
-        return NULL;
-    }
-
-    AttrData t = {token, NULL, NULL};
-    const AttrData * res = (AttrData *)bsearch(&t, page->attrs, page->numTokens,
-            sizeof(AttrData), compareAttrData);
-    if (res) {
-        if (prefix) {
-            *prefix = res->attrValuePrefix;
-        }
-        return res->attrName;
-    }
-
-    return NULL;
-}
-
-void WbxmlParser::readAttribute(Attribute * attrib)
-{
-    // attribute start: attrib start token, LITERAL or END
-    int attrStart = readByte();
-    const char * name;
-    const char * valuePrefix = NULL;
-
-    if (attrStart == TOKEN_LITERAL) {
-        name = resolveStrTableRef();
-    } else {
-        if (attrStart == TOKEN_SWITCH_PAGE) {
-            mCurrAttrPage = readByte();
-            attrStart = readByte();
-        }
-        name = lookupAttrName(attrStart, &valuePrefix);
-    }
-    if (name == NULL) {
-        longjmp(mJmpbuf, ERROR_UNRECOGNIZED_ATTR);
-    }
-    attrib->name = name;
-    attrib->value = "";
-    if (valuePrefix != NULL) {
-        attrib->value = valuePrefix;
-    }
-
-    // now attribute value: zero or more value, string, entity or extension tokens
-    for (;;) {
-        int valueToken = peekByte();
-        if (isAttrStart(valueToken) || valueToken == TOKEN_END) {
-            // An attribute start token, a LITERAL token or the END token
-            // indicates the end of an attribute value.
-            return;
-        }
-        switch (valueToken) {
-            case TOKEN_ENTITY:
-            case TOKEN_STR_I:
-            case TOKEN_STR_T:
-                readString(attrib->value);
-                break;
-
-            case TOKEN_EXT_I_0:
-            case TOKEN_EXT_I_1:
-            case TOKEN_EXT_I_2:
-            case TOKEN_EXT_0:
-            case TOKEN_EXT_1:
-            case TOKEN_EXT_2:
-                //TODO: document type specific
-                printf ("Unsupported Token 0x%x\n", valueToken);
-                longjmp(mJmpbuf, ERROR_NOT_SUPPORTED_YET);
-                break;
-
-            default:
-                //TODO
-                printf ("Unknown Token 0x%x\n", valueToken);
-                longjmp(mJmpbuf, ERROR_NOT_SUPPORTED_YET);
-                break;
-        }
-    }
-}
-
diff --git a/libwbxml/src/xml2wbxml.cpp b/libwbxml/src/xml2wbxml.cpp
deleted file mode 100644 (file)
index 41a8f44..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "xml2wbxml.h"
-#include "wbxml_stl.h"
-#include "imps_encoder.h"
-
-struct PublicIdData {
-    const char * pubid;
-    const char * xmlns;
-    PublicId idVal;
-};
-
-// http://www.openmobilealliance.org/tech/omna/omna-wbxml-public-docid.htm
-static const PublicIdData knownPublicId[] = {
-    { "-//OMA//DTD IMPS-CSP 1.3//EN",
-        "http://www.openmobilealliance.org/DTD/IMPS-CSP1.3",
-        PUBLICID_IMPS_1_3 },
-    { "-//OMA//DTD WV-CSP 1.2//EN",
-        "http://www.openmobilealliance.org/DTD/WV-CSP1.2",
-        PUBLICID_IMPS_1_2 },
-    { "-//WIRELESSVILLAGE//DTD CSP 1.1//EN",
-        "http://www.wireless-village.org/CSP1.1",
-        PUBLICID_IMPS_1_1 },
-    /*
-    { "-//OMA//DRM 2.1//EN", XXX,           0x13 },
-    { "-//OMA//DTD DRMREL 1.0//EN", XXX,    0x0e },
-    { "-//SYNCML//DTD DevInf 1.2//EN", XXX, 0x1203 },
-    { "-//SYNCML//DTD MetaInf 1.2//EN", XXX,0x1202 },
-    { "-//SYNCML//DTD SyncML 1.2//EN", XXX, 0x1201 }
-    */
-};
-
-static WbxmlEncoder * makeEncoder(int publicid)
-{
-    switch (publicid) {
-        case PUBLICID_IMPS_1_3:
-        case PUBLICID_IMPS_1_2:
-        case PUBLICID_IMPS_1_1:
-            return new ImpsWbxmlEncoder(publicid);
-
-        default:
-            return NULL;
-    }
-}
-
-Xml2WbxmlEncoder::Xml2WbxmlEncoder() :
-    mWbxmlHandler(NULL),
-    mEncoder(NULL),
-    mPublicId(-1),
-    mDepth(0),
-    mErrorCode(NO_ERROR)
-{
-    mExpatParser = new ExpatParser();
-    mExpatParser->setContentHandler(this);
-}
-
-Xml2WbxmlEncoder::~Xml2WbxmlEncoder()
-{
-    delete(mExpatParser);
-    delete(mEncoder);
-}
-
-void Xml2WbxmlEncoder::setWbxmlHandler(WbxmlHandler * handler)
-{
-    mWbxmlHandler = handler;
-}
-
-void Xml2WbxmlEncoder::startElement(const char *name, const char **atts)
-{
-    if (getErrorCode() != NO_ERROR)
-        return;
-
-    if (!mDepth) {
-        if (!isPublicIdSet()) {
-            for (int i = 0; atts[i]; i += 2) {
-                // TODO: for now we don't handle xmlns:<prefix> yet
-                if (strcmp(atts[i], "xmlns") == 0) {
-                    if (detectPublicIdByXmlns(atts[i + 1]))
-                        break;
-                }
-            }
-        }
-        if (isPublicIdSet()) {
-            // TODO: at present fixed to WBXML 1.3, UTF-8, no string table
-            mEncoder = makeEncoder(mPublicId);
-            if (mEncoder == NULL) {
-                setError(ERROR_UNSUPPORTED_DOCTYPE);
-                return;
-            }
-            mEncoder->setWbxmlHandler(mWbxmlHandler);
-        } else {
-            setError(ERROR_NO_PUBLIC_ID);
-            return;
-        }
-    }
-    setError(mEncoder->startElement(name, atts));
-    mDepth++;
-}
-
-void Xml2WbxmlEncoder::endElement(const char *name)
-{
-    if (getErrorCode() != NO_ERROR)
-        return;
-
-    setError(mEncoder->endElement());
-    mDepth--;
-}
-
-void Xml2WbxmlEncoder::characters(const char *data, int len)
-{
-    if (getErrorCode() != NO_ERROR)
-        return;
-
-    setError(mEncoder->characters(data, len));
-}
-
-void Xml2WbxmlEncoder::startDoctype(const char *doctypeName,
-        const char *sysid,
-        const char *pubid,
-        int has_internal_subset)
-{
-    if (!isPublicIdSet()) {
-        detectPublicId(pubid);
-    }
-}
-
-bool Xml2WbxmlEncoder::detectPublicId(const char * pubid)
-{
-    for (size_t i = 0; i < sizeof(knownPublicId) / sizeof(knownPublicId[0]); i++) {
-        if (strcmp(pubid, knownPublicId[i].pubid) == 0) {
-            //printf ("pubid %s => 0x%x\n", pubid, knownPublicId[i].idVal);
-            setPublicId(knownPublicId[i].idVal);
-            return true;
-        }
-    }
-    return false;
-}
-
-bool Xml2WbxmlEncoder::detectPublicIdByXmlns(const char * xmlnsUri)
-{
-    for (size_t i = 0; i < sizeof(knownPublicId) / sizeof(knownPublicId[0]); i++) {
-        if (strcmp(xmlnsUri, knownPublicId[i].xmlns) == 0) {
-            //printf ("xmlns %s => 0x%x\n", xmlnsUri, knownPublicId[i].idVal);
-            setPublicId(knownPublicId[i].idVal);
-            return true;
-        }
-    }
-    return false;
-}
-
-int Xml2WbxmlEncoder::encode(const char * data, uint32_t dataLen, bool end)
-{
-    if (data == NULL) {
-        return WBXML_STATUS_ERROR;
-    }
-    if (mExpatParser->parse(data, (int)dataLen, end) != XML_STATUS_OK) {
-        //printf ("Expat error: %s\n", XML_ErrorString(XML_GetErrorCode(mExpat)));
-        return WBXML_STATUS_ERROR;
-    }
-    return getErrorCode() == NO_ERROR ? WBXML_STATUS_OK : WBXML_STATUS_ERROR;
-}
-
diff --git a/libwbxml/test/alltests.c b/libwbxml/test/alltests.c
deleted file mode 100644 (file)
index d1931fd..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <embUnit.h>
-
-extern TestRef ImpsParserTest_tests(void);
-extern TestRef ImpsEncoderTest_tests(void);
-#ifdef SUPPORT_SYNCML
-extern TestRef SyncmlParserTest_tests(void);
-#endif
-
-int main (int argc, const char* argv[])
-{
-    TestRunner_start();
-        TestRunner_runTest(ImpsParserTest_tests());
-        TestRunner_runTest(ImpsEncoderTest_tests());
-#ifdef SUPPORT_SYNCML
-        TestRunner_runTest(SyncmlParserTest_tests());
-#endif
-    TestRunner_end();
-    return 0;
-}
diff --git a/libwbxml/test/imps_encoder_test.cpp b/libwbxml/test/imps_encoder_test.cpp
deleted file mode 100644 (file)
index 16ad7f8..0000000
+++ /dev/null
@@ -1,684 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <embUnit.h>
-#include <string.h>
-#include <stdlib.h>
-#include "xml2wbxml.h"
-#include "imps_encoder.h"
-
-#define DEFINE_TEST(test)   \
-    new_TestFixture(#test, test)
-
-#define ASSERT_EQUAL_INT(expected, actual) \
-{   \
-    int tmp = actual;   /* avoid duplicated evaluation in TEST_ASSERT_EQUAL_INT */  \
-    TEST_ASSERT_EQUAL_INT(expected, tmp);   \
-}
-
-#define ASSERT_EQUAL_BINARY_CPPSTRING(expected, cpp_string)   \
-{   \
-    ASSERT_EQUAL_INT(sizeof(expected), cpp_string.size()); \
-    ASSERT_EQUAL_INT(0, memcmp(expected, cpp_string.c_str(), sizeof(expected)));    \
-}
-
-#define ASSERT_EQUAL_CSTRING_CPPSTRING(expected, cpp_string)   \
-{   \
-    ASSERT_EQUAL_INT(sizeof(expected) - 1, cpp_string.size()); \
-    ASSERT_EQUAL_INT(0, memcmp(expected, cpp_string.c_str(), sizeof(expected) - 1));    \
-}
-
-static const char simple_csp12_xml[] = {
-    "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
-    "<WV-CSP-Message xmlns=\"http://www.openmobilealliance.org/DTD/WV-CSP1.2\"></WV-CSP-Message>"
-};
-
-static const char simple_csp12_doctype_xml[] = {
-    "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
-    "<!DOCTYPE WV-CSP PUBLIC \"-//OMA//DTD WV-CSP 1.2//EN\" "
-    "  \"http://www.openmobilealliance.org/DTD/WV-CSP.DTD\">"
-    "<WV-CSP-Message xmlns=\"http://www.openmobilealliance.org/DTD/WV-CSP1.2\"></WV-CSP-Message>"
-};
-
-static const char simple_csp12_wbxml[] = {
-    0x03, 0x11, 0x6a, 0x00, 0xc9, 0x08, 0x03, 0x31, 0x2e, 0x32, 0x00, 0x01, 0x01
-};
-
-static const char simple2_csp11_xml[] = {
-    "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
-    "<WV-CSP-Message xmlns=\"http://www.wireless-village.org/CSP1.1\">"
-    "<Session></Session>"
-    "</WV-CSP-Message>"
-};
-
-static const char simple2_csp11_wbxml[] = {
-    0x03, 0x10, 0x6a, 0x00, 0xc9, 0x05, 0x03, 0x31, 0x2e, 0x31, 0x00, 0x01,
-    0x6d, 0x01, 0x01
-};
-
-static const char simple_content_xml[] = {
-"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
-"<WV-CSP-Message xmlns=\"http://www.openmobilealliance.org/DTD/WV-CSP1.2\">"
-"    <Session>"
-"        <SessionDescriptor>"
-"            <SessionType>Outband</SessionType>"
-"        </SessionDescriptor>"
-"    </Session>"
-"</WV-CSP-Message>"
-};
-
-static const char simple_content_wbxml[] = {
-    0x03, 0x11, 0x6a, 0x00, 0xc9, 0x08, 0x03, 0x31, 0x2e, 0x32, 0x00, 0x01,
-    0x6d, 0x6e, 0x70, 0x80, 0x19, 0x01, 0x01, 0x01, 0x01
-};
-
-// libwbxml2 generates 0xC3 0x00 for integer value 0, but we take the safer
-// way 0xC3 0x01 0x00
-static const char simple_integer_xml[] = {
-    "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
-    "<WV-CSP-Message xmlns=\"http://www.openmobilealliance.org/DTD/WV-CSP1.2\">"
-    "<Session>"
-    "    <ClientID>9527</ClientID>"
-    "    <Result>"
-    "        <Code>401</Code>"
-    "        <Description>401</Description>"
-    "    </Result>"
-    "    <ContentSize>4294967295</ContentSize>"
-    "    <MessageCount>0</MessageCount>"
-    "</Session>"
-    "</WV-CSP-Message>"
-};
-static const char simple_integer_wbxml[] = {
-    0x03, 0x11, 0x6a, 0x00, 0xc9, 0x08, 0x03, 0x31, 0x2e, 0x32, 0x00, 0x01,
-    0x6d, 0x4a, 0x03, 0x39, 0x35, 0x32, 0x37, 0x00, 0x01, 0x6a, 0x4b, 0xc3,
-    0x02, 0x01, 0x91, 0x01, 0x52, 0x03, 0x34, 0x30, 0x31, 0x00, 0x01, 0x01,
-    0x4f, 0xc3, 0x04, 0xff, 0xff, 0xff, 0xff, 0x01, 0x5a, 0xc3, 0x01, 0x00,
-    0x01, 0x01, 0x01
-};
-
-static const char simple_datetime_xml[] = {
-    "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
-    "<WV-CSP-Message xmlns=\"http://www.openmobilealliance.org/DTD/WV-CSP1.2\">"
-    "<Session>"
-    "    <DateTime>20010925T165859Z</DateTime>"
-    "    <DeliveryTime>20010925T165859Z</DeliveryTime>"
-    "</Session>"
-    "</WV-CSP-Message>"
-};
-static const char simple_datetime_wbxml[] = {
-    0x03, 0x11, 0x6a, 0x00, 0xc9, 0x08, 0x03, 0x31, 0x2e, 0x32, 0x00, 0x01,
-    0x6d, 0x51, 0xc3, 0x06, 0x1f, 0x46, 0x73, 0x0e, 0xbb, 0x5a, 0x01, 0x00,
-    0x06, 0x5a, 0xc3, 0x06, 0x1f, 0x46, 0x73, 0x0e, 0xbb, 0x5a, 0x01, 0x01,
-    0x01
-};
-
-static const char simple_switch_page_xml[] = {
-    "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
-    "<WV-CSP-Message xmlns=\"http://www.openmobilealliance.org/DTD/WV-CSP1.2\">"
-    "<Session>"
-    "    <Login-Response>"
-    "        <ClientID>Esmertec112233</ClientID>"
-    "        <Result>"
-    "            <Description>blahblah</Description>"
-    "        </Result>"
-    "    </Login-Response>"
-    "</Session>"
-    "</WV-CSP-Message>"
-};
-static const char simple_switch_page_wbxml[] = {
-    0x03, 0x11, 0x6a, 0x00, 0xc9, 0x08, 0x03, 0x31, 0x2e, 0x32, 0x00, 0x01,
-    0x6d, 0x00, 0x01, 0x5e, 0x00, 0x00, 0x4a, 0x03, 0x45, 0x73, 0x6d, 0x65,
-    0x72, 0x74, 0x65, 0x63, 0x31, 0x31, 0x32, 0x32, 0x33, 0x33, 0x00, 0x01,
-    0x6a, 0x52, 0x03, 0x62, 0x6c, 0x61, 0x68, 0x62, 0x6c, 0x61, 0x68, 0x00,
-    0x01, 0x01, 0x01, 0x01, 0x01
-};
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.wireless-village.org/CSP1.1">
-    <Session>
-        <SessionDescriptor>
-            <SessionType>&#1114111</SessionType>
-        </SessionDescriptor>
-    </Session>
-</WV-CSP-Message>
-*/
-/* &#1114111 = U+10ffff = mb_u_int32 C3 ff 7f */
-static const char big_entity_wbxml[] = {
-    0x03, 0x10, 0x6a, 0x00, 0xc9, 0x05, 0x03, 0x31, 0x2e, 0x31, 0x00, 0x01,
-    0x6d, 0x6e, 0x70, 0x02, 0xc3, 0xff, 0x7f, 0x01, 0x01, 0x01, 0x01
-};
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.wireless-village.org/CSP1.1">
-<Session>
-    <SessionDescriptor>
-        <SessionType>&#1114112</SessionType>
-    </SessionDescriptor>
-</Session>
-</WV-CSP-Message>
-*/
-/* &#1114112 = 0x110000 = mb_u_int32 C4 80 00 */
-static const char invalid_entity_wbxml[] = {
-0x03, 0x10, 0x6a, 0x00, 0xc9, 0x05, 0x03, 0x31, 0x2e, 0x31, 0x00, 0x01,
-0x6d, 0x6e, 0x70, 0x02, 0xc4, 0x80, 0x00, 0x01, 0x01, 0x01, 0x01
-};
-
-static const char cap_request_xml[] = {
-"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
-"<WV-CSP-Message xmlns=\"http://www.openmobilealliance.org/DTD/WV-CSP1.2\">"
-"    <Session>"
-"        <SessionDescriptor>"
-"            <SessionType>Inband</SessionType>"
-"            <SessionID>196FE717.00000000.test1</SessionID>"
-"        </SessionDescriptor>"
-"        <Transaction>"
-"            <TransactionDescriptor>"
-"                <TransactionMode>Request</TransactionMode>"
-"                <TransactionID>transId2</TransactionID>"
-"            </TransactionDescriptor>"
-"            <TransactionContent xmlns=\"http://www.openmobilealliance.org/DTD/WV-TRC1.2\">"
-"                <ClientCapability-Request>"
-"                    <CapabilityList>"
-"                        <ClientType>MOBILE_PHONE</ClientType>"
-"                        <ParserSize>32767</ParserSize>"
-"                        <MultiTrans>1</MultiTrans>"
-"                        <InitialDeliveryMethod>P</InitialDeliveryMethod>"
-"                        <ServerPollMin>2</ServerPollMin>"
-"                        <SupportedBearer>HTTP</SupportedBearer>"
-"                        <SupportedCIRMethod>STCP</SupportedCIRMethod>"
-"                        <SupportedCIRMethod>SHTTP</SupportedCIRMethod>"
-"                        <SupportedCIRMethod>SSMS</SupportedCIRMethod>"
-"                    </CapabilityList>"
-"                </ClientCapability-Request>"
-"            </TransactionContent>"
-"        </Transaction>"
-"    </Session>"
-"</WV-CSP-Message>"
-};
-static const char cap_request_wbxml[] = {
-    0x03, 0x11, 0x6a, 0x00, 0xc9, 0x08, 0x03, 0x31, 0x2e, 0x32, 0x00, 0x01,
-    0x6d, 0x6e, 0x70, 0x80, 0x11, 0x01, 0x6f, 0x03, 0x31, 0x39, 0x36, 0x46,
-    0x45, 0x37, 0x31, 0x37, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
-    0x30, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x31, 0x00, 0x01, 0x01, 0x72, 0x74,
-    0x76, 0x80, 0x20, 0x01, 0x75, 0x03, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x49,
-    0x64, 0x32, 0x00, 0x01, 0x01, 0xf3, 0x0a, 0x03, 0x31, 0x2e, 0x32, 0x00,
-    0x01, 0x00, 0x01, 0x4c, 0x4a, 0x00, 0x05, 0x4f, 0x80, 0x6f, 0x01, 0x00,
-    0x03, 0x4d, 0xc3, 0x02, 0x7f, 0xff, 0x01, 0x4c, 0xc3, 0x01, 0x01, 0x01,
-    0x4b, 0x80, 0x1f, 0x01, 0x4e, 0xc3, 0x01, 0x02, 0x01, 0x4f, 0x80, 0x42,
-    0x01, 0x50, 0x80, 0x44, 0x01, 0x50, 0x80, 0x81, 0x25, 0x01, 0x50, 0x80,
-    0x81, 0x24, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-};
-
-static const char statusprim_xml[] = {
-"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
-"<WV-CSP-Message xmlns=\"http://www.openmobilealliance.org/DTD/IMPS-CSP1.3\">"
-" <Session>"
-"  <SessionDescriptor>"
-"   <SessionType>Inband</SessionType>"
-"   <SessionID>im.user.com#48815@server.com</SessionID>"
-"  </SessionDescriptor>"
-"  <Transaction>"
-"   <TransactionDescriptor>"
-"    <TransactionMode>Response</TransactionMode>"
-"    <TransactionID>IMApp01#12345@NOK5110</TransactionID>"
-"   </TransactionDescriptor>"
-"   <TransactionContent xmlns=\"http://www.openmobilealliance.org/DTD/IMPS-TRC1.3\">"
-"    <Status>"
-"     <Result>"
-"      <Code>201</Code>"
-"      <Description>Partially successful.</Description>"
-"      <DetailedResult>"
-"       <Code>531</Code>"
-"       <Description>Unknown user.</Description>"
-"       <UserID>wv:bad_user1@im.com</UserID>"
-"       <UserID>wv:bad_user2@im.com</UserID>"
-"      </DetailedResult>"
-"      <DetailedResult>"
-"       <Code>532</Code>"
-"       <Description>Blocked.</Description>"
-"       <UserID>wv:bad_user3@im.com</UserID>"
-"       <UserID>wv:bad_user4@im.com</UserID>"
-"      </DetailedResult>"
-"     </Result>"
-"    </Status>"
-"   </TransactionContent>"
-"  </Transaction>"
-"  <Poll>F</Poll>"
-" </Session>"
-"</WV-CSP-Message>"
-};
-
-static const char statusprim_wbxml[] = {
-  0x03, 0x12, 0x6a, 0x00, 0xc9, 0x0b, 0x03, 0x31, 0x2e, 0x33, 0x00, 0x01,
-  0x6d, 0x6e, 0x70, 0x80, 0x11, 0x01, 0x6f, 0x03, 0x69, 0x6d, 0x2e, 0x75,
-  0x73, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x23, 0x34, 0x38, 0x38, 0x31,
-  0x35, 0x40, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d,
-  0x00, 0x01, 0x01, 0x72, 0x74, 0x76, 0x80, 0x21, 0x01, 0x75, 0x03, 0x49,
-  0x4d, 0x41, 0x70, 0x70, 0x30, 0x31, 0x23, 0x31, 0x32, 0x33, 0x34, 0x35,
-  0x40, 0x4e, 0x4f, 0x4b, 0x35, 0x31, 0x31, 0x30, 0x00, 0x01, 0x01, 0xf3,
-  0x0d, 0x03, 0x31, 0x2e, 0x33, 0x00, 0x01, 0x71, 0x6a, 0x4b, 0xc3, 0x01,
-  0xc9, 0x01, 0x52, 0x03, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x6c,
-  0x79, 0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c,
-  0x2e, 0x00, 0x01, 0x53, 0x4b, 0xc3, 0x02, 0x02, 0x13, 0x01, 0x52, 0x03,
-  0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x72,
-  0x2e, 0x00, 0x01, 0x7a, 0x03, 0x77, 0x76, 0x3a, 0x62, 0x61, 0x64, 0x5f,
-  0x75, 0x73, 0x65, 0x72, 0x31, 0x40, 0x69, 0x6d, 0x2e, 0x63, 0x6f, 0x6d,
-  0x00, 0x01, 0x7a, 0x03, 0x77, 0x76, 0x3a, 0x62, 0x61, 0x64, 0x5f, 0x75,
-  0x73, 0x65, 0x72, 0x32, 0x40, 0x69, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x00,
-  0x01, 0x01, 0x53, 0x4b, 0xc3, 0x02, 0x02, 0x14, 0x01, 0x52, 0x03, 0x42,
-  0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x2e, 0x00, 0x01, 0x7a, 0x03, 0x77,
-  0x76, 0x3a, 0x62, 0x61, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x33, 0x40,
-  0x69, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x00, 0x01, 0x7a, 0x03, 0x77, 0x76,
-  0x3a, 0x62, 0x61, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x34, 0x40, 0x69,
-  0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-  0x61, 0x80, 0x0b, 0x01, 0x01, 0x01
-};
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.openmobilealliance.org/DTD/WV-CSP1.2">
-    <Session>
-        <SessionDescriptor>
-            <SessionType>Inband</SessionType>
-            <SessionID>AA0BD762.00000000.test1</SessionID>
-        </SessionDescriptor>
-        <Transaction>
-            <TransactionDescriptor>
-                <TransactionMode>Request</TransactionMode>
-                <TransactionID>transId8</TransactionID>
-            </TransactionDescriptor>
-            <TransactionContent xmlns="http://www.openmobilealliance.org/DTD/WV-TRC1.2">
-                <SendMessage-Request>
-                    <DeliveryReport>T</DeliveryReport>
-                    <MessageInfo>
-                        <Recipient>
-                            <User>
-                                <UserID>wv:test2</UserID>
-                            </User>
-                        </Recipient>
-                        <Sender>
-                            <User>
-                                <UserID>wv:test1</UserID>
-                            </User>
-                        </Sender>
-                        <DateTime>20070625T055652Z</DateTime>
-                        <ContentSize>5</ContentSize>
-                    </MessageInfo>
-                    <ContentData>Today &#160;Today</ContentData>
-                </SendMessage-Request>
-            </TransactionContent>
-        </Transaction>
-    </Session>
-</WV-CSP-Message>
-*/
-static const char sendmsgreq1_wbxml[] = {
-  0x03, 0x10, 0x6a, 0x00, 0xc9, 0x08, 0x03, 0x31, 0x2e, 0x32, 0x00, 0x01,
-  0x6d, 0x6e, 0x70, 0x80, 0x11, 0x01, 0x6f, 0x03, 0x41, 0x41, 0x30, 0x42,
-  0x44, 0x37, 0x36, 0x32, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
-  0x30, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x31, 0x00, 0x01, 0x01, 0x72, 0x74,
-  0x76, 0x80, 0x20, 0x01, 0x75, 0x03, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x49,
-  0x64, 0x38, 0x00, 0x01, 0x01, 0xf3, 0x0a, 0x03, 0x31, 0x2e, 0x32, 0x00,
-  0x01, 0x00, 0x06, 0x57, 0x48, 0x80, 0x2c, 0x01, 0x53, 0x00, 0x00, 0x67,
-  0x79, 0x7a, 0x03, 0x77, 0x76, 0x3a, 0x74, 0x65, 0x73, 0x74, 0x32, 0x00,
-  0x01, 0x01, 0x01, 0x6c, 0x79, 0x7a, 0x03, 0x77, 0x76, 0x3a, 0x74, 0x65,
-  0x73, 0x74, 0x31, 0x00, 0x01, 0x01, 0x01, 0x51, 0x03, 0x32, 0x30, 0x30,
-  0x37, 0x30, 0x36, 0x32, 0x35, 0x54, 0x30, 0x35, 0x35, 0x36, 0x35, 0x32,
-  0x5a, 0x00, 0x01, 0x4f, 0xc3, 0x01, 0x05, 0x01, 0x01, 0x4d, 0x03, 0x54,
-  0x6f, 0x64, 0x61, 0x79, 0x20, 0x00, 0x02, 0x81, 0x20, 0x03, 0x54, 0x6f,
-  0x64, 0x61, 0x79, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
-};
-
-class DataHandler : public WbxmlHandler
-{
-public:
-    void wbxmlData(const char *data, uint32_t len)
-    {
-        wbxml.append(data, len);
-#if 0
-        for (uint32_t i = 0; i < len; i++) {
-            if (!(i % 12))
-                printf ("\n");
-            printf ("0x%02x, ", (unsigned char)data[i]);
-        }
-        printf ("\n");
-#endif
-    }
-    string wbxml;
-};
-
-static void setUp(void)
-{
-}
-
-static void tearDown(void)
-{
-}
-
-static void testSmokeTest(void)
-{
-    Xml2WbxmlEncoder encoder;
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder.encode(simple_csp12_xml,
-                strlen(simple_csp12_xml), true));
-
-    Xml2WbxmlEncoder encoder1;
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder1.encode(simple_csp12_doctype_xml,
-                strlen(simple_csp12_doctype_xml), true));
-}
-
-static void testSimpleCsp12(void)
-{
-    Xml2WbxmlEncoder encoder;
-    DataHandler handler;
-    encoder.setWbxmlHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder.encode(simple_csp12_doctype_xml,
-                strlen(simple_csp12_doctype_xml), true));
-    ASSERT_EQUAL_BINARY_CPPSTRING(simple_csp12_wbxml, handler.wbxml);
-
-    Xml2WbxmlEncoder encoder1;
-    DataHandler handler1;
-    encoder1.setWbxmlHandler(&handler1);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder1.encode(simple_csp12_xml,
-                strlen(simple_csp12_xml), true));
-    ASSERT_EQUAL_BINARY_CPPSTRING(simple_csp12_wbxml, handler.wbxml);
-}
-
-static void testSimpleCsp11Level2(void)
-{
-    Xml2WbxmlEncoder encoder;
-    DataHandler handler;
-    encoder.setWbxmlHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder.encode(simple2_csp11_xml,
-                strlen(simple2_csp11_xml), true));
-    ASSERT_EQUAL_BINARY_CPPSTRING(simple2_csp11_wbxml, handler.wbxml);
-}
-
-static void testSimpleContent(void)
-{
-    Xml2WbxmlEncoder encoder;
-    DataHandler handler;
-    encoder.setWbxmlHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder.encode(simple_content_xml,
-                strlen(simple_content_xml), true));
-    ASSERT_EQUAL_BINARY_CPPSTRING(simple_content_wbxml, handler.wbxml);
-}
-
-static void testSimpleOpaqueInteger(void)
-{
-    Xml2WbxmlEncoder encoder;
-    DataHandler handler;
-    encoder.setWbxmlHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder.encode(simple_integer_xml,
-                strlen(simple_integer_xml), true));
-    ASSERT_EQUAL_BINARY_CPPSTRING(simple_integer_wbxml, handler.wbxml);
-}
-
-static void testSimpleOpaqueDatetime(void)
-{
-    Xml2WbxmlEncoder encoder;
-    DataHandler handler;
-    encoder.setWbxmlHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder.encode(simple_datetime_xml,
-                strlen(simple_datetime_xml), true));
-    ASSERT_EQUAL_BINARY_CPPSTRING(simple_datetime_wbxml, handler.wbxml);
-}
-
-static void testSimpleSwitchPage(void)
-{
-    Xml2WbxmlEncoder encoder;
-    DataHandler handler;
-    encoder.setWbxmlHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder.encode(simple_switch_page_xml,
-                strlen(simple_switch_page_xml), true));
-    ASSERT_EQUAL_BINARY_CPPSTRING(simple_switch_page_wbxml, handler.wbxml);
-}
-
-/* various token values, EXT_0 + mbuint32 */
-static void testCapRequest(void)
-{
-    Xml2WbxmlEncoder encoder;
-    DataHandler handler;
-    encoder.setWbxmlHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder.encode(cap_request_xml,
-                strlen(cap_request_xml), true));
-    ASSERT_EQUAL_BINARY_CPPSTRING(cap_request_wbxml, handler.wbxml);
-}
-
-static void testEncodeInChunk(void)
-{
-    Xml2WbxmlEncoder encoder;
-    DataHandler handler;
-    encoder.setWbxmlHandler(&handler);
-
-    int chunkSize = strlen(statusprim_xml) / 4;
-
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder.encode(statusprim_xml,
-                chunkSize, false));
-
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder.encode(statusprim_xml + chunkSize,
-                chunkSize, false));
-
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder.encode(statusprim_xml + chunkSize * 2,
-                chunkSize, false));
-
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, encoder.encode(statusprim_xml + chunkSize * 3,
-                strlen(statusprim_xml) - chunkSize * 3, true));
-
-    ASSERT_EQUAL_BINARY_CPPSTRING(statusprim_wbxml, handler.wbxml);
-}
-
-static void testImpsEncoderSmokeTest(void)
-{
-    ImpsWbxmlEncoder encoder(PUBLICID_IMPS_1_3);
-    DataHandler handler;
-    encoder.setWbxmlHandler(&handler);
-    const char * atts[] = {NULL};
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.startElement("WV-CSP-Message", atts));
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.endElement());
-    ASSERT_EQUAL_INT(6, handler.wbxml.size());
-    ASSERT_EQUAL_CSTRING_CPPSTRING("\x03\x12\x6a\x00\x49\x01", handler.wbxml);
-}
-
-static void testImpsEncoderReset(void)
-{
-    ImpsWbxmlEncoder encoder(PUBLICID_IMPS_1_3);
-    DataHandler handler;
-    encoder.setWbxmlHandler(&handler);
-    const char * atts[] = {NULL};
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.startElement("WV-CSP-Message", atts));
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.endElement());
-    ASSERT_EQUAL_INT(6, handler.wbxml.size());
-    ASSERT_EQUAL_CSTRING_CPPSTRING("\x03\x12\x6a\x00\x49\x01", handler.wbxml);
-
-    encoder.reset();
-    handler.wbxml.clear();
-
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.startElement("WV-CSP-Message", atts));
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.startElement("Session", atts));
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.endElement());
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.endElement());
-    ASSERT_EQUAL_INT(8, handler.wbxml.size());
-    ASSERT_EQUAL_CSTRING_CPPSTRING("\x03\x12\x6a\x00\x49\x6d\x01\x01", handler.wbxml);
-}
-
-static void testImpsStringContentData(void)
-{
-    ImpsWbxmlEncoder encoder(PUBLICID_IMPS_1_3);
-    DataHandler handler;
-    encoder.setWbxmlHandler(&handler);
-    const char * atts[] = {NULL};
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.startElement("ContentData", atts));
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.characters("Hello", 5));
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.endElement());
-    ASSERT_EQUAL_INT(13, handler.wbxml.size());
-    ASSERT_EQUAL_CSTRING_CPPSTRING("\x03\x12\x6a\x00\x4d\x03Hello\x00\x01", handler.wbxml);
-}
-
-static void testImpsOpaqueContentData(void)
-{
-    ImpsWbxmlEncoder encoder(PUBLICID_IMPS_1_3);
-    DataHandler handler;
-    encoder.setWbxmlHandler(&handler);
-    const char * atts[] = {NULL};
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.startElement("ContentData", atts));
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.opaque("Hello", 5));
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.endElement());
-    ASSERT_EQUAL_INT(13, handler.wbxml.size());
-    ASSERT_EQUAL_CSTRING_CPPSTRING("\x03\x12\x6a\x00\x4d\xc3\x05Hello\x01", handler.wbxml);
-
-    encoder.reset();
-    handler.wbxml.clear();
-
-    const int dataSize = 500000;    // 7a120, MB uint32 "\x9e\xc2\x20"
-    char * data = new char[dataSize];
-    memset(data, 7, dataSize);
-
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.startElement("ContentData", atts));
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.opaque(data,dataSize));
-    ASSERT_EQUAL_INT(NO_ERROR, encoder.endElement());
-
-    ASSERT_EQUAL_INT(dataSize + 9 + 1, handler.wbxml.size());
-    ASSERT_EQUAL_INT(0, memcmp("\x03\x12\x6a\x00\x4d\xc3\x9e\xc2\x20", handler.wbxml.c_str(), 9));
-    ASSERT_EQUAL_INT(0, memcmp(data, handler.wbxml.c_str() + 9, dataSize));
-    ASSERT_EQUAL_INT(0x01, handler.wbxml[9 + dataSize]);
-    delete [] data;
-}
-
-#if 0
-
-/* OPAQUE integer */
-static void testCspStatusPrim(void)
-{
-    WbxmlParser parser(0);
-    DomTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(statusprim_wbxml,
-                sizeof(statusprim_wbxml), true));
-
-    Element &root = handler.root;
-    TEST_ASSERT_EQUAL_STRING("WV-CSP-Message", root.name.c_str());
-    TEST_ASSERT_EQUAL_INT(1, root.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("xmlns", root.attribs[0].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("http://www.openmobilealliance.org/DTD/IMPS-CSP1.3",
-            root.attribs[0].value.c_str());
-
-    Element &transacContent = root.children[0].children[1].children[1];
-    TEST_ASSERT_EQUAL_STRING("TransactionContent", transacContent.name.c_str());
-    TEST_ASSERT_EQUAL_INT(1, transacContent.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("xmlns", transacContent.attribs[0].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("http://www.openmobilealliance.org/DTD/IMPS-TRC1.3",
-            transacContent.attribs[0].value.c_str());
-
-    Element &resultCode = transacContent.children[0].children[0].children[0];
-    TEST_ASSERT_EQUAL_STRING("Code", resultCode.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, resultCode.attribs.size());
-    TEST_ASSERT_EQUAL_INT(201, resultCode.intVal);
-
-    Element &detailedResultCode = transacContent.children[0].children[0].children[2].children[0];
-    TEST_ASSERT_EQUAL_STRING("Code", detailedResultCode.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, detailedResultCode.attribs.size());
-    TEST_ASSERT_EQUAL_INT(531, detailedResultCode.intVal);
-}
-
-/* SWITCH_PAGE, OPAQUE integer, ENTITY */
-static void testCspSendMsg(void)
-{
-    WbxmlParser parser(0);
-    DomTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(sendmsgreq1_wbxml,
-                sizeof(sendmsgreq1_wbxml), true));
-
-    Element &root = handler.root;
-    Element &transacContent = root.children[0].children[1].children[1];
-    Element &contentData = transacContent.children[0].children[2];
-
-    TEST_ASSERT_EQUAL_STRING("ContentData", contentData.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, contentData.attribs.size());
-    // &#160; => U+00A0, UTF-8 0xC2 0xA0
-    TEST_ASSERT_EQUAL_STRING("Today \xc2\xa0Today", contentData.characters.c_str());
-}
-
-/* more ENTITY tests */
-static void testBigEntity(void)
-{
-    WbxmlParser parser(0);
-    DomTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(big_entity_wbxml,
-                sizeof(big_entity_wbxml), true));
-
-    Element &sessionType = handler.root.children[0].children[0].children[0];
-    TEST_ASSERT_EQUAL_INT(0, sessionType.children.size());
-    TEST_ASSERT_EQUAL_STRING("SessionType", sessionType.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, sessionType.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("\xf4\x8f\xbf\xbf", sessionType.characters.c_str());
-}
-
-static void testInvalidEntity(void)
-{
-    WbxmlParser parser(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR, parser.parse(invalid_entity_wbxml,
-                sizeof(invalid_entity_wbxml), true));
-}
-
-static void testIncompleteData(void)
-{
-    WbxmlParser parser(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR, parser.parse(sendmsgreq1_wbxml,
-                1, true));
-
-    WbxmlParser parser1(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR, parser1.parse(sendmsgreq1_wbxml,
-                3, true));
-
-    WbxmlParser parser2(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR, parser2.parse(sendmsgreq1_wbxml,
-                4, true));
-
-    WbxmlParser parser3(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR, parser3.parse(sendmsgreq1_wbxml,
-                5, true));
-}
-#endif
-
-extern "C" TestRef ImpsEncoderTest_tests(void)
-{
-    EMB_UNIT_TESTFIXTURES(fixtures) {
-        DEFINE_TEST(testSmokeTest),
-        DEFINE_TEST(testSimpleCsp12),
-        DEFINE_TEST(testSimpleCsp11Level2),
-        DEFINE_TEST(testSimpleContent),
-        DEFINE_TEST(testSimpleOpaqueInteger),
-        DEFINE_TEST(testSimpleOpaqueDatetime),
-        DEFINE_TEST(testSimpleSwitchPage),
-        DEFINE_TEST(testCapRequest),
-        DEFINE_TEST(testEncodeInChunk),
-        DEFINE_TEST(testImpsEncoderSmokeTest),
-        DEFINE_TEST(testImpsEncoderReset),
-        DEFINE_TEST(testImpsStringContentData),
-        DEFINE_TEST(testImpsOpaqueContentData),
-    };
-    EMB_UNIT_TESTCALLER(ImpsEncoderTest, "ImpsEncoderTest", setUp, tearDown, fixtures);
-
-    // temporary work around for the linker/loader problem of the sooner build
-    static TestCaller t = ImpsEncoderTest;
-    t.isa = (TestImplement *)&TestCallerImplement;
-    return (TestRef)&t;
-}
-
diff --git a/libwbxml/test/imps_parser_test.cpp b/libwbxml/test/imps_parser_test.cpp
deleted file mode 100644 (file)
index cd7636e..0000000
+++ /dev/null
@@ -1,882 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <embUnit.h>
-#include <stdlib.h>
-#include <string.h>
-#include "wbxml_parser.h"
-
-#define DEFINE_TEST(test)   \
-    new_TestFixture(#test, test)
-
-#define ASSERT_EQUAL_INT(expected, actual) \
-{   \
-    int tmp = actual;   /* avoid duplicated evaluation in TEST_ASSERT_EQUAL_INT */  \
-    TEST_ASSERT_EQUAL_INT(expected, tmp);   \
-}
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.wireless-village.org/CSP1.1"></WV-CSP-Message>
- */
-static const char simple_wbxml[] = {
-    0x03, 0x10, 0x6a, 0x00, 0xc9, 0x05, 0x03, 0x31, 0x2e, 0x31, 0x00, 0x01, 0x01
-};
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.wireless-village.org/CSP1.1" />
- */
-static const char simple_nocontent_wbxml[] = {
-      0x03, 0x10, 0x6a, 0x00, 0x89, 0x05, 0x03, 0x31, 0x2e, 0x31, 0x00, 0x01
-};
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.wireless-village.org/CSP1.1">
-    <Session></Session>
-</WV-CSP-Message>
-*/
-static const char simple2_wbxml[] = {
-    0x03, 0x10, 0x6a, 0x00, 0xc9, 0x05, 0x03, 0x31, 0x2e, 0x31, 0x00, 0x01,
-    0x6d, 0x01, 0x01
-};
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.wireless-village.org/CSP1.1">
-    <Session>
-        <SessionDescriptor>
-            <SessionType>Outband</SessionType>
-        </SessionDescriptor>
-    </Session>
-</WV-CSP-Message>
-*/
-static const char simple3_wbxml[] = {
-    0x03, 0x10, 0x6a, 0x00, 0xc9, 0x05, 0x03, 0x31, 0x2e, 0x31, 0x00, 0x01,
-    0x6d, 0x6e, 0x70, 0x80, 0x19, 0x01, 0x01, 0x01, 0x01
-};
-
-/* A STR_I (the '0x03' after '0x70') without ending '\0' */
-static const char incomplete_str_i_wbxml[] = {
-    0x03, 0x10, 0x6a, 0x00, 0xc9, 0x05, 0x03, 0x31, 0x2e, 0x31, 0x00, 0x01,
-    0x6d, 0x6e, 0x70, 0x03, 0x44, 0x55, 0x66, 0x01, 0x01, 0x01, 0x01
-};
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.wireless-village.org/CSP1.1">
-    <Session>
-        <SessionDescriptor>
-            <SessionType>&#1114111</SessionType>
-        </SessionDescriptor>
-    </Session>
-</WV-CSP-Message>
-*/
-/* &#1114111 = U+10ffff = mb_u_int32 C3 ff 7f */
-static const char big_entity_wbxml[] = {
-    0x03, 0x10, 0x6a, 0x00, 0xc9, 0x05, 0x03, 0x31, 0x2e, 0x31, 0x00, 0x01,
-    0x6d, 0x6e, 0x70, 0x02, 0xc3, 0xff, 0x7f, 0x01, 0x01, 0x01, 0x01
-};
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.wireless-village.org/CSP1.1">
-    <Session>
-        <SessionDescriptor>
-            <SessionType>&#1114112</SessionType>
-        </SessionDescriptor>
-    </Session>
-</WV-CSP-Message>
-*/
-/* &#1114112 = 0x110000 = mb_u_int32 C4 80 00 */
-static const char invalid_entity_wbxml[] = {
-    0x03, 0x10, 0x6a, 0x00, 0xc9, 0x05, 0x03, 0x31, 0x2e, 0x31, 0x00, 0x01,
-    0x6d, 0x6e, 0x70, 0x02, 0xc4, 0x80, 0x00, 0x01, 0x01, 0x01, 0x01
-};
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.wireless-village.org/CSP1.1">
-    <Session>
-        <SessionDescriptor>
-            <SessionType>Outband</SessionType>
-        </SessionDescriptor>
-        <Transaction>
-            <TransactionDescriptor>
-                <TransactionMode>Response</TransactionMode>
-                <TransactionID>transId1</TransactionID>
-            </TransactionDescriptor>
-            <TransactionContent xmlns="http://www.wireless-village.org/TRC1.1">
-                <Login-Response>
-                    <ClientID>Esmertec112233</ClientID>
-                    <Result>
-                        <Code>401</Code>
-                        <Description>Please complete authentication challenge</Description>
-                    </Result>
-                    <Nonce>e6b68ebd81309d538357e39e2fba3204</Nonce>
-                    <DigestSchema>MD5</DigestSchema>
-                    <CapabilityRequest>F</CapabilityRequest>
-                </Login-Response>
-            </TransactionContent>
-        </Transaction>
-    </Session>
-</WV-CSP-Message>
-*/
-static const char loginresponse_wbxml[] = {
-    0x03, 0x10, 0x6a, 0x00, 0xc9, 0x05, 0x03, 0x31, 0x2e, 0x31, 0x00, 0x01,
-    0x6d, 0x6e, 0x70, 0x80, 0x19, 0x01, 0x01, 0x72, 0x74, 0x76, 0x80, 0x21,
-    0x01, 0x75, 0x03, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x49, 0x64, 0x31, 0x00,
-    0x01, 0x01, 0xf3, 0x07, 0x03, 0x31, 0x2e, 0x31, 0x00, 0x01, 0x00, 0x01,
-    0x5e, 0x00, 0x00, 0x4a, 0x03, 0x45, 0x73, 0x6d, 0x65, 0x72, 0x74, 0x65,
-    0x63, 0x31, 0x31, 0x32, 0x32, 0x33, 0x33, 0x00, 0x01, 0x6a, 0x4b, 0x03,
-    0x34, 0x30, 0x31, 0x00, 0x01, 0x52, 0x03, 0x50, 0x6c, 0x65, 0x61, 0x73,
-    0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61,
-    0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
-    0x6e, 0x20, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x00,
-    0x01, 0x01, 0x00, 0x01, 0x60, 0x03, 0x65, 0x36, 0x62, 0x36, 0x38, 0x65,
-    0x62, 0x64, 0x38, 0x31, 0x33, 0x30, 0x39, 0x64, 0x35, 0x33, 0x38, 0x33,
-    0x35, 0x37, 0x65, 0x33, 0x39, 0x65, 0x32, 0x66, 0x62, 0x61, 0x33, 0x32,
-    0x30, 0x34, 0x00, 0x01, 0x4f, 0x03, 0x4d, 0x44, 0x35, 0x00, 0x01, 0x4b,
-    0x80, 0x0b, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
-};
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.openmobilealliance.org/DTD/IMPS-CSP1.3">
- <Session>
-  <SessionDescriptor>
-   <SessionType>Inband</SessionType>
-   <SessionID>im.user.com#48815@server.com</SessionID>
-  </SessionDescriptor>
-  <Transaction>
-   <TransactionDescriptor>
-    <TransactionMode>Response</TransactionMode>
-    <TransactionID>IMApp01#12345@NOK5110</TransactionID>
-   </TransactionDescriptor>
-   <TransactionContent xmlns="http://www.openmobilealliance.org/DTD/IMPS-TRC1.3">
-    <Status>
-     <Result>
-      <Code>201</Code>
-      <Description>Partially successful.</Description>
-      <DetailedResult>
-       <Code>531</Code>
-       <Description>Unknown user.</Description>
-       <UserID>wv:bad_user1@im.com</UserID>
-       <UserID>wv:bad_user2@im.com</UserID>
-      </DetailedResult>
-      <DetailedResult>
-       <Code>532</Code>
-       <Description>Blocked.</Description>
-       <UserID>wv:bad_user3@im.com</UserID>
-       <UserID>wv:bad_user4@im.com</UserID>
-      </DetailedResult>
-     </Result>
-    </Status>
-   </TransactionContent>
-  </Transaction>
-  <Poll>F</Poll>
- </Session>
-</WV-CSP-Message>
-*/
-static const char statusprim_wbxml[] = {
-  0x03, 0x12, 0x6a, 0x00, 0xc9, 0x0b, 0x03, 0x31, 0x2e, 0x33, 0x00, 0x01,
-  0x6d, 0x6e, 0x70, 0x80, 0x11, 0x01, 0x6f, 0x03, 0x69, 0x6d, 0x2e, 0x75,
-  0x73, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x23, 0x34, 0x38, 0x38, 0x31,
-  0x35, 0x40, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d,
-  0x00, 0x01, 0x01, 0x72, 0x74, 0x76, 0x80, 0x21, 0x01, 0x75, 0x03, 0x49,
-  0x4d, 0x41, 0x70, 0x70, 0x30, 0x31, 0x23, 0x31, 0x32, 0x33, 0x34, 0x35,
-  0x40, 0x4e, 0x4f, 0x4b, 0x35, 0x31, 0x31, 0x30, 0x00, 0x01, 0x01, 0xf3,
-  0x0d, 0x03, 0x31, 0x2e, 0x33, 0x00, 0x01, 0x71, 0x6a, 0x4b, 0xc3, 0x01,
-  0xc9, 0x01, 0x52, 0x03, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x6c,
-  0x79, 0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c,
-  0x2e, 0x00, 0x01, 0x53, 0x4b, 0xc3, 0x02, 0x02, 0x13, 0x01, 0x52, 0x03,
-  0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x72,
-  0x2e, 0x00, 0x01, 0x7a, 0x03, 0x77, 0x76, 0x3a, 0x62, 0x61, 0x64, 0x5f,
-  0x75, 0x73, 0x65, 0x72, 0x31, 0x40, 0x69, 0x6d, 0x2e, 0x63, 0x6f, 0x6d,
-  0x00, 0x01, 0x7a, 0x03, 0x77, 0x76, 0x3a, 0x62, 0x61, 0x64, 0x5f, 0x75,
-  0x73, 0x65, 0x72, 0x32, 0x40, 0x69, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x00,
-  0x01, 0x01, 0x53, 0x4b, 0xc3, 0x02, 0x02, 0x14, 0x01, 0x52, 0x03, 0x42,
-  0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x2e, 0x00, 0x01, 0x7a, 0x03, 0x77,
-  0x76, 0x3a, 0x62, 0x61, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x33, 0x40,
-  0x69, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x00, 0x01, 0x7a, 0x03, 0x77, 0x76,
-  0x3a, 0x62, 0x61, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x34, 0x40, 0x69,
-  0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-  0x61, 0x80, 0x0b, 0x01, 0x01, 0x01,
-};
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.openmobilealliance.org/DTD/WV-CSP1.2">
-    <Session>
-        <SessionDescriptor>
-            <SessionType>Inband</SessionType>
-            <SessionID>AA0BD762.00000000.test1</SessionID>
-        </SessionDescriptor>
-        <Transaction>
-            <TransactionDescriptor>
-                <TransactionMode>Request</TransactionMode>
-                <TransactionID>transId8</TransactionID>
-            </TransactionDescriptor>
-            <TransactionContent xmlns="http://www.openmobilealliance.org/DTD/WV-TRC1.2">
-                <SendMessage-Request>
-                    <DeliveryReport>T</DeliveryReport>
-                    <MessageInfo>
-                        <Recipient>
-                            <User>
-                                <UserID>wv:test2</UserID>
-                            </User>
-                        </Recipient>
-                        <Sender>
-                            <User>
-                                <UserID>wv:test1</UserID>
-                            </User>
-                        </Sender>
-                        <DateTime>20070625T055652Z</DateTime>
-                        <ContentSize>5</ContentSize>
-                    </MessageInfo>
-                    <ContentData>Today &#160;Today</ContentData>
-                </SendMessage-Request>
-            </TransactionContent>
-        </Transaction>
-    </Session>
-</WV-CSP-Message>
-*/
-static const char sendmsgreq1_wbxml[] = {
-  0x03, 0x10, 0x6a, 0x00, 0xc9, 0x08, 0x03, 0x31, 0x2e, 0x32, 0x00, 0x01,
-  0x6d, 0x6e, 0x70, 0x80, 0x11, 0x01, 0x6f, 0x03, 0x41, 0x41, 0x30, 0x42,
-  0x44, 0x37, 0x36, 0x32, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
-  0x30, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x31, 0x00, 0x01, 0x01, 0x72, 0x74,
-  0x76, 0x80, 0x20, 0x01, 0x75, 0x03, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x49,
-  0x64, 0x38, 0x00, 0x01, 0x01, 0xf3, 0x0a, 0x03, 0x31, 0x2e, 0x32, 0x00,
-  0x01, 0x00, 0x06, 0x57, 0x48, 0x80, 0x2c, 0x01, 0x53, 0x00, 0x00, 0x67,
-  0x79, 0x7a, 0x03, 0x77, 0x76, 0x3a, 0x74, 0x65, 0x73, 0x74, 0x32, 0x00,
-  0x01, 0x01, 0x01, 0x6c, 0x79, 0x7a, 0x03, 0x77, 0x76, 0x3a, 0x74, 0x65,
-  0x73, 0x74, 0x31, 0x00, 0x01, 0x01, 0x01, 0x51, 0x03, 0x32, 0x30, 0x30,
-  0x37, 0x30, 0x36, 0x32, 0x35, 0x54, 0x30, 0x35, 0x35, 0x36, 0x35, 0x32,
-  0x5a, 0x00, 0x01, 0x4f, 0xc3, 0x01, 0x05, 0x01, 0x01, 0x4d, 0x03, 0x54,
-  0x6f, 0x64, 0x61, 0x79, 0x20, 0x00, 0x02, 0x81, 0x20, 0x03, 0x54, 0x6f,
-  0x64, 0x61, 0x79, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
-};
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.openmobilealliance.org/DTD/WV-CSP1.2">
-    <Session>
-        <SessionDescriptor>
-            <SessionType>Inband</SessionType>
-            <SessionID>196FE717.00000000.test1</SessionID>
-        </SessionDescriptor>
-        <Transaction>
-            <TransactionDescriptor>
-                <TransactionMode>Request</TransactionMode>
-                <TransactionID>transId2</TransactionID>
-            </TransactionDescriptor>
-            <TransactionContent xmlns="http://www.openmobilealliance.org/DTD/WV-TRC1.2">
-                <ClientCapability-Request>
-                    <CapabilityList>
-                        <ClientType>MOBILE_PHONE</ClientType>
-                        <ParserSize>32767</ParserSize>
-                        <MultiTrans>1</MultiTrans>
-                        <InitialDeliveryMethod>P</InitialDeliveryMethod>
-                        <ServerPollMin>2</ServerPollMin>
-                        <SupportedBearer>HTTP</SupportedBearer>
-                        <SupportedCIRMethod>STCP</SupportedCIRMethod>
-                        <SupportedCIRMethod>SHTTP</SupportedCIRMethod>
-                        <SupportedCIRMethod>SSMS</SupportedCIRMethod>
-                    </CapabilityList>
-                </ClientCapability-Request>
-            </TransactionContent>
-        </Transaction>
-    </Session>
-</WV-CSP-Message>
-*/
-static const char cap_request_wbxml[] = {
-    0x03, 0x11, 0x6a, 0x00, 0xc9, 0x08, 0x03, 0x31, 0x2e, 0x32, 0x00, 0x01,
-    0x6d, 0x6e, 0x70, 0x80, 0x11, 0x01, 0x6f, 0x03, 0x31, 0x39, 0x36, 0x46,
-    0x45, 0x37, 0x31, 0x37, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
-    0x30, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x31, 0x00, 0x01, 0x01, 0x72, 0x74,
-    0x76, 0x80, 0x20, 0x01, 0x75, 0x03, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x49,
-    0x64, 0x32, 0x00, 0x01, 0x01, 0xf3, 0x0a, 0x03, 0x31, 0x2e, 0x32, 0x00,
-    0x01, 0x00, 0x01, 0x4c, 0x4a, 0x00, 0x05, 0x4f, 0x80, 0x6f, 0x01, 0x00,
-    0x03, 0x4d, 0xc3, 0x02, 0x7f, 0xff, 0x01, 0x4c, 0xc3, 0x01, 0x01, 0x01,
-    0x4b, 0x80, 0x1f, 0x01, 0x4e, 0xc3, 0x01, 0x02, 0x01, 0x4f, 0x80, 0x42,
-    0x01, 0x50, 0x80, 0x44, 0x01, 0x50, 0x80, 0x81, 0x25, 0x01, 0x50, 0x80,
-    0x81, 0x24, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-};
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
-<WV-CSP-Message xmlns="http://www.wireless-village.org/CSP1.1">
-    <sometag>
-        <Session>
-            <someMoreTag/>
-        </Session>
-    </sometag>
-    <metag attr="sometag"/>
-    <tag movie="transformer"></tag>
-</WV-CSP-Message>
-*/
-static const char literal_wbxml[] = {
-  0x03, 0x10, 0x6a, 0x29, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x00,
-  0x73, 0x6f, 0x6d, 0x65, 0x4d, 0x6f, 0x72, 0x65, 0x54, 0x61, 0x67, 0x00,
-  0x6d, 0x65, 0x74, 0x61, 0x67, 0x00, 0x61, 0x74, 0x74, 0x72, 0x00, 0x74,
-  0x61, 0x67, 0x00, 0x6d, 0x6f, 0x76, 0x69, 0x65, 0x00, 0xc9, 0x05, 0x03,
-  0x31, 0x2e, 0x31, 0x00, 0x01, 0x44, 0x00, 0x6d, 0x04, 0x08, 0x01, 0x01,
-  0x84, 0x14, 0x04, 0x1a, 0x83, 0x00, 0x01, 0x84, 0x1f, 0x04, 0x23, 0x03,
-  0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x00,
-  0x01, 0x01
-};
-
-class SimpleTestHandler: public DefaultWbxmlContentHandler
-{
-public:
-    void startElement(const char *name, const vector<Attribute> & attribs)
-    {
-        startElemName = name;
-        this->attribs = attribs;
-    }
-    void endElement(const char *name)
-    {
-        endElemName = name;
-    }
-    string startElemName;
-    string endElemName;
-    vector<Attribute> attribs;
-};
-
-struct DomElement
-{
-    DomElement()
-    {
-        intVal = 0;
-    }
-
-    string name;
-    vector<Attribute> attribs;
-    vector<DomElement> children;
-    string characters;
-    uint32_t intVal;
-};
-
-class DomTestHandler: public DefaultWbxmlContentHandler
-{
-public:
-    DomTestHandler()
-    {
-        currentElement = NULL;
-    }
-
-    void startElement(const char *name, const vector<Attribute> & attribs)
-    {
-        if (!currentElement) {
-            currentElement = &root;
-            currentElement->name = name;
-            currentElement->attribs = attribs;
-        } else {
-            DomElement child;
-            child.name = name;
-            child.attribs = attribs;
-            currentElement->children.push_back(child);
-            elemStack.push_back(currentElement);
-            currentElement = &(currentElement->children.back());
-        }
-    }
-
-    void endElement(const char *name)
-    {
-        TEST_ASSERT_EQUAL_STRING(name, currentElement->name.c_str());
-        TEST_ASSERT((currentElement == &root) ? !elemStack.size() : elemStack.size() > 0);
-        if (elemStack.size()) {
-            currentElement = elemStack.back();
-            elemStack.pop_back();
-        }
-    }
-
-    void characters(const char * data, int len)
-    {
-        string s(data, len);
-        currentElement->characters.append(data, len);
-    }
-
-    void opaque(const char * data, int len)
-    {
-        if (currentElement->name == "Code") {
-            while (len--) {
-                currentElement->intVal <<= 8;
-                currentElement->intVal |= (unsigned char)*data;
-                data++;
-            }
-        }
-    }
-
-    DomElement root;
-
-private:
-    vector<DomElement *> elemStack;
-    DomElement *currentElement;
-};
-
-static void setUp(void)
-{
-}
-
-static void tearDown(void)
-{
-}
-
-static void testSimpleCspRet(void)
-{
-    WbxmlParser parser(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(simple_wbxml,
-                sizeof(simple_wbxml), true));
-}
-
-static void testSimpleCspPublicId(void)
-{
-    WbxmlParser parser(0);
-    DefaultWbxmlContentHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(simple_wbxml,
-                sizeof(simple_wbxml), true));
-    TEST_ASSERT_EQUAL_INT(0x10 /* WV CSP 1.1 */, handler.getPublicId());
-}
-
-static void testSimpleCspStartElement(void)
-{
-    WbxmlParser parser(0);
-    SimpleTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(simple_wbxml,
-                sizeof(simple_wbxml), true));
-    TEST_ASSERT_EQUAL_STRING("WV-CSP-Message", handler.startElemName.c_str());
-}
-
-static void testSimpleCspStartElementAttr(void)
-{
-    WbxmlParser parser(0);
-    SimpleTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(simple_wbxml,
-                sizeof(simple_wbxml), true));
-    TEST_ASSERT_EQUAL_STRING("WV-CSP-Message", handler.startElemName.c_str());
-    TEST_ASSERT_EQUAL_INT(1, handler.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("xmlns", handler.attribs[0].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("http://www.wireless-village.org/CSP1.1", handler.attribs[0].value.c_str());
-}
-
-static void testSimpleCspEndElement(void)
-{
-    WbxmlParser parser(0);
-    SimpleTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(simple_wbxml,
-                sizeof(simple_wbxml), true));
-    TEST_ASSERT_EQUAL_STRING("WV-CSP-Message", handler.endElemName.c_str());
-}
-
-static void testSimpleCspNoContentTag(void)
-{
-    WbxmlParser parser(0);
-    SimpleTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(simple_nocontent_wbxml,
-                sizeof(simple_nocontent_wbxml), true));
-    TEST_ASSERT_EQUAL_STRING("WV-CSP-Message", handler.startElemName.c_str());
-    TEST_ASSERT_EQUAL_STRING("WV-CSP-Message", handler.endElemName.c_str());
-    TEST_ASSERT_EQUAL_INT(1, handler.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("xmlns", handler.attribs[0].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("http://www.wireless-village.org/CSP1.1", handler.attribs[0].value.c_str());
-}
-
-static void testSimpleCspLevel2(void)
-{
-    WbxmlParser parser(0);
-    DomTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(simple2_wbxml,
-                sizeof(simple2_wbxml), true));
-    const DomElement &root = handler.root;
-    TEST_ASSERT_EQUAL_STRING("WV-CSP-Message", root.name.c_str());
-    TEST_ASSERT_EQUAL_INT(1, root.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("xmlns", root.attribs[0].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("http://www.wireless-village.org/CSP1.1", root.attribs[0].value.c_str());
-
-    TEST_ASSERT_EQUAL_INT(1, root.children.size());
-    const DomElement &elem = root.children[0];
-    TEST_ASSERT_EQUAL_INT(0, elem.children.size());
-    TEST_ASSERT_EQUAL_STRING("Session", elem.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, elem.attribs.size());
-}
-
-static void testSimpleCspLevel3Characters(void)
-{
-    WbxmlParser parser(0);
-    DomTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(simple3_wbxml,
-                sizeof(simple3_wbxml), true));
-
-    const DomElement &root = handler.root;
-    TEST_ASSERT_EQUAL_STRING("WV-CSP-Message", root.name.c_str());
-    TEST_ASSERT_EQUAL_INT(1, root.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("xmlns", root.attribs[0].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("http://www.wireless-village.org/CSP1.1", root.attribs[0].value.c_str());
-
-    TEST_ASSERT_EQUAL_INT(1, root.children.size());
-    const DomElement &session = root.children[0];
-    TEST_ASSERT_EQUAL_INT(1, session.children.size());
-    TEST_ASSERT_EQUAL_STRING("Session", session.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, session.attribs.size());
-
-    const DomElement &sessionDesc = session.children[0];
-    TEST_ASSERT_EQUAL_INT(1, sessionDesc.children.size());
-    TEST_ASSERT_EQUAL_STRING("SessionDescriptor", sessionDesc.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, sessionDesc.attribs.size());
-
-    const DomElement &sessionType = sessionDesc.children[0];
-    TEST_ASSERT_EQUAL_INT(0, sessionType.children.size());
-    TEST_ASSERT_EQUAL_STRING("SessionType", sessionType.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, sessionType.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("Outband", sessionType.characters.c_str());
-}
-
-/* String table, LITERAL* for tag, LITERAL for attribute, STR_T */
-static void testLiteralAndStrTable(void)
-{
-    WbxmlParser parser(0);
-    DomTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(literal_wbxml,
-                sizeof(literal_wbxml), true));
-    const DomElement &sometag = handler.root.children[0];
-    TEST_ASSERT_EQUAL_STRING("sometag", sometag.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, sometag.attribs.size());
-    TEST_ASSERT_EQUAL_INT(1, sometag.children.size());
-
-    const DomElement &someMoreTag = sometag.children[0].children[0];
-    TEST_ASSERT_EQUAL_STRING("someMoreTag", someMoreTag.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, someMoreTag.attribs.size());
-    TEST_ASSERT_EQUAL_INT(0, someMoreTag.children.size());
-
-    const DomElement &metag = handler.root.children[1];
-    TEST_ASSERT_EQUAL_STRING("metag", metag.name.c_str());
-    TEST_ASSERT_EQUAL_INT(1, metag.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("attr", metag.attribs[0].name);
-    TEST_ASSERT_EQUAL_STRING("sometag", metag.attribs[0].value);
-    TEST_ASSERT_EQUAL_INT(0, metag.children.size());
-
-    const DomElement &tag = handler.root.children[2];
-    TEST_ASSERT_EQUAL_STRING("tag", tag.name.c_str());
-    TEST_ASSERT_EQUAL_INT(1, tag.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("movie", tag.attribs[0].name);
-    TEST_ASSERT_EQUAL_STRING("transformer", tag.attribs[0].value);
-    TEST_ASSERT_EQUAL_INT(0, tag.children.size());
-}
-
-/* SWITCH_PAGE */
-static void testCspLoginResponse(void)
-{
-    WbxmlParser parser(0);
-    DomTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(loginresponse_wbxml,
-                sizeof(loginresponse_wbxml), true));
-
-    const DomElement &root = handler.root;
-    TEST_ASSERT_EQUAL_STRING("WV-CSP-Message", root.name.c_str());
-    TEST_ASSERT_EQUAL_INT(1, root.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("xmlns", root.attribs[0].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("http://www.wireless-village.org/CSP1.1",
-            root.attribs[0].value.c_str());
-
-    const DomElement &transaction = root.children[0].children[1];
-    TEST_ASSERT_EQUAL_STRING("Transaction", transaction.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, transaction.attribs.size());
-    TEST_ASSERT_EQUAL_INT(2, transaction.children.size());
-
-    const DomElement &transactionContent = transaction.children[1];
-    TEST_ASSERT_EQUAL_STRING("TransactionContent", transactionContent.name.c_str());
-    TEST_ASSERT_EQUAL_INT(1, transactionContent.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("xmlns", transactionContent.attribs[0].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("http://www.wireless-village.org/TRC1.1",
-            transactionContent.attribs[0].value.c_str());
-    TEST_ASSERT_EQUAL_INT(1, transactionContent.children.size());
-
-    const DomElement &clientID = transactionContent.children[0].children[0];
-    TEST_ASSERT_EQUAL_STRING("ClientID", clientID.name.c_str());
-    TEST_ASSERT_EQUAL_STRING("Esmertec112233", clientID.characters.c_str());
-    TEST_ASSERT_EQUAL_INT(0, clientID.attribs.size());
-    TEST_ASSERT_EQUAL_INT(0, clientID.children.size());
-
-    const DomElement &capReq = transactionContent.children[0].children[4];
-    TEST_ASSERT_EQUAL_STRING("CapabilityRequest", capReq.name.c_str());
-    TEST_ASSERT_EQUAL_STRING("F", capReq.characters.c_str());
-    TEST_ASSERT_EQUAL_INT(0, capReq.attribs.size());
-    TEST_ASSERT_EQUAL_INT(0, capReq.children.size());
-}
-
-/* OPAQUE integer */
-static void testCspStatusPrim(void)
-{
-    WbxmlParser parser(0);
-    DomTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(statusprim_wbxml,
-                sizeof(statusprim_wbxml), true));
-
-    const DomElement &root = handler.root;
-    TEST_ASSERT_EQUAL_STRING("WV-CSP-Message", root.name.c_str());
-    TEST_ASSERT_EQUAL_INT(1, root.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("xmlns", root.attribs[0].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("http://www.openmobilealliance.org/DTD/IMPS-CSP1.3",
-            root.attribs[0].value.c_str());
-
-    const DomElement &transacContent = root.children[0].children[1].children[1];
-    TEST_ASSERT_EQUAL_STRING("TransactionContent", transacContent.name.c_str());
-    TEST_ASSERT_EQUAL_INT(1, transacContent.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("xmlns", transacContent.attribs[0].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("http://www.openmobilealliance.org/DTD/IMPS-TRC1.3",
-            transacContent.attribs[0].value.c_str());
-
-    const DomElement &resultCode = transacContent.children[0].children[0].children[0];
-    TEST_ASSERT_EQUAL_STRING("Code", resultCode.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, resultCode.attribs.size());
-    TEST_ASSERT_EQUAL_INT(201, resultCode.intVal);
-
-    const DomElement &detailedResultCode = transacContent.children[0].children[0].children[2].children[0];
-    TEST_ASSERT_EQUAL_STRING("Code", detailedResultCode.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, detailedResultCode.attribs.size());
-    TEST_ASSERT_EQUAL_INT(531, detailedResultCode.intVal);
-}
-
-/* SWITCH_PAGE, OPAQUE integer, ENTITY */
-static void testCspSendMsg(void)
-{
-    WbxmlParser parser(0);
-    DomTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(sendmsgreq1_wbxml,
-                sizeof(sendmsgreq1_wbxml), true));
-
-    const DomElement &root = handler.root;
-    const DomElement &transacContent = root.children[0].children[1].children[1];
-    const DomElement &contentData = transacContent.children[0].children[2];
-
-    TEST_ASSERT_EQUAL_STRING("ContentData", contentData.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, contentData.attribs.size());
-    // &#160; => U+00A0, UTF-8 0xC2 0xA0
-    TEST_ASSERT_EQUAL_STRING("Today \xc2\xa0Today", contentData.characters.c_str());
-}
-
-/* Token values, EXT_0 + mbuint32 */
-static void testCspCapRequest(void)
-{
-    WbxmlParser parser(0);
-    DomTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(cap_request_wbxml,
-                sizeof(cap_request_wbxml), true));
-
-    const DomElement &root = handler.root;
-    const DomElement &transacContent = root.children[0].children[1].children[1];
-    const DomElement &capList = transacContent.children[0].children[0];
-
-    TEST_ASSERT_EQUAL_STRING("CapabilityList", capList.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, capList.attribs.size());
-    TEST_ASSERT_EQUAL_INT(9, capList.children.size());
-
-    TEST_ASSERT_EQUAL_STRING("ClientType", capList.children[0].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("MOBILE_PHONE", capList.children[0].characters.c_str());
-
-    TEST_ASSERT_EQUAL_STRING("SupportedBearer", capList.children[5].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("HTTP", capList.children[5].characters.c_str());
-
-    TEST_ASSERT_EQUAL_STRING("SupportedCIRMethod", capList.children[7].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("SHTTP", capList.children[7].characters.c_str());
-
-    TEST_ASSERT_EQUAL_STRING("SupportedCIRMethod", capList.children[8].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("SSMS", capList.children[8].characters.c_str());
-}
-
-static void testIncompleteInlineString(void)
-{
-    WbxmlParser parser(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR, parser.parse(incomplete_str_i_wbxml,
-                sizeof(incomplete_str_i_wbxml), true));
-}
-
-/* more ENTITY tests */
-static void testBigEntity(void)
-{
-    WbxmlParser parser(0);
-    DomTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(big_entity_wbxml,
-                sizeof(big_entity_wbxml), true));
-
-    const DomElement &sessionType = handler.root.children[0].children[0].children[0];
-    TEST_ASSERT_EQUAL_INT(0, sessionType.children.size());
-    TEST_ASSERT_EQUAL_STRING("SessionType", sessionType.name.c_str());
-    TEST_ASSERT_EQUAL_INT(0, sessionType.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("\xf4\x8f\xbf\xbf", sessionType.characters.c_str());
-}
-
-static void testInvalidEntity(void)
-{
-    WbxmlParser parser(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR, parser.parse(invalid_entity_wbxml,
-                sizeof(invalid_entity_wbxml), true));
-}
-
-static void testParseInChunk(void)
-{
-    WbxmlParser parser(0);
-    DomTestHandler handler;
-    parser.setContentHandler(&handler);
-    // wbxml version
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(sendmsgreq1_wbxml,
-                1, false));
-
-    // public id + charset
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(sendmsgreq1_wbxml + 1,
-                2, false));
-
-    // 0 byte long string table
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(sendmsgreq1_wbxml + 3,
-                1, false));
-
-    // first start tag
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(sendmsgreq1_wbxml + 4,
-                1, false));
-
-    // some data
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(sendmsgreq1_wbxml + 5,
-                5, false));
-
-    // some more data
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(sendmsgreq1_wbxml + 10,
-                sizeof(sendmsgreq1_wbxml) - 1 - 2 - 1 - 1 - 5 - 4, false));
-
-    // last 4 bytes
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(sendmsgreq1_wbxml
-                + sizeof(sendmsgreq1_wbxml) - 4, 4, true));
-
-    const DomElement &root = handler.root;
-    TEST_ASSERT_EQUAL_STRING("WV-CSP-Message", root.name.c_str());
-    TEST_ASSERT_EQUAL_INT(1, root.attribs.size());
-    TEST_ASSERT_EQUAL_STRING("xmlns", root.attribs[0].name.c_str());
-    TEST_ASSERT_EQUAL_STRING("http://www.openmobilealliance.org/DTD/WV-CSP1.2",
-            root.attribs[0].value.c_str());
-}
-
-static void testParserReset(void)
-{
-    WbxmlParser parser(0);
-
-    // first some incomplete data
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR, parser.parse(sendmsgreq1_wbxml,
-                1, true));
-
-    parser.reset();
-
-    // now some correct data: wbxml version
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(sendmsgreq1_wbxml,
-                1, false));
-
-    // more correct data: public id + charset
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(sendmsgreq1_wbxml + 1,
-                2, false));
-
-    parser.reset();
-
-    // some wrong data again
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR, parser.parse(sendmsgreq1_wbxml + 3,
-                6, false));
-
-    parser.reset();
-
-    DomTestHandler handler;
-    parser.setContentHandler(&handler);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(big_entity_wbxml,
-                sizeof(big_entity_wbxml), true));
-
-    const DomElement &sessionType = handler.root.children[0].children[0].children[0];
-    TEST_ASSERT_EQUAL_INT(0, sessionType.children.size());
-    TEST_ASSERT_EQUAL_STRING("SessionType", sessionType.name.c_str());
-
-    parser.reset();
-    handler.root.name.clear();
-    handler.root.children.clear();
-
-    // parse same document without setting a handler
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK, parser.parse(big_entity_wbxml,
-                sizeof(big_entity_wbxml), true));
-    TEST_ASSERT_EQUAL_INT(0, handler.root.children.size());
-    TEST_ASSERT_EQUAL_INT(0, handler.root.name.size());
-}
-
-static void testIncompleteData(void)
-{
-    WbxmlParser parser(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR, parser.parse(sendmsgreq1_wbxml,
-                1, true));
-
-    WbxmlParser parser1(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR, parser1.parse(sendmsgreq1_wbxml,
-                3, true));
-
-    WbxmlParser parser2(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR, parser2.parse(sendmsgreq1_wbxml,
-                4, true));
-
-    WbxmlParser parser3(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR, parser3.parse(sendmsgreq1_wbxml,
-                5, true));
-}
-
-extern "C" TestRef ImpsParserTest_tests(void)
-{
-    EMB_UNIT_TESTFIXTURES(fixtures) {
-        DEFINE_TEST(testSimpleCspRet),
-        DEFINE_TEST(testSimpleCspPublicId),
-        DEFINE_TEST(testSimpleCspStartElement),
-        DEFINE_TEST(testSimpleCspStartElementAttr),
-        DEFINE_TEST(testSimpleCspEndElement),
-        DEFINE_TEST(testSimpleCspNoContentTag),
-        DEFINE_TEST(testSimpleCspLevel2),
-        DEFINE_TEST(testSimpleCspLevel3Characters),
-        DEFINE_TEST(testLiteralAndStrTable),
-        DEFINE_TEST(testCspLoginResponse),
-        DEFINE_TEST(testCspStatusPrim),
-        DEFINE_TEST(testCspSendMsg),
-        DEFINE_TEST(testCspCapRequest),
-        DEFINE_TEST(testIncompleteInlineString),
-        DEFINE_TEST(testBigEntity),
-        DEFINE_TEST(testInvalidEntity),
-        DEFINE_TEST(testParseInChunk),
-        DEFINE_TEST(testParserReset),
-        DEFINE_TEST(testIncompleteData),
-    };
-    EMB_UNIT_TESTCALLER(ImpsParserTest, "ImpsParserTest", setUp, tearDown, fixtures);
-
-    // temporary work around for the linker/loader problem of the sooner build
-    static TestCaller t = ImpsParserTest;
-    t.isa = (TestImplement *)&TestCallerImplement;
-    return (TestRef)&t;
-}
-
diff --git a/libwbxml/test/syncml_parser_test.cpp b/libwbxml/test/syncml_parser_test.cpp
deleted file mode 100644 (file)
index ae36639..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <embUnit.h>
-#include <stdlib.h>
-#include <string.h>
-#include "wbxml_parser.h"
-
-#define DEFINE_TEST(test)   \
-    new_TestFixture( #test, test)
-
-#define ASSERT_EQUAL_INT(expected, actual) \
-    {   \
-        int tmp = actual;             /* avoid duplicated evaluation in TEST_ASSERT_EQUAL_INT */    \
-        TEST_ASSERT_EQUAL_INT(expected, tmp);   \
-    }
-
-/*
-<?xml version="1.0" encoding="UTF-8" ?>
--//SYNCML//DTD SyncML 1.2//EN
-*/
-static const char incomplete_array[] = {
-    0x02, 0x00, 0x00, 0x6A, 0x1E, '-', '/', '/', 'S', 'Y',
-    'N', 'C', 'M', 'L', '/', '/', 'D', 'T', 'D', ' ', 'S',
-    'y', 'n', 'c', 'M', 'L', ' ', '1', '.', '2', '/', '/',
-    'E', 'N', 0x00, 0x01
-};
-
-static const char complete_array_scts[] = {
-    0x02, 0x00, 0x00, 0x6a, 0x1e, 0x2d, 0x2f, 0x2f, 0x53,
-    0x59, 0x4e, 0x43, 0x4d, 0x4c, 0x2f, 0x2f, 0x44, 0x54,
-    0x44, 0x20, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x4c, 0x20,
-    0x31, 0x2e, 0x31, 0x2f, 0x2f, 0x45, 0x4e, 0x00, 0x6d,
-    0x6c, 0x71, 0x03, 0x31, 0x2e, 0x31, 0x00, 0x01, 0x72,
-    0x03, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x4c, 0x2f, 0x31,
-    0x2e, 0x31, 0x00, 0x01, 0x65, 0x03, 0x34, 0x00, 0x01,
-    0x5b, 0x03, 0x32, 0x00, 0x01, 0x6e, 0x57, 0x03, 0x68,
-    0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x31, 0x30, 0x2e,
-    0x31, 0x35, 0x2e, 0x31, 0x31, 0x2e, 0x32, 0x35, 0x34,
-    0x2f, 0x53, 0x63, 0x74, 0x73, 0x3f, 0x51, 0x4e, 0x41,
-    0x35, 0x41, 0x41, 0x3d, 0x3d, 0x00, 0x01, 0x01, 0x67,
-    0x57, 0x03, 0x53, 0x59, 0x4e, 0x43, 0x4d, 0x4c, 0x3a,
-    0x31, 0x00, 0x01, 0x01, 0x4e, 0x5a, 0x00, 0x01, 0x47,
-    0x03, 0x62, 0x36, 0x34, 0x00, 0x01, 0x53, 0x03, 0x73,
-    0x79, 0x6e, 0x63, 0x6d, 0x6c, 0x3a, 0x61, 0x75, 0x74,
-    0x68, 0x2d, 0x62, 0x61, 0x73, 0x69, 0x63, 0x00, 0x01,
-    0x01, 0x00, 0x00, 0x4f, 0x03, 0x63, 0x32, 0x56, 0x79,
-    0x64, 0x6d, 0x56, 0x79, 0x4f, 0x6e, 0x4e, 0x6c, 0x63,
-    0x6e, 0x5a, 0x6c, 0x63, 0x67, 0x3d, 0x3d, 0x00, 0x01,
-    0x01, 0x5a, 0x00, 0x01, 0x4c, 0x03, 0x32, 0x30, 0x30,
-    0x30, 0x30, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x6b,
-    0x69, 0x4b, 0x03, 0x31, 0x00, 0x01, 0x5c, 0x03, 0x31,
-    0x00, 0x01, 0x4c, 0x03, 0x30, 0x00, 0x01, 0x4a, 0x03,
-    0x53, 0x79, 0x6e, 0x63, 0x48, 0x64, 0x72, 0x00, 0x01,
-    0x6f, 0x03, 0x53, 0x59, 0x4e, 0x43, 0x4d, 0x4c, 0x3a,
-    0x31, 0x00, 0x01, 0x68, 0x03, 0x68, 0x74, 0x74, 0x70,
-    0x3a, 0x2f, 0x2f, 0x31, 0x30, 0x2e, 0x31, 0x35, 0x2e,
-    0x31, 0x31, 0x2e, 0x32, 0x35, 0x34, 0x2f, 0x53, 0x79,
-    0x6e, 0x63, 0x00, 0x01, 0x4f, 0x03, 0x32, 0x31, 0x32,
-    0x00, 0x01, 0x01, 0x46, 0x4b, 0x03, 0x32, 0x00, 0x01,
-    0x4f, 0x03, 0x32, 0x30, 0x30, 0x00, 0x01, 0x54, 0x6e,
-    0x57, 0x03, 0x64, 0x62, 0x00, 0x01, 0x01, 0x67, 0x57,
-    0x03, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x73,
-    0x00, 0x01, 0x01, 0x5a, 0x00, 0x01, 0x45, 0x4a, 0x03,
-    0x32, 0x30, 0x30, 0x38, 0x30, 0x31, 0x31, 0x37, 0x54,
-    0x30, 0x33, 0x30, 0x38, 0x32, 0x34, 0x5a, 0x00, 0x01,
-    0x4f, 0x03, 0x32, 0x30, 0x30, 0x38, 0x30, 0x31, 0x31,
-    0x37, 0x54, 0x30, 0x33, 0x31, 0x31, 0x31, 0x33, 0x5a,
-    0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x12,
-    0x01, 0x01
-};
-
-static const char complete_array2[] = {
-    0x02, 0x00, 0x00, 0x6A, 0x1E, '-', '/', '/', 'S', 'Y',
-    'N', 'C', 'M', 'L', '/', '/', 'D', 'T', 'D', ' ', 'S',
-    'y', 'n', 'c', 'M', 'L', ' ', '1', '.', '2', '/', '/',
-    'E', 'N', 0x00, 0x6D, 0x6C, 0x71, 0xC3, 0x03, '1', '.',
-    '2', 0x01, 0x72, 0xC3, 0x0A, 'S', 'y', 'n', 'c', 'M',
-    'L', '/', '1', '.', '2', 0x01, 0x65, 0xC3, 0x01, '1',
-    0x01, 0x5B, 0xC3, 0x01, '2', 0x01, 0x6E, 0x57, 0xC3,
-    0x20, 'h', 't', 't', 'p', ':', '/', '/', 'w', 'w', 'w',
-    '1', '.', 'd', 'a', 't', 'a', 's', 'y', 'n', 'c', '.',
-    'o', 'r', 'g', '/', 's', 'e', 'r', 'v', 'l', 'e', 't',
-    0x01, 0x01, 0x67, 0x57, 0xC3, 0x12, 'I', 'M', 'E', 'I',
-    ':', '1', '5', '6', '4', '4', '6', '9', '2', '1', '0',
-    '9', '4', '8', 0x01, 0x01, 0x01, 0x6B, 0x69, 0x4B,
-    0xC3, 0x01, '1', 0x01, 0x5C, 0xC3, 0x01, '1', 0x01,
-    0x4C, 0xC3, 0x01, '0', 0x01, 0x4A, 0xC3, 0x07, 'S',
-    'y', 'n', 'c', 'H', 'd', 'r', 0x01, 0x6F, 0xC3, 0x12,
-    'I', 'M', 'E', 'I', ':', '1', '5', '6', '4', '4', '6',
-    '9', '2', '1', '0', '9', '4', '8', 0x01, 0x68, 0xC3,
-    0x20, 'h', 't', 't', 'p', ':', '/', '/', 'w', 'w', 'w',
-    '1', '.', 'd', 'a', 't', 'a', 's', 'y', 'n', 'c', '.',
-    'o', 'r', 'g', '/', 's', 'e', 'r', 'v', 'l', 'e', 't',
-    0x01, 0x4F, 0xC3, 0x3, '2', '0', '0', 0x01, 0x01,
-    0x69, 0x4B, 0xC3, 0x01, '2', 0x01, 0x5C, 0xC3, 0x01,
-    '1', 0x01, 0x4C, 0xC3, 0x01, '1', 0x01, 0x4A, 0xC3,
-    0x05, 'A', 'l', 'e', 'r', 't', 0x01, 0x6F, 0xC3, 0x0E,
-    '.', '\\', 'd', 'e', 'v', '-', 'c', 'a', 'l', 'e', 'n',
-    'd', 'a', 'r', 0x01, 0x68, 0xC3, 0x0A, '.', '/', 'c',
-    'a', 'l', 'e', 'n', 'd', 'a', 'r', 0x01, 0x4F, 0xC3,
-    0x03, '2', '0', '0', 0x01, 0x54, 0x4F, 0x00, 0x01,
-    0x4F, 0xC3, 0x11, '2', '0', '0', '0', '0', '5', '0',
-    '2', '2', 'T', '0', '9', '3', '2', '2', '3', 'Z',
-    0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x6A, 0x4B, 0xC3,
-    0x01, '3', 0x01, 0x6E, 0x57, 0xC3, 0x0A, '.', '/',
-    'c', 'a', 'l', 'e', 'n', 'd', 'a', 'r', 0x01, 0x01,
-    0x67, 0x57, 0xC3, 0x0E, '.', '\\', 'd', 'e', 'v', '-',
-    'c', 'a', 'l', 'e', 'n', 'd', 'a', 'r', 0x01, 0x01,
-    0x33, 0xC3, 0x01, '1', 0x01, 0x60, 0x4B, 0xC3, 0x01,
-    '4', 0x01, 0x5A, 0x00, 0x01, 0x4D, 0x03, 't', 'e', 'x',
-    't', '/', 'x', '-', 'v', 'c', 'a', 'l', 'e', 'n', 'd',
-    'a', 'r', 0x00, 0x01, 0x00, 0x00, 0x01, 0x54, 0x67,
-    0x57, 0xC3, 0x02, '2', '6', 0x01, 0x01, 0x4F, 0xC3,
-    0x04, 'C', 'A', 'L', '1', 0x01, 0x01, 0x01, 0x01, 0x12,
-    0x01, 0x01, 0x01
-};
-
-static void setUp(void)
-{
-}
-
-static void tearDown(void)
-{
-}
-
-static void testSyncmlIncomplete(void)
-{
-    WbxmlParser parser(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_ERROR,
-                     parser.parse(incomplete_array, sizeof(incomplete_array), true));
-}
-
-static void testSyncmlComplete(void)
-{
-    WbxmlParser parser(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK,
-                     parser.parse(complete_array_scts, sizeof(complete_array_scts), true));
-}
-
-static void testSyncmlComplete2(void)
-{
-    WbxmlParser parser(0);
-    ASSERT_EQUAL_INT(WBXML_STATUS_OK,
-                     parser.parse(complete_array2, sizeof(complete_array2), true));
-}
-
-extern "C" TestRef SyncmlParserTest_tests(void)
-{
-    EMB_UNIT_TESTFIXTURES(fixtures) {
-        DEFINE_TEST(testSyncmlIncomplete),
-        DEFINE_TEST(testSyncmlComplete),
-        DEFINE_TEST(testSyncmlComplete2),
-    };
-    EMB_UNIT_TESTCALLER(SyncmlParserTest, "SyncmlParserTest", setUp, tearDown, fixtures);
-
-    // temporary work around for the linker/loader problem of the sooner build
-    static TestCaller t = SyncmlParserTest;
-    t.isa = (TestImplement *) & TestCallerImplement;
-    return (TestRef) & t;
-}
diff --git a/plugin/Android.mk b/plugin/Android.mk
deleted file mode 100644 (file)
index 28ccd21..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Copyright (C) 2008 Esmertec AG.
-# Copyright (C) 2008 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-LOCAL_PATH := $(call my-dir)
-
-# the library
-# ============================================================
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
-            $(call all-subdir-java-files) \
-            com/android/im/plugin/IImPlugin.aidl \
-            com/android/im/plugin/IPasswordDigest.aidl \
-            com/android/im/plugin/IPresenceMapping.aidl \
-
-LOCAL_MODULE:= com.android.im.plugin
-
-include $(BUILD_JAVA_LIBRARY)
diff --git a/plugin/com/android/im/plugin/BrandingResourceIDs.java b/plugin/com/android/im/plugin/BrandingResourceIDs.java
deleted file mode 100644 (file)
index b53c143..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.plugin;
-
-/**
- * Defines the IDs of branding resources.
- *
- */
-public interface BrandingResourceIDs extends android.im.BrandingResourceIDs {
-    /**
-     * The image displayed on the splash screen while logging in.
-     */
-    public static final int DRAWABLE_SPLASH_SCREEN       = 200;
-    /**
-     * The icon for blocked contacts.
-     */
-    public static final int DRAWABLE_BLOCK               = 201;
-    /**
-     * The water mark background for chat screen.
-     */
-    public static final int DRAWABLE_CHAT_WATERMARK      = 202;
-    /**
-     * The icon for the read conversation.
-     */
-    public static final int DRAWABLE_READ_CHAT           = 203;
-    /**
-     * The icon for the unread conversation.
-     */
-    public static final int DRAWABLE_UNREAD_CHAT         = 204;
-
-    /**
-     * The title of buddy list screen. It's conjuncted with the current username
-     * and should be formatted as a string like
-     * "Contact List - &lt;xliff:g id="username"&gt;%1$s&lt;/xliff:g&gt;
-     */
-    public static final int STRING_BUDDY_LIST_TITLE      = 301;
-
-    /**
-     * A string array of the smiley names.
-     */
-    public static final int STRING_ARRAY_SMILEY_NAMES    = 302;
-    /**
-     * A string array of the smiley texts.
-     */
-    public static final int STRING_ARRAY_SMILEY_TEXTS    = 303;
-
-    /**
-     * The string of available presence status.
-     */
-    public static final int STRING_PRESENCE_AVAILABLE    = 304;
-    /**
-     * The string of away presence status.
-     */
-    public static final int STRING_PRESENCE_AWAY         = 305;
-    /**
-     * The string of busy presence status.
-     */
-    public static final int STRING_PRESENCE_BUSY         = 306;
-    /**
-     * The string of the idle presence status.
-     */
-    public static final int STRING_PRESENCE_IDLE         = 307;
-    /**
-     * The string of the invisible presence status.
-     */
-    public static final int STRING_PRESENCE_INVISIBLE    = 308;
-    /**
-     * The string of the offline presence status.
-     */
-    public static final int STRING_PRESENCE_OFFLINE      = 309;
-
-    /**
-     * The label of username displayed on the account setup screen.
-     */
-    public static final int STRING_LABEL_USERNAME        = 310;
-    /**
-     * The label of the ongoing conversation group.
-     */
-    public static final int STRING_ONGOING_CONVERSATION  = 311;
-    /**
-     * The title of add contact screen.
-     */
-    public static final int STRING_ADD_CONTACT_TITLE     = 312;
-    /**
-     * The label of the contact input box on the add contact screen.
-     */
-    public static final int STRING_LABEL_INPUT_CONTACT   = 313;
-    /**
-     * The label of the add contact button on the add contact screen
-     */
-    public static final int STRING_BUTTON_ADD_CONTACT    = 314;
-    /**
-     * The title of the contact info dialog.
-     */
-    public static final int STRING_CONTACT_INFO_TITLE    = 315;
-    /**
-     * The label of the menu to add a contact.
-     */
-    public static final int STRING_MENU_ADD_CONTACT      = 316;
-    /**
-     * The label of the menu to start a conversation.
-     */
-    public static final int STRING_MENU_START_CHAT       = 317;
-    /**
-     * The label of the menu to view contact profile info.
-     */
-    public static final int STRING_MENU_VIEW_PROFILE     = 318;
-    /**
-     * The label of the menu to end a conversation.
-     */
-    public static final int STRING_MENU_END_CHAT         = 319;
-    /**
-     * The label of the menu to block a contact.
-     */
-    public static final int STRING_MENU_BLOCK_CONTACT    = 320;
-    /**
-     * The label of the menu to delete a contact.
-     */
-    public static final int STRING_MENU_DELETE_CONTACT   = 321;
-    /**
-     * The label of the menu to insert a smiley.
-     */
-    public static final int STRING_MENU_INSERT_SMILEY    = 322;
-    /**
-     * The label of the menu to switch conversations.
-     */
-    public static final int STRING_MENU_SWITCH_CHATS     = 323;
-    /**
-     * The string of the toast displayed when auto sign in button on the account
-     * setup screen is checked.
-     */
-    public static final int STRING_TOAST_CHECK_AUTO_SIGN_IN  = 324;
-    /**
-     * The string of the toast displayed when the remember password button on
-     * the account setup screen is checked.
-     */
-    public static final int STRING_TOAST_CHECK_SAVE_PASSWORD = 325;
-    /**
-     * The label of sign up a new account on the account setup screen.
-     */
-    public static final int STRING_LABEL_SIGN_UP         = 326;
-    /**
-     * The term of use message. If provided, a dialog will be shown at the first
-     * time login to ask the user if he would accept the term or not.
-     */
-    public static final int STRING_TOU_MESSAGE           = 327;
-    /**
-     * The title of the term of use dialog.
-     */
-    public static final int STRING_TOU_TITLE             = 328;
-    /**
-     * The label of the button to accept the term of use.
-     */
-    public static final int STRING_TOU_ACCEPT            = 329;
-    /**
-     * The label of the button to decline the term of use.
-     */
-    public static final int STRING_TOU_DECLINE           = 330;
-}
diff --git a/plugin/com/android/im/plugin/IImPlugin.aidl b/plugin/com/android/im/plugin/IImPlugin.aidl
deleted file mode 100644 (file)
index b641e86..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.plugin;
-
-interface IImPlugin {
-    /**
-     * Gets a map of branding resources for the provider. The keys are defined
-     * in {@link com.android.im.plugin.BrandingResourceIDs}. The values are the
-     * resource identifiers generated by the aapt tool.
-     *
-     * @return The map of branding resources.
-     */
-    Map getResourceMap();
-
-    /**
-     * Gets an array of IDs of the smiley icons. The sequence of the IDs must
-     * much the strings defined in {@link BrandingResourceIDs#STRING_ARRAY_SMILEY_TEXTS}.
-     *
-     * The IDs are generated by the aapt tool.
-     *
-     * @return An array of the IDs of the smiley icons.
-     */
-    int[] getSmileyIconIds();
-
-    /**
-     * Gets the configuration for the provider. The keys MUST match the values
-     * defined in {@link ImConfigNames} and {@link ImpsConfigNames}
-     *
-     * @return the configuration for the provider.
-     */
-    Map getProviderConfig();
-}
diff --git a/plugin/com/android/im/plugin/IPasswordDigest.aidl b/plugin/com/android/im/plugin/IPasswordDigest.aidl
deleted file mode 100644 (file)
index f6bed17..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.plugin;
-
-/**
- * The password digest method used in IMPS login transaction.
- */
-interface IPasswordDigest {
-    /**
-     * Gets an array of supported digest schema.
-     *
-     * @return an array of digest schema
-     */
-    String[] getSupportedDigestSchema();
-
-    /**
-     * Generates the digest bytes of the password.
-     *
-     * @param schema The digest schema to use.
-     * @param nonce The nonce string returned by the server.
-     * @param password The user password.
-     * @return The digest bytes of the password.
-     */
-    String digest(String schema, String nonce, String password);
-}
diff --git a/plugin/com/android/im/plugin/IPresenceMapping.aidl b/plugin/com/android/im/plugin/IPresenceMapping.aidl
deleted file mode 100644 (file)
index 3b6ffc4..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.plugin;
-
-/**
- * The methods used to map presence value sent in protocol to predefined
- * presence status.
- */
-interface IPresenceMapping {
-    /**
-     * Tells if the mapping needs all presence values sent in protocol. If this
-     * method returns true, the framework will pass all the presence values
-     * received from the server when map to the predefined status.
-     *
-     * @return true if needs; false otherwise.
-     */
-    boolean requireAllPresenceValues();
-
-    /**
-     * Map the presence values sent in protocol to the predefined presence
-     * status.
-     *
-     * @param onlineStatus The value of presence &lt;OnlineStatus&gt; received
-     *            from the server.
-     * @param userAvailability The value of presence &lt;UserAvailibility&gt;
-     *            received from the server.
-     * @param allValues The whole presence values received from the server.
-     * @return a predefined status.
-     * @see #requireAllPresenceValues()
-     */
-    int getPresenceStatus(boolean onlineStatus, String userAvailability,
-            in Map allValues);
-
-    /**
-     * Gets the value of &lt;OnlineStatus&gt; will be sent to the server when
-     * update presence to the predefined status.
-     *
-     * @param status the predefined status.
-     * @return The value of &lt;OnlineStatus&gt; will be sent to the server
-     */
-    boolean getOnlineStatus(int status);
-
-    /**
-     * Gets the value of &lt;UserAvaibility&gt; will be sent to the server when
-     * update presence to the predefined status.
-     *
-     * @param status the predefined status.
-     * @return The value of &lt;UserAvaibility&gt; will be sent to the server
-     */
-    String getUserAvaibility(int status);
-
-    /**
-     * Gets the extra presence values other than &lt;OnlineStatus&gt; and
-     * &lt;UserAvaibility&gt; will be sent to the server when update presence to
-     * the predefined status.
-     *
-     * @param status the predefined status.
-     * @return The extra values that will be sent to the server.
-     */
-    Map getExtra(int status);
-
-    /**
-     * Gets an array of the supported presence status. The client can only update
-     * presence to the values in the array.
-     *
-     * @return an array of the supported presence status.
-     */
-    int[] getSupportedPresenceStatus();
-}
diff --git a/plugin/com/android/im/plugin/ImConfigNames.java b/plugin/com/android/im/plugin/ImConfigNames.java
deleted file mode 100644 (file)
index 9f86ef8..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.plugin;
-
-/**
- * Defines the configuration names for the IM engine.
- *
- */
-public interface ImConfigNames {
-    /**
-     * The name of the protocol.
-     */
-    public static final String PROTOCOL_NAME = "im.protocol";
-
-    /**
-     * The default domain.
-     */
-    public static final String DEFAULT_DOMAIN = "im.default-domain";
-
-    /**
-     * The path of the plugin.
-     */
-    public static final String PLUGIN_PATH = "im.plugin.path";
-
-    /**
-     * The class name of the plugin implementation.
-     */
-    public static final String PLUGIN_CLASS = "im.plugin.class";
-
-    /**
-     * The version of the plugin.
-     */
-    public static final String PLUGIN_VERSION = "im.plugin.version";
-}
diff --git a/plugin/com/android/im/plugin/ImPluginConstants.java b/plugin/com/android/im/plugin/ImPluginConstants.java
deleted file mode 100644 (file)
index a512744..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.plugin;
-
-public class ImPluginConstants {
-
-    /**
-     * The intent action name for the plugin service.
-     */
-    public static final String PLUGIN_ACTION_NAME = "com.android.im.plugin";
-
-    /**
-     * The name of the provider. It should match the values defined in
-     * {@link android.provider.Im.ProviderNames}.
-     */
-    public static final String METADATA_PROVIDER_NAME = "com.android.im.provider_name";
-
-    /**
-     * The full name of the provider.
-     */
-    public static final String METADATA_PROVIDER_FULL_NAME = "com.android.im.provider_full_name";
-
-    /**
-     * The url where the user can register a new account for the provider.
-     */
-    public static final String METADATA_SIGN_UP_URL = "com.android.im.signup_url";
-
-    /**
-     * Presence status OFFLINE. Should match the value defined in the IM engine.
-     */
-    public static final int PRESENCE_OFFLINE = 0;
-
-    /**
-     * Presence status DO_NOT_DISTURB. Should match the value defined in the IM engine.
-     */
-    public static final int PRESENCE_DO_NOT_DISTURB = 1;
-
-    /**
-     * Presence status AWAY. Should match the value defined in the IM engine.
-     */
-    public static final int PRESENCE_AWAY = 2;
-
-    /**
-     * Presence status IDLE. Should match the value defined in the IM engine.
-     */
-    public static final int PRESENCE_IDLE = 3;
-
-    /**
-     * Presence status AVAILABLE. Should match the value defined in the IM engine.
-     */
-    public static final int PRESENCE_AVAILABLE = 4;
-
-    public static final String PA_AVAILABLE = "AVAILABLE";
-    public static final String PA_NOT_AVAILABLE = "NOT_AVAILABLE";
-    public static final String PA_DISCREET = "DISCREET";
-}
diff --git a/plugin/com/android/im/plugin/ImPluginInfo.aidl b/plugin/com/android/im/plugin/ImPluginInfo.aidl
deleted file mode 100644 (file)
index 943bdfe..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.plugin;
-
-parcelable ImPluginInfo;
diff --git a/plugin/com/android/im/plugin/ImPluginInfo.java b/plugin/com/android/im/plugin/ImPluginInfo.java
deleted file mode 100644 (file)
index 874e6e5..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.plugin;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * The basic information of a plugin.
- */
-public class ImPluginInfo implements Parcelable {
-    /**
-     * The name of the provider.
-     */
-    public String mProviderName;
-
-    /**
-     * The name of the package that the plugin is in.
-     */
-    public String mPackageName;
-
-    /**
-     * The name of the class that implements {@link ImPlugin} in this plugin.
-     */
-    public String mClassName;
-
-    /**
-     * The full path to the location of the package that the plugin is in.
-     */
-    public String mSrcPath;
-
-    public ImPluginInfo(String providerName, String packageName,
-            String className, String srcPath) {
-        mProviderName = providerName;
-        mPackageName = packageName;
-        mClassName = className;
-        mSrcPath = srcPath;
-    }
-
-    public ImPluginInfo(Parcel source) {
-        mProviderName = source.readString();
-        mPackageName = source.readString();
-        mClassName = source.readString();
-        mSrcPath = source.readString();
-    }
-
-    public int describeContents() {
-        return 0;
-    }
-
-    public void writeToParcel(Parcel dest, int flags) {
-        dest.writeString(mProviderName);
-        dest.writeString(mPackageName);
-        dest.writeString(mClassName);
-        dest.writeString(mSrcPath);
-    }
-
-    public static final Parcelable.Creator<ImPluginInfo> CREATOR
-            = new Parcelable.Creator<ImPluginInfo>() {
-        public ImPluginInfo createFromParcel(Parcel source) {
-            return new ImPluginInfo(source);
-        }
-
-        public ImPluginInfo[] newArray(int size) {
-            return new ImPluginInfo[size];
-        }
-    };
-}
diff --git a/plugin/com/android/im/plugin/ImpsConfigNames.java b/plugin/com/android/im/plugin/ImpsConfigNames.java
deleted file mode 100644 (file)
index de64cd4..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.plugin;
-
-/**
- * Defines the configuration names for IMPS engine.
- */
-public interface ImpsConfigNames extends ImConfigNames {
-
-    /**
-     * The version of the protocol.
-     */
-    public static final String VERSION = "imps.version";
-
-    /**
-     * The data channel banding.
-     */
-    public static final String DATA_CHANNEL = "imps.data-channel";
-
-    /**
-     * The data channel encoding.
-     */
-    public static final String DATA_ENCODING = "imps.data-encoding";
-
-    /**
-     * The CIR channel banding.
-     */
-    public static final String CIR_CHANNEL = "imps.cir-channel";
-
-    /**
-     * The backup CIR channel used when the application is in background.
-     */
-    public static final String BACKUP_CIR_CHANNEL = "imps.backup-cir-channel";
-
-    /**
-     * The host of the IMPS server.
-     */
-    public static final String HOST = "imps.host";
-
-    /**
-     * The address for SMS binding.
-     */
-    public static final String SMS_ADDR = "imps.sms.addr";
-
-    /**
-     * The port number for SMS binding.
-     */
-    public static final String SMS_PORT = "imps.sms.port";
-
-    /**
-     * The address for the SMS CIR channel.
-     */
-    public static final String SMS_CIR_ADDR = "imps.sms.cir.addr";
-
-    /**
-     * The port number for SMS CIR channel.
-     */
-    public static final String SMS_CIR_PORT = "imps.sms.cir.port";
-
-    /**
-     * The client ID.
-     */
-    public static final String CLIENT_ID = "imps.client-id";
-
-    /**
-     * The MSISDN of the client.
-     */
-    public static final String MSISDN = "imps.msisdn";
-
-    /**
-     * Determines whether 4-way login is to be used.
-     */
-    public static final String SECURE_LOGIN = "imps.secure-login";
-
-    /**
-     * Determines whether to send authentication through sms or not.
-     */
-    public static final String SMS_AUTH = "imps.sms-auth";
-
-    /**
-     * Determines whether only the basic presence will be fetched from the server.
-     */
-    public static final String BASIC_PA_ONLY = "imps.basic-pa-only";
-
-    /**
-     * Determines whether to poll presence from the server or use subscribe/notify
-     * method.
-     */
-    public static final String POLL_PRESENCE = "imps.poll-presence";
-
-    /**
-     * The presence polling interval in milliseconds. Only valid when
-     * {@link #POLL_PRESENCE} is set to true.
-     */
-    public static final String PRESENCE_POLLING_INTERVAL = "imps.presence-polling-interval";
-
-    /**
-     * The full name of the custom presence mapping is to be used. If not set,
-     * the default one will be used.
-     */
-    public static final String CUSTOM_PRESENCE_MAPPING = "imps.custom-presence-mapping";
-
-    /**
-     * The full name of the custom password digest method is to be used. If not
-     * set, the default one will be used.
-     */
-    public static final String CUSTOM_PASSWORD_DIGEST = "imps.custom-password-digest";
-}
diff --git a/res/drawable/avatar_unknown.png b/res/drawable/avatar_unknown.png
deleted file mode 100644 (file)
index be55f41..0000000
Binary files a/res/drawable/avatar_unknown.png and /dev/null differ
diff --git a/res/drawable/background_textfield.9.png b/res/drawable/background_textfield.9.png
deleted file mode 100644 (file)
index 679e00f..0000000
Binary files a/res/drawable/background_textfield.9.png and /dev/null differ
diff --git a/res/drawable/chat_history_selector.xml b/res/drawable/chat_history_selector.xml
deleted file mode 100644 (file)
index c5d8f9c..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item
-        android:state_focused="true"
-        android:state_pressed="false"
-        android:drawable="@drawable/textfield_im_selected" />
-
-    <item
-        android:state_focused="true"
-        android:state_pressed="true"
-        android:drawable="@drawable/textfield_im_pressed" />
-</selector>
diff --git a/res/drawable/dashboard_background.xml b/res/drawable/dashboard_background.xml
deleted file mode 100644 (file)
index 037dab0..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <solid android:color="#a0000000" />
-    <corners android:radius="8dp" />
-    <stroke android:width="2dp" android:color="#ffffffff" />
-</shape>
diff --git a/res/drawable/dashboard_highlight.xml b/res/drawable/dashboard_highlight.xml
deleted file mode 100644 (file)
index 8c38c86..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item
-        android:state_selected="true"
-        android:drawable="@drawable/dashboard_highlight_selected" />
-</selector>
diff --git a/res/drawable/dashboard_highlight_selected.9.png b/res/drawable/dashboard_highlight_selected.9.png
deleted file mode 100644 (file)
index 473e059..0000000
Binary files a/res/drawable/dashboard_highlight_selected.9.png and /dev/null differ
diff --git a/res/drawable/group_chat.png b/res/drawable/group_chat.png
deleted file mode 100644 (file)
index c08d822..0000000
Binary files a/res/drawable/group_chat.png and /dev/null differ
diff --git a/res/drawable/group_chat_new.png b/res/drawable/group_chat_new.png
deleted file mode 100644 (file)
index 6490d77..0000000
Binary files a/res/drawable/group_chat_new.png and /dev/null differ
diff --git a/res/drawable/ic_im_block.png b/res/drawable/ic_im_block.png
deleted file mode 100644 (file)
index 36b3c03..0000000
Binary files a/res/drawable/ic_im_block.png and /dev/null differ
diff --git a/res/drawable/ic_im_message_not_sent.png b/res/drawable/ic_im_message_not_sent.png
deleted file mode 100644 (file)
index 477b575..0000000
Binary files a/res/drawable/ic_im_message_not_sent.png and /dev/null differ
diff --git a/res/drawable/ic_launcher_im.png b/res/drawable/ic_launcher_im.png
deleted file mode 100644 (file)
index afc35a2..0000000
Binary files a/res/drawable/ic_launcher_im.png and /dev/null differ
diff --git a/res/drawable/ic_menu_my_profile.png b/res/drawable/ic_menu_my_profile.png
deleted file mode 100644 (file)
index 6f9caf7..0000000
Binary files a/res/drawable/ic_menu_my_profile.png and /dev/null differ
diff --git a/res/drawable/ic_menu_view_profile.png b/res/drawable/ic_menu_view_profile.png
deleted file mode 100644 (file)
index afc18aa..0000000
Binary files a/res/drawable/ic_menu_view_profile.png and /dev/null differ
diff --git a/res/drawable/im_logo.png b/res/drawable/im_logo.png
deleted file mode 100644 (file)
index 3bd8ca0..0000000
Binary files a/res/drawable/im_logo.png and /dev/null differ
diff --git a/res/drawable/imlogo_s.png b/res/drawable/imlogo_s.png
deleted file mode 100644 (file)
index b7aa43a..0000000
Binary files a/res/drawable/imlogo_s.png and /dev/null differ
diff --git a/res/drawable/list_item_im_bubble.9.png b/res/drawable/list_item_im_bubble.9.png
deleted file mode 100644 (file)
index 0c539cf..0000000
Binary files a/res/drawable/list_item_im_bubble.9.png and /dev/null differ
diff --git a/res/drawable/picture_frame_background.9.png b/res/drawable/picture_frame_background.9.png
deleted file mode 100644 (file)
index 8ecddcd..0000000
Binary files a/res/drawable/picture_frame_background.9.png and /dev/null differ
diff --git a/res/drawable/shape_separator.xml b/res/drawable/shape_separator.xml
deleted file mode 100644 (file)
index ea40d55..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android" type="line">
-    <solid android:color="#80505050" />
-    <!--
-    <solid android:color="#00000000" />
-    <stroke android:width="1dip" android:color="#80505050"
-        android:dashWidth="4dip" android:dashGap="3dip"/>
-    -->
-    <size android:height="2dip" />
-</shape>
diff --git a/res/drawable/status_chat.png b/res/drawable/status_chat.png
deleted file mode 100644 (file)
index abfb6fa..0000000
Binary files a/res/drawable/status_chat.png and /dev/null differ
diff --git a/res/drawable/status_chat_new.png b/res/drawable/status_chat_new.png
deleted file mode 100644 (file)
index 564b38b..0000000
Binary files a/res/drawable/status_chat_new.png and /dev/null differ
diff --git a/res/drawable/text_divider_horizontal.9.png b/res/drawable/text_divider_horizontal.9.png
deleted file mode 100644 (file)
index 21b11a3..0000000
Binary files a/res/drawable/text_divider_horizontal.9.png and /dev/null differ
diff --git a/res/drawable/textfield_im_pressed.9.png b/res/drawable/textfield_im_pressed.9.png
deleted file mode 100644 (file)
index a768cb4..0000000
Binary files a/res/drawable/textfield_im_pressed.9.png and /dev/null differ
diff --git a/res/drawable/textfield_im_received.9.png b/res/drawable/textfield_im_received.9.png
deleted file mode 100644 (file)
index bde8fc3..0000000
Binary files a/res/drawable/textfield_im_received.9.png and /dev/null differ
diff --git a/res/drawable/textfield_im_selected.9.png b/res/drawable/textfield_im_selected.9.png
deleted file mode 100644 (file)
index ba958c8..0000000
Binary files a/res/drawable/textfield_im_selected.9.png and /dev/null differ
diff --git a/res/layout/account_activity.xml b/res/layout/account_activity.xml
deleted file mode 100644 (file)
index b911f3c..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical"
-    android:padding="10dip">
-
-    <TextView android:id= "@+id/label_username"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"/>
-
-    <EditText android:id="@+id/edtName"
-        android:completionThreshold="1"
-        android:selectAllOnFocus="true"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:inputType="text" />
-
-    <TextView android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="3dip"
-        android:text="@string/label_password" />
-
-    <EditText android:id="@+id/edtPass"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:selectAllOnFocus="true"
-        android:inputType="textPassword"/>
-
-    <LinearLayout android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal">
-        <LinearLayout android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="vertical">
-            <CheckBox android:id="@+id/rememberPassword"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:text="@string/remember_password" />
-
-            <CheckBox android:id="@+id/keepSignIn"
-                android:textSize="13sp"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:text="@string/keep_me_signed_in" />
-        </LinearLayout>
-
-        <LinearLayout android:layout_width="fill_parent"
-            android:layout_height="fill_parent"
-            android:layout_weight="1.0"
-            android:gravity="center_vertical|right"
-            android:orientation="horizontal">
-            <Button android:id="@+id/btnSignIn"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="3dip"
-                android:text="@string/sign_in" />
-        </LinearLayout>
-    </LinearLayout>
-
-    <TextView android:id="@+id/signUp"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:paddingLeft="4dip"
-        android:focusable="true"
-        android:focusableInTouchMode="true"
-        android:textAppearance="?android:attr/textAppearanceSmall" />
-</LinearLayout>
diff --git a/res/layout/add_contact_activity.xml b/res/layout/add_contact_activity.xml
deleted file mode 100644 (file)
index d7aa87c..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical">
-
-    <TextView android:id="@+id/input_contact_label"
-        android:layout_marginTop="10dip"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/input_contact_label" />
-
-    <MultiAutoCompleteTextView android:id="@+id/email"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content" />
-
-    <TextView android:id="@+id/choose_list_label"
-        android:layout_marginTop="10dip"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/choose_list_label" />
-
-    <Spinner android:id="@+id/choose_list"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:drawSelectorOnTop="true"
-        android:prompt="@string/choose_list_label" />
-
-    <TextView android:layout_marginTop="10dip"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:textSize="24sp"
-        android:text="@string/invite_instruction" />
-
-    <LinearLayout android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:gravity="right">
-
-         <Button android:id="@+id/invite"
-              android:layout_marginTop="20dip"
-              android:textSize="24sp"
-              android:layout_width="wrap_content"
-              android:layout_height="wrap_content"
-              android:text="@string/invite_label" />
-    </LinearLayout>
-</LinearLayout>
diff --git a/res/layout/blocked_contact_view.xml b/res/layout/blocked_contact_view.xml
deleted file mode 100644 (file)
index ce23a18..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<view xmlns:android="http://schemas.android.com/apk/res/android"
-    class="com.android.im.app.BlockedContactView"
-    android:orientation="horizontal"
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content"
-    android:minHeight="?android:attr/listPreferredItemHeight"
-    android:paddingLeft="9dip"
-    android:paddingRight="9dip">
-
-    <FrameLayout
-        android:layout_gravity="center_vertical"
-        android:layout_width="60dip"
-        android:layout_height="60dip">
-
-        <ImageView android:id="@+id/avatar"
-            android:layout_width="fill_parent"
-            android:layout_height="fill_parent"
-            android:padding="2dip"
-            android:scaleType="fitCenter" />
-
-        <!-- Draw the circle-slash over top of the user's avatar -->
-        <ImageView android:id="@+id/blocked"
-            android:src="@drawable/ic_im_block"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center" />
-    </FrameLayout>
-
-    <LinearLayout
-        android:orientation="vertical"
-        android:paddingLeft="9dip"
-        android:layout_gravity="center_vertical"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content">
-
-        <TextView android:id="@+id/line1"
-            android:maxLines="1"
-            android:layout_width="fill_parent"
-            android:layout_weight="1"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceLarge" />
-
-        <TextView android:id="@+id/line2"
-            android:maxLines="1"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceMedium" />
-
-    </LinearLayout>
-
-</view>
diff --git a/res/layout/blocked_contacts_activity.xml b/res/layout/blocked_contacts_activity.xml
deleted file mode 100644 (file)
index 8acb900..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical">
-
-        <TextView android:id="@android:id/empty"
-            android:textAppearance="?android:attr/textAppearanceSmall"
-            android:textStyle="bold"
-            android:gravity="center_vertical|center_horizontal"
-            android:layout_width="fill_parent"
-            android:layout_height="fill_parent"
-            android:focusable="false"
-            android:text="@string/no_blocked_contact" />
-
-        <ListView android:id="@android:id/list"
-            android:layout_width="fill_parent"
-            android:layout_height="fill_parent" />
-
-</LinearLayout>
diff --git a/res/layout/chat_view.xml b/res/layout/chat_view.xml
deleted file mode 100644 (file)
index 3a4363d..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<com.android.im.app.ChatView
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/chatView"
-    android:orientation="vertical"
-    android:background="#ffffffff"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent">
-
-    <!-- The title bar -->
-    <LinearLayout style="?android:attr/windowTitleBackgroundStyle"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center_vertical"
-        android:orientation="horizontal">
-
-        <ImageView android:id="@+id/statusIcon"
-            android:layout_marginRight="3dip"
-            android:layout_width="16dip"
-            android:layout_height="16dip"
-            android:scaleType="fitCenter" />
-
-        <TextView android:id="@+id/title"
-            style="?android:attr/windowTitleStyle"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:background="@null"
-            android:fadingEdge="horizontal"
-            android:scrollHorizontally="true"
-            android:layout_marginRight="20dip" />
-    </LinearLayout>
-
-    <View android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="#ff202020" />
-
-    <ListView android:id="@+id/history"
-        android:cacheColorHint="#00000000"
-        android:layout_width="fill_parent"
-        android:layout_height="0dip"
-        android:layout_weight="1"
-        android:drawSelectorOnTop="true"
-        android:listSelector="@drawable/chat_history_selector"
-        android:stackFromBottom="true"
-        android:transcriptMode="normal"
-        android:scrollbarAlwaysDrawVerticalTrack="true" />
-
-    <LinearLayout android:id="@+id/invitationPanel"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:layout_gravity="bottom"
-        android:orientation="vertical"
-        android:visibility="gone"
-        android:background="@drawable/text_divider_horizontal">
-
-        <TextView android:id="@+id/txtInvitation"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:textColor="#ffad45d6"
-            android:text="@string/invitation_prompt" />
-
-        <LinearLayout android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal">
-
-            <Button android:id="@+id/btnAccept"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/accept_invitation" />
-
-            <Button android:id="@+id/btnDecline"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:paddingLeft="10dip"
-                android:text="@string/decline_invitation" />
-        </LinearLayout>
-    </LinearLayout>
-
-    <LinearLayout android:id="@+id/subscription"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:layout_gravity="bottom"
-        android:orientation="vertical"
-        android:visibility="gone"
-        android:background="@drawable/text_divider_horizontal">
-
-        <TextView android:id="@+id/txtSubscription"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:textColor="#ffad45d6"
-            android:text="@string/subscription_prompt" />
-
-        <LinearLayout android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal">
-
-            <Button android:id="@+id/btnApproveSubscription"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/approve_subscription" />
-
-            <Button android:id="@+id/btnDeclineSubscription"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:paddingLeft="10dip"
-                android:text="@string/decline_subscription" />
-        </LinearLayout>
-    </LinearLayout>
-
-    <LinearLayout android:id="@+id/warning"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:layout_gravity="bottom"
-        android:orientation="horizontal"
-        android:background="#ffffffff"
-        android:visibility="gone">
-
-        <ImageView android:id="@+id/warningIcon"
-            android:layout_width="wrap_content"
-            android:layout_height="fill_parent"
-            android:src="@drawable/ic_im_message_not_sent" />
-
-        <TextView android:id="@+id/warningText"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:paddingLeft="5dip"
-            android:textColor="#ffff0000"
-            android:text="@string/disconnected_warning" />
-
-    </LinearLayout>
-
-    <LinearLayout android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:baselineAligned="false"
-        android:orientation="horizontal"
-        android:background="@drawable/background_textfield">
-
-        <EditText android:id="@+id/edtInput"
-            android:layout_width="0dip"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine|textImeMultiLine"
-            android:maxLines="4"
-            android:maxLength="2000"
-            android:hint="@string/compose_hint"/>
-
-        <Button android:id="@+id/btnSend"
-            android:layout_width="wrap_content"
-            android:layout_height="fill_parent"
-            android:text="@string/send" />
-    </LinearLayout>
-</com.android.im.app.ChatView>
diff --git a/res/layout/contact_list_filter_view.xml b/res/layout/contact_list_filter_view.xml
deleted file mode 100644 (file)
index f160196..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<com.android.im.app.ContactListFilterView
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:id="@+id/contactFilterView"
-    android:orientation="vertical">
-
-    <ListView android:id="@+id/filteredList"
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent" />
-
-</com.android.im.app.ContactListFilterView>
diff --git a/res/layout/contact_list_view.xml b/res/layout/contact_list_view.xml
deleted file mode 100644 (file)
index 0bc4018..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<com.android.im.app.ContactListView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:id="@+id/contactListView"
-    android:orientation="vertical">
-
-    <com.android.im.app.UserPresenceView
-        android:id="@+id/userPresence"
-        android:orientation="horizontal"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:paddingLeft="9dip"
-        android:paddingTop="5dip"
-        android:paddingRight="5dip"
-        android:paddingBottom="5dip"            
-        android:layout_centerVertical="true"
-        android:background="#ffff">
-
-        <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="fill_parent"
-            android:layout_gravity="center_vertical">
-
-           <ImageButton android:id="@+id/statusDropDownButton"
-               android:paddingTop="2dip"
-                android:layout_marginRight="4dip"
-                android:paddingBottom="2dip"
-                android:scaleType="fitCenter"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_vertical"/>
-
-        </LinearLayout>
-
-        <EditText android:id="@+id/statusEdit"
-            android:inputType="textCapSentences|textAutoCorrect"
-            android:selectAllOnFocus="true"
-            android:layout_gravity="center_vertical"
-            android:layout_weight="1"
-            android:layout_width="0dip"
-            android:layout_height="wrap_content"/>
-
-    </com.android.im.app.UserPresenceView>
-
-    <ExpandableListView android:id="@+id/contactsList"
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent" />
-
-</com.android.im.app.ContactListView>
diff --git a/res/layout/contact_presence_activity.xml b/res/layout/contact_presence_activity.xml
deleted file mode 100644 (file)
index 5cccba6..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content" >
-
-    <LinearLayout
-        android:paddingLeft="15dip"
-        android:paddingTop="15dip"
-        android:paddingRight="15dip"
-        android:paddingBottom="15dip"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:orientation="vertical" >
-
-        <ImageView android:id="@+id/imgAvatar"
-            android:layout_width="60dip"
-            android:layout_height="60dip"
-            android:padding="2dip"
-            android:background="@drawable/picture_frame_background" />
-
-        <TextView android:id="@+id/labelName"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="12dip"
-            android:textStyle="bold"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            android:text="@string/label_username" />
-
-        <TextView android:id="@+id/txtName"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"/>
-
-        <TextView android:id="@+id/labelStatus"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="8dip"
-            android:textStyle="bold"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            android:text="@string/label_status" />
-
-        <TextView android:id="@+id/txtStatus"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content" />
-
-        <TextView android:id="@+id/txtStatusText"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginRight="8dip"
-            android:layout_marginTop="4dip"
-            android:textAppearance="?android:attr/textAppearanceSmall"
-            android:maxLines="4"
-            android:textStyle="italic" />
-
-        <TextView android:id="@+id/labelClientType"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="8dip"                
-            android:textStyle="bold"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            android:text="@string/label_client_type" />
-
-        <TextView android:id="@+id/txtClientType"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content" />
-
-    </LinearLayout>
-
-</ScrollView>
diff --git a/res/layout/contact_view.xml b/res/layout/contact_view.xml
deleted file mode 100644 (file)
index daad1ca..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<view xmlns:android="http://schemas.android.com/apk/res/android"
-    class="com.android.im.app.ContactView"
-    android:orientation="horizontal"
-    android:layout_width="fill_parent"
-    android:layout_height="?android:attr/listPreferredItemHeight"
-    android:paddingTop="2dip"
-    android:paddingBottom="2dip"
-    android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
-    android:paddingRight="9dip">
-
-    <LinearLayout android:id="@+id/contactInfo"
-        android:orientation="vertical"
-        android:paddingLeft="6dip"
-        android:layout_width="fill_parent"
-        android:layout_gravity="center_vertical"
-        android:layout_height="wrap_content">
-
-        <LinearLayout android:orientation="horizontal"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content">
-
-            <TextView android:id="@+id/line1"
-                android:maxLines="1"
-                android:layout_width="0dip"
-                android:layout_weight="1"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceLarge" />
-
-            <TextView android:id="@+id/timestamp"
-                android:singleLine="true"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:visibility="gone"
-                android:textAppearance="?android:attr/textAppearanceSmall"/>
-        </LinearLayout>
-
-        <LinearLayout
-            android:orientation="horizontal"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content">
-            <!--
-            <ImageView
-                android:id="@+id/presence"
-                android:layout_width="18dip"
-                android:layout_height="18dip" />
-            -->
-            
-            <com.android.im.app.Ticker
-               android:layout_width="fill_parent"
-               android:layout_height="wrap_content"
-               android:layout_marginLeft="4dip">
-
-               <TextView android:id="@+id/line2"
-                   android:maxLines="1"
-                   android:layout_width="wrap_content"
-                   android:layout_height="wrap_content"
-                   android:textAppearance="?android:attr/textAppearanceSmall"/>
-           </com.android.im.app.Ticker>
-        </LinearLayout>
-
-    </LinearLayout>
-
-</view>
diff --git a/res/layout/contacts_picker_activity.xml b/res/layout/contacts_picker_activity.xml
deleted file mode 100644 (file)
index d47047c..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent" >
-
-    <EditText android:id="@+id/filter"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:hint="@string/contact_filter_hint"/>
-    <RelativeLayout
-        android:layout_weight="1"
-        android:layout_width="fill_parent"
-        android:layout_height="0dip">
-        <ListView android:id="@android:id/list"
-            android:layout_width="fill_parent"
-            android:layout_height="fill_parent"/>
-
-        <TextView android:id="@android:id/empty"
-            android:layout_width="fill_parent"
-            android:layout_height="fill_parent"
-            android:textAppearance="?android:attr/textAppearanceSmall"
-            android:gravity="top|center_horizontal"
-            android:focusable="false"
-            android:visibility="gone"
-            android:text="@string/empty_contact_list" />
-    </RelativeLayout>
-</LinearLayout>
diff --git a/res/layout/dashboard.xml b/res/layout/dashboard.xml
deleted file mode 100644 (file)
index 8ae23cc..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<com.android.im.app.Dashboard xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content"
-    android:orientation="vertical"
-    android:background="@drawable/dashboard_background" >
-
-    <Gallery android:id="@+id/chats_gallery"
-        android:spacing="15dip"
-        android:layout_marginTop="15dip"
-        android:layout_marginBottom="15dip"
-        android:layout_width="fill_parent"
-        android:layout_height="140dip" />
-        
-    <TextView android:id="@+id/empty"
-        android:paddingTop="15dip"
-        android:gravity="center"
-        android:layout_gravity="center"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/empty_chat_list" />
-
-</com.android.im.app.Dashboard>
diff --git a/res/layout/dashboard_item.xml b/res/layout/dashboard_item.xml
deleted file mode 100644 (file)
index 3425d54..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:background="@drawable/dashboard_highlight"
-    android:paddingTop="3dip"
-    android:paddingBottom="3dip"
-    android:layout_marginLeft="5dip"
-    android:layout_marginRight="5dip"
-    android:layout_marginTop="15dip"
-    android:layout_width="108dip"
-    android:layout_height="wrap_content">
-
-    <RelativeLayout
-        android:layout_gravity="center_horizontal"
-        android:layout_width="70dip"
-        android:layout_height="65dip">
-
-        <ImageView android:id="@+id/avatar"
-            android:background="#ffffffff"
-            android:scaleType="centerCrop"
-            android:padding="2dip"
-            android:layout_width="60dip"
-            android:layout_height="60dip"
-            android:layout_centerInParent="true"
-            />
-
-        <ImageView android:id="@+id/presence"
-            android:scaleType="fitXY"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentRight="true"
-            android:layout_alignParentTop="true" />
-    </RelativeLayout>
-
-    <TextView android:id="@+id/name"
-        android:textColor="?android:attr/textColorPrimaryNoDisable"
-        android:gravity="center"
-        android:layout_gravity="center_horizontal"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-    <TextView android:id="@+id/shortcut"
-        android:textColor="?android:attr/textColorPrimaryNoDisable"
-        android:gravity="center"
-        android:layout_gravity="center_horizontal"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</LinearLayout>
diff --git a/res/layout/empty_contact_group_view.xml b/res/layout/empty_contact_group_view.xml
deleted file mode 100644 (file)
index c8dafda..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="wrap_content"
-        android:layout_height="?android:attr/listPreferredItemHeight"
-        android:text="@string/empty_contact_group"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:textStyle="normal"
-        android:gravity="center_vertical"
-        android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"/>
diff --git a/res/layout/empty_conversation_group_view.xml b/res/layout/empty_conversation_group_view.xml
deleted file mode 100644 (file)
index 3901031..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="wrap_content"
-        android:layout_height="?android:attr/listPreferredItemHeight"
-        android:text="@string/empty_conversation_group"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:textStyle="normal"
-        android:gravity="center_vertical"
-        android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"/>
diff --git a/res/layout/group_view.xml b/res/layout/group_view.xml
deleted file mode 100644 (file)
index 2ab2e12..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="horizontal"
-    android:layout_width="fill_parent"
-    android:layout_height="?android:attr/listPreferredItemHeight"
-    android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft">
-
-    <TextView android:id="@+id/text1"
-        android:maxLines="1"
-        android:layout_width="0dip"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center_vertical"
-        android:layout_weight="1"
-        android:textAppearance="?android:attr/textAppearanceLarge" />
-
-    <TextView android:id="@+id/text2"
-        android:maxLines="1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center_vertical"
-        android:paddingRight="4dip"
-        android:textAppearance="?android:attr/textAppearanceSmall"/>
-
-</LinearLayout>
diff --git a/res/layout/imglist_item.xml b/res/layout/imglist_item.xml
deleted file mode 100644 (file)
index a210dd9..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="horizontal"
-    android:layout_width="fill_parent"
-    android:layout_height="?android:attr/listPreferredItemHeight"
-    android:gravity="center_vertical" >
-
-    <ImageView android:id="@+id/separator"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:paddingTop="3dip"
-        android:paddingBottom="3dip"
-        android:visibility="gone"
-        android:src="@drawable/shape_separator" />
-
-    <ImageView android:id="@+id/image"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:paddingLeft="4dip"
-        android:paddingRight="4dip" />
-
-    <TextView android:id="@+id/text"
-        android:textColor="@color/status_popup_text"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textAppearance="?android:attr/textAppearanceLarge"
-        android:singleLine="true" />
-
-</LinearLayout>
diff --git a/res/layout/new_message_item.xml b/res/layout/new_message_item.xml
deleted file mode 100644 (file)
index a662630..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<view xmlns:android="http://schemas.android.com/apk/res/android"
-    class="com.android.im.app.MessageView"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content" >
-
-    <TextView android:id="@+id/message"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content" />
-
-</view>
diff --git a/res/layout/preference_activity.xml b/res/layout/preference_activity.xml
deleted file mode 100644 (file)
index d8b6c06..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content" >
-
-    <RelativeLayout
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content" >
-
-        <TextView android:id="@+id/tvDataChannel"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/data_channel_label"
-            android:textStyle="bold" />
-
-        <RadioGroup android:id="@+id/rgDataChannel"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="10dip"
-            android:layout_below="@id/tvDataChannel"
-            android:checkedButton="@+id/HTTP" >
-
-            <RadioButton android:id="@+id/DATA_HTTP"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:text="@string/http" />
-
-            <RadioButton android:id="@+id/DATA_SMS"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:focusable="false"
-                android:text="@string/sms" />
-
-        </RadioGroup>
-
-       <TextView android:id="@+id/tvDataEncoding"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_below="@+id/rgDataChannel"
-            android:text="@string/data_encoding_label"
-            android:textStyle="bold" />
-
-        <RadioGroup android:id="@+id/rgDataEncoding"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="10dip"
-            android:layout_below="@id/tvDataEncoding"
-            android:checkedButton="@+id/ENC_WBXML" >
-
-            <RadioButton android:id="@+id/ENC_XML"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:text="@string/xml" />
-
-            <RadioButton android:id="@+id/ENC_WBXML"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:text="@string/wbxml" />
-
-            <RadioButton android:id="@+id/ENC_SMS"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:focusable="false"
-                android:text="@string/sms" />
-
-        </RadioGroup>
-
-        <TextView android:id="@+id/tvCirChannel"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_below="@+id/rgDataEncoding"
-            android:text="@string/cir_channel_label"
-            android:textStyle="bold" />
-
-        <RadioGroup android:id="@+id/rgCirChannel"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="10dip"
-            android:layout_below="@id/tvCirChannel"
-            android:layout_marginBottom="3dip"
-            android:checkedButton="@+id/STCP" >
-
-            <RadioButton android:id="@+id/CIR_STCP"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:text="@string/tcp" />
-
-            <RadioButton android:id="@+id/CIR_SHTTP"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:text="@string/http" />
-
-            <RadioButton android:id="@+id/CIR_SSMS"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:textColor="?android:attr/textColorTertiary"
-                android:focusable="false"
-                android:text="@string/sms" />
-
-        </RadioGroup>
-
-        <LinearLayout android:id="@+id/host"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            android:layout_below="@+id/rgCirChannel"
-            android:layout_marginBottom="3dip" >
-
-            <TextView android:id="@+id/tvHost"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginRight="2dip"
-                android:text="@string/host_label"
-                android:textStyle="bold" />
-
-            <EditText android:id="@+id/etHost"
-                android:autoText="false"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:singleLine="true"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:scrollHorizontally="true" />
-
-        </LinearLayout>
-
-        <LinearLayout android:id="@+id/msisdn"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            android:layout_below="@+id/host"
-            android:layout_marginBottom="3dip" >
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginRight="2dip"
-                android:text="@string/msisdn_label"
-                android:textStyle="bold" />
-
-            <EditText android:id="@+id/etMsisdn"
-                android:autoText="false"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:singleLine="true"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:scrollHorizontally="true" />
-
-        </LinearLayout>
-
-        <Button android:id="@+id/btnSave"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_below="@id/msisdn"
-            android:layout_alignParentRight="true"
-            android:text="@string/save" />
-
-    </RelativeLayout>
-</ScrollView>
diff --git a/res/layout/signing_in_activity.xml b/res/layout/signing_in_activity.xml
deleted file mode 100644 (file)
index add1e64..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:gravity="center_vertical">
-
-    <ImageView android:id="@+id/splashscr"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:scaleType="fitCenter"/>
-
-    <LinearLayout
-        android:orientation="horizontal"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:paddingTop="10dip"
-        android:gravity="center_horizontal">
-
-        <ProgressBar android:layout_width="20dip"
-            android:layout_height="20dip"
-            android:indeterminate="true" />
-
-        <TextView android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:paddingLeft="10dip"
-            android:gravity="center_vertical"
-            android:text="@string/signing_in_wait" />
-
-    </LinearLayout>
-
-</LinearLayout>
diff --git a/res/layout/simple_input_activity.xml b/res/layout/simple_input_activity.xml
deleted file mode 100644 (file)
index 80a5a77..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content"
-    android:orientation="vertical">
-
-    <TextView android:id="@+id/prompt"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content" />
-
-    <EditText android:id="@+id/edit"
-        android:autoText="false"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:singleLine="true" />
-
-    <LinearLayout
-        android:orientation="horizontal"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="6dip"
-        android:layout_gravity="right" >
-
-        <Button android:id="@+id/btnOk"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/ok" />
-
-        <Button android:id="@+id/btnCancel"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/cancel" />
-
-    </LinearLayout>
-
-</LinearLayout>
diff --git a/res/layout/smiley_menu_item.xml b/res/layout/smiley_menu_item.xml
deleted file mode 100644 (file)
index 61d76e0..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="horizontal"
-    android:layout_width="fill_parent"
-    android:layout_height="?android:attr/listPreferredItemHeight">
-
-    <ImageView android:id="@+id/smiley_icon"
-        android:layout_gravity="center_vertical"
-        android:layout_marginLeft="4dip"
-        android:layout_width="20dip"
-        android:layout_height="20dip" />
-
-    <TextView android:id="@+id/smiley_name"
-        android:singleLine="true"
-        android:textAppearance="?android:attr/textAppearanceLarge"
-        android:textColor="?android:attr/textColorPrimaryInverse"
-        android:layout_marginLeft="10dip"
-        android:layout_gravity="center_vertical"
-        android:layout_weight="1"
-        android:layout_width="0dip"
-        android:layout_height="wrap_content" />
-
-    <TextView android:id="@+id/smiley_text"
-        android:singleLine="true"
-        android:textAppearance="?android:attr/textAppearanceLarge"
-        android:textColor="?android:attr/textColorPrimaryInverse"
-        android:layout_marginRight="20dip"
-        android:layout_gravity="center_vertical"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</LinearLayout>
diff --git a/res/menu/chat_screen_menu.xml b/res/menu/chat_screen_menu.xml
deleted file mode 100644 (file)
index 74714d4..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <item android:id="@+id/menu_view_friend_list"
-        android:title="@string/menu_view_contact_list"
-        android:icon="@*android:drawable/ic_menu_cc" />
-
-    <item android:id="@+id/menu_switch_chats"
-        android:title="@string/menu_switch_chats"
-        android:alphabeticShortcut=" "
-        android:icon="@*android:drawable/ic_menu_chat_dashboard" />
-
-    <item android:id="@+id/menu_insert_smiley"
-        android:title="@string/menu_insert_smiley"
-        android:icon="@*android:drawable/ic_menu_emoticons" />
-
-    <item android:id="@+id/menu_end_conversation"
-        android:title="@string/menu_end_conversation"
-        android:icon="@*android:drawable/ic_menu_end_conversation" />
-
-    <item android:id="@+id/menu_block_contact"
-        android:title="@string/menu_block_contact"
-        android:icon="@*android:drawable/ic_menu_block" />
-
-    <item android:id="@+id/menu_invite_contact"
-        android:title="@string/menu_invite_contact"
-        android:icon="@*android:drawable/ic_menu_invite" />
-
-    <item android:id="@+id/menu_view_profile"
-        android:title="@string/menu_view_profile"
-        android:icon="@drawable/ic_menu_view_profile"/>
-
-    <item
-        android:id="@+id/menu_prev_chat"
-        android:alphabeticShortcut="j"
-        android:visible="false"
-        android:enabled="true" />
-
-    <item
-        android:id="@+id/menu_next_chat"
-        android:alphabeticShortcut="k"
-        android:visible="false"
-        android:enabled="true" />
-
-    <item
-        android:id="@+id/menu_quick_switch_0"
-        android:alphabeticShortcut="0"
-        android:visible="false"
-        android:enabled="true" />
-
-    <item
-        android:id="@+id/menu_quick_switch_1"
-        android:alphabeticShortcut="1"
-        android:visible="false"
-        android:enabled="true" />
-
-    <item
-        android:id="@+id/menu_quick_switch_2"
-        android:alphabeticShortcut="2"
-        android:visible="false"
-        android:enabled="true" />
-
-    <item
-        android:id="@+id/menu_quick_switch_3"
-        android:alphabeticShortcut="3"
-        android:visible="false"
-        android:enabled="true" />
-
-    <item
-        android:id="@+id/menu_quick_switch_4"
-        android:alphabeticShortcut="4"
-        android:visible="false"
-        android:enabled="true" />
-
-    <item
-        android:id="@+id/menu_quick_switch_5"
-        android:alphabeticShortcut="5"
-        android:visible="false"
-        android:enabled="true" />
-
-    <item
-        android:id="@+id/menu_quick_switch_6"
-        android:alphabeticShortcut="6"
-        android:visible="false"
-        android:enabled="true" />
-
-    <item
-        android:id="@+id/menu_quick_switch_7"
-        android:alphabeticShortcut="7"
-        android:visible="false"
-        android:enabled="true" />
-
-    <item
-        android:id="@+id/menu_quick_switch_8"
-        android:alphabeticShortcut="8"
-        android:visible="false"
-        android:enabled="true" />
-
-    <item
-        android:id="@+id/menu_quick_switch_9"
-        android:alphabeticShortcut="9"
-        android:visible="false"
-        android:enabled="true" />
-
-</menu>
diff --git a/res/menu/contact_list_menu.xml b/res/menu/contact_list_menu.xml
deleted file mode 100644 (file)
index cf15b4a..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <item android:id="@+id/menu_invite_user"
-        android:title="@string/menu_add_contact"
-        android:icon="@*android:drawable/ic_menu_invite" />
-
-    <item android:id="@+id/menu_blocked_contacts"
-        android:title="@string/menu_view_blocked"
-        android:icon="@*android:drawable/ic_menu_blocked_user" />
-
-    <item android:id="@+id/menu_view_accounts"
-        android:title="@string/menu_view_accounts"
-        android:icon="@*android:drawable/ic_menu_account_list" />
-
-    <item android:id="@+id/menu_settings"
-        android:title="@string/menu_settings"
-        android:icon="@android:drawable/ic_menu_preferences" />
-
-    <item android:id="@+id/menu_sign_out"
-        android:title="@string/menu_sign_out"
-        android:icon="@android:drawable/ic_menu_close_clear_cancel" />
-</menu>
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
deleted file mode 100644 (file)
index 93b52df..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="im_label">"Chat"</string>
-    <string name="menu_cancel_signin">"Zrušit přihlašování"</string>
-    <string name="menu_add_contact">"Přidat kontakt"</string>
-    <string name="menu_remove_contact">"Smazat kontakt"</string>
-    <string name="menu_block_contact">"Blokovat kontakt"</string>
-    <string name="menu_view_blocked">"Blokovaní uživatelé"</string>
-    <string name="menu_view_accounts">"Seznam účtů"</string>
-    <string name="menu_settings">"Nastavení"</string>
-    <string name="menu_start_chat">"Začít chat"</string>
-    <string name="menu_sign_out">"Odhlásit se"</string>
-    <string name="menu_view_profile">"Zobrazit profil"</string>
-    <string name="menu_end_conversation">"Ukončit chat"</string>
-    <string name="menu_view_contact_list">"Seznam kontaktů"</string>
-    <string name="menu_invite_contact">"Pozvat..."</string>
-    <string name="menu_switch_chats">"Přepnout chat"</string>
-    <string name="menu_insert_smiley">"Vložit smajlík"</string>
-    <string name="menu_plus">"Menu+"</string>
-    <string name="default_input_title">"Vstup"</string>
-    <string name="confirm">"Potvrdit"</string>
-    <string name="confirm_delete_contact">"Kontakt <xliff:g id="USER">%1$s</xliff:g> bude smazán."</string>
-    <string name="confirm_block_contact">"Kontakt <xliff:g id="USER">%1$s</xliff:g> bude blokován."</string>
-    <string name="confirm_unblock_contact">"Kontakt <xliff:g id="USER">%1$s</xliff:g> bude odblokován."</string>
-    <string name="ok">"OK"</string>
-    <string name="cancel">"Zrušit"</string>
-    <string name="yes">"OK"</string>
-    <string name="no">"Zrušit"</string>
-    <string name="signed_out_prompt">"Byli jste odhlášeni ze služby <xliff:g id="ACCOUNT">%1$s</xliff:g>."</string>
-    <string name="signed_out_prompt_with_error">"Byli jste odhlášeni ze služby <xliff:g id="ACCOUNT">%1$s</xliff:g>, protože došlo k chybě <xliff:g id="REASON">%2$s</xliff:g>."</string>
-    <string name="add_account">"Přidat účet <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="label_username">"Uživatelské jméno:"</string>
-    <string name="label_password">"Heslo:"</string>
-    <string name="remember_password">"Zapamatovat heslo."</string>
-    <string name="keep_me_signed_in">"Přihlašovat automaticky."</string>
-    <string name="sign_up">"Nemáte účet?"</string>
-    <string name="check_auto_sign_in">"Pokud povolíte tuto možnost, budete automaticky přihlášeni pokaždé, když spustíte tuto aplikaci. Chcete-li tuto možnost zakázat, odhlaste se a zrušte zaškrtnutí políčka Přihlašovat automaticky."</string>
-    <string name="sign_in">"Přihlásit se"</string>
-    <string name="signing_in_to">"Přihlašování k účtu <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="signing_in_wait">"Přihlašování..."</string>
-    <!-- no translation found for bg_data_prompt_title (4861800723853178111) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_message (2343305645142823544) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_ok (3443385427882751532) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_cancel (7206105589826174638) -->
-    <skip />
-    <string name="ongoing_conversation">"Probíhající chaty: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
-    <string name="online_count">"Kontakty online: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
-    <string name="subscriptions">"Nabídky přátelství"</string>
-    <string name="unknown_contact">"("<i>"Neznámý uživatel"</i>")"</string>
-    <string name="empty_contact_group">"Žádné kontakty"</string>
-    <string name="empty_conversation_group">"Skupina je prázdná"</string>
-    <string name="contacts_picker_title">"Vyberte kontakty, které chcete pozvat"</string>
-    <string name="contact_filter_hint">"Zadejte hledaný kontakt"</string>
-    <string name="empty_contact_list">"Nebyly nalezeny žádné kontakty."</string>
-    <string name="blocked_list_title">"Blokované kontakty – <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="no_blocked_contact">"Žádné kontakty nejsou blokovány."</string>
-    <string name="contact_profile_title">"Profil kontaktu"</string>
-    <string name="label_status">"Stav:"</string>
-    <string name="label_client_type">"Typ klienta:"</string>
-    <string name="client_type_computer">"počítač"</string>
-    <string name="client_type_mobile">"Mobil"</string>
-    <string name="presence_available">"Online"</string>
-    <string name="presence_busy">"Zaneprázdněn"</string>
-    <string name="presence_away">"Pryč"</string>
-    <string name="presence_idle">"Nečinný"</string>
-    <string name="presence_offline">"Offline"</string>
-    <string name="presence_invisible">"Zobrazit jako offline"</string>
-    <string name="preference_title">"<xliff:g id="PROVIDER">%1$s</xliff:g> settings (dev only)"</string>
-    <string name="data_channel_label">"Datový kanál"</string>
-    <string name="data_encoding_label">"Kódování dat"</string>
-    <string name="cir_channel_label">"Kanál CIR"</string>
-    <string name="host_label">"Hostitel"</string>
-    <string name="msisdn_label">"MSISDN"</string>
-    <string name="http">"HTTP"</string>
-    <string name="sms">"SMS"</string>
-    <string name="tcp">"TCP"</string>
-    <string name="xml">"XML"</string>
-    <string name="wbxml">"WBXML"</string>
-    <string name="save">"Uložit"</string>
-    <string name="chat_with">"Chat s uživatelem <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="me">"Já"</string>
-    <string name="compose_hint">"Sem zadejte zprávu"</string>
-    <string name="contact_online">"uživatel <xliff:g id="USER">%1$s</xliff:g> je online"</string>
-    <string name="contact_away">"uživatel <xliff:g id="USER">%1$s</xliff:g> je pryč"</string>
-    <string name="contact_busy">"<xliff:g id="USER">%1$s</xliff:g> je zaneprázdněn"</string>
-    <string name="contact_offline">"uživatel <xliff:g id="USER">%1$s</xliff:g> je offline"</string>
-    <string name="contact_joined">"Uživatel <xliff:g id="USER">%1$s</xliff:g> se připojil"</string>
-    <string name="contact_left">"uživatel <xliff:g id="USER">%1$s</xliff:g> odešel"</string>
-    <string name="time_stamp" format="date">"'Odesláno v '<xliff:g id="HOUR">hh</xliff:g>':'<xliff:g id="MINUTE">mm</xliff:g>' '<xliff:g id="AMPM">a</xliff:g>' dne '<xliff:g id="DATE">EEEE</xliff:g>"</string>
-    <string name="send">"Odeslat"</string>
-    <string name="msg_sent_failed">"Zprávu nelze odeslat."</string>
-    <string name="disconnected_warning">"Spojení se serverem bylo ztraceno. Zpráva bude odeslána, jakmile se jej podaří obnovit."</string>
-    <string name="contact_offline_warning">"<xliff:g id="USER_0">%1$s</xliff:g> je offline. Odeslané zprávy budou doručeny, jakmile se <xliff:g id="USER_1">%1$s</xliff:g> přihlásí online."</string>
-    <string name="contact_not_in_list_warning">"<xliff:g id="USER">%1$s</xliff:g> není ve vašem seznamu kontaktů."</string>
-    <string name="select_link_title">"Zvolit odkaz"</string>
-    <string name="empty_chat_list">"Neprobíhá žádný chat."</string>
-    <string name="add_contact_title">"Přidat kontakt"</string>
-    <string name="input_contact_label">"E-mailová adresa osoby, kterou chcete pozvat:"</string>
-    <string name="choose_list_label">"Zvolte seznam:"</string>
-    <string name="invite_instruction">"Zadejte jméno uživatele, kterého chcete přidat z Kontaktů."</string>
-    <string name="invite_label">"Odeslat pozvánku"</string>
-    <string name="setting_title">"Obecné nastavení"</string>
-    <string name="hide_offline_contacts">"Skrýt kontakty offline"</string>
-    <string name="notification_group_title">"Nastavení oznámení"</string>
-    <string name="notification_enabled_title">"Oznamování chatových zpráv"</string>
-    <string name="notification_enabled_summary">"Příchod chatové zprávy oznamovat na stavovém panelu."</string>
-    <string name="notification_vibrate_title">"Vibrace"</string>
-    <string name="notification_vibrate_summary">"Oznámit příchozí chatovou zprávu také vibracemi"</string>
-    <string name="notification_sound_title">"Zvuk"</string>
-    <string name="notification_sound_summary">"Oznámit příchozí chatovou zprávu také vyzváněním"</string>
-    <string name="notification_ringtone_title">"Vybrat vyzváněcí tón"</string>
-    <string name="invitation_prompt">"Uživatel <xliff:g id="USER">%1$s</xliff:g> vás pozval k hromadnému chatu."</string>
-    <string name="invitation_sent_prompt">"Uživateli <xliff:g id="USER">%1$s</xliff:g> byla zaslána pozvánka."</string>
-    <string name="accept_invitation">"Přijmout"</string>
-    <string name="decline_invitation">"Odmítnout"</string>
-    <string name="subscription_prompt">"<xliff:g id="USER">%1$s</xliff:g> si vás chce přidat do svého seznamu kontaktů."</string>
-    <string name="approve_subscription">"Přijmout"</string>
-    <string name="decline_subscription">"Odmítnout"</string>
-    <string name="approve_subscription_error">"Přihlášení k odběru uživatele <xliff:g id="USER">%1$s</xliff:g> se nepodařilo schválit. Zkuste to prosím znovu později."</string>
-    <string name="decline_subscription_error">"Odmítnutí odběru uživatele <xliff:g id="USER">%1$s</xliff:g> se nezdařilo. Zkuste to prosím znovu později."</string>
-    <string name="newMessages_label">"Nové zprávy od poskytovatele <xliff:g id="PROVIDER">%1$s</xliff:g>"</string>
-    <string name="num_unread_chats">"Nové zprávy: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
-    <string name="subscription_notify_text">"Nová nabídka přátelství od uživatele <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="notify_groupchat_label">"Pozvánka k hromadnému chatu"</string>
-    <string name="group_chat_invite_notify_text">"Nová pozvánka k hromadnému chatu od uživatele <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="add_contact_success">"Kontakt <xliff:g id="USER">%1$s</xliff:g> byl přidán."</string>
-    <string name="delete_contact_success">"Kontakt <xliff:g id="USER">%1$s</xliff:g> byl smazán."</string>
-    <string name="block_contact_success">"Kontakt <xliff:g id="USER">%1$s</xliff:g> je blokován."</string>
-    <string name="unblock_contact_success">"Kontakt <xliff:g id="USER">%1$s</xliff:g> je odblokován."</string>
-    <string name="perm_label">"spustit službu Chat"</string>
-    <string name="perm_desc">"Povoluje aplikacím spustit Chat přes službu intent."</string>
-    <string name="error">"Upozornění"</string>
-    <string name="login_service_failed">"Nepodařilo se přihlásit ke službě <xliff:g id="SERVICE">%1$s</xliff:g>. Zkuste to prosím znovu později."\n"(Podrobnosti: <xliff:g id="DESCRIPTION">%2$s</xliff:g>)"</string>
-    <string name="add_list_failed">"Seznam se nepodařilo přidat."</string>
-    <string name="block_contact_failed">"Blokování kontaktu se nezdařilo."</string>
-    <string name="unblock_contact_failed">"Odblokování kontaktu se nezdařilo."</string>
-    <string name="select_contact">"Nejprve zvolte kontakt."</string>
-    <string name="disconnected">"Odpojeno"\n</string>
-    <string name="service_error">"Chyba služby."</string>
-    <string name="load_contact_list_failed">"Seznam kontaktů se nepodařilo načíst."</string>
-    <string name="cant_connect_to_server">"K serveru se nelze připojit. Zkontrolujte své připojení."</string>
-    <string name="contact_already_exist">"<xliff:g id="USER">%1$s</xliff:g> již je ve vašem seznamu kontaktů."</string>
-    <string name="contact_blocked">"Kontakt <xliff:g id="USER">%1$s</xliff:g> byl zablokován."</string>
-    <string name="contact_not_loaded">"Počkejte, než se seznam kontaktů načte."</string>
-    <string name="network_error">"Došlo k chybě sítě."</string>
-    <string name="service_not_support">"Server tuto funkci nepodporuje."</string>
-    <string name="invalid_password">"Zadané heslo není platné."</string>
-    <string name="internal_server_error">"Na serveru došlo k chybě."</string>
-    <string name="not_implemented">"Server tuto funkci nepodporuje."</string>
-    <string name="service_unavaiable">"Server je momentálně nedostupný."</string>
-    <string name="timeout">"Vypršel časový limit serveru."</string>
-    <string name="version_not_supported">"Server nepodporuje aktuální verzi."</string>
-    <string name="message_queue_full">"Fronta zpráv je plná."</string>
-    <string name="domain_not_supported">"Server nepodporuje předávání této doméně."</string>
-    <string name="unknown_user">"Zadané uživatelské jméno nebylo rozpoznáno."</string>
-    <string name="recipient_blocked_the_user">"Tento uživatel vás blokuje."</string>
-    <string name="session_expired">"Této relaci již vypršela platnost, přihlaste se znovu."</string>
-    <string name="forced_logout">"jste přihlášeni z jiného klienta."</string>
-    <string name="already_logged_in">"již jste přihlášeni z jiného klienta."</string>
-    <string name="msisdn_error">"Z karty SIM nelze číst vaše telefonní číslo. Požádejte o pomoc operátora."</string>
-    <string name="not_signed_in">"Momentálně nejste přihlášeni."</string>
-    <string name="general_error">"Kód chyby: <xliff:g id="CODE">%1$d</xliff:g>"</string>
-  <string-array name="default_smiley_names">
-    <item>"Happy"</item>
-    <item>"Smutný"</item>
-    <item>"Mrkající"</item>
-    <item>"Vypláznutý jazyk"</item>
-    <item>"Překvapený"</item>
-    <item>"Pusa"</item>
-    <item>"Hej!"</item>
-    <item>"Cool"</item>
-    <item>"Cinkání zlaťáků"</item>
-    <item>"Šlápota v úsměvu"</item>
-    <item>"V rozpacích"</item>
-    <item>"Andílek"</item>
-    <item>"Nerozhodný"</item>
-    <item>"Rozplakaný"</item>
-    <item>"Ani muk"</item>
-    <item>"Smějící se"</item>
-    <item>"Zmatený"</item>
-  </string-array>
-  <string-array name="default_smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
deleted file mode 100644 (file)
index d47f646..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="im_label">"Chat"</string>
-    <string name="menu_cancel_signin">"Anmeldung abbrechen"</string>
-    <string name="menu_add_contact">"Kontakt hinzufügen"</string>
-    <string name="menu_remove_contact">"Kontakt löschen"</string>
-    <string name="menu_block_contact">"Kontakt blockieren"</string>
-    <string name="menu_view_blocked">"Blockiert"</string>
-    <string name="menu_view_accounts">"Liste der Konten"</string>
-    <string name="menu_settings">"Einstellungen"</string>
-    <string name="menu_start_chat">"Chat starten"</string>
-    <string name="menu_sign_out">"Abmelden"</string>
-    <string name="menu_view_profile">"Profil anzeigen"</string>
-    <string name="menu_end_conversation">"Chat beenden"</string>
-    <string name="menu_view_contact_list">"Kontaktliste"</string>
-    <string name="menu_invite_contact">"Einladen..."</string>
-    <string name="menu_switch_chats">"Chat wechseln"</string>
-    <string name="menu_insert_smiley">"Smiley einfügen"</string>
-    <string name="menu_plus">"Menü +"</string>
-    <string name="default_input_title">"Eingabe"</string>
-    <string name="confirm">"Bestätigen"</string>
-    <string name="confirm_delete_contact">"Kontakt \"<xliff:g id="USER">%1$s</xliff:g>\" wird gelöscht."</string>
-    <string name="confirm_block_contact">"Kontakt \"<xliff:g id="USER">%1$s</xliff:g>\" wird blockiert."</string>
-    <string name="confirm_unblock_contact">"Blockierung des Kontakts \"<xliff:g id="USER">%1$s</xliff:g>\" wird aufgehoben."</string>
-    <string name="ok">"OK"</string>
-    <string name="cancel">"Abbrechen"</string>
-    <string name="yes">"OK"</string>
-    <string name="no">"Abbrechen"</string>
-    <string name="signed_out_prompt">"Sie wurden von <xliff:g id="ACCOUNT">%1$s</xliff:g> abgemeldet."</string>
-    <string name="signed_out_prompt_with_error">"Sie wurden aus folgendem Grund von <xliff:g id="ACCOUNT">%1$s</xliff:g> abgemeldet: <xliff:g id="REASON">%2$s</xliff:g>."</string>
-    <string name="add_account">"<xliff:g id="ACCOUNT">%1$s</xliff:g>-Konto hinzufügen"</string>
-    <string name="label_username">"Benutzername:"</string>
-    <string name="label_password">"Kennwort:"</string>
-    <string name="remember_password">"Kennwort speichern"</string>
-    <string name="keep_me_signed_in">"Automatisch anmelden"</string>
-    <string name="sign_up">"Besitzen Sie kein Konto?"</string>
-    <string name="check_auto_sign_in">"Mit dieser Option werden Sie bei jedem Öffnen der Anwendung automatisch angemeldet. Wenn Sie die Option deaktivieren möchten, melden Sie sich ab, und deaktivieren Sie das Kontrollkästchen \"Automatisch anmelden\"."</string>
-    <string name="sign_in">"Anmelden"</string>
-    <string name="signing_in_to">"Anmeldung bei <xliff:g id="ACCOUNT">%1$s</xliff:g> wird ausgeführt."</string>
-    <string name="signing_in_wait">"Anmeldung wird ausgeführt..."</string>
-    <!-- no translation found for bg_data_prompt_title (4861800723853178111) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_message (2343305645142823544) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_ok (3443385427882751532) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_cancel (7206105589826174638) -->
-    <skip />
-    <string name="ongoing_conversation">"Derzeit ausgeführte Chats (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="online_count">"<xliff:g id="NUMBER">%1$d</xliff:g> online"</string>
-    <string name="subscriptions">"Freundschaftseinladungen"</string>
-    <string name="unknown_contact">"("<i>"Unbekannt"</i>")"</string>
-    <string name="empty_contact_group">"Leer"</string>
-    <string name="empty_conversation_group">"Keine Gespräche"</string>
-    <string name="contacts_picker_title">"Kontakte für Einladung auswählen"</string>
-    <string name="contact_filter_hint">"Gesuchten Kontakt eingeben"</string>
-    <string name="empty_contact_list">"Keine Kontakte gefunden"</string>
-    <string name="blocked_list_title">"Blockierte Kontakte - <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="no_blocked_contact">"Keine blockierten Kontakte"</string>
-    <string name="contact_profile_title">"Kontaktprofil"</string>
-    <string name="label_status">"Status:"</string>
-    <string name="label_client_type">"Clienttyp:"</string>
-    <string name="client_type_computer">"Computer"</string>
-    <string name="client_type_mobile">"Mobil"</string>
-    <string name="presence_available">"Online"</string>
-    <string name="presence_busy">"Ausgelastet"</string>
-    <string name="presence_away">"Abwesend"</string>
-    <string name="presence_idle">"Leerlauf"</string>
-    <string name="presence_offline">"Offline"</string>
-    <string name="presence_invisible">"Als offline anzeigen"</string>
-    <string name="preference_title">"Einstellungen für <xliff:g id="PROVIDER">%1$s</xliff:g> (nur für Entwickler)"</string>
-    <string name="data_channel_label">"Datenkanal"</string>
-    <string name="data_encoding_label">"Datenkodierung"</string>
-    <string name="cir_channel_label">"CIR-Kanal"</string>
-    <string name="host_label">"Host"</string>
-    <string name="msisdn_label">"MSISDN"</string>
-    <string name="http">"HTTP"</string>
-    <string name="sms">"SMS"</string>
-    <string name="tcp">"TCP"</string>
-    <string name="xml">"XML"</string>
-    <string name="wbxml">"WBXML"</string>
-    <string name="save">"Speichern"</string>
-    <string name="chat_with">"Mit <xliff:g id="USER">%1$s</xliff:g> chatten"</string>
-    <string name="me">"Eigene"</string>
-    <string name="compose_hint">"Zum Erstellen eintippen"</string>
-    <string name="contact_online">"<xliff:g id="USER">%1$s</xliff:g> ist online."</string>
-    <string name="contact_away">"<xliff:g id="USER">%1$s</xliff:g> ist abwesend."</string>
-    <string name="contact_busy">"<xliff:g id="USER">%1$s</xliff:g> ist beschäftigt."</string>
-    <string name="contact_offline">"<xliff:g id="USER">%1$s</xliff:g> ist offline."</string>
-    <string name="contact_joined">"<xliff:g id="USER">%1$s</xliff:g> hat Teilnahme begonnen."</string>
-    <string name="contact_left">"<xliff:g id="USER">%1$s</xliff:g> hat Chat verlassen."</string>
-    <string name="time_stamp" format="date">"'Gesendet um '<xliff:g id="HOUR">hh</xliff:g>':'<xliff:g id="MINUTE">mm</xliff:g>' '<xliff:g id="AMPM">a</xliff:g>' am '<xliff:g id="DATE">EEEE</xliff:g>"</string>
-    <string name="send">"Senden"</string>
-    <string name="msg_sent_failed">"Die Nachricht kann nicht gesendet werden."</string>
-    <string name="disconnected_warning">"Verbindung zum Server getrennt. Nachrichten werden gesendet, sobald eine Online-Verbindung besteht."</string>
-    <string name="contact_offline_warning">"<xliff:g id="USER_0">%1$s</xliff:g> ist offline. Von Ihnen gesendete Nachrichten werden geliefert, sobald <xliff:g id="USER_1">%1$s</xliff:g> online ist."</string>
-    <string name="contact_not_in_list_warning">"<xliff:g id="USER">%1$s</xliff:g> ist nicht in Ihrer Kontaktliste enthalten."</string>
-    <string name="select_link_title">"Link auswählen"</string>
-    <string name="empty_chat_list">"Keine aktiven Chats"</string>
-    <string name="add_contact_title">"Kontakt hinzufügen"</string>
-    <string name="input_contact_label">"E-Mail-Adresse der Person, die Sie einladen möchten:"</string>
-    <string name="choose_list_label">"Liste auswählen:"</string>
-    <string name="invite_instruction">"Geben Sie einen Namen ein, der aus den Kontakten hinzugefügt werden soll."</string>
-    <string name="invite_label">"Einladung senden"</string>
-    <string name="setting_title">"Allgemeine Einstellungen"</string>
-    <string name="hide_offline_contacts">"Offline-Kontakte ausblenden"</string>
-    <string name="notification_group_title">"Benachrichtigungseinstellungen"</string>
-    <string name="notification_enabled_title">"Chat-Benachrichtigungen"</string>
-    <string name="notification_enabled_summary">"Bei Nachrichteneingang Benachrichtigung in Statuszeile anzeigen"</string>
-    <string name="notification_vibrate_title">"Vibrieren"</string>
-    <string name="notification_vibrate_summary">"Bei Nachrichteneingang vibrieren"</string>
-    <string name="notification_sound_title">"Ton"</string>
-    <string name="notification_sound_summary">"Bei Nachrichteneingang Klingelton wiedergeben"</string>
-    <string name="notification_ringtone_title">"Klingelton auswählen"</string>
-    <string name="invitation_prompt">"<xliff:g id="USER">%1$s</xliff:g> hat Sie zu einem Gruppenchat eingeladen."</string>
-    <string name="invitation_sent_prompt">"Einladung wurde an <xliff:g id="USER">%1$s</xliff:g> gesendet."</string>
-    <string name="accept_invitation">"Annehmen"</string>
-    <string name="decline_invitation">"Ablehnen"</string>
-    <string name="subscription_prompt">"<xliff:g id="USER">%1$s</xliff:g> hat Sie zur Aufnahme in die Kontaktliste eingeladen."</string>
-    <string name="approve_subscription">"Annehmen"</string>
-    <string name="decline_subscription">"Ablehnen"</string>
-    <string name="approve_subscription_error">"Anmeldung von <xliff:g id="USER">%1$s</xliff:g> kann nicht genehmigt werden. Bitte versuchen Sie es später erneut."</string>
-    <string name="decline_subscription_error">"Anmeldung von <xliff:g id="USER">%1$s</xliff:g> kann nicht abgelehnt werden. Bitte versuchen Sie es später erneut."</string>
-    <string name="newMessages_label">"<xliff:g id="PROVIDER">%1$s</xliff:g>"</string>
-    <string name="num_unread_chats">"<xliff:g id="NUMBER">%1$d</xliff:g> ungelesene Chats"</string>
-    <string name="subscription_notify_text">"Neue Freundschaftseinladung von <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="notify_groupchat_label">"Einladung zum Gruppenchat"</string>
-    <string name="group_chat_invite_notify_text">"Neue Einladung zum Gruppenchat von <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="add_contact_success">"Kontakt \"<xliff:g id="USER">%1$s</xliff:g>\" hinzugefügt"</string>
-    <string name="delete_contact_success">"Kontakt \"<xliff:g id="USER">%1$s</xliff:g>\" gelöscht"</string>
-    <string name="block_contact_success">"Kontakt \"<xliff:g id="USER">%1$s</xliff:g>\" blockiert"</string>
-    <string name="unblock_contact_success">"Blockierung des Kontakts \"<xliff:g id="USER">%1$s</xliff:g>\" aufgehoben"</string>
-    <string name="perm_label">"Chat-Service starten"</string>
-    <string name="perm_desc">"Ermöglicht Anwendungen das eigenständige Starten von Chat-Services."</string>
-    <string name="error">"Achtung"</string>
-    <string name="login_service_failed">"Anmeldung beim <xliff:g id="SERVICE">%1$s</xliff:g>-Service nicht möglich. Bitte versuchen Sie es später erneut."\n"(Details: <xliff:g id="DESCRIPTION">%2$s</xliff:g>)"</string>
-    <string name="add_list_failed">"Die Liste wurde nicht hinzugefügt."</string>
-    <string name="block_contact_failed">"Kontakt wurde nicht blockiert."</string>
-    <string name="unblock_contact_failed">"Blockierung des Kontakts wurde nicht aufgehoben."</string>
-    <string name="select_contact">"Wählen Sie zunächst einen Kontakt aus."</string>
-    <string name="disconnected">"Getrennt"\n</string>
-    <string name="service_error">"Servicefehler"</string>
-    <string name="load_contact_list_failed">"Kontaktliste wurde nicht geladen."</string>
-    <string name="cant_connect_to_server">"Verbindung zum Server kann nicht hergestellt werden. Überprüfen Sie die Verbindung."</string>
-    <string name="contact_already_exist">"<xliff:g id="USER">%1$s</xliff:g> ist bereits in der Kontaktliste vorhanden."</string>
-    <string name="contact_blocked">"Kontakt \"<xliff:g id="USER">%1$s</xliff:g>\" wurde blockiert."</string>
-    <string name="contact_not_loaded">"Kontaktliste wird geladen, bitte warten."</string>
-    <string name="network_error">"Ein Netzwerkfehler ist aufgetreten."</string>
-    <string name="service_not_support">"Diese Funktion wird vom Server nicht unterstützt."</string>
-    <string name="invalid_password">"Das eingegebene Kennwort ist ungültig."</string>
-    <string name="internal_server_error">"Beim Server ist ein Fehler aufgetreten."</string>
-    <string name="not_implemented">"Diese Funktion wird vom Server nicht unterstützt."</string>
-    <string name="service_unavaiable">"Der Server ist derzeit nicht verfügbar."</string>
-    <string name="timeout">"Timeout beim Server"</string>
-    <string name="version_not_supported">"Die aktuelle Version wird vom Server nicht unterstützt."</string>
-    <string name="message_queue_full">"Die Nachrichtenwarteschlange ist voll."</string>
-    <string name="domain_not_supported">"Das Weiterleiten an die Domäne wird vom Server nicht unterstützt."</string>
-    <string name="unknown_user">"Der eingegebene Benutzername wird nicht erkannt."</string>
-    <string name="recipient_blocked_the_user">"Sie werden leider vom Benutzer blockiert."</string>
-    <string name="session_expired">"Die Sitzung ist abgelaufen, bitte melden Sie sich erneut an."</string>
-    <string name="forced_logout">"Sie haben sich von einem anderen Client aus angemeldet."</string>
-    <string name="already_logged_in">"Sie haben sich bereits von einem anderen Client aus angemeldet."</string>
-    <string name="msisdn_error">"Die auf der SIM-Karte gespeicherte Telefonnummer kann nicht gelesen werden. Bitte wenden Sie sich an den Betreiber."</string>
-    <string name="not_signed_in">"Sie sind derzeit nicht angemeldet."</string>
-    <string name="general_error">"Fehlercode <xliff:g id="CODE">%1$d</xliff:g>"</string>
-  <string-array name="default_smiley_names">
-    <item>"Glücklich"</item>
-    <item>"Traurig"</item>
-    <item>"Zwinkern"</item>
-    <item>"Herausgestreckte Zunge"</item>
-    <item>"Überrascht"</item>
-    <item>"Kuss"</item>
-    <item>"Schreien"</item>
-    <item>"Cool"</item>
-    <item>"Worten sollen Taten folgen"</item>
-    <item>"Ins Fettnäpfchen getreten"</item>
-    <item>"Peinlich berührt"</item>
-    <item>"Engel"</item>
-    <item>"Unentschlossen"</item>
-    <item>"Weinen"</item>
-    <item>"Versiegelte Lippen"</item>
-    <item>"Lachen"</item>
-    <item>"Verwirrt"</item>
-  </string-array>
-  <string-array name="default_smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
deleted file mode 100644 (file)
index 304975d..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="im_label">"MI"</string>
-    <string name="menu_cancel_signin">"Cancelar acceso"</string>
-    <string name="menu_add_contact">"Añadir contacto"</string>
-    <string name="menu_remove_contact">"Eliminar contacto"</string>
-    <string name="menu_block_contact">"Bloquear contacto"</string>
-    <string name="menu_view_blocked">"Bloqueados"</string>
-    <string name="menu_view_accounts">"Lista de cuentas"</string>
-    <string name="menu_settings">"Ajustes"</string>
-    <string name="menu_start_chat">"Iniciar chat"</string>
-    <string name="menu_sign_out">"Salir"</string>
-    <string name="menu_view_profile">"Ver perfil"</string>
-    <string name="menu_end_conversation">"Finalizar chat"</string>
-    <string name="menu_view_contact_list">"Lista de contactos"</string>
-    <string name="menu_invite_contact">"Invitar…"</string>
-    <string name="menu_switch_chats">"Cambiar de chat"</string>
-    <string name="menu_insert_smiley">"Insertar emoticono"</string>
-    <string name="menu_plus">"MENU+"</string>
-    <string name="default_input_title">"Introducción de texto"</string>
-    <string name="confirm">"Confirmar"</string>
-    <string name="confirm_delete_contact">"El contacto \"<xliff:g id="USER">%1$s</xliff:g>\" se eliminará."</string>
-    <string name="confirm_block_contact">"El contacto \"<xliff:g id="USER">%1$s</xliff:g>\" se bloqueará."</string>
-    <string name="confirm_unblock_contact">"El contacto \"<xliff:g id="USER">%1$s</xliff:g>\" se desbloqueará."</string>
-    <string name="ok">"Aceptar"</string>
-    <string name="cancel">"Cancelar"</string>
-    <string name="yes">"Aceptar"</string>
-    <string name="no">"Cancelar"</string>
-    <string name="signed_out_prompt">"Se ha cerrado tu cuenta de <xliff:g id="ACCOUNT">%1$s</xliff:g>."</string>
-    <string name="signed_out_prompt_with_error">"Se ha cerrado la cuenta de <xliff:g id="ACCOUNT">%1$s</xliff:g> porque <xliff:g id="REASON">%2$s</xliff:g>."</string>
-    <string name="add_account">"Añadir cuenta <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="label_username">"Nombre de usuario:"</string>
-    <string name="label_password">"Contraseña:"</string>
-    <string name="remember_password">"Recordar mi contraseña"</string>
-    <string name="keep_me_signed_in">"Acceder automáticamente"</string>
-    <string name="sign_up">"¿No tienes una cuenta?"</string>
-    <string name="check_auto_sign_in">"Esta opción te permite acceder automáticamente a tu cuenta cada vez que abres la aplicación. Para inhabilitarla, sal de la cuenta y desactiva la casilla de verificación \"Acceder automáticamente\"."</string>
-    <string name="sign_in">"Acceder"</string>
-    <string name="signing_in_to">"Accediendo a <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="signing_in_wait">"Accediendo..."</string>
-    <!-- no translation found for bg_data_prompt_title (4861800723853178111) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_message (2343305645142823544) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_ok (3443385427882751532) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_cancel (7206105589826174638) -->
-    <skip />
-    <string name="ongoing_conversation">"Chats en curso (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="online_count">"<xliff:g id="NUMBER">%1$d</xliff:g> conectado"</string>
-    <string name="subscriptions">"Invitaciones de amigos"</string>
-    <string name="unknown_contact">"("<i>"Desconocido"</i>")"</string>
-    <string name="empty_contact_group">"Vacío"</string>
-    <string name="empty_conversation_group">"Ninguna conversación"</string>
-    <string name="contacts_picker_title">"Seleccionar contactos a los que se dirige la invitación"</string>
-    <string name="contact_filter_hint">"Escribe el nombre del contacto que quieras localizar."</string>
-    <string name="empty_contact_list">"No se ha encontrado ningún contacto."</string>
-    <string name="blocked_list_title">"Contactos bloqueados - <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="no_blocked_contact">"No hay ningún contacto bloqueado."</string>
-    <string name="contact_profile_title">"Perfil del contacto"</string>
-    <string name="label_status">"Estado:"</string>
-    <string name="label_client_type">"Tipo de cliente:"</string>
-    <string name="client_type_computer">"Equipo"</string>
-    <string name="client_type_mobile">"Móvil"</string>
-    <string name="presence_available">"Conectado"</string>
-    <string name="presence_busy">"Ocupado"</string>
-    <string name="presence_away">"Ausente"</string>
-    <string name="presence_idle">"Inactivo"</string>
-    <string name="presence_offline">"Desconectado"</string>
-    <string name="presence_invisible">"Aparecer desconectado"</string>
-    <string name="preference_title">"<xliff:g id="PROVIDER">%1$s</xliff:g> settings (dev only)"</string>
-    <string name="data_channel_label">"Canal de datos"</string>
-    <string name="data_encoding_label">"Codificación de datos"</string>
-    <string name="cir_channel_label">"Canal CIR"</string>
-    <string name="host_label">"Host"</string>
-    <string name="msisdn_label">"MSISDN"</string>
-    <string name="http">"HTTP"</string>
-    <string name="sms">"SMS"</string>
-    <string name="tcp">"TCP"</string>
-    <string name="xml">"XML"</string>
-    <string name="wbxml">"WBXML"</string>
-    <string name="save">"Guardar"</string>
-    <string name="chat_with">"Chat con <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="me">"Yo"</string>
-    <string name="compose_hint">"Escribe el texto aquí"</string>
-    <string name="contact_online">"<xliff:g id="USER">%1$s</xliff:g> está conectado"</string>
-    <string name="contact_away">"<xliff:g id="USER">%1$s</xliff:g> está ausente"</string>
-    <string name="contact_busy">"<xliff:g id="USER">%1$s</xliff:g> está ocupado"</string>
-    <string name="contact_offline">"<xliff:g id="USER">%1$s</xliff:g> está desconectado"</string>
-    <string name="contact_joined">"<xliff:g id="USER">%1$s</xliff:g> se ha unido al chat"</string>
-    <string name="contact_left">"<xliff:g id="USER">%1$s</xliff:g> se ha desconectado"</string>
-    <string name="time_stamp" format="date">"'Enviado a las '<xliff:g id="HOUR">hh</xliff:g>':'<xliff:g id="MINUTE">mm</xliff:g>' '<xliff:g id="AMPM">a</xliff:g>' el '<xliff:g id="DATE">EEEE</xliff:g>"</string>
-    <string name="send">"Enviar"</string>
-    <string name="msg_sent_failed">"No se ha podido enviar el mensaje."</string>
-    <string name="disconnected_warning">"Se ha perdido la conexión con el servidor. Los mensajes se enviarán cuando se restablezca la conexión."</string>
-    <string name="contact_offline_warning">"<xliff:g id="USER_0">%1$s</xliff:g> está desconectado. Los mensajes enviados se entregarán cuando <xliff:g id="USER_1">%1$s</xliff:g> vuelva a conectarse."</string>
-    <string name="contact_not_in_list_warning">"<xliff:g id="USER">%1$s</xliff:g> no figura en tu lista de contactos."</string>
-    <string name="select_link_title">"Seleccionar enlace"</string>
-    <string name="empty_chat_list">"No hay ningún chat activo."</string>
-    <string name="add_contact_title">"Añadir contacto"</string>
-    <string name="input_contact_label">"Dirección de correo electrónico de la persona a la que deseas invitar:"</string>
-    <string name="choose_list_label">"Seleccionar una lista:"</string>
-    <string name="invite_instruction">"Escribe el nombre del contacto que quieras añadir."</string>
-    <string name="invite_label">"Enviar invitación"</string>
-    <string name="setting_title">"Configuración general"</string>
-    <string name="hide_offline_contacts">"Ocultar contactos desconectados"</string>
-    <string name="notification_group_title">"Configuración de notificaciones"</string>
-    <string name="notification_enabled_title">"Notificaciones de MI"</string>
-    <string name="notification_enabled_summary">"Avisar en la barra de estado al recibir un mensaje instantáneo"</string>
-    <string name="notification_vibrate_title">"Vibración"</string>
-    <string name="notification_vibrate_summary">"Vibración al recibir mensaje instantáneo"</string>
-    <string name="notification_sound_title">"Sonido"</string>
-    <string name="notification_sound_summary">"Reproducir tono al recibir mensaje instantáneo"</string>
-    <string name="notification_ringtone_title">"Seleccionar tono"</string>
-    <string name="invitation_prompt">"<xliff:g id="USER">%1$s</xliff:g> te ha invitado a unirte a un chat en grupo."</string>
-    <string name="invitation_sent_prompt">"Se ha enviado la invitación a <xliff:g id="USER">%1$s</xliff:g>."</string>
-    <string name="accept_invitation">"Aceptar"</string>
-    <string name="decline_invitation">"Rechazar"</string>
-    <string name="subscription_prompt">"<xliff:g id="USER">%1$s</xliff:g> te ha invitado a formar parte de su lista de contactos."</string>
-    <string name="approve_subscription">"Aceptar"</string>
-    <string name="decline_subscription">"Rechazar"</string>
-    <string name="approve_subscription_error">"No se ha podido aprobar la suscripción de <xliff:g id="USER">%1$s</xliff:g>. Inténtalo de nuevo más tarde."</string>
-    <string name="decline_subscription_error">"No se ha podido rechazar la suscripción de <xliff:g id="USER">%1$s</xliff:g>. Inténtalo de nuevo más tarde."</string>
-    <string name="newMessages_label">"Mensajes nuevos de <xliff:g id="PROVIDER">%1$s</xliff:g>"</string>
-    <string name="num_unread_chats">"<xliff:g id="NUMBER">%1$d</xliff:g> chats no leídos"</string>
-    <string name="subscription_notify_text">"Invitación de amigo nuevo de <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="notify_groupchat_label">"Invitación a chat en grupo"</string>
-    <string name="group_chat_invite_notify_text">"Nueva invitación a chat en grupo de <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="add_contact_success">"Contacto \"<xliff:g id="USER">%1$s</xliff:g>\" añadido"</string>
-    <string name="delete_contact_success">"Contacto \"<xliff:g id="USER">%1$s</xliff:g>\" eliminado"</string>
-    <string name="block_contact_success">"Contacto \"<xliff:g id="USER">%1$s</xliff:g>\" bloqueado"</string>
-    <string name="unblock_contact_success">"Contacto \"<xliff:g id="USER">%1$s</xliff:g>\" desbloqueado"</string>
-    <string name="perm_label">"iniciar servicio de MI"</string>
-    <string name="perm_desc">"Permite que las aplicaciones inicien el servicio de MI mediante la ejecución de un intento."</string>
-    <string name="error">"Atención"</string>
-    <string name="login_service_failed">"No ha sido posible acceder al servicio <xliff:g id="SERVICE">%1$s</xliff:g>. Inténtalo de nuevo más tarde."\n"(Detalles: <xliff:g id="DESCRIPTION">%2$s</xliff:g>)"</string>
-    <string name="add_list_failed">"La lista no se ha añadido."</string>
-    <string name="block_contact_failed">"No se ha podido bloquear el contacto."</string>
-    <string name="unblock_contact_failed">"No se ha podido desbloquear el contacto."</string>
-    <string name="select_contact">"Selecciona primero un contacto."</string>
-    <string name="disconnected">"Desconectado"\n</string>
-    <string name="service_error">"Error del servicio"</string>
-    <string name="load_contact_list_failed">"No se ha podido cargar la lista de contactos."</string>
-    <string name="cant_connect_to_server">"No se puede establecer conexión con el servidor. Comprueba la conexión."</string>
-    <string name="contact_already_exist">"<xliff:g id="USER">%1$s</xliff:g> ya figura en tu lista de contactos."</string>
-    <string name="contact_blocked">"El contacto \"<xliff:g id="USER">%1$s</xliff:g>\" se ha bloqueado."</string>
-    <string name="contact_not_loaded">"Por favor, espera mientras se carga la lista de contactos."</string>
-    <string name="network_error">"Se ha producido un error de red."</string>
-    <string name="service_not_support">"El servidor no admite esta función."</string>
-    <string name="invalid_password">"La contraseña introducida no es válida."</string>
-    <string name="internal_server_error">"Se ha producido un error en el servidor."</string>
-    <string name="not_implemented">"El servidor no admite esta función."</string>
-    <string name="service_unavaiable">"El servidor no está disponible en este momento."</string>
-    <string name="timeout">"Se ha agotado el tiempo de espera del servidor."</string>
-    <string name="version_not_supported">"El servidor no admite la versión actual."</string>
-    <string name="message_queue_full">"La cola de mensajes está llena."</string>
-    <string name="domain_not_supported">"El servidor no admite el reenvío al dominio."</string>
-    <string name="unknown_user">"El nombre de usuario introducido no se reconoce."</string>
-    <string name="recipient_blocked_the_user">"El usuario te ha bloqueado."</string>
-    <string name="session_expired">"La sesión ha caducado. Accede de nuevo."</string>
-    <string name="forced_logout">"has accedido desde otro cliente."</string>
-    <string name="already_logged_in">"ya has accedido desde otro cliente."</string>
-    <string name="msisdn_error">"No se puede leer el número de teléfono de la tarjeta SIM. Ponte en contacto con tu operador para obtener ayuda."</string>
-    <string name="not_signed_in">"No has accedido a tu cuenta."</string>
-    <string name="general_error">"Código de error <xliff:g id="CODE">%1$d</xliff:g>"</string>
-  <string-array name="default_smiley_names">
-    <item>"Feliz"</item>
-    <item>"Triste"</item>
-    <item>"Guiñando"</item>
-    <item>"Sacando la lengua"</item>
-    <item>"Sorprendido"</item>
-    <item>"Besando"</item>
-    <item>"Gritando"</item>
-    <item>"Atractivo"</item>
-    <item>"Dinero en la boca"</item>
-    <item>"Metedura de pata"</item>
-    <item>"Avergonzado"</item>
-    <item>"Ángel"</item>
-    <item>"Indeciso"</item>
-    <item>"Llorando"</item>
-    <item>"Labios sellados"</item>
-    <item>"Riendo"</item>
-    <item>"Confuso"</item>
-  </string-array>
-  <string-array name="default_smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
deleted file mode 100644 (file)
index 4838cf9..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="im_label">"MI"</string>
-    <string name="menu_cancel_signin">"Annuler la connexion"</string>
-    <string name="menu_add_contact">"Ajouter un contact"</string>
-    <string name="menu_remove_contact">"Supprimer le contact"</string>
-    <string name="menu_block_contact">"Bloquer le contact"</string>
-    <string name="menu_view_blocked">"Bloqué"</string>
-    <string name="menu_view_accounts">"Liste des comptes"</string>
-    <string name="menu_settings">"Paramètres"</string>
-    <string name="menu_start_chat">"Lancer un chat"</string>
-    <string name="menu_sign_out">"Se déconnecter"</string>
-    <string name="menu_view_profile">"Afficher le profil"</string>
-    <string name="menu_end_conversation">"Arrêter le chat"</string>
-    <string name="menu_view_contact_list">"Liste de contacts"</string>
-    <string name="menu_invite_contact">"Inviter..."</string>
-    <string name="menu_switch_chats">"Changer de chat"</string>
-    <string name="menu_insert_smiley">"Insérer un émoticône"</string>
-    <string name="menu_plus">"Menu+"</string>
-    <string name="default_input_title">"Entrée"</string>
-    <string name="confirm">"Confirmer"</string>
-    <string name="confirm_delete_contact">"Le contact \"<xliff:g id="USER">%1$s</xliff:g>\" sera supprimé."</string>
-    <string name="confirm_block_contact">"Le contact \"<xliff:g id="USER">%1$s</xliff:g>\" sera bloqué."</string>
-    <string name="confirm_unblock_contact">"Le contact \"<xliff:g id="USER">%1$s</xliff:g>\" sera débloqué."</string>
-    <string name="ok">"OK"</string>
-    <string name="cancel">"Annuler"</string>
-    <string name="yes">"OK"</string>
-    <string name="no">"Annuler"</string>
-    <string name="signed_out_prompt">"Vous avez été déconnecté de <xliff:g id="ACCOUNT">%1$s</xliff:g>."</string>
-    <string name="signed_out_prompt_with_error">"Vous avez été déconnecté de <xliff:g id="ACCOUNT">%1$s</xliff:g> parce que <xliff:g id="REASON">%2$s</xliff:g>."</string>
-    <string name="add_account">"Ajouter un compte <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="label_username">"Nom d\'utilisateur :"</string>
-    <string name="label_password">"Mot de passe :"</string>
-    <string name="remember_password">"Mémoriser mon mot de passe."</string>
-    <string name="keep_me_signed_in">"Me connecter automatiquement."</string>
-    <string name="sign_up">"Vous ne possédez pas de compte ?"</string>
-    <string name="check_auto_sign_in">"Cette option vous connecte automatiquement à chaque fois que vous ouvrez cette application. Pour désactiver l\'option, déconnectez-vous, puis décochez la case \"Connexion automatique\"."</string>
-    <string name="sign_in">"Se connecter"</string>
-    <string name="signing_in_to">"Se connecter à <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="signing_in_wait">"Connexion..."</string>
-    <!-- no translation found for bg_data_prompt_title (4861800723853178111) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_message (2343305645142823544) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_ok (3443385427882751532) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_cancel (7206105589826174638) -->
-    <skip />
-    <string name="ongoing_conversation">"Conversations en cours (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="online_count">"<xliff:g id="NUMBER">%1$d</xliff:g> en ligne"</string>
-    <string name="subscriptions">"Inviter des amis"</string>
-    <string name="unknown_contact">"("<i>"Inconnu"</i>")"</string>
-    <string name="empty_contact_group">"Vide"</string>
-    <string name="empty_conversation_group">"Aucune conversation"</string>
-    <string name="contacts_picker_title">"Sélectionnez les contacts à inviter"</string>
-    <string name="contact_filter_hint">"Saisissez le nom du contact à rechercher"</string>
-    <string name="empty_contact_list">"Aucun contact trouvé."</string>
-    <string name="blocked_list_title">"Contacts bloqués : <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="no_blocked_contact">"Aucun contact bloqué."</string>
-    <string name="contact_profile_title">"Profil du contact"</string>
-    <string name="label_status">"État :"</string>
-    <string name="label_client_type">"Type de client :"</string>
-    <string name="client_type_computer">"Ordinateur"</string>
-    <string name="client_type_mobile">"Mobile"</string>
-    <string name="presence_available">"En ligne"</string>
-    <string name="presence_busy">"Occupé"</string>
-    <string name="presence_away">"Absent"</string>
-    <string name="presence_idle">"Absent"</string>
-    <string name="presence_offline">"Hors ligne"</string>
-    <string name="presence_invisible">"Apparaître hors ligne"</string>
-    <string name="preference_title">"<xliff:g id="PROVIDER">%1$s</xliff:g> settings (dev only)"</string>
-    <string name="data_channel_label">"Canal de données"</string>
-    <string name="data_encoding_label">"Codage des données"</string>
-    <string name="cir_channel_label">"Canal CIR"</string>
-    <string name="host_label">"Hôte"</string>
-    <string name="msisdn_label">"MSISDN"</string>
-    <string name="http">"HTTP"</string>
-    <string name="sms">"SMS"</string>
-    <string name="tcp">"TCP"</string>
-    <string name="xml">"XML"</string>
-    <string name="wbxml">"WBXML"</string>
-    <string name="save">"Enregistrer"</string>
-    <string name="chat_with">"Chatter avec <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="me">"Moi"</string>
-    <string name="compose_hint">"Cliquer pour composer"</string>
-    <string name="contact_online">"<xliff:g id="USER">%1$s</xliff:g> est en ligne"</string>
-    <string name="contact_away">"<xliff:g id="USER">%1$s</xliff:g> est absent"</string>
-    <string name="contact_busy">"<xliff:g id="USER">%1$s</xliff:g> est occupé"</string>
-    <string name="contact_offline">"<xliff:g id="USER">%1$s</xliff:g> est hors ligne"</string>
-    <string name="contact_joined">"<xliff:g id="USER">%1$s</xliff:g> a rejoint la conversation"</string>
-    <string name="contact_left">"<xliff:g id="USER">%1$s</xliff:g> a quitté la conversation"</string>
-    <string name="time_stamp" format="date">"'Date d\'\'envoi : le '<xliff:g id="DATE">EEEE</xliff:g>' à '<xliff:g id="HOUR">hh</xliff:g>':'<xliff:g id="MINUTE">mm</xliff:g>' '<xliff:g id="AMPM">a</xliff:g>"</string>
-    <string name="send">"Envoyer"</string>
-    <string name="msg_sent_failed">"Ce message n\'a pas pu être envoyé."</string>
-    <string name="disconnected_warning">"Connexion au serveur interrompue. Les messages seront transmis lorsque vous serez de nouveau connecté."</string>
-    <string name="contact_offline_warning">"<xliff:g id="USER_0">%1$s</xliff:g> est hors ligne. Les messages que vous lui envoyez lui seront remis lors de la prochaine connexion de <xliff:g id="USER_1">%1$s</xliff:g>."</string>
-    <string name="contact_not_in_list_warning">"<xliff:g id="USER">%1$s</xliff:g> n\'est pas dans votre liste de contacts."</string>
-    <string name="select_link_title">"Sélectionner le lien"</string>
-    <string name="empty_chat_list">"Aucun chat actif."</string>
-    <string name="add_contact_title">"Ajouter un contact"</string>
-    <string name="input_contact_label">"Adresse e-mail de la personne que vous souhaitez inviter :"</string>
-    <string name="choose_list_label">"Sélectionnez une liste :"</string>
-    <string name="invite_instruction">"Saisissez un nom à ajouter à partir de vos contacts"</string>
-    <string name="invite_label">"Envoyer une invitation"</string>
-    <string name="setting_title">"Paramètres généraux"</string>
-    <string name="hide_offline_contacts">"Masquer les contacts hors ligne"</string>
-    <string name="notification_group_title">"Paramètres des notifications"</string>
-    <string name="notification_enabled_title">"Notifications de MI"</string>
-    <string name="notification_enabled_summary">"Signaler la réception d\'un MI dans la barre d\'état"</string>
-    <string name="notification_vibrate_title">"Vibrer"</string>
-    <string name="notification_vibrate_summary">"Vibre également à la réception d\'un MI"</string>
-    <string name="notification_sound_title">"Son"</string>
-    <string name="notification_sound_summary">"Déclencher la sonnerie lors de la réception d\'un MI"</string>
-    <string name="notification_ringtone_title">"Sélectionner une sonnerie"</string>
-    <string name="invitation_prompt">"<xliff:g id="USER">%1$s</xliff:g> vous a invité à rejoindre un chat en groupe."</string>
-    <string name="invitation_sent_prompt">"L\'invitation a été envoyé à <xliff:g id="USER">%1$s</xliff:g>."</string>
-    <string name="accept_invitation">"Accepter"</string>
-    <string name="decline_invitation">"Refuser"</string>
-    <string name="subscription_prompt">"<xliff:g id="USER">%1$s</xliff:g> aimerait vous ajouter à sa liste de contacts."</string>
-    <string name="approve_subscription">"Accepter"</string>
-    <string name="decline_subscription">"Refuser"</string>
-    <string name="approve_subscription_error">"Impossible d\'approuver l\'inscription de <xliff:g id="USER">%1$s</xliff:g>. Veuillez réessayer ultérieurement."</string>
-    <string name="decline_subscription_error">"Impossible de refuser l\'inscription de <xliff:g id="USER">%1$s</xliff:g>. Veuillez réessayer ultérieurement."</string>
-    <string name="newMessages_label">"Nouveaux messages de <xliff:g id="PROVIDER">%1$s</xliff:g>"</string>
-    <string name="num_unread_chats">"<xliff:g id="NUMBER">%1$d</xliff:g> chats non lus"</string>
-    <string name="subscription_notify_text">"Nouvelle invitation de <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="notify_groupchat_label">"Invitation à un chat en groupe"</string>
-    <string name="group_chat_invite_notify_text">"Nouvelle invitation à un chat en groupe de la part de <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="add_contact_success">"Contact \"<xliff:g id="USER">%1$s</xliff:g>\" ajouté."</string>
-    <string name="delete_contact_success">"Contact \"<xliff:g id="USER">%1$s</xliff:g>\" supprimé."</string>
-    <string name="block_contact_success">"Contact \"<xliff:g id="USER">%1$s</xliff:g>\" bloqué."</string>
-    <string name="unblock_contact_success">"Contact \"<xliff:g id="USER">%1$s</xliff:g>\" débloqué."</string>
-    <string name="perm_label">"démarrer le service de MI"</string>
-    <string name="perm_desc">"Permet aux applications de lancer le service de MI via Intent."</string>
-    <string name="error">"Avertissement"</string>
-    <string name="login_service_failed">"Connexion au service <xliff:g id="SERVICE">%1$s</xliff:g> impossible. Veuillez réessayer ultérieurement."\n"(Détails : <xliff:g id="DESCRIPTION">%2$s</xliff:g>)"</string>
-    <string name="add_list_failed">"La liste n\'a pas été ajoutée."</string>
-    <string name="block_contact_failed">"Le contact n\'a pas été bloqué."</string>
-    <string name="unblock_contact_failed">"Le contact n\'a pas été débloqué."</string>
-    <string name="select_contact">"Veuillez d\'abord sélectionner un contact."</string>
-    <string name="disconnected">"Déconnecté !"\n</string>
-    <string name="service_error">"Erreur du service !"</string>
-    <string name="load_contact_list_failed">"La liste de contact n\'a pas pu être chargée."</string>
-    <string name="cant_connect_to_server">"Connexion au serveur impossible. Veuillez vérifier votre connexion."</string>
-    <string name="contact_already_exist">"<xliff:g id="USER">%1$s</xliff:g> existe déjà dans votre liste de contacts."</string>
-    <string name="contact_blocked">"Le contact \"<xliff:g id="USER">%1$s</xliff:g>\" a été bloqué."</string>
-    <string name="contact_not_loaded">"Veuillez patienter pendant le chargement de votre liste de contacts."</string>
-    <string name="network_error">"Une erreur réseau s\'est produite."</string>
-    <string name="service_not_support">"Le serveur ne prend pas en charge cette fonctionnalité."</string>
-    <string name="invalid_password">"Le mot de passe saisi n\'est pas correct."</string>
-    <string name="internal_server_error">"Le serveur a rencontré une erreur."</string>
-    <string name="not_implemented">"Le serveur ne prend pas en charge cette fonctionnalité."</string>
-    <string name="service_unavaiable">"Le serveur n\'est pas disponible actuellement."</string>
-    <string name="timeout">"Le délai d\'inactivité du serveur est écoulé."</string>
-    <string name="version_not_supported">"Le serveur ne prend pas en charge la version actuelle."</string>
-    <string name="message_queue_full">"La file d\'attente des messages est pleine."</string>
-    <string name="domain_not_supported">"Le serveur ne prend pas en charge le transfert vers le domaine."</string>
-    <string name="unknown_user">"Le nom d\'utilisateur que vous avez saisi n\'est pas reconnu."</string>
-    <string name="recipient_blocked_the_user">"Désolé, l\'utilisateur vous a bloqué."</string>
-    <string name="session_expired">"La session a expiré. Veuillez vous reconnecter."</string>
-    <string name="forced_logout">"vous vous êtes connecté depuis un autre client."</string>
-    <string name="already_logged_in">"vous êtes déjà connecté depuis un autre client."</string>
-    <string name="msisdn_error">"Désolé, impossible de lire le numéro de téléphone de votre carte SIM. Veuillez contacter votre opérateur pour obtenir de l\'aide."</string>
-    <string name="not_signed_in">"Vous n\'êtes pas connecté actuellement."</string>
-    <string name="general_error">"Code d\'erreur <xliff:g id="CODE">%1$d</xliff:g>"</string>
-  <string-array name="default_smiley_names">
-    <item>"Content"</item>
-    <item>"Triste"</item>
-    <item>"Clin d\'oeil"</item>
-    <item>"Tire la langue"</item>
-    <item>"Surpris"</item>
-    <item>"Bisous"</item>
-    <item>"Crier"</item>
-    <item>"Cool"</item>
-    <item>"Argent"</item>
-    <item>"Embarrassé"</item>
-    <item>"Gêné"</item>
-    <item>"Ange"</item>
-    <item>"Indécis"</item>
-    <item>"Pleure"</item>
-    <item>"Motus et bouche cousue"</item>
-    <item>"Rire"</item>
-    <item>"Confus"</item>
-  </string-array>
-  <string-array name="default_smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
deleted file mode 100644 (file)
index e3b801f..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="im_label">"IM"</string>
-    <string name="menu_cancel_signin">"Annulla accesso"</string>
-    <string name="menu_add_contact">"Aggiungi contatto"</string>
-    <string name="menu_remove_contact">"Elimina contatto"</string>
-    <string name="menu_block_contact">"Blocca contatto"</string>
-    <string name="menu_view_blocked">"Bloccato"</string>
-    <string name="menu_view_accounts">"Elenco account"</string>
-    <string name="menu_settings">"Impostazioni"</string>
-    <string name="menu_start_chat">"Inizia conversazione"</string>
-    <string name="menu_sign_out">"Disconnetti"</string>
-    <string name="menu_view_profile">"Visualizza profilo"</string>
-    <string name="menu_end_conversation">"Termina conversazione"</string>
-    <string name="menu_view_contact_list">"Elenco contatti"</string>
-    <string name="menu_invite_contact">"Invita..."</string>
-    <string name="menu_switch_chats">"Cambia conversazione"</string>
-    <string name="menu_insert_smiley">"Inserisci smile"</string>
-    <string name="menu_plus">"Menu+"</string>
-    <string name="default_input_title">"Input"</string>
-    <string name="confirm">"Conferma"</string>
-    <string name="confirm_delete_contact">"Il contatto \"<xliff:g id="USER">%1$s</xliff:g>\" sarà eliminato."</string>
-    <string name="confirm_block_contact">"Il contatto \"<xliff:g id="USER">%1$s</xliff:g>\" sarà bloccato."</string>
-    <string name="confirm_unblock_contact">"Il contatto \"<xliff:g id="USER">%1$s</xliff:g>\" sarà sbloccato."</string>
-    <string name="ok">"OK"</string>
-    <string name="cancel">"Annulla"</string>
-    <string name="yes">"OK"</string>
-    <string name="no">"Annulla"</string>
-    <string name="signed_out_prompt">"Utente disconnesso da <xliff:g id="ACCOUNT">%1$s</xliff:g>."</string>
-    <string name="signed_out_prompt_with_error">"Utente disconnesso da <xliff:g id="ACCOUNT">%1$s</xliff:g>. Causa: <xliff:g id="REASON">%2$s</xliff:g>."</string>
-    <string name="add_account">"Aggiungi account <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="label_username">"Nome utente:"</string>
-    <string name="label_password">"Password:"</string>
-    <string name="remember_password">"Memorizza la password."</string>
-    <string name="keep_me_signed_in">"Accesso automatico"</string>
-    <string name="sign_up">"Non hai un account?"</string>
-    <string name="check_auto_sign_in">"Questa opzione ti consente di accedere automaticamente ogni volta che apri l\'applicazione. Per disattivare l\'opzione, disconnettiti e deseleziona la casella \"Accesso automatico\"."</string>
-    <string name="sign_in">"Accedi"</string>
-    <string name="signing_in_to">"Accesso a <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="signing_in_wait">"Accesso..."</string>
-    <!-- no translation found for bg_data_prompt_title (4861800723853178111) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_message (2343305645142823544) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_ok (3443385427882751532) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_cancel (7206105589826174638) -->
-    <skip />
-    <string name="ongoing_conversation">"Conversazioni in corso (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="online_count">"<xliff:g id="NUMBER">%1$d</xliff:g> online"</string>
-    <string name="subscriptions">"Inviti amici"</string>
-    <string name="unknown_contact">"("<i>"Sconosciuto"</i>")"</string>
-    <string name="empty_contact_group">"Vuoto"</string>
-    <string name="empty_conversation_group">"Nessuna conversazione"</string>
-    <string name="contacts_picker_title">"Seleziona contatti da invitare"</string>
-    <string name="contact_filter_hint">"Digita per trovare contatti"</string>
-    <string name="empty_contact_list">"Nessun contatto trovato."</string>
-    <string name="blocked_list_title">"Contatti bloccati - <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="no_blocked_contact">"Nessun contatto bloccato."</string>
-    <string name="contact_profile_title">"Profilo contatto"</string>
-    <string name="label_status">"Stato:"</string>
-    <string name="label_client_type">"Tipo client:"</string>
-    <string name="client_type_computer">"Computer"</string>
-    <string name="client_type_mobile">"Portatile"</string>
-    <string name="presence_available">"Online"</string>
-    <string name="presence_busy">"Occupato"</string>
-    <string name="presence_away">"Non al computer"</string>
-    <string name="presence_idle">"Inattivo"</string>
-    <string name="presence_offline">"Offline"</string>
-    <string name="presence_invisible">"Invisibile"</string>
-    <string name="preference_title">"<xliff:g id="PROVIDER">%1$s</xliff:g> settings (dev only)"</string>
-    <string name="data_channel_label">"Canale dati"</string>
-    <string name="data_encoding_label">"Codifica dati"</string>
-    <string name="cir_channel_label">"Canale CIR"</string>
-    <string name="host_label">"Host"</string>
-    <string name="msisdn_label">"MSISDN"</string>
-    <string name="http">"HTTP"</string>
-    <string name="sms">"SMS"</string>
-    <string name="tcp">"TCP"</string>
-    <string name="xml">"XML"</string>
-    <string name="wbxml">"WBXML"</string>
-    <string name="save">"Salva"</string>
-    <string name="chat_with">"Conversazione con <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="me">"Io"</string>
-    <string name="compose_hint">"Digita per comporre"</string>
-    <string name="contact_online">"<xliff:g id="USER">%1$s</xliff:g> è online"</string>
-    <string name="contact_away">"<xliff:g id="USER">%1$s</xliff:g> non è al computer"</string>
-    <string name="contact_busy">"<xliff:g id="USER">%1$s</xliff:g> è occupato"</string>
-    <string name="contact_offline">"<xliff:g id="USER">%1$s</xliff:g> è offline"</string>
-    <string name="contact_joined">"<xliff:g id="USER">%1$s</xliff:g> è entrato"</string>
-    <string name="contact_left">"<xliff:g id="USER">%1$s</xliff:g> è uscito"</string>
-    <string name="time_stamp" format="date">"'Inviato alle '<xliff:g id="HOUR">hh</xliff:g>':'<xliff:g id="MINUTE">mm</xliff:g>' '<xliff:g id="AMPM">a</xliff:g>' il '<xliff:g id="DATE">EEEE</xliff:g>"</string>
-    <string name="send">"Invia"</string>
-    <string name="msg_sent_failed">"Impossibile inviare il messaggio."</string>
-    <string name="disconnected_warning">"Connessione al server persa. I messaggi saranno inviati quando verrà ristabilita."</string>
-    <string name="contact_offline_warning">"<xliff:g id="USER_0">%1$s</xliff:g> è offline. I messaggi inviati saranno consegnati non appena <xliff:g id="USER_1">%1$s</xliff:g> torna online."</string>
-    <string name="contact_not_in_list_warning">"<xliff:g id="USER">%1$s</xliff:g> non presente nell\'elenco contatti."</string>
-    <string name="select_link_title">"Seleziona link"</string>
-    <string name="empty_chat_list">"Nessuna conversazione attiva."</string>
-    <string name="add_contact_title">"Aggiungi contatto"</string>
-    <string name="input_contact_label">"Indirizzo email della persona da invitare:"</string>
-    <string name="choose_list_label">"Selezionare un elenco:"</string>
-    <string name="invite_instruction">"Digita un nome da aggiungere dai contatti."</string>
-    <string name="invite_label">"Invia invito"</string>
-    <string name="setting_title">"Impostazioni generali"</string>
-    <string name="hide_offline_contacts">"Nascondi contatti offline"</string>
-    <string name="notification_group_title">"Impostazioni notifiche"</string>
-    <string name="notification_enabled_title">"Notifiche IM"</string>
-    <string name="notification_enabled_summary">"Notifica in barra di stato quando arriva msg IM"</string>
-    <string name="notification_vibrate_title">"Vibrazione"</string>
-    <string name="notification_vibrate_summary">"Vibra anche quando arriva msg IM"</string>
-    <string name="notification_sound_title">"Allarme"</string>
-    <string name="notification_sound_summary">"Usa suoneria anche quando arriva msg IM"</string>
-    <string name="notification_ringtone_title">"Seleziona suoneria"</string>
-    <string name="invitation_prompt">"<xliff:g id="USER">%1$s</xliff:g> ti ha invitato a unirti a una conversazione di gruppo."</string>
-    <string name="invitation_sent_prompt">"L\'invito è stato inviato a <xliff:g id="USER">%1$s</xliff:g>."</string>
-    <string name="accept_invitation">"Accetto"</string>
-    <string name="decline_invitation">"Rifiuto"</string>
-    <string name="subscription_prompt">"<xliff:g id="USER">%1$s</xliff:g> ti ha invitato a inserirti nel suo elenco contatti."</string>
-    <string name="approve_subscription">"Accetto"</string>
-    <string name="decline_subscription">"Rifiuto"</string>
-    <string name="approve_subscription_error">"Impossibile approvare l\'iscrizione di <xliff:g id="USER">%1$s</xliff:g>. Riprova più tardi."</string>
-    <string name="decline_subscription_error">"Impossibile rifiutare l\'iscrizione di <xliff:g id="USER">%1$s</xliff:g>. Riprova più tardi."</string>
-    <string name="newMessages_label">"Nuovi messaggi <xliff:g id="PROVIDER">%1$s</xliff:g>"</string>
-    <string name="num_unread_chats">"<xliff:g id="NUMBER">%1$d</xliff:g> messaggi da leggere"</string>
-    <string name="subscription_notify_text">"Invito nuovo amico da <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="notify_groupchat_label">"Invito a conversazione di gruppo"</string>
-    <string name="group_chat_invite_notify_text">"Nuovo invito a conversazione di gruppo di <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="add_contact_success">"Contatto \"<xliff:g id="USER">%1$s</xliff:g>\" aggiunto."</string>
-    <string name="delete_contact_success">"Contatto \"<xliff:g id="USER">%1$s</xliff:g>\" eliminato."</string>
-    <string name="block_contact_success">"Contatto \"<xliff:g id="USER">%1$s</xliff:g>\" bloccato."</string>
-    <string name="unblock_contact_success">"Contatto \"<xliff:g id="USER">%1$s</xliff:g>\" sbloccato."</string>
-    <string name="perm_label">"avviare servizio IM"</string>
-    <string name="perm_desc">"Consente l\'avvio del servizio IM tramite intent."</string>
-    <string name="error">"Attenzione"</string>
-    <string name="login_service_failed">"Impossibile accedere al servizio <xliff:g id="SERVICE">%1$s</xliff:g>. Riprova più tardi."\n"(Dettagli: <xliff:g id="DESCRIPTION">%2$s</xliff:g>)"</string>
-    <string name="add_list_failed">"L\'elenco non è stato aggiunto."</string>
-    <string name="block_contact_failed">"Il contatto non è stato bloccato."</string>
-    <string name="unblock_contact_failed">"Il contatto non è stato sbloccato."</string>
-    <string name="select_contact">"Seleziona prima un contatto."</string>
-    <string name="disconnected">"Disconnessa!"\n</string>
-    <string name="service_error">"Errore del servizio."</string>
-    <string name="load_contact_list_failed">"Elenco contatti non caricato."</string>
-    <string name="cant_connect_to_server">"Impossibile collegarsi al server. Controllare la connessione."</string>
-    <string name="contact_already_exist">"<xliff:g id="USER">%1$s</xliff:g> già presente nell\'elenco contatti."</string>
-    <string name="contact_blocked">"Il contatto \"<xliff:g id="USER">%1$s</xliff:g>\" è stato bloccato."</string>
-    <string name="contact_not_loaded">"Attendere il caricamento dell\'elenco contatti."</string>
-    <string name="network_error">"Errore di rete."</string>
-    <string name="service_not_support">"Il server non supporta questa funzionalità."</string>
-    <string name="invalid_password">"La password inserita non è valida."</string>
-    <string name="internal_server_error">"Errore del server."</string>
-    <string name="not_implemented">"Il server non supporta questa funzionalità."</string>
-    <string name="service_unavaiable">"Server al momento non disponibile."</string>
-    <string name="timeout">"Timeout del server."</string>
-    <string name="version_not_supported">"Il server non supporta la versione corrente."</string>
-    <string name="message_queue_full">"La coda messaggi è piena."</string>
-    <string name="domain_not_supported">"Il server non supporta l\'inoltro al dominio."</string>
-    <string name="unknown_user">"Nome utente inserito non riconosciuto."</string>
-    <string name="recipient_blocked_the_user">"Spiacenti. Sei stato bloccato dall\'utente."</string>
-    <string name="session_expired">"Sessione scaduta. Accedi di nuovo."</string>
-    <string name="forced_logout">"accesso effettuato da un altro client"</string>
-    <string name="already_logged_in">"accesso già effettuato da un altro client"</string>
-    <string name="msisdn_error">"Spiacenti. Impossibile leggere il numero di telefono sulla scheda SIM. Contattare l\'operatore."</string>
-    <string name="not_signed_in">"Accesso non effettuato."</string>
-    <string name="general_error">"Codice errore <xliff:g id="CODE">%1$d</xliff:g>"</string>
-  <string-array name="default_smiley_names">
-    <item>"Felice"</item>
-    <item>"Triste"</item>
-    <item>"Fare l\'occhiolino"</item>
-    <item>"Lingua fuori"</item>
-    <item>"Sorpreso"</item>
-    <item>"Baciare"</item>
-    <item>"Urlare"</item>
-    <item>"Favoloso"</item>
-    <item>"Bocca a forma di dollaro"</item>
-    <item>"Gaffe"</item>
-    <item>"Imbarazzato"</item>
-    <item>"Angelo"</item>
-    <item>"Indeciso"</item>
-    <item>"Piangere"</item>
-    <item>"Labbra cucite"</item>
-    <item>"Sorridere"</item>
-    <item>"Confuso"</item>
-  </string-array>
-  <string-array name="default_smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
deleted file mode 100644 (file)
index 0abb727..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="im_label">"IM"</string>
-    <string name="menu_cancel_signin">"ログインをキャンセル"</string>
-    <string name="menu_add_contact">"連絡先を追加"</string>
-    <string name="menu_remove_contact">"連絡先を削除"</string>
-    <string name="menu_block_contact">"連絡先をブロック"</string>
-    <string name="menu_view_blocked">"ブロック"</string>
-    <string name="menu_view_accounts">"アカウントリスト"</string>
-    <string name="menu_settings">"設定"</string>
-    <string name="menu_start_chat">"チャットを始める"</string>
-    <string name="menu_sign_out">"ログアウト"</string>
-    <string name="menu_view_profile">"プロフィールを表示"</string>
-    <string name="menu_end_conversation">"チャットをやめる"</string>
-    <string name="menu_view_contact_list">"連絡先リスト"</string>
-    <string name="menu_invite_contact">"招待..."</string>
-    <string name="menu_switch_chats">"チャットを切り替え"</string>
-    <string name="menu_insert_smiley">"絵文字を挿入"</string>
-    <string name="menu_plus">"Menu+"</string>
-    <string name="default_input_title">"入力"</string>
-    <string name="confirm">"確認"</string>
-    <string name="confirm_delete_contact">"連絡先「<xliff:g id="USER">%1$s</xliff:g>」を削除します。"</string>
-    <string name="confirm_block_contact">"連絡先「<xliff:g id="USER">%1$s</xliff:g>」をブロックします。"</string>
-    <string name="confirm_unblock_contact">"連絡先「<xliff:g id="USER">%1$s</xliff:g>」のブロックを解除します。"</string>
-    <string name="ok">"OK"</string>
-    <string name="cancel">"キャンセル"</string>
-    <string name="yes">"OK"</string>
-    <string name="no">"キャンセル"</string>
-    <string name="signed_out_prompt">"既に<xliff:g id="ACCOUNT">%1$s</xliff:g>をログアウトしています。"</string>
-    <string name="signed_out_prompt_with_error">"既に<xliff:g id="ACCOUNT">%1$s</xliff:g>をログアウトしています。理由:<xliff:g id="REASON">%2$s</xliff:g>"</string>
-    <string name="add_account">"<xliff:g id="ACCOUNT">%1$s</xliff:g>アカウント"</string>
-    <string name="label_username">"ユーザー名:"</string>
-    <string name="label_password">"パスワード"</string>
-    <string name="remember_password">"パスワードを保存する"</string>
-    <string name="keep_me_signed_in">"自動ログイン"</string>
-    <string name="sign_up">"アカウントがない場合"</string>
-    <string name="check_auto_sign_in">"このオプションをONにするとこのアプリケーションを開くたびに自動的にこのアカウントでログインします。このオプションをOFFにするにはログアウトしてから[自動ログイン]をOFFにしてください。"</string>
-    <string name="sign_in">"ログイン"</string>
-    <string name="signing_in_to">"<xliff:g id="ACCOUNT">%1$s</xliff:g>にログインしています"</string>
-    <string name="signing_in_wait">"ログインしています..."</string>
-    <!-- no translation found for bg_data_prompt_title (4861800723853178111) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_message (2343305645142823544) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_ok (3443385427882751532) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_cancel (7206105589826174638) -->
-    <skip />
-    <string name="ongoing_conversation">"継続中のチャット (<xliff:g id="NUMBER">%1$d</xliff:g>件)"</string>
-    <string name="online_count">"オンライン<xliff:g id="NUMBER">%1$d</xliff:g>人"</string>
-    <string name="subscriptions">"友だちの招待"</string>
-    <string name="unknown_contact">"("<i>"不明"</i>")"</string>
-    <string name="empty_contact_group">"未登録"</string>
-    <string name="empty_conversation_group">"チャットしていません"</string>
-    <string name="contacts_picker_title">"招待する連絡先を選択してください"</string>
-    <string name="contact_filter_hint">"検索する連絡先を入力"</string>
-    <string name="empty_contact_list">"連絡先がありません。"</string>
-    <string name="blocked_list_title">"ブロックしている連絡先-<xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="no_blocked_contact">"ブロック中のユーザーはいません。"</string>
-    <string name="contact_profile_title">"連絡先プロファイル"</string>
-    <string name="label_status">"ステータス:"</string>
-    <string name="label_client_type">"クライアントタイプ:"</string>
-    <string name="client_type_computer">"パソコン"</string>
-    <string name="client_type_mobile">"モバイル"</string>
-    <string name="presence_available">"オンライン"</string>
-    <string name="presence_busy">"取り込み中"</string>
-    <string name="presence_away">"退席中"</string>
-    <string name="presence_idle">"アイドル状態"</string>
-    <string name="presence_offline">"オフライン"</string>
-    <string name="presence_invisible">"オフラインとして表示"</string>
-    <string name="preference_title">"<xliff:g id="PROVIDER">%1$s</xliff:g> settings (dev only)"</string>
-    <string name="data_channel_label">"データチャネル"</string>
-    <string name="data_encoding_label">"データのエンコード"</string>
-    <string name="cir_channel_label">"CIRチャネル"</string>
-    <string name="host_label">"ホスト"</string>
-    <string name="msisdn_label">"MSISDN"</string>
-    <string name="http">"HTTP"</string>
-    <string name="sms">"SMS"</string>
-    <string name="tcp">"TCP"</string>
-    <string name="xml">"XML"</string>
-    <string name="wbxml">"WBXML"</string>
-    <string name="save">"保存"</string>
-    <string name="chat_with">"<xliff:g id="USER">%1$s</xliff:g>とチャット"</string>
-    <string name="me">"自分"</string>
-    <string name="compose_hint">"メッセージを入力"</string>
-    <string name="contact_online">"<xliff:g id="USER">%1$s</xliff:g>さんはオンラインです"</string>
-    <string name="contact_away">"<xliff:g id="USER">%1$s</xliff:g>さんは退席中です"</string>
-    <string name="contact_busy">"<xliff:g id="USER">%1$s</xliff:g>さんは取り込み中です"</string>
-    <string name="contact_offline">"<xliff:g id="USER">%1$s</xliff:g>さんはオフラインです"</string>
-    <string name="contact_joined">"<xliff:g id="USER">%1$s</xliff:g>さんが参加しました"</string>
-    <string name="contact_left">"<xliff:g id="USER">%1$s</xliff:g>さんが退出しました"</string>
-    <string name="time_stamp" format="date">"<xliff:g id="DATE">EEEE</xliff:g>' '<xliff:g id="HOUR">hh</xliff:g>':'<xliff:g id="MINUTE">mm</xliff:g>' '<xliff:g id="AMPM">a</xliff:g>'送信'"</string>
-    <string name="send">"送信"</string>
-    <string name="msg_sent_failed">"メッセージを送信できませんでした。"</string>
-    <string name="disconnected_warning">"サーバーとの接続が失われました。オンラインになり次第メッセージを送信します。"</string>
-    <string name="contact_offline_warning">"<xliff:g id="USER_0">%1$s</xliff:g>さんはオフラインです。<xliff:g id="USER_1">%1$s</xliff:g>さんがオンラインになったら、メッセージを送信します。"</string>
-    <string name="contact_not_in_list_warning">"<xliff:g id="USER">%1$s</xliff:g>さんは連絡先リストに登録されていません。"</string>
-    <string name="select_link_title">"リンクを選択"</string>
-    <string name="empty_chat_list">"アクティブなチャットはありません。"</string>
-    <string name="add_contact_title">"連絡先を追加"</string>
-    <string name="input_contact_label">"招待する人のメールアドレス:"</string>
-    <string name="choose_list_label">"リストを選択:"</string>
-    <string name="invite_instruction">"連絡先から追加する名前を入力してください。"</string>
-    <string name="invite_label">"招待状を送る"</string>
-    <string name="setting_title">"全般設定"</string>
-    <string name="hide_offline_contacts">"オフラインの連絡先を表示しない"</string>
-    <string name="notification_group_title">"通知設定"</string>
-    <string name="notification_enabled_title">"IM通知"</string>
-    <string name="notification_enabled_summary">"IM受信: ステータスバーで通知"</string>
-    <string name="notification_vibrate_title">"バイブレーション"</string>
-    <string name="notification_vibrate_summary">"IM受信: バイブレーションもON"</string>
-    <string name="notification_sound_title">"サウンド"</string>
-    <string name="notification_sound_summary">"IM受信: 着信音も鳴らす"</string>
-    <string name="notification_ringtone_title">"着信音を選択"</string>
-    <string name="invitation_prompt">"<xliff:g id="USER">%1$s</xliff:g>さんからグループチャットに招待されました。"</string>
-    <string name="invitation_sent_prompt">"招待状を<xliff:g id="USER">%1$s</xliff:g>さんに送りました。"</string>
-    <string name="accept_invitation">"承認"</string>
-    <string name="decline_invitation">"拒否"</string>
-    <string name="subscription_prompt">"<xliff:g id="USER">%1$s</xliff:g>さんが連絡先リストへの登録にあなたを招待しました。"</string>
-    <string name="approve_subscription">"承認"</string>
-    <string name="decline_subscription">"拒否"</string>
-    <string name="approve_subscription_error">"<xliff:g id="USER">%1$s</xliff:g>さんからの登録依頼を承認できませんでした。しばらくしてからもう一度試してください。"</string>
-    <string name="decline_subscription_error">"<xliff:g id="USER">%1$s</xliff:g>さんからの登録依頼を拒否できませんでした。しばらくしてからもう一度試してください。"</string>
-    <string name="newMessages_label">"新しい<xliff:g id="PROVIDER">%1$s</xliff:g>メッセージが届きました"</string>
-    <string name="num_unread_chats">"未読のチャットが<xliff:g id="NUMBER">%1$d</xliff:g>件あります。"</string>
-    <string name="subscription_notify_text">"<xliff:g id="USER">%s</xliff:g>さんから招待状が届きました"</string>
-    <string name="notify_groupchat_label">"グループチャットの招待"</string>
-    <string name="group_chat_invite_notify_text">"<xliff:g id="USER">%s</xliff:g>さんからグループチャットの招待状が届きました"</string>
-    <string name="add_contact_success">"連絡先「<xliff:g id="USER">%1$s</xliff:g>」を追加しました。"</string>
-    <string name="delete_contact_success">"連絡先「<xliff:g id="USER">%1$s</xliff:g>」を削除しました。"</string>
-    <string name="block_contact_success">"連絡先「<xliff:g id="USER">%1$s</xliff:g>」をブロックしました。"</string>
-    <string name="unblock_contact_success">"連絡先「<xliff:g id="USER">%1$s</xliff:g>」のブロックを解除しました。"</string>
-    <string name="perm_label">"IMサービスの開始"</string>
-    <string name="perm_desc">"intent経由でのIMサービスの開始をアプリケーションに許可します。"</string>
-    <string name="error">"注意"</string>
-    <string name="login_service_failed">"<xliff:g id="SERVICE">%1$s</xliff:g>サービスにログインできませんでした。しばらくしてからやり直してください。"\n"(詳細:<xliff:g id="DESCRIPTION">%2$s</xliff:g>)"</string>
-    <string name="add_list_failed">"リストを追加できませんでした。"</string>
-    <string name="block_contact_failed">"連絡先をブロックできませんでした。"</string>
-    <string name="unblock_contact_failed">"連絡先のブロックを解除できませんでした。"</string>
-    <string name="select_contact">"まず連絡先を選択してください。"</string>
-    <string name="disconnected">"切断されました。"\n</string>
-    <string name="service_error">"サービスエラー"</string>
-    <string name="load_contact_list_failed">"連絡先リストをロードできませんでした。"</string>
-    <string name="cant_connect_to_server">"サーバーに接続できません。接続を確認してください。"</string>
-    <string name="contact_already_exist">"<xliff:g id="USER">%1$s</xliff:g>さんは既に連絡先リストに登録されています。"</string>
-    <string name="contact_blocked">"連絡先「<xliff:g id="USER">%1$s</xliff:g>」はブロックされています。"</string>
-    <string name="contact_not_loaded">"連絡先リストをロードしています。しばらくお待ちください。"</string>
-    <string name="network_error">"ネットワークエラーが発生しました。"</string>
-    <string name="service_not_support">"この機能はサーバーでサポートされていません。"</string>
-    <string name="invalid_password">"入力されたパスワードは無効です。"</string>
-    <string name="internal_server_error">"サーバーでエラーが発生しました。"</string>
-    <string name="not_implemented">"この機能はサーバーでサポートされていません。"</string>
-    <string name="service_unavaiable">"現在サーバーを使用できません。"</string>
-    <string name="timeout">"サーバーがタイムアウトしました。"</string>
-    <string name="version_not_supported">"現在のバージョンはサーバーでサポートされていません。"</string>
-    <string name="message_queue_full">"メッセージキューがいっぱいです。"</string>
-    <string name="domain_not_supported">"このドメインへの転送はサーバーでサポートされていません。"</string>
-    <string name="unknown_user">"入力されたユーザー名を認識できません。"</string>
-    <string name="recipient_blocked_the_user">"ユーザーによってブロックされています。"</string>
-    <string name="session_expired">"セッションは期限切れになりました。もう一度ログインしてください。"</string>
-    <string name="forced_logout">"別のクライアントからログインしています。"</string>
-    <string name="already_logged_in">"別のクライアントから既にログインしています。"</string>
-    <string name="msisdn_error">"SIMカードから電話番号を読み取れませんでした。オペレータにお問い合わせください。"</string>
-    <string name="not_signed_in">"現在ログインしていません。"</string>
-    <string name="general_error">"エラーコード<xliff:g id="CODE">%1$d</xliff:g>"</string>
-  <string-array name="default_smiley_names">
-    <item>"ハッピー"</item>
-    <item>"悲しい"</item>
-    <item>"ウィンク"</item>
-    <item>"アッカンベー"</item>
-    <item>"びっくり"</item>
-    <item>"キス"</item>
-    <item>"激怒"</item>
-    <item>"クール"</item>
-    <item>"気持ち悪い"</item>
-    <item>"しまった"</item>
-    <item>"恥ずかしい"</item>
-    <item>"天使"</item>
-    <item>"迷う"</item>
-    <item>"泣く"</item>
-    <item>"お口にチャック"</item>
-    <item>"笑顔"</item>
-    <item>"混乱"</item>
-  </string-array>
-  <string-array name="default_smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
deleted file mode 100644 (file)
index d61b065..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="im_label">"IM"</string>
-    <string name="menu_cancel_signin">"로그인 취소"</string>
-    <string name="menu_add_contact">"연락처 추가"</string>
-    <string name="menu_remove_contact">"연락처 삭제"</string>
-    <string name="menu_block_contact">"연락처 차단"</string>
-    <string name="menu_view_blocked">"차단됨"</string>
-    <string name="menu_view_accounts">"계정 목록"</string>
-    <string name="menu_settings">"설정"</string>
-    <string name="menu_start_chat">"채팅 시작"</string>
-    <string name="menu_sign_out">"로그아웃"</string>
-    <string name="menu_view_profile">"프로필 보기"</string>
-    <string name="menu_end_conversation">"채팅 끝내기"</string>
-    <string name="menu_view_contact_list">"연락처 목록"</string>
-    <string name="menu_invite_contact">"초대..."</string>
-    <string name="menu_switch_chats">"채팅 전환"</string>
-    <string name="menu_insert_smiley">"이모티콘 삽입"</string>
-    <string name="menu_plus">"Menu+"</string>
-    <string name="default_input_title">"입력"</string>
-    <string name="confirm">"확인"</string>
-    <string name="confirm_delete_contact">"연락처 \'<xliff:g id="USER">%1$s</xliff:g>\'이(가) 삭제됩니다."</string>
-    <string name="confirm_block_contact">"연락처 \'<xliff:g id="USER">%1$s</xliff:g>\'이(가) 차단됩니다."</string>
-    <string name="confirm_unblock_contact">"연락처 \'<xliff:g id="USER">%1$s</xliff:g>\'이(가) 차단 해제됩니다."</string>
-    <string name="ok">"확인"</string>
-    <string name="cancel">"취소"</string>
-    <string name="yes">"확인"</string>
-    <string name="no">"취소"</string>
-    <string name="signed_out_prompt">"<xliff:g id="ACCOUNT">%1$s</xliff:g>에서 로그아웃되었습니다."</string>
-    <string name="signed_out_prompt_with_error">"<xliff:g id="REASON">%2$s</xliff:g>(으)로 인해 <xliff:g id="ACCOUNT">%1$s</xliff:g>에서 로그아웃되었습니다."</string>
-    <string name="add_account">"<xliff:g id="ACCOUNT">%1$s</xliff:g> 계정 추가"</string>
-    <string name="label_username">"사용자 이름:"</string>
-    <string name="label_password">"비밀번호:"</string>
-    <string name="remember_password">"내 비밀번호 저장"</string>
-    <string name="keep_me_signed_in">"자동으로 로그인"</string>
-    <string name="sign_up">"계정이 없으세요?"</string>
-    <string name="check_auto_sign_in">"이 옵션을 선택하면 응용프로그램을 열 때마다 자동으로 로그인됩니다. 옵션을 비활성화하려면 로그아웃한 다음 \'자동으로 로그인\' 확인란을 선택 취소하세요."</string>
-    <string name="sign_in">"로그인"</string>
-    <string name="signing_in_to">"<xliff:g id="ACCOUNT">%1$s</xliff:g>에 로그인하는 중"</string>
-    <string name="signing_in_wait">"로그인하는 중..."</string>
-    <!-- no translation found for bg_data_prompt_title (4861800723853178111) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_message (2343305645142823544) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_ok (3443385427882751532) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_cancel (7206105589826174638) -->
-    <skip />
-    <string name="ongoing_conversation">"진행 중인 채팅(<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="online_count">"온라인 <xliff:g id="NUMBER">%1$d</xliff:g>명"</string>
-    <string name="subscriptions">"친구 초대"</string>
-    <string name="unknown_contact">"("<i>"알 수 없음"</i>")"</string>
-    <string name="empty_contact_group">"비어 있음"</string>
-    <string name="empty_conversation_group">"대화 내용 없음"</string>
-    <string name="contacts_picker_title">"초대할 연락처 선택"</string>
-    <string name="contact_filter_hint">"입력하여 연락처 찾기"</string>
-    <string name="empty_contact_list">"연락처가 없습니다."</string>
-    <string name="blocked_list_title">"차단된 연락처 - <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="no_blocked_contact">"차단된 연락처가 없습니다."</string>
-    <string name="contact_profile_title">"연락처 프로필"</string>
-    <string name="label_status">"상태:"</string>
-    <string name="label_client_type">"클라이언트 유형:"</string>
-    <string name="client_type_computer">"컴퓨터"</string>
-    <string name="client_type_mobile">"모바일"</string>
-    <string name="presence_available">"온라인"</string>
-    <string name="presence_busy">"다른 용무 중"</string>
-    <string name="presence_away">"자리 비움"</string>
-    <string name="presence_idle">"한가함"</string>
-    <string name="presence_offline">"오프라인"</string>
-    <string name="presence_invisible">"오프라인"</string>
-    <string name="preference_title">"<xliff:g id="PROVIDER">%1$s</xliff:g> settings (dev only)"</string>
-    <string name="data_channel_label">"데이터 채널"</string>
-    <string name="data_encoding_label">"데이터 인코딩"</string>
-    <string name="cir_channel_label">"CIR 채널"</string>
-    <string name="host_label">"호스트"</string>
-    <string name="msisdn_label">"MSISDN"</string>
-    <string name="http">"HTTP"</string>
-    <string name="sms">"SMS"</string>
-    <string name="tcp">"TCP"</string>
-    <string name="xml">"XML"</string>
-    <string name="wbxml">"WBXML"</string>
-    <string name="save">"저장"</string>
-    <string name="chat_with">"<xliff:g id="USER">%1$s</xliff:g>님과 채팅"</string>
-    <string name="me">"나"</string>
-    <string name="compose_hint">"메시지 내용을 입력하세요."</string>
-    <string name="contact_online">"<xliff:g id="USER">%1$s</xliff:g>님이 온라인 상태입니다."</string>
-    <string name="contact_away">"<xliff:g id="USER">%1$s</xliff:g>님이 자리에 없습니다."</string>
-    <string name="contact_busy">"<xliff:g id="USER">%1$s</xliff:g>님이 다른 용무 중입니다."</string>
-    <string name="contact_offline">"<xliff:g id="USER">%1$s</xliff:g>님이 오프라인 상태입니다."</string>
-    <string name="contact_joined">"<xliff:g id="USER">%1$s</xliff:g>님이 참여하셨습니다."</string>
-    <string name="contact_left">"<xliff:g id="USER">%1$s</xliff:g>님이 채팅룸을 나가셨습니다."</string>
-    <string name="time_stamp" format="date">"<xliff:g id="DATE">EEEE</xliff:g>', '<xliff:g id="HOUR">hh</xliff:g>':'<xliff:g id="MINUTE">mm</xliff:g>' '<xliff:g id="AMPM">a</xliff:g>'에 전송'"</string>
-    <string name="send">"보내기"</string>
-    <string name="msg_sent_failed">"메시지를 보내지 못했습니다."</string>
-    <string name="disconnected_warning">"서버와의 연결이 끊어졌습니다. 메시지는 온라인 상태일 때 전송됩니다."</string>
-    <string name="contact_offline_warning">"<xliff:g id="USER_0">%1$s</xliff:g>님이 오프라인 상태입니다. 보내는 메시지는 <xliff:g id="USER_1">%1$s</xliff:g>님이 온라인 상태일 때 배달됩니다."</string>
-    <string name="contact_not_in_list_warning">"<xliff:g id="USER">%1$s</xliff:g>이(가) 연락처 목록에 없습니다."</string>
-    <string name="select_link_title">"링크 선택"</string>
-    <string name="empty_chat_list">"진행 중인 채팅이 없습니다."</string>
-    <string name="add_contact_title">"연락처 추가"</string>
-    <string name="input_contact_label">"초대할 사람의 이메일 주소:"</string>
-    <string name="choose_list_label">"목록 선택:"</string>
-    <string name="invite_instruction">"연락처에서 추가할 이름을 입력하세요."</string>
-    <string name="invite_label">"초대장 보내기"</string>
-    <string name="setting_title">"일반 설정"</string>
-    <string name="hide_offline_contacts">"오프라인 연락처 숨기기"</string>
-    <string name="notification_group_title">"알림 설정"</string>
-    <string name="notification_enabled_title">"IM 알림"</string>
-    <string name="notification_enabled_summary">"IM 도착 시 상태 표시줄에 알림"</string>
-    <string name="notification_vibrate_title">"진동"</string>
-    <string name="notification_vibrate_summary">"IM 도착 시 진동 울림"</string>
-    <string name="notification_sound_title">"소리"</string>
-    <string name="notification_sound_summary">"IM 도착 시 벨소리 재생"</string>
-    <string name="notification_ringtone_title">"벨소리 선택"</string>
-    <string name="invitation_prompt">"<xliff:g id="USER">%1$s</xliff:g>님이 그룹 채팅에 초대하셨습니다."</string>
-    <string name="invitation_sent_prompt">"<xliff:g id="USER">%1$s</xliff:g>님에게 초대장을 보냈습니다."</string>
-    <string name="accept_invitation">"수락"</string>
-    <string name="decline_invitation">"거절"</string>
-    <string name="subscription_prompt">"<xliff:g id="USER">%1$s</xliff:g>님이 연락처 목록에 올리기 위해 초대하셨습니다."</string>
-    <string name="approve_subscription">"수락"</string>
-    <string name="decline_subscription">"거절"</string>
-    <string name="approve_subscription_error">"<xliff:g id="USER">%1$s</xliff:g>님의 구독을 승인할 수 없습니다. 나중에 다시 시도해 보세요."</string>
-    <string name="decline_subscription_error">"<xliff:g id="USER">%1$s</xliff:g>님의 구독을 거절할 수 없습니다. 나중에 다시 시도해 보세요."</string>
-    <string name="newMessages_label">"새로운 <xliff:g id="PROVIDER">%1$s</xliff:g> 메시지"</string>
-    <string name="num_unread_chats">"읽지 않은 채팅 <xliff:g id="NUMBER">%1$d</xliff:g>개"</string>
-    <string name="subscription_notify_text">"<xliff:g id="USER">%s</xliff:g>님이 친구 초대를 보내셨습니다."</string>
-    <string name="notify_groupchat_label">"그룹 채팅 초대"</string>
-    <string name="group_chat_invite_notify_text">"<xliff:g id="USER">%s</xliff:g>님이 그룹 채팅에 초대하셨습니다."</string>
-    <string name="add_contact_success">"연락처 \'<xliff:g id="USER">%1$s</xliff:g>\'이(가) 추가되었습니다."</string>
-    <string name="delete_contact_success">"연락처 \'<xliff:g id="USER">%1$s</xliff:g>\'이(가) 삭제되었습니다."</string>
-    <string name="block_contact_success">"연락처 \'<xliff:g id="USER">%1$s</xliff:g>\'이(가) 차단되었습니다."</string>
-    <string name="unblock_contact_success">"연락처 \'<xliff:g id="USER">%1$s</xliff:g>\'이(가) 차단 해제되었습니다."</string>
-    <string name="perm_label">"IM 서비스 시작"</string>
-    <string name="perm_desc">"응용프로그램이 의도를 통해 IM 서비스를 시작할 수 있도록 합니다."</string>
-    <string name="error">"주의"</string>
-    <string name="login_service_failed">"<xliff:g id="SERVICE">%1$s</xliff:g> 서비스에 로그인할 수 없습니다. 나중에 다시 시도해 보세요."\n"(세부정보: <xliff:g id="DESCRIPTION">%2$s</xliff:g>)"</string>
-    <string name="add_list_failed">"목록이 추가되지 않았습니다."</string>
-    <string name="block_contact_failed">"연락처를 차단하지 못했습니다."</string>
-    <string name="unblock_contact_failed">"연락처를 차단 해제하지 못했습니다."</string>
-    <string name="select_contact">"먼저 연락처를 선택하세요."</string>
-    <string name="disconnected">"연결 끊김!"\n</string>
-    <string name="service_error">"서비스 오류!"</string>
-    <string name="load_contact_list_failed">"연락처 목록을 로드하지 못했습니다."</string>
-    <string name="cant_connect_to_server">"서버에 연결할 수 없습니다. 연결을 확인하세요."</string>
-    <string name="contact_already_exist">"<xliff:g id="USER">%1$s</xliff:g>이(가) 이미 연락처 목록에 있습니다."</string>
-    <string name="contact_blocked">"연락처 \'<xliff:g id="USER">%1$s</xliff:g>\'이(가) 차단되었습니다."</string>
-    <string name="contact_not_loaded">"연락처 목록이 로드되는 동안 잠시 기다려 주세요."</string>
-    <string name="network_error">"네트워크 오류가 발생했습니다."</string>
-    <string name="service_not_support">"서버에서 이 기능을 지원하지 않습니다."</string>
-    <string name="invalid_password">"입력한 비밀번호가 올바르지 않습니다."</string>
-    <string name="internal_server_error">"서버에 오류가 발생했습니다."</string>
-    <string name="not_implemented">"서버에서 이 기능을 지원하지 않습니다."</string>
-    <string name="service_unavaiable">"현재 서버를 사용할 수 없습니다."</string>
-    <string name="timeout">"서버가 제한 시간을 초과했습니다."</string>
-    <string name="version_not_supported">"서버에서 현재 버전을 지원하지 않습니다."</string>
-    <string name="message_queue_full">"메시지 대기열이 가득 찼습니다."</string>
-    <string name="domain_not_supported">"서버에서 도메인으로 전달하는 기능을 지원하지 않습니다."</string>
-    <string name="unknown_user">"입력한 사용자 이름을 인식할 수 없습니다."</string>
-    <string name="recipient_blocked_the_user">"죄송합니다. 상대방에 의해 차단되었습니다."</string>
-    <string name="session_expired">"세션이 만료되었습니다. 다시 로그인하세요."</string>
-    <string name="forced_logout">"다른 클라이언트로부터 로그인했습니다."</string>
-    <string name="already_logged_in">"이미 다른 클라이언트로부터 로그인했습니다."</string>
-    <string name="msisdn_error">"죄송합니다. SIM 카드에서 전화번호를 읽을 수 없습니다. 이동통신사에 문의하세요."</string>
-    <string name="not_signed_in">"현재 로그인되어 있지 않습니다."</string>
-    <string name="general_error">"오류 코드 <xliff:g id="CODE">%1$d</xliff:g>"</string>
-  <string-array name="default_smiley_names">
-    <item>"행복"</item>
-    <item>"슬픔"</item>
-    <item>"윙크"</item>
-    <item>"메롱"</item>
-    <item>"놀람"</item>
-    <item>"키스"</item>
-    <item>"소리 지름"</item>
-    <item>"멋짐"</item>
-    <item>"욕심"</item>
-    <item>"부끄러움"</item>
-    <item>"당황"</item>
-    <item>"천사"</item>
-    <item>"우유부단"</item>
-    <item>"울음"</item>
-    <item>"입막음"</item>
-    <item>"웃음"</item>
-    <item>"어리둥절"</item>
-  </string-array>
-  <string-array name="default_smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
deleted file mode 100644 (file)
index 9d6b208..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="im_label">"Nettprat"</string>
-    <string name="menu_cancel_signin">"Avbryt innlogging"</string>
-    <string name="menu_add_contact">"Legg til kontakt"</string>
-    <string name="menu_remove_contact">"Fjern kontakt"</string>
-    <string name="menu_block_contact">"Blokker kontakt"</string>
-    <string name="menu_view_blocked">"Blokkert"</string>
-    <string name="menu_view_accounts">"Kontoliste"</string>
-    <string name="menu_settings">"Innstillinger"</string>
-    <string name="menu_start_chat">"Start samtale"</string>
-    <string name="menu_sign_out">"Logg ut"</string>
-    <string name="menu_view_profile">"Vis profil"</string>
-    <string name="menu_end_conversation">"Avslutt samtale"</string>
-    <string name="menu_view_contact_list">"Kontaktliste"</string>
-    <string name="menu_invite_contact">"Inviter…"</string>
-    <string name="menu_switch_chats">"Bytt mellom samtaler"</string>
-    <string name="menu_insert_smiley">"Sett inn smilefjes"</string>
-    <string name="menu_plus">"Meny+"</string>
-    <string name="default_input_title">"Inndata"</string>
-    <string name="confirm">"Bekreft"</string>
-    <string name="confirm_delete_contact">"Kontakten \\\\\\\"<xliff:g id="USER">%1$s</xliff:g>\\\\\\\" vil bli slettet."</string>
-    <string name="confirm_block_contact">"Kontakten \\\\\\\"<xliff:g id="USER">%1$s</xliff:g>\\\\\\\" vil bli blokkert."</string>
-    <string name="confirm_unblock_contact">"Kontakten \\\\\\\"<xliff:g id="USER">%1$s</xliff:g>\\\\\\\" vil bli avblokkert."</string>
-    <string name="ok">"OK"</string>
-    <string name="cancel">"Avbryt"</string>
-    <string name="yes">"OK"</string>
-    <string name="no">"Avbryt"</string>
-    <string name="signed_out_prompt">"De er blitt logget ut fra <xliff:g id="ACCOUNT">%1$s</xliff:g>."</string>
-    <string name="signed_out_prompt_with_error">"Du er blitt logget ut fra <xliff:g id="ACCOUNT">%1$s</xliff:g> fordi <xliff:g id="REASON">%2$s</xliff:g>."</string>
-    <string name="add_account">"Legg til <xliff:g id="ACCOUNT">%1$s</xliff:g>-konto"</string>
-    <string name="label_username">"Brukernavn:"</string>
-    <string name="label_password">"Passord:"</string>
-    <string name="remember_password">"Husk passord."</string>
-    <string name="keep_me_signed_in">"Logg inn automatisk."</string>
-    <string name="sign_up">"Mangler du konto?"</string>
-    <string name="check_auto_sign_in">"Dette valget logger deg automatisk inn hver gang du åpner applikasjonen. For å avmerke valget, logg ut og fjern så haken ved \\\\\\\"Logg inn automatis\\\\\\\"."</string>
-    <string name="sign_in">"Logg inn"</string>
-    <string name="signing_in_to">"Logger inn på <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="signing_in_wait">"Logger inn…"</string>
-    <!-- no translation found for bg_data_prompt_title (4861800723853178111) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_message (2343305645142823544) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_ok (3443385427882751532) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_cancel (7206105589826174638) -->
-    <skip />
-    <string name="ongoing_conversation">"Pågående samtaler (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="online_count">"<xliff:g id="NUMBER">%1$d</xliff:g> tilgjengelig"</string>
-    <string name="subscriptions">"Venneinvitasjoner"</string>
-    <string name="unknown_contact">"("<i>"Ukjent"</i>")"</string>
-    <string name="empty_contact_group">"Tom"</string>
-    <string name="empty_conversation_group">"Ingen samtaler"</string>
-    <string name="contacts_picker_title">"Velg kontakt(er) som skal inviteres"</string>
-    <string name="contact_filter_hint">"Skriv for å finne kontakter"</string>
-    <string name="empty_contact_list">"Fant ingen kontakter."</string>
-    <string name="blocked_list_title">"Blokkerte kontakter - <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="no_blocked_contact">"Ingen blokkerte kontakter."</string>
-    <string name="contact_profile_title">"Kontaktprofil"</string>
-    <string name="label_status">"Status:"</string>
-    <string name="label_client_type">"Klienttype:"</string>
-    <string name="client_type_computer">"Datamaskin"</string>
-    <string name="client_type_mobile">"Mobil"</string>
-    <string name="presence_available">"Tilgjengelig"</string>
-    <string name="presence_busy">"Opptatt"</string>
-    <string name="presence_away">"Borte"</string>
-    <string name="presence_idle">"Inaktiv"</string>
-    <string name="presence_offline">"Avlogget"</string>
-    <string name="presence_invisible">"Usynlig"</string>
-    <string name="preference_title">"<xliff:g id="PROVIDER">%1$s</xliff:g> settings (dev only)"</string>
-    <string name="data_channel_label">"Data channel"</string>
-    <string name="data_encoding_label">"Data encoding"</string>
-    <string name="cir_channel_label">"CIR channel"</string>
-    <string name="host_label">"Host"</string>
-    <string name="msisdn_label">"MSISDN"</string>
-    <string name="http">"HTTP"</string>
-    <string name="sms">"SMS"</string>
-    <string name="tcp">"TCP"</string>
-    <string name="xml">"XML"</string>
-    <string name="wbxml">"WBXML"</string>
-    <string name="save">"Save"</string>
-    <string name="chat_with">"Samtale med <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="me">"Meg"</string>
-    <!-- no translation found for compose_hint (1735533889811320962) -->
-    <skip />
-    <string name="contact_online">"<xliff:g id="USER">%1$s</xliff:g> er tilgjengelig"</string>
-    <string name="contact_away">"<xliff:g id="USER">%1$s</xliff:g> er borte"</string>
-    <string name="contact_busy">"<xliff:g id="USER">%1$s</xliff:g> er opptatt"</string>
-    <string name="contact_offline">"<xliff:g id="USER">%1$s</xliff:g> er avlogget"</string>
-    <string name="contact_joined">"<xliff:g id="USER">%1$s</xliff:g> har blitt med i samtalen"</string>
-    <string name="contact_left">"<xliff:g id="USER">%1$s</xliff:g> har forlatt samtalen"</string>
-    <!-- no translation found for time_stamp (8952691401963972802) -->
-    <skip />
-    <string name="send">"Send"</string>
-    <string name="msg_sent_failed">"Kunne ikke sende meldingen."</string>
-    <string name="disconnected_warning">"Mistet tilkoblingen til tjeneren. Meldingen vil bli sendt ved tilkobling."</string>
-    <string name="contact_offline_warning">"<xliff:g id="USER_0">%1$s</xliff:g> er avlogget. Meldinger du sender vil bli levert når <xliff:g id="USER_1">%1$s</xliff:g> kobler til."</string>
-    <string name="contact_not_in_list_warning">"<xliff:g id="USER">%1$s</xliff:g> er ikke i kontaktlisten."</string>
-    <string name="select_link_title">"Velg lenke"</string>
-    <string name="empty_chat_list">"Ingen aktive samtaler."</string>
-    <string name="add_contact_title">"Legg til kontakt"</string>
-    <string name="input_contact_label">"E-postadresse til den du ønsker å invitere:"</string>
-    <string name="choose_list_label">"Velg en liste:"</string>
-    <string name="invite_instruction">"Skriv inn et navn som skal legges til fra kontaktene."</string>
-    <string name="invite_label">"Send invitasjon"</string>
-    <string name="setting_title">"Generelle innstillinger"</string>
-    <string name="hide_offline_contacts">"Skjul avloggede kontakter"</string>
-    <string name="notification_group_title">"Varslingsinnstillinger"</string>
-    <string name="notification_enabled_title">"Varsel om lynmeldinger"</string>
-    <string name="notification_enabled_summary">"Varsle i statusveltet når det kommer lynmeldinger"</string>
-    <string name="notification_vibrate_title">"Vibrer"</string>
-    <string name="notification_vibrate_summary">"Vibrer når det kommer lynmeldinger"</string>
-    <string name="notification_sound_title">"Lyd"</string>
-    <string name="notification_sound_summary">"Spill ringetone når det kommer lynmeldinger"</string>
-    <string name="notification_ringtone_title">"Velg ringetone"</string>
-    <string name="invitation_prompt">"<xliff:g id="USER">%1$s</xliff:g> har invitert deg til en gruppesamtale."</string>
-    <string name="invitation_sent_prompt">"Invitasjonen er blitt sendt til <xliff:g id="USER">%1$s</xliff:g>."</string>
-    <string name="accept_invitation">"Godta"</string>
-    <string name="decline_invitation">"Avslå"</string>
-    <string name="subscription_prompt">"<xliff:g id="USER">%1$s</xliff:g> har invitert deg til å være på kontaktlisten sin."</string>
-    <string name="approve_subscription">"Godta"</string>
-    <string name="decline_subscription">"Avslå"</string>
-    <string name="approve_subscription_error">"Kunne ikke godta abonnement fra <xliff:g id="USER">%1$s</xliff:g>. Prøv igjen senere."</string>
-    <string name="decline_subscription_error">"Kunne ikke avslå abonnement fra <xliff:g id="USER">%1$s</xliff:g>. Prøv igjen senere."</string>
-    <string name="newMessages_label">"Nye <xliff:g id="PROVIDER">%1$s</xliff:g>-meldinger"</string>
-    <string name="num_unread_chats">"<xliff:g id="NUMBER">%1$d</xliff:g> uleste samtaler"</string>
-    <string name="subscription_notify_text">"Ny venneinvitasjon fra <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="notify_groupchat_label">"Invitasjon til gruppesamtale"</string>
-    <string name="group_chat_invite_notify_text">"Ny invitasjon til gruppesamtale fra <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="add_contact_success">"Kontakten \\\\\\\"<xliff:g id="USER">%1$s</xliff:g>\\\\\\\" ble lagt til."</string>
-    <string name="delete_contact_success">"Kontakten \\\\\\\"<xliff:g id="USER">%1$s</xliff:g>\\\\\\\" ble slettet."</string>
-    <string name="block_contact_success">"Kontakten \\\\\\\"<xliff:g id="USER">%1$s</xliff:g>\\\\\\\" ble blokkert."</string>
-    <string name="unblock_contact_success">"Kontakten \\\\\\\"<xliff:g id="USER">%1$s</xliff:g>\\\\\\\" ble avblokkert."</string>
-    <string name="perm_label">"start lynmeldingstjeneste"</string>
-    <string name="perm_desc">"Tillater applikasjoner å starte lynmeldingstjenesten."</string>
-    <string name="error">"NB"</string>
-    <string name="login_service_failed">"Kunne ikke logge inn på <xliff:g id="SERVICE">%1$s</xliff:g>. Prøv igjen senere."\n"(Detaljer: <xliff:g id="DESCRIPTION">%2$s</xliff:g>)"</string>
-    <string name="add_list_failed">"Listen ble ikke lagt til."</string>
-    <string name="block_contact_failed">"Kontakten ble ikke blokkert."</string>
-    <string name="unblock_contact_failed">"Kontakten ble ikke avblokkert."</string>
-    <string name="select_contact">"Velg en kontakt først."</string>
-    <string name="disconnected">"Frakoblet!"\n</string>
-    <string name="service_error">"Tjenestefeil!"</string>
-    <string name="load_contact_list_failed">"Kontaktlisten ble ikke lastet."</string>
-    <string name="cant_connect_to_server">"Kan ikke koble til tjeneren. Sjekk tilkoblingen."</string>
-    <string name="contact_already_exist">"<xliff:g id="USER">%1$s</xliff:g> finnes allerede i kontaktlisten."</string>
-    <string name="contact_blocked">"Kontakten \\\\\\\"<xliff:g id="USER">%1$s</xliff:g>\\\\\\\" er nå blokkert."</string>
-    <string name="contact_not_loaded">"Vent mens kontaktlisten lastes."</string>
-    <string name="network_error">"Det oppsto en nettfeil."</string>
-    <string name="service_not_support">"Tjeneren støtter ikke denne funksjonen."</string>
-    <string name="invalid_password">"Passordet er ikke gyldig."</string>
-    <string name="internal_server_error">"Det oppsto en feil på tjeneren."</string>
-    <string name="not_implemented">"Tjeneren støtter ikke denne funksjonen."</string>
-    <string name="service_unavaiable">"Tjeneren er utilgjengelig."</string>
-    <string name="timeout">"Det oppsto et tidsavbrudd på tjeneren."</string>
-    <string name="version_not_supported">"Tjeneren støtter ikke denne versjonen."</string>
-    <string name="message_queue_full">"Meldingskøen er full."</string>
-    <string name="domain_not_supported">"Tjeneren støtter ikke videresending til domenet."</string>
-    <string name="unknown_user">"Brukernavnet du skrev inn ble ikke gjenkjent."</string>
-    <string name="recipient_blocked_the_user">"Beklager, du er blokkert av brukeren."</string>
-    <string name="session_expired">"Sesjonen har gått ut, logg inn på nytt."</string>
-    <string name="forced_logout">"du er logget inn på en annen klient."</string>
-    <string name="already_logged_in">"du allerede er logget inn på en annen klient."</string>
-    <string name="msisdn_error">"Beklager, kan ikke lese telefonnummeret fra SIM-kortet. Kontakt operatøren for hjelp."</string>
-    <string name="not_signed_in">"Du er ikke logget inn."</string>
-    <string name="general_error">"Feilkode <xliff:g id="CODE">%1$d</xliff:g>"</string>
-  <string-array name="default_smiley_names">
-    <item>"Glad"</item>
-    <item>"Trist"</item>
-    <item>"Blunker"</item>
-    <item>"Rekker tunge"</item>
-    <item>"Overrasket"</item>
-    <item>"Kyss"</item>
-    <item>"Roper"</item>
-    <item>"Kul"</item>
-    <item>"Pengemunn"</item>
-    <item>"Fot i munnen"</item>
-    <item>"Flau"</item>
-    <item>"Engel"</item>
-    <item>"Usikker"</item>
-    <item>"Gråter"</item>
-    <item>"Stille som graven"</item>
-    <item>"Ler"</item>
-    <item>"Forvirret"</item>
-  </string-array>
-  <string-array name="default_smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\\\\\\\"</item>
-    <item>":\\\\\\\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
deleted file mode 100644 (file)
index d437686..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="im_label">"Chat"</string>
-    <string name="menu_cancel_signin">"Aanmelding annuleren"</string>
-    <string name="menu_add_contact">"Contactpersoon toevoegen"</string>
-    <string name="menu_remove_contact">"Contactpersoon verwijderen"</string>
-    <string name="menu_block_contact">"Contactpersoon blokkeren"</string>
-    <string name="menu_view_blocked">"Geblokkeerd"</string>
-    <string name="menu_view_accounts">"Accountlijst"</string>
-    <string name="menu_settings">"Instellingen"</string>
-    <string name="menu_start_chat">"Chat starten"</string>
-    <string name="menu_sign_out">"Afmelden"</string>
-    <string name="menu_view_profile">"Profiel weergeven"</string>
-    <string name="menu_end_conversation">"Chat beëindigen"</string>
-    <string name="menu_view_contact_list">"Lijst met contactpersonen"</string>
-    <string name="menu_invite_contact">"Uitnodigen..."</string>
-    <string name="menu_switch_chats">"Schakelen tussen chats"</string>
-    <string name="menu_insert_smiley">"Smiley invoegen"</string>
-    <string name="menu_plus">"Menu+"</string>
-    <string name="default_input_title">"Invoer"</string>
-    <string name="confirm">"Bevestigen"</string>
-    <string name="confirm_delete_contact">"Contactpersoon \'<xliff:g id="USER">%1$s</xliff:g>\' wordt verwijderd."</string>
-    <string name="confirm_block_contact">"Contactpersoon \'<xliff:g id="USER">%1$s</xliff:g>\' wordt geblokkeerd."</string>
-    <string name="confirm_unblock_contact">"Contactpersoon \'<xliff:g id="USER">%1$s</xliff:g>\' wordt gedeblokkeerd."</string>
-    <string name="ok">"OK"</string>
-    <string name="cancel">"Annuleren"</string>
-    <string name="yes">"OK"</string>
-    <string name="no">"Annuleren"</string>
-    <string name="signed_out_prompt">"U bent afgemeld bij <xliff:g id="ACCOUNT">%1$s</xliff:g>."</string>
-    <string name="signed_out_prompt_with_error">"U bent afgemeld bij <xliff:g id="ACCOUNT">%1$s</xliff:g> vanwege <xliff:g id="REASON">%2$s</xliff:g>"</string>
-    <string name="add_account">"<xliff:g id="ACCOUNT">%1$s</xliff:g>-account toevoegen"</string>
-    <string name="label_username">"Gebruikersnaam:"</string>
-    <string name="label_password">"Wachtwoord:"</string>
-    <string name="remember_password">"Mijn wachtwoord onthouden."</string>
-    <string name="keep_me_signed_in">"Automatisch aanmelden."</string>
-    <string name="sign_up">"Heeft u geen account?"</string>
-    <string name="check_auto_sign_in">"Met deze optie wordt u automatisch aangemeld wanneer u deze toepassing opent. Als u deze optie wilt uitschakelen, verwijdert u het vinkje uit het selectievakje \'Automatisch aanmelden\'."</string>
-    <string name="sign_in">"Aanmelden"</string>
-    <string name="signing_in_to">"Aanmelden bij <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="signing_in_wait">"Aanmelden..."</string>
-    <!-- no translation found for bg_data_prompt_title (4861800723853178111) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_message (2343305645142823544) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_ok (3443385427882751532) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_cancel (7206105589826174638) -->
-    <skip />
-    <string name="ongoing_conversation">"Actieve chats (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="online_count">"<xliff:g id="NUMBER">%1$d</xliff:g> online"</string>
-    <string name="subscriptions">"Uitnodigingen voor vriendschap"</string>
-    <string name="unknown_contact">"("<i>"Onbekend"</i>")"</string>
-    <string name="empty_contact_group">"Leeg"</string>
-    <string name="empty_conversation_group">"Geen gesprekken"</string>
-    <string name="contacts_picker_title">"Contactpersonen selecteren om uit te nodigen"</string>
-    <string name="contact_filter_hint">"Typ om een contactpersoon te vinden"</string>
-    <string name="empty_contact_list">"Kan geen contactpersonen vinden."</string>
-    <string name="blocked_list_title">"Geblokkeerde contactpersonen - <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="no_blocked_contact">"Geen geblokkeerde contactpersonen."</string>
-    <string name="contact_profile_title">"Profiel van contactpersoon"</string>
-    <string name="label_status">"Status:"</string>
-    <string name="label_client_type">"Type client:"</string>
-    <string name="client_type_computer">"Computer"</string>
-    <string name="client_type_mobile">"Mobiel"</string>
-    <string name="presence_available">"Online"</string>
-    <string name="presence_busy">"Bezet"</string>
-    <string name="presence_away">"Afwezig"</string>
-    <string name="presence_idle">"Inactief"</string>
-    <string name="presence_offline">"Offline"</string>
-    <string name="presence_invisible">"Offline weergeven"</string>
-    <string name="preference_title">"<xliff:g id="PROVIDER">%1$s</xliff:g> settings (dev only)"</string>
-    <string name="data_channel_label">"Gegevenskanaal"</string>
-    <string name="data_encoding_label">"Gegevenscodering"</string>
-    <string name="cir_channel_label">"CIR-kanaal"</string>
-    <string name="host_label">"Host"</string>
-    <string name="msisdn_label">"MSISDN"</string>
-    <string name="http">"HTTP"</string>
-    <string name="sms">"SMS"</string>
-    <string name="tcp">"TCP"</string>
-    <string name="xml">"XML"</string>
-    <string name="wbxml">"WBXML"</string>
-    <string name="save">"Opslaan"</string>
-    <string name="chat_with">"Chatten met <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="me">"Ik"</string>
-    <string name="compose_hint">"Typ om een bericht te schrijven"</string>
-    <string name="contact_online">"<xliff:g id="USER">%1$s</xliff:g> is online"</string>
-    <string name="contact_away">"<xliff:g id="USER">%1$s</xliff:g> is afwezig"</string>
-    <string name="contact_busy">"<xliff:g id="USER">%1$s</xliff:g> is bezet"</string>
-    <string name="contact_offline">"<xliff:g id="USER">%1$s</xliff:g> is offline"</string>
-    <string name="contact_joined">"<xliff:g id="USER">%1$s</xliff:g> is online gekomen"</string>
-    <string name="contact_left">"<xliff:g id="USER">%1$s</xliff:g> is weggegaan"</string>
-    <string name="time_stamp" format="date">"'Verzonden om '<xliff:g id="HOUR">hh</xliff:g>':'<xliff:g id="MINUTE">mm</xliff:g>' '<xliff:g id="AMPM">a</xliff:g>' op '<xliff:g id="DATE">EEEE</xliff:g>"</string>
-    <string name="send">"Verzenden"</string>
-    <string name="msg_sent_failed">"Dit bericht kan niet worden verzonden."</string>
-    <string name="disconnected_warning">"Verbinding met de server is verbroken. Berichten worden verzonden wanneer u online bent."</string>
-    <string name="contact_offline_warning">"<xliff:g id="USER_0">%1$s</xliff:g> is offline. Berichten die u verzendt, worden afgeleverd wanneer <xliff:g id="USER_1">%1$s</xliff:g> online komt."</string>
-    <string name="contact_not_in_list_warning">"<xliff:g id="USER">%1$s</xliff:g> staat niet in uw lijst met contactpersonen"</string>
-    <string name="select_link_title">"Link selecteren"</string>
-    <string name="empty_chat_list">"Geen actieve chats."</string>
-    <string name="add_contact_title">"Contactpersoon toevoegen"</string>
-    <string name="input_contact_label">"E-mailadres van persoon die u wilt uitnodigen:"</string>
-    <string name="choose_list_label">"Een lijst kiezen:"</string>
-    <string name="invite_instruction">"Typ een naam om toe te voegen vanuit \'Contactpersonen\'."</string>
-    <string name="invite_label">"Uitnodiging verzenden"</string>
-    <string name="setting_title">"Algemene instellingen"</string>
-    <string name="hide_offline_contacts">"Offline contactpersonen verbergen"</string>
-    <string name="notification_group_title">"Instellingen voor meldingen"</string>
-    <string name="notification_enabled_title">"Meldingen voor chatberichten"</string>
-    <string name="notification_enabled_summary">"Melding op statusbalk weergeven wanneer een chatbericht wordt ontvangen"</string>
-    <string name="notification_vibrate_title">"Trillen"</string>
-    <string name="notification_vibrate_summary">"Ook trillen wanneer een chatbericht wordt ontvangen"</string>
-    <string name="notification_sound_title">"Geluid"</string>
-    <string name="notification_sound_summary">"Ook beltoon afspelen wanneer een chatbericht wordt ontvangen"</string>
-    <string name="notification_ringtone_title">"Beltoon selecteren"</string>
-    <string name="invitation_prompt">"<xliff:g id="USER">%1$s</xliff:g> heeft u uitgenodigd deel te nemen aan een groepchat"</string>
-    <string name="invitation_sent_prompt">"Er is een uitnodiging verzonden naar <xliff:g id="USER">%1$s</xliff:g>."</string>
-    <string name="accept_invitation">"Accepteren"</string>
-    <string name="decline_invitation">"Afwijzen"</string>
-    <string name="subscription_prompt">"<xliff:g id="USER">%1$s</xliff:g> heeft u uitgenodigd voor zijn/haar lijst met contactpersonen."</string>
-    <string name="approve_subscription">"Accepteren"</string>
-    <string name="decline_subscription">"Afwijzen"</string>
-    <string name="approve_subscription_error">"Kan het abonnement van <xliff:g id="USER">%1$s</xliff:g> niet goedkeuren. Probeer het later opnieuw."</string>
-    <string name="decline_subscription_error">"Kan het abonnement van <xliff:g id="USER">%1$s</xliff:g> niet afwijzen. Probeer het later opnieuw."</string>
-    <string name="newMessages_label">"Nieuwe berichten van <xliff:g id="PROVIDER">%1$s</xliff:g>"</string>
-    <string name="num_unread_chats">"<xliff:g id="NUMBER">%1$d</xliff:g> ongelezen chats"</string>
-    <string name="subscription_notify_text">"Nieuwe uitnodiging voor vriendschap van <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="notify_groupchat_label">"Uitnodiging voor groepchat"</string>
-    <string name="group_chat_invite_notify_text">"Nieuwe uitnodiging voor groepchat van <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="add_contact_success">"Contactpersoon \' <xliff:g id="USER">%1$s</xliff:g>\' is toegevoegd."</string>
-    <string name="delete_contact_success">"Contactpersoon \'<xliff:g id="USER">%1$s</xliff:g>\' is verwijderd."</string>
-    <string name="block_contact_success">"Contactpersoon \'<xliff:g id="USER">%1$s</xliff:g>\' is geblokkeerd."</string>
-    <string name="unblock_contact_success">"Contactpersoon \'<xliff:g id="USER">%1$s</xliff:g>\' is gedeblokkeerd."</string>
-    <string name="perm_label">"chatservice starten"</string>
-    <string name="perm_desc">"Toepassingen toestaan om chatservice te starten zoals bedoeld."</string>
-    <string name="error">"Aandacht vereist"</string>
-    <string name="login_service_failed">"Kan niet aanmelden bij de <xliff:g id="SERVICE">%1$s</xliff:g>-service. Probeer het later opnieuw."\n"(Details: <xliff:g id="DESCRIPTION">%2$s</xliff:g>)"</string>
-    <string name="add_list_failed">"De lijst is niet toegevoegd."</string>
-    <string name="block_contact_failed">"Contactpersoon is niet geblokkeerd."</string>
-    <string name="unblock_contact_failed">"Contactpersoon is niet gedeblokkeerd."</string>
-    <string name="select_contact">"Selecteer eerst een contactpersoon."</string>
-    <string name="disconnected">"Verbinding verbroken!"\n</string>
-    <string name="service_error">"Servicefout."</string>
-    <string name="load_contact_list_failed">"De lijst met contactpersonen is niet geladen."</string>
-    <string name="cant_connect_to_server">"Kan geen verbinding maken met de server. Controleer uw verbinding."</string>
-    <string name="contact_already_exist">"<xliff:g id="USER">%1$s</xliff:g> staat al in uw lijst met contactpersonen."</string>
-    <string name="contact_blocked">"Contactpersoon \'<xliff:g id="USER">%1$s</xliff:g>\' is geblokkeerd."</string>
-    <string name="contact_not_loaded">"Uw lijst met contactpersonen wordt geladen."</string>
-    <string name="network_error">"Er is een netwerkfout opgetreden."</string>
-    <string name="service_not_support">"Deze functionaliteit wordt niet ondersteund door de server."</string>
-    <string name="invalid_password">"Het opgegeven wachtwoord is ongeldig."</string>
-    <string name="internal_server_error">"Er is een fout aangetroffen op de server."</string>
-    <string name="not_implemented">"Deze functionaliteit wordt niet ondersteund door de server."</string>
-    <string name="service_unavaiable">"De server is momenteel niet beschikbaar."</string>
-    <string name="timeout">"Er is een time-out opgetreden op de server."</string>
-    <string name="version_not_supported">"De huidige versie wordt niet ondersteund door de server."</string>
-    <string name="message_queue_full">"De wachtrij voor berichten is vol."</string>
-    <string name="domain_not_supported">"Omleiden naar het domein wordt niet ondersteund door de server."</string>
-    <string name="unknown_user">"De opgegeven gebruikersnaam wordt niet herkend."</string>
-    <string name="recipient_blocked_the_user">"U bent geblokkeerd door deze gebruiker."</string>
-    <string name="session_expired">"De sessie is verlopen. Meld u opnieuw aan."</string>
-    <string name="forced_logout">"u bent aangemeld via een andere client."</string>
-    <string name="already_logged_in">"u bent al aangemeld via een andere client."</string>
-    <string name="msisdn_error">"Het telefoonnummer kan niet worden gelezen vanaf uw SIM-kaart. Neem contact op met uw operator voor ondersteuning."</string>
-    <string name="not_signed_in">"U bent momenteel niet aangemeld."</string>
-    <string name="general_error">"Foutcode <xliff:g id="CODE">%1$d</xliff:g>"</string>
-  <string-array name="default_smiley_names">
-    <item>"Blij"</item>
-    <item>"Bedroefd"</item>
-    <item>"Knipoog"</item>
-    <item>"Tong uitsteken"</item>
-    <item>"Verrast"</item>
-    <item>"Kussend"</item>
-    <item>"Schreeuwend"</item>
-    <item>"Cool"</item>
-    <item>"Geldzoeker"</item>
-    <item>"Mond vol tanden"</item>
-    <item>"Beschaamd"</item>
-    <item>"Engel"</item>
-    <item>"Twijfelend"</item>
-    <item>"Huilend"</item>
-    <item>"Lippen op elkaar"</item>
-    <item>"Lachend"</item>
-    <item>"Verward"</item>
-  </string-array>
-  <string-array name="default_smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
deleted file mode 100644 (file)
index 8cf3cd9..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="im_label">"Komunikator"</string>
-    <string name="menu_cancel_signin">"Anuluj logowanie"</string>
-    <string name="menu_add_contact">"Dodaj kontakt"</string>
-    <string name="menu_remove_contact">"Usuń kontakt"</string>
-    <string name="menu_block_contact">"Zablokuj kontakt"</string>
-    <string name="menu_view_blocked">"Zablokowano"</string>
-    <string name="menu_view_accounts">"Lista kont"</string>
-    <string name="menu_settings">"Ustawienia"</string>
-    <string name="menu_start_chat">"Rozpocznij czat"</string>
-    <string name="menu_sign_out">"Wyloguj"</string>
-    <string name="menu_view_profile">"Przeglądaj profil"</string>
-    <string name="menu_end_conversation">"Zakończ czat"</string>
-    <string name="menu_view_contact_list">"Lista kontaktów"</string>
-    <string name="menu_invite_contact">"Zaproś…"</string>
-    <string name="menu_switch_chats">"Przełącz czaty"</string>
-    <string name="menu_insert_smiley">"Wstaw emotikon"</string>
-    <string name="menu_plus">"Menu+"</string>
-    <string name="default_input_title">"Katalog wejściowy"</string>
-    <string name="confirm">"Potwierdź"</string>
-    <string name="confirm_delete_contact">"Kontakt „<xliff:g id="USER">%1$s</xliff:g>” zostanie usunięty."</string>
-    <string name="confirm_block_contact">"Kontakt „<xliff:g id="USER">%1$s</xliff:g>” zostanie zablokowany."</string>
-    <string name="confirm_unblock_contact">"Kontakt „<xliff:g id="USER">%1$s</xliff:g>” zostanie odblokowany."</string>
-    <string name="ok">"OK"</string>
-    <string name="cancel">"Anuluj"</string>
-    <string name="yes">"OK"</string>
-    <string name="no">"Anuluj"</string>
-    <string name="signed_out_prompt">"Nastąpiło wylogowanie z konta <xliff:g id="ACCOUNT">%1$s</xliff:g>."</string>
-    <string name="signed_out_prompt_with_error">"Nastąpiło wylogowanie z konta <xliff:g id="ACCOUNT">%1$s</xliff:g> z powodu <xliff:g id="REASON">%2$s</xliff:g>."</string>
-    <string name="add_account">"Dodaj konto <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="label_username">"Nazwa użytkownika:"</string>
-    <string name="label_password">"Hasło:"</string>
-    <string name="remember_password">"Pamiętaj moje hasło."</string>
-    <string name="keep_me_signed_in">"Zaloguj mnie automatycznie."</string>
-    <string name="sign_up">"Nie masz konta?"</string>
-    <string name="check_auto_sign_in">"Ta opcja powoduje automatyczne logowanie użytkownika przy każdym uruchomieniu tej aplikacji. Aby wyłączyć tę opcję, wyloguj się, a następnie usuń zaznaczenie pola wyboru „Zaloguj automatycznie”."</string>
-    <string name="sign_in">"Zaloguj"</string>
-    <string name="signing_in_to">"Logowanie do konta <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="signing_in_wait">"Trwa logowanie…"</string>
-    <!-- no translation found for bg_data_prompt_title (4861800723853178111) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_message (2343305645142823544) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_ok (3443385427882751532) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_cancel (7206105589826174638) -->
-    <skip />
-    <string name="ongoing_conversation">"Aktywne czaty (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="online_count">"<xliff:g id="NUMBER">%1$d</xliff:g> online"</string>
-    <string name="subscriptions">"Zaproszenia"</string>
-    <string name="unknown_contact">"("<i>"Nieznany"</i>")"</string>
-    <string name="empty_contact_group">"Pusty"</string>
-    <string name="empty_conversation_group">"Brak rozmów"</string>
-    <string name="contacts_picker_title">"Wybierz kontakty do zaproszenia"</string>
-    <string name="contact_filter_hint">"Wpisz, aby znaleźć kontakt"</string>
-    <string name="empty_contact_list">"Nie znaleziono kontaktów."</string>
-    <string name="blocked_list_title">"Zablokowane kontakty - <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="no_blocked_contact">"Brak zablokowanych kontaktów."</string>
-    <string name="contact_profile_title">"Profil kontaktu"</string>
-    <string name="label_status">"Stan:"</string>
-    <string name="label_client_type">"Typ klienta:"</string>
-    <string name="client_type_computer">"Komputer"</string>
-    <string name="client_type_mobile">"Przenośny"</string>
-    <string name="presence_available">"Online"</string>
-    <string name="presence_busy">"Zajęty"</string>
-    <string name="presence_away">"Z dala od komputera"</string>
-    <string name="presence_idle">"Bezczynność"</string>
-    <string name="presence_offline">"Offline"</string>
-    <string name="presence_invisible">"Pokazuj jako offline"</string>
-    <string name="preference_title">"<xliff:g id="PROVIDER">%1$s</xliff:g> settings (dev only)"</string>
-    <string name="data_channel_label">"Kanał danych"</string>
-    <string name="data_encoding_label">"Szyfrowanie danych"</string>
-    <string name="cir_channel_label">"Kanał CIR"</string>
-    <string name="host_label">"Host"</string>
-    <string name="msisdn_label">"MSISDN"</string>
-    <string name="http">"HTTP"</string>
-    <string name="sms">"SMS"</string>
-    <string name="tcp">"TCP"</string>
-    <string name="xml">"XML"</string>
-    <string name="wbxml">"WBXML"</string>
-    <string name="save">"Zapisz"</string>
-    <string name="chat_with">"Czatuj z użytkownikiem <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="me">"Ja"</string>
-    <string name="compose_hint">"Wpisz, aby utworzyć"</string>
-    <string name="contact_online">"Użytkownik <xliff:g id="USER">%1$s</xliff:g> jest dostępny"</string>
-    <string name="contact_away">"Użytkownik <xliff:g id="USER">%1$s</xliff:g> jest niedostępny"</string>
-    <string name="contact_busy">"Użytkownik <xliff:g id="USER">%1$s</xliff:g> jest zajęty"</string>
-    <string name="contact_offline">"Użytkownik <xliff:g id="USER">%1$s</xliff:g> jest niedostępny"</string>
-    <string name="contact_joined">"Użytkownik <xliff:g id="USER">%1$s</xliff:g> dołączył do czatu"</string>
-    <string name="contact_left">"Użytkownik <xliff:g id="USER">%1$s</xliff:g> opuścił czat"</string>
-    <string name="time_stamp" format="date">"'Wysłane '<xliff:g id="HOUR">hh</xliff:g>':'<xliff:g id="MINUTE">mm</xliff:g><xliff:g id="AMPM">a</xliff:g>' do '<xliff:g id="DATE">EEEE</xliff:g>"</string>
-    <string name="send">"Wyślij"</string>
-    <string name="msg_sent_failed">"Nie można wysłać wiadomości."</string>
-    <string name="disconnected_warning">"Utracono połączenie z serwerem. Wiadomości zostaną wysłane po przejściu w tryb online."</string>
-    <string name="contact_offline_warning">"Użytkownik <xliff:g id="USER_0">%1$s</xliff:g> jest offline. Wysyłane wiadomości zostaną dostarczone, gdy <xliff:g id="USER_1">%1$s</xliff:g> będzie znowu online."</string>
-    <string name="contact_not_in_list_warning">"Użytkownik <xliff:g id="USER">%1$s</xliff:g> nie jest na Twojej liście kontaktów."</string>
-    <string name="select_link_title">"Wybierz łącze"</string>
-    <string name="empty_chat_list">"Brak aktywnych czatów."</string>
-    <string name="add_contact_title">"Dodaj kontakt"</string>
-    <string name="input_contact_label">"Adres e-mail zapraszanej osoby:"</string>
-    <string name="choose_list_label">"Wybierz listę"</string>
-    <string name="invite_instruction">"Wpisz imię, aby dodać do Kontaktów."</string>
-    <string name="invite_label">"Wyślij zaproszenie"</string>
-    <string name="setting_title">"Ustawienia ogólne"</string>
-    <string name="hide_offline_contacts">"Ukryj kontakty offline"</string>
-    <string name="notification_group_title">"Ustawienia powiadomień"</string>
-    <string name="notification_enabled_title">"Powiadomienia wiadomości błyskawicznych"</string>
-    <string name="notification_enabled_summary">"Sygnalizuj nadejście wiadomości błyskawicznej na pasku stanu"</string>
-    <string name="notification_vibrate_title">"Wibracje"</string>
-    <string name="notification_vibrate_summary">"Sygnalizuj nadejście wiadomości błyskawicznej wibracją"</string>
-    <string name="notification_sound_title">"Dźwięk"</string>
-    <string name="notification_sound_summary">"Sygnalizuj nadejście wiadomości błyskawicznej dzwonkiem"</string>
-    <string name="notification_ringtone_title">"Wybierz dzwonek"</string>
-    <string name="invitation_prompt">"<xliff:g id="USER">%1$s</xliff:g> przesyła zaproszenie do czatu grupowego."</string>
-    <string name="invitation_sent_prompt">"Wysłano zaproszenie do użytkownika <xliff:g id="USER">%1$s</xliff:g>."</string>
-    <string name="accept_invitation">"Zaakceptuj"</string>
-    <string name="decline_invitation">"Odmów"</string>
-    <string name="subscription_prompt">"Użytkownik <xliff:g id="USER">%1$s</xliff:g> zaprosił Cię do swojej listy kontaktów."</string>
-    <string name="approve_subscription">"Zaakceptuj"</string>
-    <string name="decline_subscription">"Odmów"</string>
-    <string name="approve_subscription_error">"Nie można zatwierdzić subskrypcji od użytkownika <xliff:g id="USER">%1$s</xliff:g>. Spróbuj ponownie później."</string>
-    <string name="decline_subscription_error">"Nie można odmówić subskrypcji od <xliff:g id="USER">%1$s</xliff:g>. Spróbuj ponownie później."</string>
-    <string name="newMessages_label">"Nowe wiadomości <xliff:g id="PROVIDER">%1$s</xliff:g>"</string>
-    <string name="num_unread_chats">"Nieprzeczytane czaty: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
-    <string name="subscription_notify_text">"Zaproszenie od użytkownika <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="notify_groupchat_label">"Zaproszenie do czatu grupowego"</string>
-    <string name="group_chat_invite_notify_text">"Nowe zaproszenie do czatu grupowego od <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="add_contact_success">"Dodano kontakt „<xliff:g id="USER">%1$s</xliff:g>”."</string>
-    <string name="delete_contact_success">"Usunięto kontakt „<xliff:g id="USER">%1$s</xliff:g>”."</string>
-    <string name="block_contact_success">"Zablokowano kontakt „<xliff:g id="USER">%1$s</xliff:g>”."</string>
-    <string name="unblock_contact_success">"Odblokowano kontakt „<xliff:g id="USER">%1$s</xliff:g>”."</string>
-    <string name="perm_label">"uruchom usługę wiadomości błyskawicznych"</string>
-    <string name="perm_desc">"Umożliwia aplikacjom uruchamianie usługi wiadomości błyskawicznych przez zamierzenie."</string>
-    <string name="error">"Uwaga"</string>
-    <string name="login_service_failed">"Nie można zalogować do usługi <xliff:g id="SERVICE">%1$s</xliff:g>. Spróbuj ponownie później."\n"(Szczegóły: <xliff:g id="DESCRIPTION">%2$s</xliff:g>)"</string>
-    <string name="add_list_failed">"Nie dodano listy."</string>
-    <string name="block_contact_failed">"Nie zablokowano kontaktu."</string>
-    <string name="unblock_contact_failed">"Nie odblokowano kontaktu."</string>
-    <string name="select_contact">"Należy wybrać kontakt."</string>
-    <string name="disconnected">"Rozłączono!"\n</string>
-    <string name="service_error">"Błąd usługi!"</string>
-    <string name="load_contact_list_failed">"Nie załadowano listy kontaktów."</string>
-    <string name="cant_connect_to_server">"Nie można się połączyć z serwerem. Sprawdź połączenie."</string>
-    <string name="contact_already_exist">"Użytkownik <xliff:g id="USER">%1$s</xliff:g> już znajduje się na Twojej liście kontaktów."</string>
-    <string name="contact_blocked">"Zablokowano kontakt „<xliff:g id="USER">%1$s</xliff:g>”."</string>
-    <string name="contact_not_loaded">"Czekaj, trwa ładowanie listy kontaktów."</string>
-    <string name="network_error">"Wystąpił błąd sieciowy."</string>
-    <string name="service_not_support">"Serwer nie obsługuje tej funkcji."</string>
-    <string name="invalid_password">"Wprowadzono nieprawidłowe hasło."</string>
-    <string name="internal_server_error">"Błąd serwera."</string>
-    <string name="not_implemented">"Serwer nie obsługuje tej funkcji."</string>
-    <string name="service_unavaiable">"Serwer jest aktualnie niedostępny."</string>
-    <string name="timeout">"Przekroczono limit czasu serwera."</string>
-    <string name="version_not_supported">"Serwer nie obsługuje bieżącej wersji."</string>
-    <string name="message_queue_full">"Kolejka wiadomości jest pełna."</string>
-    <string name="domain_not_supported">"Serwer nie obsługuje przekazywania do domeny."</string>
-    <string name="unknown_user">"Nie rozpoznano wprowadzonej nazwy użytkownika."</string>
-    <string name="recipient_blocked_the_user">"Niestety, ten użytkownik Cię blokuje."</string>
-    <string name="session_expired">"Sesja wygasła, zaloguj się ponownie."</string>
-    <string name="forced_logout">"zalogowania z innego klienta."</string>
-    <string name="already_logged_in">"użytkownik już jest zalogowany z innego klienta."</string>
-    <string name="msisdn_error">"Niestety, nie można odczytać numeru telefonu z karty SIM. Skontaktuj się z operatorem, aby uzyskać pomoc."</string>
-    <string name="not_signed_in">"Użytkownik nie jest aktualnie zalogowany."</string>
-    <string name="general_error">"Kod błędu <xliff:g id="CODE">%1$d</xliff:g>"</string>
-  <string-array name="default_smiley_names">
-    <item>"Zadowolenie"</item>
-    <item>"Smutek"</item>
-    <item>"Mrugnięcie"</item>
-    <item>"Wystający język"</item>
-    <item>"Zdziwienie"</item>
-    <item>"Całus"</item>
-    <item>"Krzyk"</item>
-    <item>"Super"</item>
-    <item>"Pazerność"</item>
-    <item>"Gafa"</item>
-    <item>"Zakłopotanie"</item>
-    <item>"Anioł"</item>
-    <item>"Niezdecydowanie"</item>
-    <item>"Płacz"</item>
-    <item>"Milczę jak grób"</item>
-    <item>"Śmiech"</item>
-    <item>"Zakłopotanie"</item>
-  </string-array>
-  <string-array name="default_smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
deleted file mode 100644 (file)
index dbd374c..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="im_label">"Чат"</string>
-    <string name="menu_cancel_signin">"Отменить вход"</string>
-    <string name="menu_add_contact">"Добавить знакомого"</string>
-    <string name="menu_remove_contact">"Удалить контакт"</string>
-    <string name="menu_block_contact">"Заблокировать знакомого"</string>
-    <string name="menu_view_blocked">"Заблокированные"</string>
-    <string name="menu_view_accounts">"Список аккаунтов"</string>
-    <string name="menu_settings">"Настройки"</string>
-    <string name="menu_start_chat">"Начать чат"</string>
-    <string name="menu_sign_out">"Выйти"</string>
-    <string name="menu_view_profile">"Просмотреть профиль"</string>
-    <string name="menu_end_conversation">"Завершить чат"</string>
-    <string name="menu_view_contact_list">"Список контактов"</string>
-    <string name="menu_invite_contact">"Пригласить…"</string>
-    <string name="menu_switch_chats">"Переключить чат"</string>
-    <string name="menu_insert_smiley">"Вставить смайлик"</string>
-    <string name="menu_plus">"Мenu+"</string>
-    <string name="default_input_title">"Ввод"</string>
-    <string name="confirm">"Подтверждение"</string>
-    <string name="confirm_delete_contact">"Контакт \"<xliff:g id="USER">%1$s</xliff:g>\" будет удален."</string>
-    <string name="confirm_block_contact">"Знакомый \"<xliff:g id="USER">%1$s</xliff:g>\" будет заблокирован."</string>
-    <string name="confirm_unblock_contact">"Контакт \"<xliff:g id="USER">%1$s</xliff:g>\" будет разблокирован."</string>
-    <string name="ok">"ОК"</string>
-    <string name="cancel">"Отмена"</string>
-    <string name="yes">"ОК"</string>
-    <string name="no">"Отмена"</string>
-    <string name="signed_out_prompt">"Выполнен выход из аккаунта <xliff:g id="ACCOUNT">%1$s</xliff:g>."</string>
-    <string name="signed_out_prompt_with_error">"Выполнен выход из аккаунта <xliff:g id="ACCOUNT">%1$s</xliff:g> по следующей причине: <xliff:g id="REASON">%2$s</xliff:g>."</string>
-    <string name="add_account">"Добавить аккаунт <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="label_username">"Имя пользователя:"</string>
-    <string name="label_password">"Пароль:"</string>
-    <string name="remember_password">"Запомнить пароль."</string>
-    <string name="keep_me_signed_in">"Входить автоматически."</string>
-    <string name="sign_up">"Нет аккаунта?"</string>
-    <string name="check_auto_sign_in">"Этот параметр автоматически выполняет вход при открытии данного приложения. Чтобы отключить его, выполните выход и снимите флажок \"Входить автоматически\"."</string>
-    <string name="sign_in">"Войти"</string>
-    <string name="signing_in_to">"Вход в аккаунт <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="signing_in_wait">"Выполняется вход…"</string>
-    <!-- no translation found for bg_data_prompt_title (4861800723853178111) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_message (2343305645142823544) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_ok (3443385427882751532) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_cancel (7206105589826174638) -->
-    <skip />
-    <string name="ongoing_conversation">"Открыто чатов: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
-    <string name="online_count">"В сети: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
-    <string name="subscriptions">"Предложения дружбы"</string>
-    <string name="unknown_contact">"("<i>"Неизвестно"</i>")"</string>
-    <string name="empty_contact_group">"Пусто"</string>
-    <string name="empty_conversation_group">"Нет разговоров"</string>
-    <string name="contacts_picker_title">"Выбрать контакт(ы) для приглашения"</string>
-    <string name="contact_filter_hint">"Начните ввод для поиска контакта"</string>
-    <string name="empty_contact_list">"Контакты не найдены."</string>
-    <string name="blocked_list_title">"Заблокированные контакты – <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="no_blocked_contact">"Нет заблокированных контактов."</string>
-    <string name="contact_profile_title">"Профиль контакта"</string>
-    <string name="label_status">"Состояние:"</string>
-    <string name="label_client_type">"Тип клиента:"</string>
-    <string name="client_type_computer">"Компьютер"</string>
-    <string name="client_type_mobile">"Мобильный"</string>
-    <string name="presence_available">"В сети"</string>
-    <string name="presence_busy">"Занят"</string>
-    <string name="presence_away">"Нет на месте"</string>
-    <string name="presence_idle">"Не активен"</string>
-    <string name="presence_offline">"Не в сети"</string>
-    <string name="presence_invisible">"Невидимость"</string>
-    <string name="preference_title">"<xliff:g id="PROVIDER">%1$s</xliff:g> settings (dev only)"</string>
-    <string name="data_channel_label">"Канал данных"</string>
-    <string name="data_encoding_label">"Кодировка данных"</string>
-    <string name="cir_channel_label">"Канал CIR"</string>
-    <string name="host_label">"Хост"</string>
-    <string name="msisdn_label">"MSISDN"</string>
-    <string name="http">"HTTP"</string>
-    <string name="sms">"SMS"</string>
-    <string name="tcp">"TCP"</string>
-    <string name="xml">"XML"</string>
-    <string name="wbxml">"WBXML"</string>
-    <string name="save">"Сохранить"</string>
-    <string name="chat_with">"Чат: <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="me">"Я"</string>
-    <string name="compose_hint">"Введите текст"</string>
-    <string name="contact_online">"<xliff:g id="USER">%1$s</xliff:g> в сети"</string>
-    <string name="contact_away">"<xliff:g id="USER">%1$s</xliff:g> отсутствует"</string>
-    <string name="contact_busy">"Пользователь <xliff:g id="USER">%1$s</xliff:g> занят"</string>
-    <string name="contact_offline">"<xliff:g id="USER">%1$s</xliff:g> не в сети"</string>
-    <string name="contact_joined">"<xliff:g id="USER">%1$s</xliff:g> в чате"</string>
-    <string name="contact_left">"<xliff:g id="USER">%1$s</xliff:g> не в чате"</string>
-    <string name="time_stamp" format="date">"'Отправлено в '<xliff:g id="HOUR">hh</xliff:g><xliff:g id="MINUTE">mm</xliff:g><xliff:g id="AMPM">a</xliff:g>', '<xliff:g id="DATE">EEEE</xliff:g>"</string>
-    <string name="send">"Отправить"</string>
-    <string name="msg_sent_failed">"Не удалось отправить сообщение."</string>
-    <string name="disconnected_warning">"Подключение к серверу прервано. Сообщения будут отправлены при подключении к Интернету."</string>
-    <string name="contact_offline_warning">"<xliff:g id="USER_0">%1$s</xliff:g> не в сети. Сообщения будут доставлены, когда <xliff:g id="USER_1">%1$s</xliff:g> войдет в сеть."</string>
-    <string name="contact_not_in_list_warning">"<xliff:g id="USER">%1$s</xliff:g> не в вашем списке контактов."</string>
-    <string name="select_link_title">"Выберите ссылку"</string>
-    <string name="empty_chat_list">"Нет активных чатов."</string>
-    <string name="add_contact_title">"Добавить знакомого"</string>
-    <string name="input_contact_label">"Адрес электронной почты приглашаемого:"</string>
-    <string name="choose_list_label">"Выберите список:"</string>
-    <string name="invite_instruction">"Введите имя для добавления из контактов."</string>
-    <string name="invite_label">"Отправить приглашение"</string>
-    <string name="setting_title">"Общие настройки"</string>
-    <string name="hide_offline_contacts">"Скрыть тех, кто не в сети"</string>
-    <string name="notification_group_title">"Настройки уведомлений"</string>
-    <string name="notification_enabled_title">"Уведомления чата"</string>
-    <string name="notification_enabled_summary">"Уведомлять о новых сообщениях в строке состояния"</string>
-    <string name="notification_vibrate_title">"Вибрация"</string>
-    <string name="notification_vibrate_summary">"Вибрировать при получении сообщения в чате"</string>
-    <string name="notification_sound_title">"Звук"</string>
-    <string name="notification_sound_summary">"Играть мелодию звонка при получении сообщения в чате"</string>
-    <string name="notification_ringtone_title">"Выбрать мелодию звонка"</string>
-    <string name="invitation_prompt">"<xliff:g id="USER">%1$s</xliff:g> приглашает вас в групповой чат."</string>
-    <string name="invitation_sent_prompt">"Приглашение отправлено пользователю <xliff:g id="USER">%1$s</xliff:g>."</string>
-    <string name="accept_invitation">"Принять"</string>
-    <string name="decline_invitation">"Отклонить"</string>
-    <string name="subscription_prompt">"<xliff:g id="USER">%1$s</xliff:g> приглашает вас в свой список знакомых."</string>
-    <string name="approve_subscription">"Принять"</string>
-    <string name="decline_subscription">"Отклонить"</string>
-    <string name="approve_subscription_error">"Невозможно одобрить подписку пользователя <xliff:g id="USER">%1$s</xliff:g>. Повторите попытку позже."</string>
-    <string name="decline_subscription_error">"Невозможно отклонить подписку пользователя <xliff:g id="USER">%1$s</xliff:g>. Повторите попытку позже."</string>
-    <string name="newMessages_label">"Новые сообщения от <xliff:g id="PROVIDER">%1$s</xliff:g>"</string>
-    <string name="num_unread_chats">"Непрочитанных чатов: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
-    <string name="subscription_notify_text">"Предложение дружбы от пользователя <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="notify_groupchat_label">"Приглашение в групповой чат"</string>
-    <string name="group_chat_invite_notify_text">"Новое приглашение в чат от пользователя <xliff:g id="USER">%s</xliff:g>"</string>
-    <string name="add_contact_success">"Контакт \"<xliff:g id="USER">%1$s</xliff:g>\" добавлен."</string>
-    <string name="delete_contact_success">"Контакт \"<xliff:g id="USER">%1$s</xliff:g>\" удален."</string>
-    <string name="block_contact_success">"Контакт \"<xliff:g id="USER">%1$s</xliff:g>\" заблокирован."</string>
-    <string name="unblock_contact_success">"Контакт \"<xliff:g id="USER">%1$s</xliff:g>\" разблокирован."</string>
-    <string name="perm_label">"запустить службу чата"</string>
-    <string name="perm_desc">"Позволяет приложениям при необходимости запустить службу чата."</string>
-    <string name="error">"Внимание"</string>
-    <string name="login_service_failed">"Не удалось войти в службу <xliff:g id="SERVICE">%1$s</xliff:g>. Повторите попытку позже."\n"(Подробнее: <xliff:g id="DESCRIPTION">%2$s</xliff:g>)"</string>
-    <string name="add_list_failed">"Список не был добавлен."</string>
-    <string name="block_contact_failed">"Контакт не был заблокирован."</string>
-    <string name="unblock_contact_failed">"Контакт не был разблокирован."</string>
-    <string name="select_contact">"Сначала выберите контакт."</string>
-    <string name="disconnected">"Подключение прервано!"\n</string>
-    <string name="service_error">"Ошибка службы!"</string>
-    <string name="load_contact_list_failed">"Список контактов не загружен."</string>
-    <string name="cant_connect_to_server">"Невозможно подключиться к серверу. Проверьте подключение."</string>
-    <string name="contact_already_exist">"<xliff:g id="USER">%1$s</xliff:g> уже есть в вашем списке знакомых."</string>
-    <string name="contact_blocked">"Контакт \"<xliff:g id="USER">%1$s</xliff:g>\" заблокирован."</string>
-    <string name="contact_not_loaded">"Дождитесь загрузки списка контактов."</string>
-    <string name="network_error">"Произошла ошибка в сети."</string>
-    <string name="service_not_support">"Сервер не поддерживает эту возможность."</string>
-    <string name="invalid_password">"Указан недействительный пароль."</string>
-    <string name="internal_server_error">"На сервере произошла ошибка."</string>
-    <string name="not_implemented">"Сервер не поддерживает эту возможность."</string>
-    <string name="service_unavaiable">"Сервер сейчас недоступен."</string>
-    <string name="timeout">"Тайм-аут сервера."</string>
-    <string name="version_not_supported">"Сервер не поддерживает текущую версию."</string>
-    <string name="message_queue_full">"Очередь сообщений полна."</string>
-    <string name="domain_not_supported">"Сервер не поддерживает пересылку домену."</string>
-    <string name="unknown_user">"Указанное имя пользователя не распознано."</string>
-    <string name="recipient_blocked_the_user">"К сожалению, этот пользователь вас заблокировал."</string>
-    <string name="session_expired">"Сеанс устарел, войдите снова."</string>
-    <string name="forced_logout">"вы вошли из другого клиента."</string>
-    <string name="already_logged_in">"вы уже вошли из другого клиента."</string>
-    <string name="msisdn_error">"К сожалению, не удается считать телефонный номер с SIM-карты. Обратитесь за справкой к своему оператору."</string>
-    <string name="not_signed_in">"Вы пока не выполнили вход."</string>
-    <string name="general_error">"Код ошибки <xliff:g id="CODE">%1$d</xliff:g>"</string>
-  <string-array name="default_smiley_names">
-    <item>"Счастье"</item>
-    <item>"Грустно"</item>
-    <item>"Подмигиваю"</item>
-    <item>"Высунутый язык"</item>
-    <item>"Удивление"</item>
-    <item>"Целую"</item>
-    <item>"Кричу"</item>
-    <item>"Круто"</item>
-    <item>"Знаю, что говорю"</item>
-    <item>"Молчок"</item>
-    <item>"В смущении"</item>
-    <item>"Ангел"</item>
-    <item>"В нерешительности"</item>
-    <item>"Плачу"</item>
-    <item>"Никому не скажу"</item>
-    <item>"Смешно"</item>
-    <item>"В замешательстве"</item>
-  </string-array>
-  <string-array name="default_smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
deleted file mode 100644 (file)
index 5241944..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="im_label">"即时消息"</string>
-    <string name="menu_cancel_signin">"取消登录"</string>
-    <string name="menu_add_contact">"添加联系人"</string>
-    <string name="menu_remove_contact">"删除联系人"</string>
-    <string name="menu_block_contact">"阻止联系人"</string>
-    <string name="menu_view_blocked">"已阻止"</string>
-    <string name="menu_view_accounts">"帐户列表"</string>
-    <string name="menu_settings">"设置"</string>
-    <string name="menu_start_chat">"发起聊天"</string>
-    <string name="menu_sign_out">"退出"</string>
-    <string name="menu_view_profile">"查看个人资料"</string>
-    <string name="menu_end_conversation">"结束聊天"</string>
-    <string name="menu_view_contact_list">"“联系人”列表"</string>
-    <string name="menu_invite_contact">"邀请..."</string>
-    <string name="menu_switch_chats">"切换聊天"</string>
-    <string name="menu_insert_smiley">"插入表情符号"</string>
-    <string name="menu_plus">"“菜单”+"</string>
-    <string name="default_input_title">"输入"</string>
-    <string name="confirm">"确认"</string>
-    <string name="confirm_delete_contact">"联系人“<xliff:g id="USER">%1$s</xliff:g>”会被删除。"</string>
-    <string name="confirm_block_contact">"联系人“<xliff:g id="USER">%1$s</xliff:g>”会被阻止。"</string>
-    <string name="confirm_unblock_contact">"联系人“<xliff:g id="USER">%1$s</xliff:g>”会被取消阻止。"</string>
-    <string name="ok">"确定"</string>
-    <string name="cancel">"取消"</string>
-    <string name="yes">"确定"</string>
-    <string name="no">"取消"</string>
-    <string name="signed_out_prompt">"您已退出<xliff:g id="ACCOUNT">%1$s</xliff:g>。"</string>
-    <string name="signed_out_prompt_with_error">"您已退出<xliff:g id="ACCOUNT">%1$s</xliff:g>,原因是<xliff:g id="REASON">%2$s</xliff:g>。"</string>
-    <string name="add_account">"添加<xliff:g id="ACCOUNT">%1$s</xliff:g>帐户"</string>
-    <string name="label_username">"用户名:"</string>
-    <string name="label_password">"密码:"</string>
-    <string name="remember_password">"记住我的密码。"</string>
-    <string name="keep_me_signed_in">"自动登录。"</string>
-    <string name="sign_up">"没有帐户?"</string>
-    <string name="check_auto_sign_in">"每次您打开该应用程序时,此选项都会自动让您登录。要禁用此选项,请退出,然后取消选中“自动登录”复选框。"</string>
-    <string name="sign_in">"登录"</string>
-    <string name="signing_in_to">"登录<xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="signing_in_wait">"正在登录..."</string>
-    <!-- no translation found for bg_data_prompt_title (4861800723853178111) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_message (2343305645142823544) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_ok (3443385427882751532) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_cancel (7206105589826174638) -->
-    <skip />
-    <string name="ongoing_conversation">"正在进行的聊天数 (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="online_count">"<xliff:g id="NUMBER">%1$d</xliff:g> 人在线"</string>
-    <string name="subscriptions">"好友邀请"</string>
-    <string name="unknown_contact">"("<i>"未知"</i>")"</string>
-    <string name="empty_contact_group">"空"</string>
-    <string name="empty_conversation_group">"没有会话"</string>
-    <string name="contacts_picker_title">"选择要邀请的联系人"</string>
-    <string name="contact_filter_hint">"键入内容以查找联系人"</string>
-    <string name="empty_contact_list">"未找到联系人。"</string>
-    <string name="blocked_list_title">"已阻止的联系人 - <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="no_blocked_contact">"没有联系人被阻止。"</string>
-    <string name="contact_profile_title">"联系人个人资料"</string>
-    <string name="label_status">"状态:"</string>
-    <string name="label_client_type">"客户端类型:"</string>
-    <string name="client_type_computer">"计算机"</string>
-    <string name="client_type_mobile">"移动"</string>
-    <string name="presence_available">"在线"</string>
-    <string name="presence_busy">"忙碌"</string>
-    <string name="presence_away">"离开"</string>
-    <string name="presence_idle">"空闲"</string>
-    <string name="presence_offline">"脱机"</string>
-    <string name="presence_invisible">"显示为脱机"</string>
-    <string name="preference_title">"<xliff:g id="PROVIDER">%1$s</xliff:g>设置(仅限开发人员)"</string>
-    <string name="data_channel_label">"数据通道"</string>
-    <string name="data_encoding_label">"数据编码"</string>
-    <string name="cir_channel_label">"承诺信息速率通道"</string>
-    <string name="host_label">"主机"</string>
-    <string name="msisdn_label">"MSISDN"</string>
-    <string name="http">"HTTP"</string>
-    <string name="sms">"SMS"</string>
-    <string name="tcp">"TCP"</string>
-    <string name="xml">"XML"</string>
-    <string name="wbxml">"WBXML"</string>
-    <string name="save">"保存"</string>
-    <string name="chat_with">"与<xliff:g id="USER">%1$s</xliff:g>聊天"</string>
-    <string name="me">"我"</string>
-    <string name="compose_hint">"键入内容"</string>
-    <string name="contact_online">"<xliff:g id="USER">%1$s</xliff:g>在线"</string>
-    <string name="contact_away">"<xliff:g id="USER">%1$s</xliff:g>离开"</string>
-    <string name="contact_busy">"<xliff:g id="USER">%1$s</xliff:g>正忙"</string>
-    <string name="contact_offline">"<xliff:g id="USER">%1$s</xliff:g>脱机"</string>
-    <string name="contact_joined">"<xliff:g id="USER">%1$s</xliff:g>已加入"</string>
-    <string name="contact_left">"<xliff:g id="USER">%1$s</xliff:g>已离开"</string>
-    <string name="time_stamp" format="date">"'发送时间:'<xliff:g id="DATE">EEEE</xliff:g><xliff:g id="AMPM">a</xliff:g>' '<xliff:g id="HOUR">hh</xliff:g>':'<xliff:g id="MINUTE">mm</xliff:g>"</string>
-    <string name="send">"发送"</string>
-    <string name="msg_sent_failed">"该消息无法发送。"</string>
-    <string name="disconnected_warning">"与服务器断开连接。消息将在您上线时发送。"</string>
-    <string name="contact_offline_warning">"<xliff:g id="USER_0">%1$s</xliff:g>脱机。您发送的消息会在<xliff:g id="USER_1">%1$s</xliff:g>再次上线后发送给他/她。"</string>
-    <string name="contact_not_in_list_warning">"<xliff:g id="USER">%1$s</xliff:g>不在您的“联系人”列表中。"</string>
-    <string name="select_link_title">"选择链接"</string>
-    <string name="empty_chat_list">"没有正在进行的聊天。"</string>
-    <string name="add_contact_title">"添加联系人"</string>
-    <string name="input_contact_label">"您要邀请的人的电子邮件地址:"</string>
-    <string name="choose_list_label">"选择一个列表:"</string>
-    <string name="invite_instruction">"键入要从“联系人”添加的名称。"</string>
-    <string name="invite_label">"发送邀请"</string>
-    <string name="setting_title">"常规设置"</string>
-    <string name="hide_offline_contacts">"隐藏脱机联系人"</string>
-    <string name="notification_group_title">"通知设置"</string>
-    <string name="notification_enabled_title">"即时消息通知"</string>
-    <string name="notification_enabled_summary">"收到即时消息在状态栏中通知"</string>
-    <string name="notification_vibrate_title">"振动"</string>
-    <string name="notification_vibrate_summary">"收到即时消息时伴有振动"</string>
-    <string name="notification_sound_title">"声音"</string>
-    <string name="notification_sound_summary">"收到即时消息时伴有响铃"</string>
-    <string name="notification_ringtone_title">"选择铃声"</string>
-    <string name="invitation_prompt">"<xliff:g id="USER">%1$s</xliff:g>邀请您加入群聊。"</string>
-    <string name="invitation_sent_prompt">"邀请已发送至<xliff:g id="USER">%1$s</xliff:g>。"</string>
-    <string name="accept_invitation">"接受"</string>
-    <string name="decline_invitation">"拒绝"</string>
-    <string name="subscription_prompt">"<xliff:g id="USER">%1$s</xliff:g>邀请您加入他们的“联系人”列表。"</string>
-    <string name="approve_subscription">"接受"</string>
-    <string name="decline_subscription">"拒绝"</string>
-    <string name="approve_subscription_error">"无法批准<xliff:g id="USER">%1$s</xliff:g>的订阅。请稍后重试。"</string>
-    <string name="decline_subscription_error">"无法拒绝来自<xliff:g id="USER">%1$s</xliff:g>的订阅。请稍后重试。"</string>
-    <string name="newMessages_label">"新的<xliff:g id="PROVIDER">%1$s</xliff:g>消息"</string>
-    <string name="num_unread_chats">"<xliff:g id="NUMBER">%1$d</xliff:g> 条未读的聊天消息"</string>
-    <string name="subscription_notify_text">"来自<xliff:g id="USER">%s</xliff:g>的新好友邀请"</string>
-    <string name="notify_groupchat_label">"群聊邀请"</string>
-    <string name="group_chat_invite_notify_text">"来自<xliff:g id="USER">%s</xliff:g>的新群聊邀请"</string>
-    <string name="add_contact_success">"已添加联系人“<xliff:g id="USER">%1$s</xliff:g>”。"</string>
-    <string name="delete_contact_success">"联系人“<xliff:g id="USER">%1$s</xliff:g>”已删除。"</string>
-    <string name="block_contact_success">"联系人“<xliff:g id="USER">%1$s</xliff:g>”已被阻止。"</string>
-    <string name="unblock_contact_success">"已取消阻止联系人“<xliff:g id="USER">%1$s</xliff:g>”。"</string>
-    <string name="perm_label">"启用即时消息服务"</string>
-    <string name="perm_desc">"允许应用程序通过互联网启用即时消息服务。"</string>
-    <string name="error">"注意"</string>
-    <string name="login_service_failed">"无法登录<xliff:g id="SERVICE">%1$s</xliff:g>服务。请稍后重试。"\n"(详细信息:<xliff:g id="DESCRIPTION">%2$s</xliff:g>)"</string>
-    <string name="add_list_failed">"未添加该列表。"</string>
-    <string name="block_contact_failed">"联系人未被阻止。"</string>
-    <string name="unblock_contact_failed">"联系人未被取消阻止。"</string>
-    <string name="select_contact">"请先选择一个联系人。"</string>
-    <string name="disconnected">"连接断开!"\n</string>
-    <string name="service_error">"服务错误!"</string>
-    <string name="load_contact_list_failed">"“联系人”列表未载入。"</string>
-    <string name="cant_connect_to_server">"无法连接到服务器。请检查您的连接。"</string>
-    <string name="contact_already_exist">"<xliff:g id="USER">%1$s</xliff:g>已在您的“联系人”列表中。"</string>
-    <string name="contact_blocked">"联系人“<xliff:g id="USER">%1$s</xliff:g>”已被阻止。"</string>
-    <string name="contact_not_loaded">"正在载入您的“联系人”列表,请耐心等待。"</string>
-    <string name="network_error">"出现网络错误。"</string>
-    <string name="service_not_support">"服务器不支持该功能。"</string>
-    <string name="invalid_password">"您输入的密码无效。"</string>
-    <string name="internal_server_error">"服务器遇到错误。"</string>
-    <string name="not_implemented">"服务器不支持该功能。"</string>
-    <string name="service_unavaiable">"服务器当前不可用。"</string>
-    <string name="timeout">"服务器超时。"</string>
-    <string name="version_not_supported">"服务器不支持当前版本。"</string>
-    <string name="message_queue_full">"消息队列已满。"</string>
-    <string name="domain_not_supported">"服务器不支持转向到该域。"</string>
-    <string name="unknown_user">"您输入的用户名无法识别。"</string>
-    <string name="recipient_blocked_the_user">"抱歉,您已被该用户阻止。"</string>
-    <string name="session_expired">"会话已过期,请重新登录。"</string>
-    <string name="forced_logout">"您已从其他客户端登录。"</string>
-    <string name="already_logged_in">"您已从其他客户端登录。"</string>
-    <string name="msisdn_error">"抱歉,无法从您的 SIM 卡读取该电话号码。请联系您的接线员寻求帮助。"</string>
-    <string name="not_signed_in">"您当前未登录。"</string>
-    <string name="general_error">"错误代码 <xliff:g id="CODE">%1$d</xliff:g>"</string>
-  <string-array name="default_smiley_names">
-    <item>"开心"</item>
-    <item>"忧伤"</item>
-    <item>"眨眼"</item>
-    <item>"吐舌"</item>
-    <item>"吃惊"</item>
-    <item>"亲吻"</item>
-    <item>"叫喊"</item>
-    <item>"酷"</item>
-    <item>"财迷"</item>
-    <item>"不知所云"</item>
-    <item>"尴尬"</item>
-    <item>"天使"</item>
-    <item>"犹豫不定"</item>
-    <item>"哭泣"</item>
-    <item>"闭嘴"</item>
-    <item>"大笑"</item>
-    <item>"困惑"</item>
-  </string-array>
-  <string-array name="default_smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
deleted file mode 100644 (file)
index 36d72df..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="im_label">"即時訊息"</string>
-    <string name="menu_cancel_signin">"取消登入"</string>
-    <string name="menu_add_contact">"新增連絡人"</string>
-    <string name="menu_remove_contact">"刪除連絡人"</string>
-    <string name="menu_block_contact">"封鎖連絡人"</string>
-    <string name="menu_view_blocked">"封鎖"</string>
-    <string name="menu_view_accounts">"帳戶清單"</string>
-    <string name="menu_settings">"設定"</string>
-    <string name="menu_start_chat">"開始交談"</string>
-    <string name="menu_sign_out">"登出"</string>
-    <string name="menu_view_profile">"觀看個人檔案"</string>
-    <string name="menu_end_conversation">"結束交談"</string>
-    <string name="menu_view_contact_list">"連絡人清單"</string>
-    <string name="menu_invite_contact">"邀請…"</string>
-    <string name="menu_switch_chats">"切換交談"</string>
-    <string name="menu_insert_smiley">"插入表情符號"</string>
-    <string name="menu_plus">"選單+"</string>
-    <string name="default_input_title">"輸入"</string>
-    <string name="confirm">"確認"</string>
-    <string name="confirm_delete_contact">"「<xliff:g id="USER">%1$s</xliff:g>」會被刪除。"</string>
-    <string name="confirm_block_contact">"封鎖「<xliff:g id="USER">%1$s</xliff:g>」。"</string>
-    <string name="confirm_unblock_contact">"「<xliff:g id="USER">%1$s</xliff:g>」會被解除封鎖。"</string>
-    <string name="ok">"確定"</string>
-    <string name="cancel">"取消"</string>
-    <string name="yes">"確定"</string>
-    <string name="no">"取消"</string>
-    <string name="signed_out_prompt">"您已登出 <xliff:g id="ACCOUNT">%1$s</xliff:g>。"</string>
-    <string name="signed_out_prompt_with_error">"由於 <xliff:g id="REASON">%2$s</xliff:g>,您已登出 <xliff:g id="ACCOUNT">%1$s</xliff:g>。"</string>
-    <string name="add_account">"新增 <xliff:g id="ACCOUNT">%1$s</xliff:g> 帳戶"</string>
-    <string name="label_username">"使用者名稱:"</string>
-    <string name="label_password">"密碼:"</string>
-    <string name="remember_password">"記住我的密碼。"</string>
-    <string name="keep_me_signed_in">"自動登入"</string>
-    <string name="sign_up">"您有帳戶嗎?"</string>
-    <string name="check_auto_sign_in">"此選項可以讓您開啟應用程式時自動登入。若要停用請登出,並清除「自動登入」核取方塊。"</string>
-    <string name="sign_in">"登入"</string>
-    <string name="signing_in_to">"登入 <xliff:g id="ACCOUNT">%1$s</xliff:g>"</string>
-    <string name="signing_in_wait">"登入中…"</string>
-    <!-- no translation found for bg_data_prompt_title (4861800723853178111) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_message (2343305645142823544) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_ok (3443385427882751532) -->
-    <skip />
-    <!-- no translation found for bg_data_prompt_cancel (7206105589826174638) -->
-    <skip />
-    <string name="ongoing_conversation">"進行中的交談 (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="online_count">"線上人數 <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
-    <string name="subscriptions">"邀請朋友"</string>
-    <string name="unknown_contact">"("<i>" 未知的 "</i>")"</string>
-    <string name="empty_contact_group">"沒有連絡人"</string>
-    <string name="empty_conversation_group">"沒有對話"</string>
-    <string name="contacts_picker_title">"選取要邀請的連絡人"</string>
-    <string name="contact_filter_hint">"輸入關鍵字尋找連絡人"</string>
-    <string name="empty_contact_list">"找不到連絡人。"</string>
-    <string name="blocked_list_title">"已封鎖連絡人 - <xliff:g id="USER">%1$s</xliff:g>"</string>
-    <string name="no_blocked_contact">"沒有封鎖的連絡人。"</string>
-    <string name="contact_profile_title">"連絡人檔案"</string>
-    <string name="label_status">"狀態:"</string>
-    <string name="label_client_type">"客戶端類型:"</string>
-    <string name="client_type_computer">"電腦"</string>
-    <string name="client_type_mobile">"行動"</string>
-    <string name="presence_available">"線上"</string>
-    <string name="presence_busy">"忙碌"</string>
-    <string name="presence_away">"外出"</string>
-    <string name="presence_idle">"閒置"</string>
-    <string name="presence_offline">"離線"</string>
-    <string name="presence_invisible">"顯示離線"</string>
-    <string name="preference_title">"<xliff:g id="PROVIDER">%1$s</xliff:g> settings (dev only)"</string>
-    <string name="data_channel_label">"資料頻道"</string>
-    <string name="data_encoding_label">"紀錄日期"</string>
-    <string name="cir_channel_label">"多重路徑頻道"</string>
-    <string name="host_label">"主機"</string>
-    <string name="msisdn_label">"MSISDN"</string>
-    <string name="http">"HTTP"</string>
-    <string name="sms">"SMS"</string>
-    <string name="tcp">"TCP"</string>
-    <string name="xml">"XML"</string>
-    <string name="wbxml">"WBXML"</string>
-    <string name="save">"儲存"</string>
-    <string name="chat_with">"與 <xliff:g id="USER">%1$s</xliff:g> 交談"</string>
-    <string name="me">"我"</string>
-    <string name="compose_hint">"輸入文字開始撰寫"</string>
-    <string name="contact_online">"<xliff:g id="USER">%1$s</xliff:g> 在線上"</string>
-    <string name="contact_away">"<xliff:g id="USER">%1$s</xliff:g> 顯示離開"</string>
-    <string name="contact_busy">"<xliff:g id="USER">%1$s</xliff:g> 目前忙碌"</string>
-    <string name="contact_offline">"<xliff:g id="USER">%1$s</xliff:g> 顯示離線"</string>
-    <string name="contact_joined">"<xliff:g id="USER">%1$s</xliff:g> 加入交談"</string>
-    <string name="contact_left">"<xliff:g id="USER">%1$s</xliff:g> 已離開"</string>
-    <string name="time_stamp" format="date">"'傳送時間:'<xliff:g id="HOUR">hh</xliff:g>':'<xliff:g id="MINUTE">mm</xliff:g>' '<xliff:g id="AMPM">a</xliff:g>','<xliff:g id="DATE">EEEE</xliff:g>"</string>
-    <string name="send">"傳送"</string>
-    <string name="msg_sent_failed">"訊息無法傳送。"</string>
-    <string name="disconnected_warning">"與伺服器連線中斷。您的訊息將在下次登入時傳送。"</string>
-    <string name="contact_offline_warning">"<xliff:g id="USER_0">%1$s</xliff:g> 顯示離線。您的訊息將在 <xliff:g id="USER_1">%1$s</xliff:g> 登入時傳送。"</string>
-    <string name="contact_not_in_list_warning">"<xliff:g id="USER">%1$s</xliff:g> 不在您的連絡人清單。"</string>
-    <string name="select_link_title">"選取連結"</string>
-    <string name="empty_chat_list">"沒有交談"</string>
-    <string name="add_contact_title">"新增連絡人"</string>
-    <string name="input_contact_label">"您要邀請的對象電子郵件地址:"</string>
-    <string name="choose_list_label">"選擇一個清單:"</string>
-    <string name="invite_instruction">"輸入連絡人姓名。"</string>
-    <string name="invite_label">"傳送邀請"</string>
-    <string name="setting_title">"一般設定"</string>
-    <string name="hide_offline_contacts">"隱藏離線連絡人"</string>
-    <string name="notification_group_title">"通知設定"</string>
-    <string name="notification_enabled_title">"即時訊息通知"</string>
-    <string name="notification_enabled_summary">"收到訊息時在狀態列顯示通知"</string>
-    <string name="notification_vibrate_title">"震動"</string>
-    <string name="notification_vibrate_summary">"收到訊息時震動視窗"</string>
-    <string name="notification_sound_title">"音效"</string>
-    <string name="notification_sound_summary">"收到訊息時播放鈴聲"</string>
-    <string name="notification_ringtone_title">"選取鈴聲"</string>
-    <string name="invitation_prompt">"<xliff:g id="USER">%1$s</xliff:g> 邀請您加入群組交談。"</string>
-    <string name="invitation_sent_prompt">"已傳送邀請給 <xliff:g id="USER">%1$s</xliff:g>。"</string>
-    <string name="accept_invitation">"接受"</string>
-    <string name="decline_invitation">"拒絕"</string>
-    <string name="subscription_prompt">"<xliff:g id="USER">%1$s</xliff:g> 想要將您新增到連絡人清單。"</string>
-    <string name="approve_subscription">"接受"</string>
-    <string name="decline_subscription">"拒絕"</string>
-    <string name="approve_subscription_error">"訂閱 <xliff:g id="USER">%1$s</xliff:g> 資訊失敗。請稍後再試一次。"</string>
-    <string name="decline_subscription_error">"拒絕訂閱 <xliff:g id="USER">%1$s</xliff:g> 資訊失敗。請稍後再試一次。"</string>
-    <string name="newMessages_label">"來自 <xliff:g id="PROVIDER">%1$s</xliff:g> 的新訊息"</string>
-    <string name="num_unread_chats">"<xliff:g id="NUMBER">%1$d</xliff:g> 個未讀交談"</string>
-    <string name="subscription_notify_text">"<xliff:g id="USER">%s</xliff:g> 邀請您"</string>
-    <string name="notify_groupchat_label">"群組交談邀請"</string>
-    <string name="group_chat_invite_notify_text">"來自 <xliff:g id="USER">%s</xliff:g> 的群組交談邀請"</string>
-    <string name="add_contact_success">"「<xliff:g id="USER">%1$s</xliff:g>」已新增。"</string>
-    <string name="delete_contact_success">"「<xliff:g id="USER">%1$s</xliff:g>」已刪除。"</string>
-    <string name="block_contact_success">"「<xliff:g id="USER">%1$s</xliff:g>」已封鎖。"</string>
-    <string name="unblock_contact_success">"「<xliff:g id="USER">%1$s</xliff:g>」已解除封鎖。"</string>
-    <string name="perm_label">"開始即時訊息服務"</string>
-    <string name="perm_desc">"允許應用程式透過網際網路啟動即時訊息服務"</string>
-    <string name="error">"注意"</string>
-    <string name="login_service_failed">"無法登入 <xliff:g id="SERVICE">%1$s</xliff:g> 服務。請稍候再試一次。"\n" (詳細內容:<xliff:g id="DESCRIPTION">%2$s</xliff:g>)"</string>
-    <string name="add_list_failed">"清單未增加"</string>
-    <string name="block_contact_failed">"連絡人未封鎖。"</string>
-    <string name="unblock_contact_failed">"連絡人未解除封鎖。"</string>
-    <string name="select_contact">"請先選取連絡人。"</string>
-    <string name="disconnected">"連線中斷!"\n</string>
-    <string name="service_error">"服務錯誤!"</string>
-    <string name="load_contact_list_failed">"未載入連絡人清單。"</string>
-    <string name="cant_connect_to_server">"無法連線到伺服器。請檢查連線狀態。"</string>
-    <string name="contact_already_exist">"<xliff:g id="USER">%1$s</xliff:g> 已在您的連絡人清單。"</string>
-    <string name="contact_blocked">"「<xliff:g id="USER">%1$s</xliff:g>」已封鎖。"</string>
-    <string name="contact_not_loaded">"請等待連絡人清單載入完成。"</string>
-    <string name="network_error">"網路發生問題。"</string>
-    <string name="service_not_support">"伺服器不支援此功能。"</string>
-    <string name="invalid_password">"您輸入的密碼無效。"</string>
-    <string name="internal_server_error">"伺服器發生問題。"</string>
-    <string name="not_implemented">"伺服器不支援此功能。"</string>
-    <string name="service_unavaiable">"目前無法存取伺服器。"</string>
-    <string name="timeout">"伺服器連線逾時。"</string>
-    <string name="version_not_supported">"伺服器不支援目前版本。"</string>
-    <string name="message_queue_full">"訊息佇列已滿。"</string>
-    <string name="domain_not_supported">"伺服器不支援網域名稱轉址。"</string>
-    <string name="unknown_user">"您輸入的使用者名稱無法辨識。"</string>
-    <string name="recipient_blocked_the_user">"抱歉,您被此使用者封鎖。"</string>
-    <string name="session_expired">"登入時限已到,請重新登入。"</string>
-    <string name="forced_logout">"您已在其他程式登入。"</string>
-    <string name="already_logged_in">"您已在另一台機器上登入。"</string>
-    <string name="msisdn_error">"抱歉,無法從 SIM 卡讀取電話號碼。請與您的服務商尋求協助。"</string>
-    <string name="not_signed_in">"您尚未登入。"</string>
-    <string name="general_error">"錯誤代碼 <xliff:g id="CODE">%1$d</xliff:g>"</string>
-  <string-array name="default_smiley_names">
-    <item>"開心"</item>
-    <item>"傷心"</item>
-    <item>"眨眼"</item>
-    <item>"吐舌頭"</item>
-    <item>"驚訝"</item>
-    <item>"紅唇"</item>
-    <item>"大喊"</item>
-    <item>"酷"</item>
-    <item>"滿嘴錢"</item>
-    <item>"說錯話"</item>
-    <item>"害羞"</item>
-    <item>"天使"</item>
-    <item>"還沒決定"</item>
-    <item>"嚎啕大哭"</item>
-    <item>"不要告訴別人"</item>
-    <item>"開懷大笑"</item>
-    <item>"疑惑"</item>
-  </string-array>
-  <string-array name="default_smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
deleted file mode 100644 (file)
index 3037baf..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<resources>
-    <color name="chat_msg">#ff000000</color>
-    <color name="chat_msg_presence">#ffad45d6</color>
-    <color name="chat_contact">#000</color>
-    <color name="nonchat_contact">#fff</color>
-    <color name="status_popup_text">#ff000000</color>
-    <color name="error">#ffcc5555</color>
-</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
deleted file mode 100644 (file)
index edf37cc..0000000
+++ /dev/null
@@ -1,448 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <!-- The application label. This appears in the application launcher on the
-    Home screen. This is a noun. -->
-    <string name="im_label">IM</string>
-
-    <!-- Sign in progress screen menu items.-->
-    <!-- Screen menu item on the sign-in progress screen. It allows the user to cancel signing in.-->
-    <string name="menu_cancel_signin">Cancel signin</string>
-
-    <!--Contact list screen menu and context menu items.-->
-    <!-- This is a screen menu item for the Contact List Screen. It lets the
-    user to add a friend to the friend list. May be overrided by the plugin.-->
-    <string name="menu_add_contact">Add contact</string>
-    <!-- Context/drop-down menu item for the Contact List Screen. The context menu is
-    displayed when the user long clicks on a contact in the contact list. It lets the user to
-    remove a contact from the list. May be overrided by the plugin.-->
-    <string name="menu_remove_contact">Delete contact</string>
-    <!-- Context/drop-down menu item for the Contact List Screen. The context menu is
-    displayed when the user long clicks on a contact in the contact list. It lets the user to
-    block a contact. May be overrided by the plugin.-->
-    <string name="menu_block_contact">Block contact</string>
-    <!-- Screen menu item on the contact list screen to go to the blocked list
-    screen.-->
-    <string name="menu_view_blocked">Blocked</string>
-    <!-- Screen menu item on the contact list to go back to the landing page,
-    where you can choose which IM service you want to use-->
-    <string name="menu_view_accounts">Account list</string>
-    <!-- Screen menu item on the contact list to go to the setting page.-->
-    <string name="menu_settings">Settings</string>
-    <!-- Context/drop-down menu item for the contact list screen. The context menu is
-    displayed when the user long clicks on a contact in the contact list. It lets the user to
-    start a chat with a friend. May be overried by the plugin.-->
-    <string name="menu_start_chat">Start chat</string>
-    <!-- Screen menu item on the contact list to sign out the service.-->
-    <string name="menu_sign_out">Sign out</string>
-    <!-- Context/drop-down menu item for the contact list screen. The context menu is
-    displayed when the user long clicks on a contact in the contact list. It lets the
-    user to view the contact's profile. May be overrided by the plugin.-->
-    <string name="menu_view_profile">View profile</string>
-    <!-- Context/drop-down menu item for the contact list screen. The context menu is
-    displayed when the user long clicks on a conversation in the contact list. It lets the
-    user to end a chat with a contact. May be overrided by the plugin.-->
-    <string name="menu_end_conversation">End chat</string>
-
-    <!-- Chat screen menu and context menu items.-->
-    <!-- Screen menu item on the chat screen to go back the contact list screen.
-    May be overrided by the plugin.-->
-    <string name="menu_view_contact_list">Contact list</string>
-    <!-- Screen menu item on the chat screen to invite another contact to join the chat.
-    Currently not supported.-->
-    <string name="menu_invite_contact">Invite\u2026</string>
-    <!-- Screen menu item on the chat screen to open a chat dash board which lets the user to
-    switch between chats. May be overrided by the plugin.-->
-    <string name="menu_switch_chats">Switch chats</string>
-    <!-- Screen menu item on the chat screen to insert smiley. May be overrided by the plugin.-->
-    <string name="menu_insert_smiley">Insert smiley</string>
-
-    <!-- This string is used in the chat dashboard.  When there is a shortcut assigned to a chat
-     it allows the user to press menu+[0-9] to quickly switch beteen chats.  This string of
-     menu+ is used to build up the UI to show the user which shortcut to use.  A number (0-9) will
-     be appended to the end of this.  -->
-    <string name="menu_plus">Menu+"</string>
-
-    <!-- The title of a simple input dialog. Currently not used.-->
-    <string name="default_input_title">Input</string>
-
-    <!-- Strings for the confirm dialogs-->
-    <!-- The title of the confirm dialog which asks the user to continue or cancel an operation such as block a contact, remove a contact.-->
-    <string name="confirm">Confirm</string>
-    <!-- This is the message displayed in the confirm dialog that opens when user clicks to delete a contact in the contact list screen.-->
-    <string name="confirm_delete_contact">The contact \"<xliff:g id="user">%1$s</xliff:g>\" will be deleted.</string>
-    <!-- This is the message displayed in the confirm dialog that opens when user clicks to  block a contact in the contact list screen.-->
-    <string name="confirm_block_contact">The contact \"<xliff:g id="user">%1$s</xliff:g>\" will be blocked.</string>
-    <!-- This is the message displayed on the confirm dialog that opens when user clicks to unblock a contact in the blocked list screen.-->
-    <string name="confirm_unblock_contact">The contact \"<xliff:g id="user">%1$s</xliff:g>\" will be unblocked.</string>
-    <!-- The "OK" button label for the error message dialog. -->
-    <string name="ok">OK</string>
-    <!-- The "Cancel" button label for the confirm dialogs. -->
-    <string name="cancel">Cancel</string>
-    <!-- The "OK" button label for the confirm dialogs. -->
-    <string name="yes">OK</string>
-    <!-- The "Cancel" button label for the confirm dialogs. -->
-    <string name="no">Cancel</string>
-
-    <!-- This is the toast message displayed when the user has been signed out of the service.-->
-    <string name="signed_out_prompt">You have been signed out of <xliff:g id="account">%1$s</xliff:g>.</string>
-    <!-- This is the toast message displayed when the user has been signed out of the service due to an error.-->
-    <string name="signed_out_prompt_with_error">You have been signed out of <xliff:g id="account">%1$s</xliff:g> because <xliff:g id="reason">%2$s</xliff:g>.</string>
-
-    <!-- These strings displayed on the landing page. -->
-    <!-- The add account label on the landing page. This is displayed when the user hasn't setup an account of the IM service.-->
-    <string name="add_account">Add <xliff:g id="account">%1$s</xliff:g> account</string>
-
-    <!-- These strings are displayed on the account setup page. -->
-    <!-- The username label. May be overrided by the plugin.-->
-    <string name="label_username">Username:</string>
-    <!-- The password label. -->
-    <string name="label_password">Password:</string>
-    <!-- The label for the checkbox which asks if the user wants to save the password on the client. -->
-    <string name="remember_password">Remember my password.</string>
-    <!-- The label for the checkbox which asks if the user wants to sign in the account automatically when phone bootstrap. -->
-    <string name="keep_me_signed_in">Sign me in automatically.</string>
-    <!-- The label for the link which will bring up browser to let the user to sign up a new account when clicked. May be overrided by the plugin.-->
-    <string name="sign_up">Don\u2019t have an account?</string>
-    <!-- This is the warning message displayed in a toast when "Sign me in automatically" is selected. May be overrided by the plugin.-->
-    <string name="check_auto_sign_in">This option automatically signs you in every time you open this application. To disable the option, sign out, then clear the \"Sign me in automatically\" check box.</string>
-    <!-- The button label which lets the user to sign into the IM service.  -->
-    <string name="sign_in">Sign in</string>
-
-    <!-- These strings are displayed the sign in progress screen.-->
-    <!-- The title of the sign-in progress screen.  -->
-    <string name="signing_in_to">Signing in to <xliff:g id="account">%1$s</xliff:g></string>
-    <!-- This is the progress/status text displayed in the middle of the sign-in progress screen. -->
-    <string name="signing_in_wait">Signing in\u2026</string>
-    <!-- Dialog title -->
-    <!-- This is the title for the background data prompt dialog, asking the user whether
-    to enable the background data if it is disabled when launch the IM app -->
-    <string name="bg_data_prompt_title">Background data disabled</string>
-    <!-- Dialog messages: -->
-    <!-- This is the message displayed in the prompt dialog when we launch IM but found
-    the background data is disabled -->
-    <string name="bg_data_prompt_message">
-         <xliff:g id="provider">%1$s</xliff:g> needs background data to be enabled.
-    </string>
-    <!-- Dialog buttons: -->
-    <!-- OK button for the prompt dialog -->
-    <string name="bg_data_prompt_ok">Enable</string>
-    <!-- Cancel button for the prompt dialog -->
-    <string name="bg_data_prompt_cancel">Quit</string>
-
-    <!-- These strings are displayed on the contact list page. -->
-    <!-- The title of the ongoing chat group. May be overrided by the plugin.-->
-    <string name="ongoing_conversation">Ongoing chats (<xliff:g id="number">%1$d</xliff:g>)</string>
-    <!-- Displays the number of online contacts in a list.-->
-    <string name="online_count"><xliff:g id="number">%1$d</xliff:g> online</string>
-    <!-- The title of the subscription request group if there is any.-->
-    <string name="subscriptions">Friend invitations</string>
-    <!-- Prefix of the contact if he/she is not in the user's list.-->
-    <string name="unknown_contact">(<i>Unknown</i>) </string>
-    <!-- Displayed as a child item of the contact list if it's empty.-->
-    <string name="empty_contact_group">Empty</string>
-    <!-- Displayed as a child item of the ongoing chat group if it's empty. -->
-    <string name="empty_conversation_group">No conversations</string>
-
-    <!-- Strings for contacts picker activity to inviting a contact into a group chat. Currently not supported.-->
-    <string name="contacts_picker_title">Select contact(s) to invite</string>
-    <string name="contact_filter_hint">Type to find contact</string>
-    <string name="empty_contact_list">No contacts found.</string>
-
-    <!-- The title of blocked contact list.-->
-    <string name="blocked_list_title">Blocked contacts - <xliff:g id="user">%1$s</xliff:g></string>
-    <!-- Displayed if there isn't any blocked contact.-->
-    <string name="no_blocked_contact">No blocked contacts.</string>
-
-    <!-- These strings are displayed in the contact info dialog. -->
-    <!-- The title of the contact profile dialog. -->
-    <string name="contact_profile_title">Contact profile</string>
-    <!-- The label of the status on the contact profile dialog. -->
-    <string name="label_status">Status:</string>
-    <!-- The label of the client type on the contact profile dialog. -->
-    <string name="label_client_type">Client type:</string>
-    <!-- The client type which indicates the contact is sign in with a PC client. -->
-    <string name="client_type_computer">Computer</string>
-    <!-- The client type which indicates the contact is sign in with a mobile client. -->
-    <string name="client_type_mobile">Mobile</string>
-
-    <!-- The contact presence status. May be overrided by the plugin. -->
-    <!-- This is an adjective describing the "online" status for the user. It appears in the
-    drop-down status menu on the Contact List screen -->
-    <string name="presence_available">Online</string>
-    <!-- This is an adjective describing the "busy" status for the user. It appears in the
-    drop-down status menu on the Contact List screen -->
-    <string name="presence_busy">Busy</string>
-    <!-- This is an adjective describing the "away" status for the user. It appears in the
-    drop-down status menu on the Contact List screen -->
-    <string name="presence_away">Away</string>
-    <!-- This is an adjective describing the "idle" status for the user. It appears in the
-    drop-down status menu on the Contact List screen -->
-    <string name="presence_idle">Idle</string>
-    <!-- This is an adjective describing the "offline" status for the user. It appears in the
-    drop-down status menu on the Contact List screen -->
-    <string name="presence_offline">Offline</string>
-    <!-- This is an adjective describing the "invisible" status for the user. It appears in the
-    drop-down status menu on the Contact List screen -->
-    <string name="presence_invisible">Appear offline</string>
-
-    <!-- These strings are displayed on the connection setting activity. They are used for development only. Do not localize! -->
-    <string name="preference_title"><xliff:g id="provider">%1$s</xliff:g> settings (dev only)</string>
-    <string name="data_channel_label">Data channel</string>
-    <string name="data_encoding_label">Data encoding</string>
-    <string name="cir_channel_label">CIR channel</string>
-    <string name="host_label">Host</string>
-    <string name="msisdn_label">MSISDN</string>
-    <string name="http">HTTP</string>
-    <string name="sms">SMS</string>
-    <string name="tcp">TCP</string>
-    <string name="xml">XML</string>
-    <string name="wbxml">WBXML</string>
-    <string name="save">Save</string>
-
-    <!-- These strings are displayed on the chat screen -->
-    <!-- Chat screen title (i.e. Chat with Anne Clarkson) -->
-    <string name="chat_with">Chat with <xliff:g id="user">%1$s</xliff:g></string>
-    <!-- In the chat history list, this label is added before the chats the user typed -->
-    <string name="me">Me</string>
-    <!-- On the chat screen, this is the hint text in the input field where the user enters the
-    chat. This needs to fit in both portrait and landscape mode -->
-    <string name="compose_hint">Type to compose</string>    
-    <!-- Inline status message in the chat history list, when receiving a "online" status update. -->
-    <string name="contact_online"><xliff:g id="user">%1$s</xliff:g> is online</string>
-    <!-- Inline status message in the chat history list, when receiving an "away" status update. -->
-    <string name="contact_away"><xliff:g id="user">%1$s</xliff:g> is away</string>
-    <!-- Inline status message in the chat history list, when receiving a "busy" status update. -->
-    <string name="contact_busy"><xliff:g id="user">%1$s</xliff:g> is busy</string>
-    <!-- Inline status message in the chat history list, when receiving a "offline" status update. -->
-    <string name="contact_offline"><xliff:g id="user">%1$s</xliff:g> is offline</string>
-    <!-- Inline status message in the chat history list, when a friend joined the chat. -->
-    <string name="contact_joined"><xliff:g id="user">%1$s</xliff:g> has joined</string>
-    <!-- Inline status message in the chat history list, when a friend left the chat. -->
-    <string name="contact_left"><xliff:g id="user">%1$s</xliff:g> has left</string>
-    <!-- Inline time stamp status in the chat history list. The timestamp formatting maybe different for different locales.-->
-    <string name="time_stamp" format="date">\'Sent at\' <xliff:g id="hour">hh</xliff:g>:<xliff:g id="minute">mm</xliff:g> <xliff:g id="ampm">a</xliff:g> \'on\' <xliff:g id="date">EEEE</xliff:g></string>
-    <!-- The send button on the chat screen. -->
-    <string name="send">Send</string>
-    <!-- Error message when a chat failed to be sent.-->
-    <string name="msg_sent_failed">This message could not be sent.</string>
-    <!-- Warning message displayed in the chat screen when connection is lost.-->
-    <string name="disconnected_warning">Lost connection to server. Messages will be sent when online.</string>
-    <!-- Warning message displayed in the chat screen when the contact is offline.-->
-    <string name="contact_offline_warning"><xliff:g id="user">%1$s</xliff:g> is offline. Messages you send will be delivered when <xliff:g id="user">%1$s</xliff:g> comes online.</string>
-    <!-- Warning message displayed in the chat screen when the contact is not in the user's list.-->
-    <string name="contact_not_in_list_warning"><xliff:g id="user">%1$s</xliff:g> is not in your Contact list.</string>
-    <!-- The menu of links brought up when the user clicks on a chat history item, if there are any.-->
-    <string name="select_link_title">Select link</string>
-    <!-- Displayed when there is no active chats in the chat dashboard.-->
-    <string name="empty_chat_list">No active chats.</string>
-
-    <!-- Add contact screen -->
-    <!-- This is the title of the Add Contact Screen. -->
-    <string name="add_contact_title">Add contact</string>
-    <!-- The label of the email input box on the Add Contact Screen. -->
-    <string name="input_contact_label">Email address of person you wish to invite:</string>
-    <!-- The label of the list spinner on the Add Contact Screen. -->
-    <string name="choose_list_label">Choose a list:</string>
-    <!-- This is an instruction message displayed under the input box on the Add Contact Screen.  -->
-    <string name="invite_instruction">Type a name to add from Contacts.</string>
-    <!-- The label of the button on the Add Contact Screen to send the invitation. -->
-    <string name="invite_label">Send invitation</string>
-
-    <!-- setting screen. A title is the name of the setting; a summary is displayed in smaller text below the title. -->
-    <string name="setting_title">General settings</string>
-    <string name="hide_offline_contacts">Hide offline contacts</string>
-    <!-- This is a subtitle for the "Notification settings"  in the Setting screen. -->
-    <string name="notification_group_title">Notification settings</string>
-    <!-- This is the text label of the setting for IM notifications; a summary is displayed in
-    smaller text below this label -->
-    <string name="notification_enabled_title">IM notifications</string>
-    <!-- This is the summary of the setting for IM notifications -->
-    <string name="notification_enabled_summary">Notify in status bar when IM arrives</string>
-    <!-- This is the text label of the vibrate notification setting; a summary is displayed in
-    smaller text below this label -->
-    <string name="notification_vibrate_title">Vibrate</string>
-    <!-- This is the summary of the vibrate notification setting-->
-    <string name="notification_vibrate_summary">Also vibrate when IM arrives</string>
-    <!-- This is the text label of the sound notification setting; a summary is displayed in
-    smaller text below this label -->
-    <string name="notification_sound_title">Sound</string>
-    <!-- This is the summary of the vibrate notification setting-->
-    <string name="notification_sound_summary">Also play ringtone when IM arrives</string>
-    <!-- This is the text label selecting the ringtone. Clicking on this will take the user to
-    the ringtone picker -->
-    <string name="notification_ringtone_title">Select ringtone</string>
-
-    <!-- Group chat invitation screen (Currently not used.) -->
-    <!-- The prompt message displayed on the group chat invitation screen.-->
-    <string name="invitation_prompt"><xliff:g id="user">%1$s</xliff:g> has invited you to join a group chat.</string>
-    <!-- Toast when group chat invitation has been sent to the contact.-->
-    <string name="invitation_sent_prompt"> Invitation has been sent to <xliff:g id="user">%1$s</xliff:g>.</string>
-    <!-- The button for accepting an invitation.-->
-    <string name="accept_invitation">Accept</string>
-    <!-- The button for decline an invitation.-->
-    <string name="decline_invitation">Decline</string>
-
-    <!-- Friend subscription screen -->
-    <string name="subscription_prompt"><xliff:g id="user">%1$s</xliff:g> has invited you to be on their Contact list.</string>
-    <!-- The button for approving a subscription request.-->
-    <string name="approve_subscription">Accept</string>
-    <!-- The button for delecling a subscription request.-->
-    <string name="decline_subscription">Decline</string>
-    <!-- Toast when approve a subscription request failed.-->
-    <string name="approve_subscription_error">Unable to approve subscription from <xliff:g id="user">%1$s</xliff:g>. Please try again later.</string>
-    <!-- Toast when decline a subscription request failed.-->
-    <string name="decline_subscription_error">Unable to decline subscription from <xliff:g id="user">%1$s</xliff:g>. Please try again later.</string>
-    <!-- Notification bar messages -->
-    <!-- This is the notification bar message when a new IM arrives. -->
-    <string name="newMessages_label">New <xliff:g id="provider">%1$s</xliff:g> messages</string>
-    <!-- This is the notification bar message when new IMs comes from more than one contact. -->
-    <string name="num_unread_chats">
-        <xliff:g id="number">%1$d</xliff:g> unread chats
-    </string>
-    <!-- This is the notification bar message when an invitation from someone arrived. -->
-    <string name="subscription_notify_text">
-        New friend invitation from <xliff:g id="user">%s</xliff:g>
-    </string>
-    <!-- This is the notification bar message when an invitation to join a group chat from someone arrived. Currently not used. -->
-    <string name="notify_groupchat_label">Group chat invitation</string>
-    <!-- This is the text label of the group chat invitation message in the notification. Currently not used. -->
-    <string name="group_chat_invite_notify_text">
-        New group chat invitation from <xliff:g id="user">%s</xliff:g>
-    </string>
-
-    <!-- Toast when a contact is added into a list.-->
-    <string name="add_contact_success">Contact \"<xliff:g id="user">%1$s</xliff:g>\" added.</string>
-    <!-- Toast when a contact is deleted from the list.-->
-    <string name="delete_contact_success">Contact \"<xliff:g id="user">%1$s</xliff:g>\" deleted.</string>
-    <!-- Toast when a contact is blocked.-->
-    <string name="block_contact_success">Contact \"<xliff:g id="user">%1$s</xliff:g>\" blocked.</string>
-    <!-- Toast when a contact is unblocked.-->
-    <string name="unblock_contact_success">Contact \"<xliff:g id="user">%1$s</xliff:g>\" unblocked.</string>
-
-
-    <!-- IM service permission -->
-    <string name="perm_label">start IM service</string>
-    <string name="perm_desc">Allows applications to start IM service via intent.</string>
-
-    <!-- Errors-->
-    <!-- The title of the error dialog -->
-    <string name="error">Attention</string>
-    <!-- Error message for sign in failed.-->
-    <string name="login_service_failed">Unable to sign in to the <xliff:g id="service">%1$s</xliff:g> service. Please try again later.\n(Detail: <xliff:g id="description">%2$s</xliff:g>)</string>
-    <!-- Error message for creating contact list failed.-->
-    <string name="add_list_failed">The list was not added.</string>
-    <!-- Error message for blocking contact failed.-->
-    <string name="block_contact_failed">Contact was not blocked.</string>
-    <!-- Error message for unblocking contact failed.-->
-    <string name="unblock_contact_failed">Contact was not unblocked.</string>
-    <!-- Error message for when the user didn't select a contact as required.-->
-    <string name="select_contact">Please select a contact first.</string>
-    <!-- Error message for when the current connection disconnected.-->
-    <string name="disconnected">Disconnected!\n</string>
-    <!-- Error message for when the IM service has died.-->
-    <string name="service_error">Service error!</string>
-    <!-- Error message for loading contact list failed.-->
-    <string name="load_contact_list_failed">Contact list did not load.</string>
-    <!-- Error message for failed to connect to the server.-->
-    <string name="cant_connect_to_server">Cannot connect to server. Please check your connection.</string>
-    <!-- Error message for when the contact is already in the list.-->
-    <string name="contact_already_exist">"<xliff:g id="user">%1$s</xliff:g>" already exists in your Contact list.</string>
-    <!-- Error message for when the contact is blocked. -->
-    <string name="contact_blocked">Contact \"<xliff:g id="user">%1$s</xliff:g>\" has been blocked.</string>
-    <!-- Error message for when the contact list is not compeletely loaded.-->
-    <string name="contact_not_loaded">Please wait while your Contact list loads.</string>
-    <!-- Error message for when a network error occurred.-->
-    <string name="network_error">A network error occurred.</string>
-    <!-- Error message for lack of server support error.-->
-    <string name="service_not_support">The server does not support this functionality.</string>
-    <!-- Erorr message for bad password error.-->
-    <string name="invalid_password">The password you entered is not valid.</string>
-    <!-- Error message for server internal error.-->
-    <string name="internal_server_error">The server encountered an error.</string>
-    <!-- Error message for when the server does not implement the feature. -->
-    <string name="not_implemented">The server does not support this functionality.</string>
-    <!-- Error message for server not available error.-->
-    <string name="service_unavaiable">The server is currently unavailable.</string>
-    <!-- Error message for timeout error.-->
-    <string name="timeout">The server has timed out.</string>
-    <!-- Error message for when the server does not support the current protocol version.-->
-    <string name="version_not_supported">The server does not support the current version.</string>
-    <!-- Error message for when the message queue on the server is full.-->
-    <string name="message_queue_full">The message queue is full.</string>
-    <!-- Error message for when the domain is not supported by the server.-->
-    <string name="domain_not_supported">The server does not support forwarding to the domain.</string>
-    <!-- Error message for a bad username error.-->
-    <string name="unknown_user">The username you entered is not recognized.</string>
-    <!-- Error message for when the user is blocked by the recipient.-->
-    <string name="recipient_blocked_the_user">Sorry, you are blocked by the user.</string>
-    <!-- Error message for session expired error.-->
-    <string name="session_expired">The session has expired, please sign in again.</string>
-    <!-- forced_logout and already_logged_in are used within another sentence so y is not capped. -->
-    <string name="forced_logout">you have signed in from another client.</string>
-    <string name="already_logged_in">you have already signed in from another client.</string>
-    <!-- Error message for msisdn error.-->
-    <string name="msisdn_error">Sorry, the phone number cannot be read from your SIM card. Please contact your operator for help.</string>
-    <!-- Error message for when the user is not signed in.-->
-    <string name="not_signed_in">You are currently not signed in.</string>
-    <!-- Generic error.-->
-    <string name="general_error">Error code <xliff:g id="code">%1$d</xliff:g></string>
-
-    <!-- Smiley names. May be overrided by the plugin. -->
-    <string-array name="default_smiley_names">
-        <item>Happy</item>
-        <item>Sad</item>
-        <item>Winking</item>
-        <item>Tongue sticking out</item>
-        <item>Surprised</item>
-        <item>Kissing</item>
-        <item>Yelling</item>
-        <item>Cool</item>
-        <item>Money mouth</item>
-        <item>Foot in mouth</item>
-        <item>Embarrassed</item>
-        <item>Angel</item>
-        <item>Undecided</item>
-        <item>Crying</item>
-        <item>Lips are sealed</item>
-        <item>Laughing</item>
-        <item>Confused</item>
-    </string-array>
-    <!-- Do not localize! Smiley text representations. May be overrided by the plugin. -->
-    <string-array name="default_smiley_texts">
-        <item>:-)</item>
-        <item>:-(</item>
-        <item>;-)</item>
-        <item>:-P</item>
-        <item>=-O</item>
-        <item>:-*</item>
-        <item>:O</item>
-        <item>B-)</item>
-        <item>:-$</item>
-        <item>:-!</item>
-        <item>:-[</item>
-        <item>O:-)</item>
-        <item>:-\\</item>
-        <item>:\'(</item>
-        <item>:-X</item>
-        <item>:-D</item>
-        <item>o_O</item>
-    </string-array>
-</resources>
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
deleted file mode 100644 (file)
index 9ff37a4..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-    <PreferenceCategory android:title="@string/setting_title">
-        <CheckBoxPreference
-                android:key="hide-offline-contacts"
-                android:title="@string/hide_offline_contacts"
-                android:defaultValue="false"
-                android:persistent="false" />
-    </PreferenceCategory>
-
-    <PreferenceCategory android:title="@string/notification_group_title">
-
-        <CheckBoxPreference
-                android:key="enable-notifications"
-                android:title="@string/notification_enabled_title"
-                android:summary="@string/notification_enabled_summary"
-                android:defaultValue="true"
-                android:persistent="false" />
-
-        <CheckBoxPreference
-                android:layout="?android:attr/preferenceLayoutChild"
-                android:dependency="enable-notifications"
-                android:key="notification-vibrate"
-                android:defaultValue="false"
-                android:persistent="false"
-                android:title="@string/notification_vibrate_title"
-                android:summary="@string/notification_vibrate_summary" />
-
-        <CheckBoxPreference
-                android:layout="?android:attr/preferenceLayoutChild"
-                android:dependency="enable-notifications"
-                android:defaultValue="true"
-                android:persistent="false"
-                android:key="notification-sound"
-                android:title="@string/notification_sound_title"
-                android:summary="@string/notification_sound_summary" />
-
-        <com.android.im.app.ImRingtonePreference
-                android:layout="?android:attr/preferenceLayoutChild"
-                android:dependency="notification-sound"
-                android:key="notification-ringtone"
-                android:persistent="false"
-                android:title="@string/notification_ringtone_title"
-                android:ringtoneType="notification" />
-
-    </PreferenceCategory>
-
-</PreferenceScreen>
diff --git a/samples/PluginDemo/Android.mk b/samples/PluginDemo/Android.mk
deleted file mode 100644 (file)
index 3cf36f2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := samples development
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files) \
-
-LOCAL_PACKAGE_NAME := ImPluginDemo
-
-LOCAL_JAVA_LIBRARIES := com.android.im.plugin
-
-include $(BUILD_PACKAGE)
diff --git a/samples/PluginDemo/AndroidManifest.xml b/samples/PluginDemo/AndroidManifest.xml
deleted file mode 100644 (file)
index eaebd68..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec Inc.
- * Copyright (C) 2008 The Android Open Source Project
-
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.android.im.plugin.demo" android:sharedUserId="android.uid.im">
-
-    <application android:taskAffinity="android.task.im">
-
-        <uses-library android:name="com.android.im.plugin" />
-
-        <service android:name=".DemoImPlugin">
-            <intent-filter>
-                <action android:name="com.android.im.plugin" />
-            </intent-filter>
-            <meta-data android:name="com.android.im.provider_name"
-                android:value="Demo"/>
-            <meta-data android:name="com.android.im.provider_full_name"
-                android:value="Demo IM Provider"/>
-            <meta-data android:name="com.android.im.signup_url"
-                android:value="http://xxx.xxx.xxx"/>
-        </service>
-
-    </application>
-
-</manifest>
diff --git a/samples/PluginDemo/res/drawable/chat.png b/samples/PluginDemo/res/drawable/chat.png
deleted file mode 100755 (executable)
index be844fd..0000000
Binary files a/samples/PluginDemo/res/drawable/chat.png and /dev/null differ
diff --git a/samples/PluginDemo/res/drawable/chat_new.png b/samples/PluginDemo/res/drawable/chat_new.png
deleted file mode 100755 (executable)
index f31ba59..0000000
Binary files a/samples/PluginDemo/res/drawable/chat_new.png and /dev/null differ
diff --git a/samples/PluginDemo/res/drawable/im_logo.png b/samples/PluginDemo/res/drawable/im_logo.png
deleted file mode 100644 (file)
index 764d189..0000000
Binary files a/samples/PluginDemo/res/drawable/im_logo.png and /dev/null differ
diff --git a/samples/PluginDemo/res/drawable/im_logo_splashscr.png b/samples/PluginDemo/res/drawable/im_logo_splashscr.png
deleted file mode 100644 (file)
index 1b7ee6f..0000000
Binary files a/samples/PluginDemo/res/drawable/im_logo_splashscr.png and /dev/null differ
diff --git a/samples/PluginDemo/res/values-cs/strings.xml b/samples/PluginDemo/res/values-cs/strings.xml
deleted file mode 100644 (file)
index a0cdf4c..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">"Přidat kontakt"</string>
-    <string name="menu_remove_contact">"Smazat kontakt"</string>
-    <string name="menu_block_contact">"Blokovat"</string>
-    <string name="menu_contact_list">"Seznam kontaktů"</string>
-    <string name="menu_start_chat">"Odeslat zprávu"</string>
-    <string name="menu_view_profile">"Info o kamarádovi"</string>
-    <string name="menu_end_conversation">"Konec konverzace"</string>
-    <string name="menu_switch_chats">"Přepnout chat"</string>
-    <string name="menu_insert_smiley">"Vložit emotikony"</string>
-    <string name="sign_up">"Zřízení nového účtu"</string>
-    <string name="check_save_password">"Pokud je váš telefon ukraden nebo jej ztratíte, přejděte v zájmu vlastní bezpečnosti na počítači na web a změňte své heslo."</string>
-    <string name="buddy_list_title">"Seznam kontaktů – <xliff:g id="USERNAME">%1$s</xliff:g>"</string>
-    <string name="label_username">"Uživatelské jméno:"</string>
-    <string name="ongoing_conversation">"Konverzace (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="contact_profile_title">"Kontaktní informace"</string>
-    <string name="presence_available">"Povoleno"</string>
-    <string name="add_contact_title">"Přidat kontakt"</string>
-    <string name="input_contact_label">"Jméno osoby, kterou chcete přidat:"</string>
-    <string name="invite_label">"Přidat kamaráda"</string>
-  <string-array name="smiley_names">
-    <item>"Happy"</item>
-    <item>"Smutný"</item>
-    <item>"Mrkající"</item>
-    <item>"Vypláznutý jazyk"</item>
-    <item>"Překvapený"</item>
-    <item>"Pusa"</item>
-    <item>"Hej!"</item>
-    <item>"Cool"</item>
-    <item>"Cinkání zlaťáků"</item>
-    <item>"Šlápota v úsměvu"</item>
-    <item>"V rozpacích"</item>
-    <item>"Andílek"</item>
-    <item>"Nerozhodný"</item>
-    <item>"Rozplakaný"</item>
-    <item>"Ani muk"</item>
-    <item>"Smějící se"</item>
-    <item>"Zmatený"</item>
-  </string-array>
-  <string-array name="smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/samples/PluginDemo/res/values-de/strings.xml b/samples/PluginDemo/res/values-de/strings.xml
deleted file mode 100644 (file)
index 192cccc..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">"Kontakt hinzufügen"</string>
-    <string name="menu_remove_contact">"Kontakt löschen"</string>
-    <string name="menu_block_contact">"Blockieren"</string>
-    <string name="menu_contact_list">"Kontaktliste"</string>
-    <string name="menu_start_chat">"IM senden"</string>
-    <string name="menu_view_profile">"Buddy Info"</string>
-    <string name="menu_end_conversation">"Gespräch beenden"</string>
-    <string name="menu_switch_chats">"Chats wechseln"</string>
-    <string name="menu_insert_smiley">"Emoticons einfügen"</string>
-    <string name="sign_up">"Ein neues Konto erhalten"</string>
-    <string name="check_save_password">"Zu Ihrer Sicherheit: Wenn Sie Ihr Telefon verloren haben oder es gestohlen wurde, rufen Sie die Website auf Ihrem Computer auf und ändern Sie Ihr Passwort."</string>
-    <string name="buddy_list_title">"Kontaktliste - <xliff:g id="USERNAME">%1$s</xliff:g>"</string>
-    <string name="label_username">"Benutzername:"</string>
-    <string name="ongoing_conversation">"Gespräche (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="contact_profile_title">"Kontaktinformationen"</string>
-    <string name="presence_available">"Verfügbar"</string>
-    <string name="add_contact_title">"Kontakt hinzufügen"</string>
-    <string name="input_contact_label">"Displayname der Person, die Sie hinzufügen möchten:"</string>
-    <string name="invite_label">"Buddy hinzufügen"</string>
-  <string-array name="smiley_names">
-    <item>"Glücklich"</item>
-    <item>"Traurig"</item>
-    <item>"Zwinkern"</item>
-    <item>"Herausgestreckte Zunge"</item>
-    <item>"Überrascht"</item>
-    <item>"Kuss"</item>
-    <item>"Schreien"</item>
-    <item>"Cool"</item>
-    <item>"Worten sollen Taten folgen"</item>
-    <item>"Ins Fettnäpfchen getreten"</item>
-    <item>"Peinlich berührt"</item>
-    <item>"Engel"</item>
-    <item>"Unentschlossen"</item>
-    <item>"Weinen"</item>
-    <item>"Versiegelte Lippen"</item>
-    <item>"Lachen"</item>
-    <item>"Verwirrt"</item>
-  </string-array>
-  <string-array name="smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/samples/PluginDemo/res/values-es/strings.xml b/samples/PluginDemo/res/values-es/strings.xml
deleted file mode 100644 (file)
index 8fde664..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">"Añadir contacto"</string>
-    <string name="menu_remove_contact">"Eliminar contacto"</string>
-    <string name="menu_block_contact">"Bloquear"</string>
-    <string name="menu_contact_list">"Lista de contactos"</string>
-    <string name="menu_start_chat">"Enviar MI"</string>
-    <string name="menu_view_profile">"Información de amigo"</string>
-    <string name="menu_end_conversation">"Finalizar conversación"</string>
-    <string name="menu_switch_chats">"Cambiar de chat"</string>
-    <string name="menu_insert_smiley">"Insertar emoticonos"</string>
-    <string name="sign_up">"Obtener una cuenta nueva"</string>
-    <string name="check_save_password">"Si pierdes el teléfono o te lo roban, te recomendamos por seguridad que accedas al sitio web desde tu equipo y cambies la contraseña."</string>
-    <string name="buddy_list_title">"Lista de contactos - <xliff:g id="USERNAME">%1$s</xliff:g>"</string>
-    <string name="label_username">"Nombre de usuario:"</string>
-    <string name="ongoing_conversation">"Conversaciones (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="contact_profile_title">"Información de contacto"</string>
-    <string name="presence_available">"Disponible"</string>
-    <string name="add_contact_title">"Añadir contacto"</string>
-    <string name="input_contact_label">"Nombre de pantalla de la persona que quieres añadir:"</string>
-    <string name="invite_label">"Añadir amigo"</string>
-  <string-array name="smiley_names">
-    <item>"Feliz"</item>
-    <item>"Triste"</item>
-    <item>"Guiñando"</item>
-    <item>"Sacando la lengua"</item>
-    <item>"Sorprendido"</item>
-    <item>"Besando"</item>
-    <item>"Gritando"</item>
-    <item>"Atractivo"</item>
-    <item>"Dinero en la boca"</item>
-    <item>"Metedura de pata"</item>
-    <item>"Avergonzado"</item>
-    <item>"Ángel"</item>
-    <item>"Indeciso"</item>
-    <item>"Llorando"</item>
-    <item>"Labios sellados"</item>
-    <item>"Riendo"</item>
-    <item>"Confuso"</item>
-  </string-array>
-  <string-array name="smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/samples/PluginDemo/res/values-fr/strings.xml b/samples/PluginDemo/res/values-fr/strings.xml
deleted file mode 100644 (file)
index 8d490e3..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">"Ajouter un contact"</string>
-    <string name="menu_remove_contact">"Supprimer un contact"</string>
-    <string name="menu_block_contact">"Bloquer"</string>
-    <string name="menu_contact_list">"Liste de contacts"</string>
-    <string name="menu_start_chat">"Envoyer un message instantané"</string>
-    <string name="menu_view_profile">"Infos sur le contact"</string>
-    <string name="menu_end_conversation">"Terminer la conversation"</string>
-    <string name="menu_switch_chats">"Changer de chat"</string>
-    <string name="menu_insert_smiley">"Insérer une émoticône"</string>
-    <string name="sign_up">"Créer un nouveau compte"</string>
-    <string name="check_save_password">"Pour votre sécurité, en cas de vol ou de perte de votre téléphone, rendez-vous sur le site Web depuis votre ordinateur et modifiez votre mot de passe."</string>
-    <string name="buddy_list_title">"Liste de contacts :<xliff:g id="USERNAME">%1$s</xliff:g>"</string>
-    <string name="label_username">"Nom d\'utilisateur :"</string>
-    <string name="ongoing_conversation">"Conversations (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="contact_profile_title">"Infos sur le contact"</string>
-    <string name="presence_available">"Disponible"</string>
-    <string name="add_contact_title">"Ajouter le contact"</string>
-    <string name="input_contact_label">"Identifiant du contact que vous souhaitez ajouter :"</string>
-    <string name="invite_label">"Ajouter un contact"</string>
-  <string-array name="smiley_names">
-    <item>"Content"</item>
-    <item>"Triste"</item>
-    <item>"Clin d\'œil"</item>
-    <item>"Tire la langue"</item>
-    <item>"Surpris"</item>
-    <item>"Bisous"</item>
-    <item>"Crier"</item>
-    <item>"Cool"</item>
-    <item>"Argent"</item>
-    <item>"Embarrassé"</item>
-    <item>"Gêné"</item>
-    <item>"Ange"</item>
-    <item>"Indécis"</item>
-    <item>"Pleure"</item>
-    <item>"Motus et bouche cousue"</item>
-    <item>"Rire"</item>
-    <item>"Confus"</item>
-  </string-array>
-  <string-array name="smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/samples/PluginDemo/res/values-it/strings.xml b/samples/PluginDemo/res/values-it/strings.xml
deleted file mode 100644 (file)
index 19dbc78..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">"Aggiungi contatto"</string>
-    <string name="menu_remove_contact">"Elimina contatto"</string>
-    <string name="menu_block_contact">"Blocca"</string>
-    <string name="menu_contact_list">"Elenco contatti"</string>
-    <string name="menu_start_chat">"Invia IM"</string>
-    <string name="menu_view_profile">"Info amico"</string>
-    <string name="menu_end_conversation">"Termina conversazione"</string>
-    <string name="menu_switch_chats">"Cambia conversazione"</string>
-    <string name="menu_insert_smiley">"Inserisci emoticon"</string>
-    <string name="sign_up">"Ottieni un nuovo account"</string>
-    <string name="check_save_password">"Per la tua sicurezza, in caso di perdita o furto del telefono visita il sito web da un computer e cambia la password."</string>
-    <string name="buddy_list_title">"Elenco contatti - <xliff:g id="USERNAME">%1$s</xliff:g>"</string>
-    <string name="label_username">"Nome utente:"</string>
-    <string name="ongoing_conversation">"Conversazioni (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="contact_profile_title">"Info contatto"</string>
-    <string name="presence_available">"Disponibile"</string>
-    <string name="add_contact_title">"Aggiungi contatto"</string>
-    <string name="input_contact_label">"Nome visualizzato della persona da aggiungere:"</string>
-    <string name="invite_label">"Aggiungi amico"</string>
-  <string-array name="smiley_names">
-    <item>"Felice"</item>
-    <item>"Triste"</item>
-    <item>"Fare l\'occhiolino"</item>
-    <item>"Lingua fuori"</item>
-    <item>"Sorpreso"</item>
-    <item>"Baciare"</item>
-    <item>"Urlare"</item>
-    <item>"Favoloso"</item>
-    <item>"Bocca a forma di dollaro"</item>
-    <item>"Gaffe"</item>
-    <item>"Imbarazzato"</item>
-    <item>"Angelo"</item>
-    <item>"Indeciso"</item>
-    <item>"Piangere"</item>
-    <item>"Labbra cucite"</item>
-    <item>"Sorridere"</item>
-    <item>"Confuso"</item>
-  </string-array>
-  <string-array name="smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/samples/PluginDemo/res/values-ja/strings.xml b/samples/PluginDemo/res/values-ja/strings.xml
deleted file mode 100644 (file)
index 8bada1d..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">"連絡先を追加"</string>
-    <string name="menu_remove_contact">"連絡先を削除"</string>
-    <string name="menu_block_contact">"ブロック"</string>
-    <string name="menu_contact_list">"連絡先リスト"</string>
-    <string name="menu_start_chat">"IMを送信"</string>
-    <string name="menu_view_profile">"友だち情報"</string>
-    <string name="menu_end_conversation">"チャットをやめる"</string>
-    <string name="menu_switch_chats">"チャットを切り替え"</string>
-    <string name="menu_insert_smiley">"絵文字を挿入"</string>
-    <string name="sign_up">"新しいアカウントを取得"</string>
-    <string name="check_save_password">"セキュリティ保護のため、携帯電話を紛失したり盗まれたりした場合は、パソコンからウェブサイトにアクセスしてパスワードを変更してください。"</string>
-    <string name="buddy_list_title">"連絡先リスト - <xliff:g id="USERNAME">%1$s</xliff:g>"</string>
-    <string name="label_username">"ユーザー名:"</string>
-    <string name="ongoing_conversation">"チャット (<xliff:g id="NUMBER">%1$d</xliff:g>件)"</string>
-    <string name="contact_profile_title">"連絡先情報"</string>
-    <string name="presence_available">"オンライン"</string>
-    <string name="add_contact_title">"連絡先を追加"</string>
-    <string name="input_contact_label">"追加する人のスクリーンネーム:"</string>
-    <string name="invite_label">"友だちを追加"</string>
-  <string-array name="smiley_names">
-    <item>"ハッピー"</item>
-    <item>"悲しい"</item>
-    <item>"ウィンク"</item>
-    <item>"アッカンベー"</item>
-    <item>"びっくり"</item>
-    <item>"キス"</item>
-    <item>"激怒"</item>
-    <item>"クール"</item>
-    <item>"気持ち悪い"</item>
-    <item>"しまった"</item>
-    <item>"恥ずかしい"</item>
-    <item>"天使"</item>
-    <item>"迷う"</item>
-    <item>"泣く"</item>
-    <item>"お口にチャック"</item>
-    <item>"笑顔"</item>
-    <item>"混乱"</item>
-  </string-array>
-  <string-array name="smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/samples/PluginDemo/res/values-ko/strings.xml b/samples/PluginDemo/res/values-ko/strings.xml
deleted file mode 100644 (file)
index e4b1480..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">"연락처 추가"</string>
-    <string name="menu_remove_contact">"연락처 삭제"</string>
-    <string name="menu_block_contact">"차단"</string>
-    <string name="menu_contact_list">"연락처 목록"</string>
-    <string name="menu_start_chat">"IM 보내기"</string>
-    <string name="menu_view_profile">"친구정보"</string>
-    <string name="menu_end_conversation">"대화종료"</string>
-    <string name="menu_switch_chats">"채팅 전환"</string>
-    <string name="menu_insert_smiley">"이모티콘 삽입"</string>
-    <string name="sign_up">"새 계정 만들기"</string>
-    <string name="check_save_password">"전화기를 잃어버렸거나 도난당한 경우에는 보안을 위해 컴퓨터에서 웹사이트를 방문하여 비밀번호를 변경하세요."</string>
-    <string name="buddy_list_title">"연락처 목록 - <xliff:g id="USERNAME">%1$s</xliff:g>"</string>
-    <string name="label_username">"사용자 이름:"</string>
-    <string name="ongoing_conversation">"대화(<xliff:g id="NUMBER">%1$d</xliff:g>명)"</string>
-    <string name="contact_profile_title">"연락처 정보"</string>
-    <string name="presence_available">"대화가능"</string>
-    <string name="add_contact_title">"연락처 추가"</string>
-    <string name="input_contact_label">"추가할 사람의 대화명:"</string>
-    <string name="invite_label">"친구추가"</string>
-  <string-array name="smiley_names">
-    <item>"행복"</item>
-    <item>"슬픔"</item>
-    <item>"윙크"</item>
-    <item>"메롱"</item>
-    <item>"놀람"</item>
-    <item>"키스"</item>
-    <item>"소리 지름"</item>
-    <item>"멋짐"</item>
-    <item>"욕심"</item>
-    <item>"부끄러움"</item>
-    <item>"당황"</item>
-    <item>"천사"</item>
-    <item>"우유부단"</item>
-    <item>"울음"</item>
-    <item>"입막음"</item>
-    <item>"웃음"</item>
-    <item>"어리둥절"</item>
-  </string-array>
-  <string-array name="smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/samples/PluginDemo/res/values-nb/strings.xml b/samples/PluginDemo/res/values-nb/strings.xml
deleted file mode 100644 (file)
index 6a92d62..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">"Legg til kontakt"</string>
-    <string name="menu_remove_contact">"Fjern kontakt"</string>
-    <string name="menu_block_contact">"Blokker kontakt"</string>
-    <string name="menu_contact_list">"Kontaktliste"</string>
-    <string name="menu_start_chat">"Start samtale"</string>
-    <string name="menu_view_profile">"Vis profil"</string>
-    <string name="menu_end_conversation">"Avslutt samtale"</string>
-    <string name="menu_switch_chats">"Bytt mellom samtaler"</string>
-    <string name="menu_insert_smiley">"Sett inn smilefjes"</string>
-    <string name="sign_up">"Mangler du konto?"</string>
-    <string name="check_save_password">"Av sikkerhetsgrunner, gå til nettstedet og endre passordet om telefonen blir tapt eller stjåler."</string>
-    <string name="buddy_list_title">"Kontaktliste - <xliff:g id="USERNAME">%1$s</xliff:g>"</string>
-    <string name="label_username">"Brukernavn:"</string>
-    <string name="ongoing_conversation">"Pågående samtaler (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="contact_profile_title">"Kontaktprofil"</string>
-    <string name="presence_available">"Tilgjengelig"</string>
-    <string name="add_contact_title">"Legg til kontakt"</string>
-    <string name="input_contact_label">"E-postadresse til den du ønsker å invitere:"</string>
-    <string name="invite_label">"Send invitasjon"</string>
-  <string-array name="smiley_names">
-    <item>"Glad"</item>
-    <item>"Trist"</item>
-    <item>"Blunker"</item>
-    <item>"Rekker tunge"</item>
-    <item>"Overrasket"</item>
-    <item>"Kyss"</item>
-    <item>"Roper"</item>
-    <item>"Kul"</item>
-    <item>"Pengemunn"</item>
-    <item>"Fot i munnen"</item>
-    <item>"Flau"</item>
-    <item>"Engel"</item>
-    <item>"Usikker"</item>
-    <item>"Gråter"</item>
-    <item>"Stille som graven"</item>
-    <item>"Ler"</item>
-    <item>"Forvirret"</item>
-  </string-array>
-  <string-array name="smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\\\"</item>
-    <item>":\\\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/samples/PluginDemo/res/values-nl/strings.xml b/samples/PluginDemo/res/values-nl/strings.xml
deleted file mode 100644 (file)
index f719753..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">"Contactpersoon toevoegen"</string>
-    <string name="menu_remove_contact">"Contactpersoon verwijderen"</string>
-    <string name="menu_block_contact">"Blokkeren"</string>
-    <string name="menu_contact_list">"Lijst met contactpersonen"</string>
-    <string name="menu_start_chat">"Chat verzenden"</string>
-    <string name="menu_view_profile">"Buddygegevens"</string>
-    <string name="menu_end_conversation">"Conversatie beëindigen"</string>
-    <string name="menu_switch_chats">"Schakelen tussen chats"</string>
-    <string name="menu_insert_smiley">"Emoticons invoegen"</string>
-    <string name="sign_up">"Een nieuw account verkrijgen"</string>
-    <string name="check_save_password">"Als u uw telefoon verliest of als deze wordt gestolen, moet u voor uw veiligheid naar de website gaan op uw computer en uw wachtwoord wijzigen."</string>
-    <string name="buddy_list_title">"Lijst met contactpersonen - <xliff:g id="USERNAME">%1$s</xliff:g>"</string>
-    <string name="label_username">"Gebruikersnaam:"</string>
-    <string name="ongoing_conversation">"Conversaties (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="contact_profile_title">"Contactgegevens"</string>
-    <string name="presence_available">"Beschikbaar"</string>
-    <string name="add_contact_title">"Contactpersoon toevoegen"</string>
-    <string name="input_contact_label">"Schermnaam van de persoon die u wilt toevoegen:"</string>
-    <string name="invite_label">"Buddy toevoegen"</string>
-  <string-array name="smiley_names">
-    <item>"Blij"</item>
-    <item>"Bedroefd"</item>
-    <item>"Knipoog"</item>
-    <item>"Tong uitsteken"</item>
-    <item>"Verrast"</item>
-    <item>"Kussend"</item>
-    <item>"Schreeuwend"</item>
-    <item>"Cool"</item>
-    <item>"Geldzoeker"</item>
-    <item>"Mond vol tanden"</item>
-    <item>"Beschaamd"</item>
-    <item>"Engel"</item>
-    <item>"Twijfelend"</item>
-    <item>"Huilend"</item>
-    <item>"Lippen op elkaar"</item>
-    <item>"Lachend"</item>
-    <item>"Verward"</item>
-  </string-array>
-  <string-array name="smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/samples/PluginDemo/res/values-pl/strings.xml b/samples/PluginDemo/res/values-pl/strings.xml
deleted file mode 100644 (file)
index 8a088d2..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">"Dodaj kontakt"</string>
-    <string name="menu_remove_contact">"Usuń kontakt"</string>
-    <string name="menu_block_contact">"Zablokuj"</string>
-    <string name="menu_contact_list">"Lista kontaktów"</string>
-    <string name="menu_start_chat">"Wyślij wiadomość"</string>
-    <string name="menu_view_profile">"Informacje o znajomym"</string>
-    <string name="menu_end_conversation">"Zakończ rozmowę"</string>
-    <string name="menu_switch_chats">"Przełącz czaty"</string>
-    <string name="menu_insert_smiley">"Wstaw emotikony"</string>
-    <string name="sign_up">"Utwórz nowe konto"</string>
-    <string name="check_save_password">"Ze względów bezpieczeństwa w przypadku zgubienia lub kradzieży telefonu odwiedź witrynę internetową ze swojego komputera i zmień hasło."</string>
-    <string name="buddy_list_title">"Lista kontaktów — <xliff:g id="USERNAME">%1$s</xliff:g>"</string>
-    <string name="label_username">"Nazwa użytkownika:"</string>
-    <string name="ongoing_conversation">"Rozmowy <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
-    <string name="contact_profile_title">"Informacje kontaktowe"</string>
-    <string name="presence_available">"Dostępny"</string>
-    <string name="add_contact_title">"Dodaj kontakt"</string>
-    <string name="input_contact_label">"Widoczna nazwa dodawanej osoby:"</string>
-    <string name="invite_label">"Dodaj znajomego"</string>
-  <string-array name="smiley_names">
-    <item>"Zadowolenie"</item>
-    <item>"Smutek"</item>
-    <item>"Mrugnięcie"</item>
-    <item>"Wystający język"</item>
-    <item>"Zdziwienie"</item>
-    <item>"Całus"</item>
-    <item>"Krzyk"</item>
-    <item>"Super"</item>
-    <item>"Pazerność"</item>
-    <item>"Gafa"</item>
-    <item>"Zakłopotanie"</item>
-    <item>"Anioł"</item>
-    <item>"Niezdecydowanie"</item>
-    <item>"Płacz"</item>
-    <item>"Milczę jak grób"</item>
-    <item>"Śmiech"</item>
-    <item>"Zakłopotanie"</item>
-  </string-array>
-  <string-array name="smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/samples/PluginDemo/res/values-ru/strings.xml b/samples/PluginDemo/res/values-ru/strings.xml
deleted file mode 100644 (file)
index b2eccb6..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">"Добавить контакт"</string>
-    <string name="menu_remove_contact">"Удалить контакт"</string>
-    <string name="menu_block_contact">"Заблокировать"</string>
-    <string name="menu_contact_list">"Список контактов"</string>
-    <string name="menu_start_chat">"Отправить сообщение"</string>
-    <string name="menu_view_profile">"Сведения о друге"</string>
-    <string name="menu_end_conversation">"Завершить разговор"</string>
-    <string name="menu_switch_chats">"Переключить чат"</string>
-    <string name="menu_insert_smiley">"Вставить значки настроения"</string>
-    <string name="sign_up">"Получить новый аккаунт"</string>
-    <string name="check_save_password">"В целях безопасности при утере или краже телефона откройте веб-сайт с компьютера и измените пароль."</string>
-    <string name="buddy_list_title">"Список контактов – <xliff:g id="USERNAME">%1$s</xliff:g>"</string>
-    <string name="label_username">"Имя пользователя:"</string>
-    <string name="ongoing_conversation">"Разговоры (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="contact_profile_title">"Сведения о контакте"</string>
-    <string name="presence_available">"Доступен"</string>
-    <string name="add_contact_title">"Добавить контакт"</string>
-    <string name="input_contact_label">"Экранное имя добавляемого:"</string>
-    <string name="invite_label">"Добавить друга"</string>
-  <string-array name="smiley_names">
-    <item>"Счастье"</item>
-    <item>"Грустно"</item>
-    <item>"Подмигиваю"</item>
-    <item>"Высунутый язык"</item>
-    <item>"Удивление"</item>
-    <item>"Целую"</item>
-    <item>"Кричу"</item>
-    <item>"Круто"</item>
-    <item>"Знаю, что говорю"</item>
-    <item>"Молчок"</item>
-    <item>"В смущении"</item>
-    <item>"Ангел"</item>
-    <item>"В нерешительности"</item>
-    <item>"Плачу"</item>
-    <item>"Никому не скажу"</item>
-    <item>"Смешно"</item>
-    <item>"В замешательстве"</item>
-  </string-array>
-  <string-array name="smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/samples/PluginDemo/res/values-zh-rCN/strings.xml b/samples/PluginDemo/res/values-zh-rCN/strings.xml
deleted file mode 100644 (file)
index 89976ae..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">"添加联系人"</string>
-    <string name="menu_remove_contact">"删除联系人"</string>
-    <string name="menu_block_contact">"阻止"</string>
-    <string name="menu_contact_list">"“联系人”列表"</string>
-    <string name="menu_start_chat">"发送即时消息"</string>
-    <string name="menu_view_profile">"好友信息"</string>
-    <string name="menu_end_conversation">"结束交谈"</string>
-    <string name="menu_switch_chats">"切换聊天"</string>
-    <string name="menu_insert_smiley">"插入表情符号"</string>
-    <string name="sign_up">"获取新帐户"</string>
-    <string name="check_save_password">"出于安全起见,如果您的手机丢失或被盗,请通过计算机访问网站并更改您的密码。"</string>
-    <string name="buddy_list_title">"“联系人”列表 - <xliff:g id="USERNAME">%1$s</xliff:g>"</string>
-    <string name="label_username">"用户名:"</string>
-    <string name="ongoing_conversation">"交谈 (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="contact_profile_title">"联系人信息"</string>
-    <string name="presence_available">"可用"</string>
-    <string name="add_contact_title">"添加联系人"</string>
-    <string name="input_contact_label">"您要添加的人的屏幕名称:"</string>
-    <string name="invite_label">"添加好友"</string>
-  <string-array name="smiley_names">
-    <item>"开心"</item>
-    <item>"忧伤"</item>
-    <item>"眨眼"</item>
-    <item>"吐舌"</item>
-    <item>"吃惊"</item>
-    <item>"亲吻"</item>
-    <item>"叫喊"</item>
-    <item>"酷"</item>
-    <item>"财迷"</item>
-    <item>"不知所云"</item>
-    <item>"尴尬"</item>
-    <item>"天使"</item>
-    <item>"犹豫不定"</item>
-    <item>"哭泣"</item>
-    <item>"闭嘴"</item>
-    <item>"大笑"</item>
-    <item>"困惑"</item>
-  </string-array>
-  <string-array name="smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/samples/PluginDemo/res/values-zh-rTW/strings.xml b/samples/PluginDemo/res/values-zh-rTW/strings.xml
deleted file mode 100644 (file)
index c15ed6b..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">"新增連絡人"</string>
-    <string name="menu_remove_contact">"刪除連絡人"</string>
-    <string name="menu_block_contact">"封鎖"</string>
-    <string name="menu_contact_list">"連絡人清單"</string>
-    <string name="menu_start_chat">"傳送即時訊息"</string>
-    <string name="menu_view_profile">"好友資訊"</string>
-    <string name="menu_end_conversation">"結束對談"</string>
-    <string name="menu_switch_chats">"切換交談"</string>
-    <string name="menu_insert_smiley">"插入表情符號"</string>
-    <string name="sign_up">"取得新帳戶"</string>
-    <string name="check_save_password">"為了安全起見,如果電話遺失或遭竊,請使用電腦前往該網站並變更密碼。"</string>
-    <string name="buddy_list_title">"連絡人清單 - <xliff:g id="USERNAME">%1$s</xliff:g>"</string>
-    <string name="label_username">"使用者名稱:"</string>
-    <string name="ongoing_conversation">"對談 (<xliff:g id="NUMBER">%1$d</xliff:g>)"</string>
-    <string name="contact_profile_title">"連絡人資訊"</string>
-    <string name="presence_available">"可用"</string>
-    <string name="add_contact_title">"新增連絡人"</string>
-    <string name="input_contact_label">"要新增之連絡人在畫面上的名稱:"</string>
-    <string name="invite_label">"新增好友"</string>
-  <string-array name="smiley_names">
-    <item>"開心"</item>
-    <item>"傷心"</item>
-    <item>"眨眼"</item>
-    <item>"吐舌頭"</item>
-    <item>"驚訝"</item>
-    <item>"紅唇"</item>
-    <item>"大喊"</item>
-    <item>"酷"</item>
-    <item>"滿嘴錢"</item>
-    <item>"說錯話"</item>
-    <item>"害羞"</item>
-    <item>"天使"</item>
-    <item>"還沒決定"</item>
-    <item>"嚎啕大哭"</item>
-    <item>"不要告訴別人"</item>
-    <item>"開懷大笑"</item>
-    <item>"疑惑"</item>
-  </string-array>
-  <string-array name="smiley_texts">
-    <item>":-)"</item>
-    <item>":-("</item>
-    <item>";-)"</item>
-    <item>":-P"</item>
-    <item>"=-O"</item>
-    <item>":-*"</item>
-    <item>":O"</item>
-    <item>"B-)"</item>
-    <item>":-$"</item>
-    <item>":-!"</item>
-    <item>":-["</item>
-    <item>"O:-)"</item>
-    <item>":-\\"</item>
-    <item>":\'("</item>
-    <item>":-X"</item>
-    <item>":-D"</item>
-    <item>"o_O"</item>
-  </string-array>
-</resources>
diff --git a/samples/PluginDemo/res/values/strings.xml b/samples/PluginDemo/res/values/strings.xml
deleted file mode 100644 (file)
index 7afa4ab..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 Esmertec Inc.
- * Copyright (C) 2008 The Android Open Source Project
-
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_add_contact">Add Contact</string>
-    <string name="menu_remove_contact">Delete Contact</string>
-    <string name="menu_block_contact">Block</string>
-    <string name="menu_contact_list">Contact List</string>
-    <string name="menu_start_chat">Send IM</string>
-    <string name="menu_view_profile">Buddy Info</string>
-    <string name="menu_end_conversation">End Conversation</string>
-    <string name="menu_switch_chats">Switch Chats</string>
-    <string name="menu_insert_smiley">Insert Emoticons</string>
-    <string name="sign_up">Get a new account</string>
-    <string name="check_save_password">For your security, if your phone is lost or stolen, go to the Web site on your computer and change your password.</string>
-    <string name="buddy_list_title">Contact List - <xliff:g id="username">%1$s</xliff:g></string>
-    <string name="label_username">Username:</string>
-    <string name="ongoing_conversation">Conversations (<xliff:g id="number">%1$d</xliff:g>)</string>
-    <string name="contact_profile_title">Contact Info</string>
-    <string name="presence_available">Available</string>
-    <string name="add_contact_title">Add Contact</string>
-    <string name="input_contact_label">Screen name of person you wish to add:</string>
-    <string name="invite_label">Add Buddy</string>
-
-    <string-array name="smiley_names">
-        <item>Happy</item>
-        <item>Sad</item>
-        <item>Winking</item>
-        <item>Tongue sticking out</item>
-        <item>Surprised</item>
-        <item>Kissing</item>
-        <item>Yelling</item>
-        <item>Cool</item>
-        <item>Money mouth</item>
-        <item>Foot in mouth</item>
-        <item>Embarrassed</item>
-        <item>Angel</item>
-        <item>Undecided</item>
-        <item>Crying</item>
-        <item>Lips are sealed</item>
-        <item>Laughing</item>
-        <item>Confused</item>
-    </string-array>
-
-    <string-array name="smiley_texts">
-        <item>:-)</item>
-        <item>:-(</item>
-        <item>;-)</item>
-        <item>:-P</item>
-        <item>=-O</item>
-        <item>:-*</item>
-        <item>:O</item>
-        <item>B-)</item>
-        <item>:-$</item>
-        <item>:-!</item>
-        <item>:-[</item>
-        <item>O:-)</item>
-        <item>:-\\</item>
-        <item>:\'(</item>
-        <item>:-X</item>
-        <item>:-D</item>
-        <item>o_O</item>
-    </string-array>
-</resources>
diff --git a/samples/PluginDemo/src/com/android/im/plugin/demo/DemoImPlugin.java b/samples/PluginDemo/src/com/android/im/plugin/demo/DemoImPlugin.java
deleted file mode 100644 (file)
index 9975d38..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.plugin.demo;
-
-import com.android.im.plugin.BrandingResourceIDs;
-import com.android.im.plugin.IImPlugin;
-import com.android.im.plugin.ImConfigNames;
-import com.android.im.plugin.ImpsConfigNames;
-
-import android.app.Service;
-import android.content.Intent;
-import android.os.IBinder;
-import android.os.RemoteException;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Simple example of writing a plug-in for the IM application.
- *
- */
-public class DemoImPlugin extends Service {
-
-    @Override
-    public IBinder onBind(Intent intent) {
-        return mBinder;
-    }
-
-    /**
-     * The implementation of IImPlugin defined through AIDL.
-     */
-    private IBinder mBinder = new IImPlugin.Stub() {
-        public Map getProviderConfig() {
-            HashMap<String, String> config = new HashMap<String, String>();
-            // The protocol name MUST be IMPS now.
-            config.put(ImConfigNames.PROTOCOL_NAME, "IMPS");
-            config.put(ImpsConfigNames.HOST, "http://xxx.xxxx.xxx");
-            config.put(ImpsConfigNames.CLIENT_ID, "Jimmy");
-            config.put(ImpsConfigNames.DATA_CHANNEL, "HTTP");
-            config.put(ImpsConfigNames.DATA_ENCODING, "WBXML");
-            config.put(ImpsConfigNames.CIR_CHANNEL, "STCP");
-            config.put(ImpsConfigNames.CUSTOM_PRESENCE_MAPPING,
-                    "com.android.im.plugin.demo.DemoPresenceMapping");
-            return config;
-        }
-
-        public Map getResourceMap() throws RemoteException {
-            HashMap<Integer, Integer> resMapping = new HashMap<Integer, Integer>();
-            resMapping.put(BrandingResourceIDs.DRAWABLE_LOGO, R.drawable.im_logo);
-            resMapping.put(BrandingResourceIDs.DRAWABLE_PRESENCE_ONLINE,
-                    android.R.drawable.presence_online);
-            resMapping.put(BrandingResourceIDs.DRAWABLE_PRESENCE_AWAY,
-                    android.R.drawable.presence_away);
-            resMapping.put(BrandingResourceIDs.DRAWABLE_PRESENCE_BUSY,
-                    android.R.drawable.presence_busy);
-            resMapping.put(BrandingResourceIDs.DRAWABLE_PRESENCE_INVISIBLE,
-                    android.R.drawable.presence_invisible);
-            resMapping.put(BrandingResourceIDs.DRAWABLE_PRESENCE_OFFLINE,
-                    android.R.drawable.presence_offline);
-            resMapping.put(BrandingResourceIDs.DRAWABLE_SPLASH_SCREEN,
-                    R.drawable.im_logo_splashscr);
-            resMapping.put(BrandingResourceIDs.DRAWABLE_READ_CHAT,
-                    R.drawable.chat);
-            resMapping.put(BrandingResourceIDs.DRAWABLE_UNREAD_CHAT,
-                    R.drawable.chat_new);
-
-            resMapping.put(BrandingResourceIDs.STRING_BUDDY_LIST_TITLE,
-                    R.string.buddy_list_title);
-            resMapping.put(BrandingResourceIDs.STRING_ARRAY_SMILEY_NAMES,
-                    R.array.smiley_names);
-            resMapping.put(BrandingResourceIDs.STRING_ARRAY_SMILEY_TEXTS,
-                    R.array.smiley_texts);
-            resMapping.put(BrandingResourceIDs.STRING_PRESENCE_AVAILABLE,
-                    R.string.presence_available);
-
-            resMapping.put(BrandingResourceIDs.STRING_LABEL_USERNAME,
-                    R.string.label_username);
-            resMapping.put(BrandingResourceIDs.STRING_ONGOING_CONVERSATION,
-                    R.string.ongoing_conversation);
-            resMapping.put(BrandingResourceIDs.STRING_ADD_CONTACT_TITLE,
-                    R.string.add_contact_title);
-            resMapping.put(BrandingResourceIDs.STRING_LABEL_INPUT_CONTACT,
-                    R.string.input_contact_label);
-            resMapping.put(BrandingResourceIDs.STRING_BUTTON_ADD_CONTACT,
-                    R.string.invite_label);
-            resMapping.put(BrandingResourceIDs.STRING_CONTACT_INFO_TITLE,
-                    R.string.contact_profile_title);
-
-            resMapping.put(BrandingResourceIDs.STRING_MENU_ADD_CONTACT,
-                    R.string.menu_add_contact);
-            resMapping.put(BrandingResourceIDs.STRING_MENU_BLOCK_CONTACT,
-                    R.string.menu_block_contact);
-            resMapping.put(BrandingResourceIDs.STRING_MENU_CONTACT_LIST,
-                    R.string.menu_contact_list);
-            resMapping.put(BrandingResourceIDs.STRING_MENU_DELETE_CONTACT,
-                    R.string.menu_remove_contact);
-            resMapping.put(BrandingResourceIDs.STRING_MENU_END_CHAT,
-                    R.string.menu_end_conversation);
-            resMapping.put(BrandingResourceIDs.STRING_MENU_INSERT_SMILEY,
-                    R.string.menu_insert_smiley);
-            resMapping.put(BrandingResourceIDs.STRING_MENU_START_CHAT,
-                    R.string.menu_start_chat);
-            resMapping.put(BrandingResourceIDs.STRING_MENU_VIEW_PROFILE,
-                    R.string.menu_view_profile);
-            resMapping.put(BrandingResourceIDs.STRING_MENU_SWITCH_CHATS,
-                    R.string.menu_switch_chats);
-
-            resMapping.put(BrandingResourceIDs.STRING_TOAST_CHECK_SAVE_PASSWORD,
-                    R.string.check_save_password);
-            resMapping.put(BrandingResourceIDs.STRING_LABEL_SIGN_UP,
-                    R.string.sign_up);
-            return resMapping;
-        }
-
-        public int[] getSmileyIconIds() throws RemoteException {
-            return SMILEY_RES_IDS;
-        }
-    };
-
-    /**
-     * An array of the smiley icon IDs. Note that the sequence of the array MUST
-     * match the smiley texts and smiley names defined in strings.xml.
-     */
-    static final int[] SMILEY_RES_IDS = {
-        android.R.drawable.emo_im_happy,
-        android.R.drawable.emo_im_sad,
-        android.R.drawable.emo_im_winking,
-        android.R.drawable.emo_im_tongue_sticking_out,
-        android.R.drawable.emo_im_surprised,
-        android.R.drawable.emo_im_kissing,
-        android.R.drawable.emo_im_yelling,
-        android.R.drawable.emo_im_cool,
-        android.R.drawable.emo_im_money_mouth,
-        android.R.drawable.emo_im_foot_in_mouth,
-        android.R.drawable.emo_im_embarrassed,
-        android.R.drawable.emo_im_angel,
-        android.R.drawable.emo_im_undecided,
-        android.R.drawable.emo_im_crying,
-        android.R.drawable.emo_im_lips_are_sealed,
-        android.R.drawable.emo_im_laughing,
-        android.R.drawable.emo_im_wtf
-    };
-
-}
diff --git a/samples/PluginDemo/src/com/android/im/plugin/demo/DemoPresenceMapping.java b/samples/PluginDemo/src/com/android/im/plugin/demo/DemoPresenceMapping.java
deleted file mode 100644 (file)
index e8acb88..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.plugin.demo;
-
-import com.android.im.plugin.ImPluginConstants;
-import com.android.im.plugin.IPresenceMapping;
-
-import java.util.Map;
-
-/**
- * A simple implementation of PresenceMaping for the provider.
- *
- */
-public class DemoPresenceMapping extends IPresenceMapping.Stub {
-
-    public int[] getSupportedPresenceStatus() {
-        return new int[] {
-                ImPluginConstants.PRESENCE_AVAILABLE,
-                ImPluginConstants.PRESENCE_DO_NOT_DISTURB,
-                ImPluginConstants.PRESENCE_OFFLINE
-        };
-    }
-
-    public boolean getOnlineStatus(int status) {
-        return status != ImPluginConstants.PRESENCE_OFFLINE;
-    }
-
-    public String getUserAvaibility(int status) {
-        switch (status) {
-            case ImPluginConstants.PRESENCE_AVAILABLE:
-                return ImPluginConstants.PA_AVAILABLE;
-
-            case ImPluginConstants.PRESENCE_DO_NOT_DISTURB:
-                return ImPluginConstants.PA_DISCREET;
-
-            case ImPluginConstants.PRESENCE_OFFLINE:
-                return ImPluginConstants.PA_NOT_AVAILABLE;
-
-            default:
-                return null;
-        }
-    }
-
-    public Map<String, Object> getExtra(int status) {
-        // We don't have extra values except OnlineStatus and UserAvaibility
-        // need to be sent to the server. If we do need other values to the server,
-        // return a map the values structured the same as they are defined in the spec.
-        //
-        // e.g.
-        // Map<String, Object> extra = new HashMap<String, Object>();
-        //
-        // HashMap<String, Object> commCap = new HashMap<String, Object>();
-        //
-        // HashMap<String, Object> commC = new HashMap<String, Object>();
-        // commC.put("Qualifier", "T");
-        // commC.put("Cap", "IM");
-        // commC.put("Status", "Open");
-        //
-        // commCap.put("Qualifier", "T");
-        // commCap.put("CommC", commC);
-        //
-        // extra.put("CommCap", commCap);
-        // return extra;
-        return null;
-    }
-
-    public boolean requireAllPresenceValues() {
-        // Return false since we don't need all values received from the server
-        // when map it to the predefined presence status.
-        return false;
-    }
-
-    public int getPresenceStatus(boolean onlineStatus, String userAvailability,
-            Map allValues) {
-        if (!onlineStatus) {
-            return ImPluginConstants.PRESENCE_OFFLINE;
-        }
-        if (ImPluginConstants.PA_NOT_AVAILABLE.equals(userAvailability)) {
-            return ImPluginConstants.PRESENCE_AWAY;
-        } else if (ImPluginConstants.PA_DISCREET.equals(userAvailability)) {
-            return ImPluginConstants.PRESENCE_DO_NOT_DISTURB;
-        } else {
-            return ImPluginConstants.PRESENCE_AVAILABLE;
-        }
-    }
-
-}
diff --git a/src/com/android/im/IChatListener.aidl b/src/com/android/im/IChatListener.aidl
deleted file mode 100644 (file)
index b041a15..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im;
-
-import com.android.im.IChatSession;
-import com.android.im.engine.Contact;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.Message;
-
-oneway interface IChatListener {
-    /**
-     * This method is called when a new message of the ChatSession has arrived.
-     */
-    void onIncomingMessage(IChatSession ses, in Message msg);
-
-    /**
-     * This method is called when an error is found to send a message in the ChatSession.
-     */
-    void onSendMessageError(IChatSession ses, in Message msg, in ImErrorInfo error);
-
-    /**
-     * This method is called when the chat is converted to a group chat.
-     */
-    void onConvertedToGroupChat(IChatSession ses);
-
-    /**
-     * This method is called when a new contact has joined into this ChatSession.
-     */
-    void onContactJoined(IChatSession ses, in Contact contact);
-
-    /**
-     * This method is called when a contact in this ChatSession has left.
-     */
-    void onContactLeft(IChatSession ses, in Contact contact);
-
-    /**
-     * This method is called when an error is found to invite a contact to join
-     * this ChatSession.
-     */
-    void onInviteError(IChatSession ses, in ImErrorInfo error);
-}
diff --git a/src/com/android/im/IChatSession.aidl b/src/com/android/im/IChatSession.aidl
deleted file mode 100644 (file)
index 637a787..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im;
-
-import com.android.im.IChatListener;
-import com.android.im.engine.Message;
-
-interface IChatSession {
-    /**
-     * Registers a ChatListener with this ChatSession to listen to incoming
-     * message and participant change events.
-     */
-    void registerChatListener(IChatListener listener);
-
-    /**
-     * Unregisters the ChatListener so that it won't be notified again.
-     */
-    void unregisterChatListener(IChatListener listener);
-
-    /**
-     * Tells if this ChatSession is a group session.
-     */
-    boolean isGroupChatSession();
-
-    /**
-     * Gets the name of ChatSession.
-     */
-    String getName();
-
-    /**
-     * Gets the id of the ChatSession in content provider.
-     */
-    long getId();
-
-    /**
-     * Gets the participants of this ChatSession.
-     */
-    String[] getPariticipants();
-
-    /**
-     * Convert a single chat to a group chat. If the chat session is already a
-     * group chat or it's converting to group chat.
-     */
-    void convertToGroupChat();
-
-    /**
-     * Invites a contact to join this ChatSession. The user can only invite
-     * contacts to join this ChatSession if it's a group session. Nothing will
-     * happen if this is a simple one-to-one ChatSession.
-     */
-    void inviteContact(String contact);
-
-    /**
-     * Leaves this ChatSession.
-     */
-    void leave();
-
-    /**
-     * Leaves this ChatSession if there isn't any message sent or received in it.
-     */
-    void leaveIfInactive();
-
-    /**
-     * Sends a message to all participants in this ChatSession.
-     */
-    void sendMessage(String text);
-
-    /**
-     * Mark this chat session as read.
-     */
-    void markAsRead();
-}
diff --git a/src/com/android/im/IChatSessionListener.aidl b/src/com/android/im/IChatSessionListener.aidl
deleted file mode 100644 (file)
index b12fd38..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im;
-
-import com.android.im.IChatSession;
-import com.android.im.engine.ImErrorInfo;
-
-oneway interface IChatSessionListener {
-    /**
-     * This method is called when a new ChatSession is created. A ChatSession
-     * will be created either when the user called explicitly or an incoming
-     * message which doesn't belong to any active sessions arrived.
-     */
-    void onChatSessionCreated(IChatSession session);
-
-    /**
-     * This method is called when it failed to create a new ChatSession.
-     *
-     * @param name the name of the ChatSession failed to create. It's either the
-     *      name of the contact or the group.
-     * @param error detail error,
-     */
-    void onChatSessionCreateError(String name, in ImErrorInfo error);
-}
diff --git a/src/com/android/im/IChatSessionManager.aidl b/src/com/android/im/IChatSessionManager.aidl
deleted file mode 100644 (file)
index 06f463d..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im;
-
-import com.android.im.IChatSession;
-import com.android.im.IChatSessionListener;
-
-interface IChatSessionManager {
-    void registerChatSessionListener(IChatSessionListener listener);
-    void unregisterChatSessionListener(IChatSessionListener listener);
-
-    /**
-     * Create a ChatSession with the specified contact. If the contact does not exist in any
-     * of the user's contact lists, it will be added to the temporary list.
-     *
-     * @param contactAddress the address of the contact.
-     */
-    IChatSession createChatSession(String contactAddress);
-
-    /**
-     * Get the ChatSession that is associated with the specified contact or group.
-     *
-     * @param the address of the contact or group.
-     * @return the ChatSession with the contact or group or <code>null</code> if
-     *       there isn't any active ChatSession with the contact or group.
-     */
-    IChatSession getChatSession(String address);
-
-    /**
-     * Get a list of all active ChatSessions.
-     *
-     * @return a list of IBinders of all active ChatSessions.
-     */
-    List getActiveChatSessions();
-}
diff --git a/src/com/android/im/IConnectionCreationListener.aidl b/src/com/android/im/IConnectionCreationListener.aidl
deleted file mode 100644 (file)
index 264941c..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im;
-
-import com.android.im.IImConnection;
-
-oneway interface IConnectionCreationListener {
-    /**
-     * Called when a connection is created in the service.
-     */
-    void onConnectionCreated(in IImConnection connection);
-}
diff --git a/src/com/android/im/IConnectionListener.aidl b/src/com/android/im/IConnectionListener.aidl
deleted file mode 100644 (file)
index ec9ae34..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im;
-
-import com.android.im.IImConnection;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.Presence;
-
-oneway interface IConnectionListener {
-    void onStateChanged(in IImConnection connection, int state,
-            in ImErrorInfo error);
-
-    void onUserPresenceUpdated(in IImConnection connection);
-
-    void onUpdatePresenceError(in IImConnection connection,
-            in ImErrorInfo error);
-}
diff --git a/src/com/android/im/IContactList.aidl b/src/com/android/im/IContactList.aidl
deleted file mode 100644 (file)
index 3eb61bd..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im;
-
-import com.android.im.engine.Contact;
-
-interface IContactList {
-    /**
-     * Gets the name of the list.
-     */
-    String getName();
-
-    /**
-     * Sets the name of the list.
-     */
-    void setName(String name);
-
-    /**
-     * Adds a new contact to the list.
-     */
-    int addContact(String address);
-
-    /**
-     * Removes a contact in the list.
-     */
-    int removeContact(String address);
-
-    /**
-     * Sets the list to the default list.
-     */
-    void setDefault(boolean isDefault);
-
-    /**
-     * Tells if the list is the default list.
-     */
-    boolean isDefault();
-}
diff --git a/src/com/android/im/IContactListListener.aidl b/src/com/android/im/IContactListListener.aidl
deleted file mode 100644 (file)
index c93228b..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im;
-
-import com.android.im.IContactList;
-import com.android.im.engine.Contact;
-import com.android.im.engine.ImErrorInfo;
-
-oneway interface IContactListListener {
-    /**
-     * Called when:
-     *  <ul>
-     *  <li> a contact list has been created, deleted, renamed or loaded, or
-     *  <li> a contact has been added to or removed from a list, or
-     *  <li> a contact has been blocked or unblocked
-     *  </ul>
-     *
-     * @see com.android.im.engine.ContactListListener#onContactChange(int, ContactList, Contact)
-     */
-    void onContactChange(int type, IContactList list, in Contact contact);
-
-    /**
-     * Called when all the contact lists have been loaded from server.
-     *
-     * @see com.android.im.engine.ContactListListener#onAllContactListsLoaded()
-     */
-    void onAllContactListsLoaded();
-
-    /**
-     * Called when one or more contacts' presence information has updated.
-     *
-     * @see com.android.im.engine.ContactListListener#onContactsPresenceUpdate(Contact[])
-     */
-    void onContactsPresenceUpdate(in Contact[] contacts);
-
-    /**
-     * Called when a previous contact related request has failed.
-     *
-     * @see com.android.im.engine.ContactListListener#onContactError(int, ImErrorInfo, String, Contact)
-     */
-    void onContactError(int errorType, in ImErrorInfo error, String listName, in Contact contact);
-}
diff --git a/src/com/android/im/IContactListManager.aidl b/src/com/android/im/IContactListManager.aidl
deleted file mode 100644 (file)
index 725fb5a..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im;
-
-import com.android.im.IContactList;
-import com.android.im.IContactListListener;
-import com.android.im.ISubscriptionListener;
-import com.android.im.engine.Contact;
-
-interface IContactListManager {
-    void registerContactListListener(IContactListListener listener);
-    void unregisterContactListListener(IContactListListener listener);
-
-    void registerSubscriptionListener(ISubscriptionListener listener);
-    void unregisterSubscriptionListener(ISubscriptionListener listener);
-
-    /**
-     * Gets all the contact lists of this account.
-     */
-    List getContactLists();
-
-    /**
-     * Gets a contact list with specific name, return null if no contact list is found.
-     */
-    IContactList getContactList(String name);
-
-    /**
-     * Creates a contact list with given name and a list of initial contacts.
-     *
-     * @param name the name of the list to create.
-     * @param contacts a list of contacts will be added to the new contact list, can be null.
-     */
-    int createContactList(String name, in List<Contact> contacts);
-
-    /**
-     * Deletes a contact list with given name.
-     *
-     * @param name the name of the list to delete.
-     */
-    int deleteContactList(String name);
-
-    /**
-     * Removes a contact from all contact lists. Note the temporary contacts
-     * can only be removed by this method.
-     *
-     * @param address the address of the contact to be removed.
-     */
-    int removeContact(String address);
-
-    /**
-     * Approves a subscription request from another user.
-     */
-    void approveSubscription(String address);
-
-    /**
-     * Declines a subscription request from another user.
-     */
-    void declineSubscription(String address);
-
-    /**
-     * Blocks a contact. The ContactListListener will be notified when the contact is blocked
-     * successfully or any error occurs.
-     *
-     * @param address the address of the contact to block.
-     * @return ILLEGAL_CONTACT_LIST_MANAGER_STATE if contact lists is not loaded.
-     */
-    int blockContact(String address);
-
-    /**
-     * Unblocks a contact.The ContactListListener will be notified when the contact is blocked
-     * successfully or any error occurs.
-     *
-     * @param address the address of the contact to unblock.
-     * @return ILLEGAL_CONTACT_LIST_MANAGER_STATE if contact lists is not loaded.
-     */
-    int unBlockContact(String address);
-
-    /**
-     * Tells if a certain contact is blocked.
-     *
-     * @param address the address of the contact.
-     * @return true if it's blocked; false otherwise.
-     */
-    boolean isBlocked(String address);
-
-    /**
-     * Explicitly load contact lists from the server. The user only needs to call this method if
-     * autoLoadContacts is false when login; otherwise, contact lists will be downloaded from the
-     * server automatically after login.
-     */
-    void loadContactLists();
-
-    /**
-     * Gets the state of the manager.
-     *
-     * @return the state of the manager.
-     */
-    int getState();
-}
diff --git a/src/com/android/im/IImConnection.aidl b/src/com/android/im/IImConnection.aidl
deleted file mode 100644 (file)
index 65ee794..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im;
-
-import com.android.im.IConnectionListener;
-import com.android.im.IChatSessionManager;
-import com.android.im.IContactListManager;
-import com.android.im.IInvitationListener;
-import com.android.im.engine.Presence;
-
-interface IImConnection {
-    void registerConnectionListener(IConnectionListener listener);
-    void unregisterConnectionListener(IConnectionListener listener);
-
-    void setInvitationListener(IInvitationListener listener);
-
-    IContactListManager getContactListManager();
-    IChatSessionManager getChatSessionManager();
-
-    /**
-     * Login the IM server.
-     *
-     * @param accountId the id of the account in content provider.
-     * @param userName the useName.
-     * @param password the password.
-     * @param autoLoadContacts if true, contacts will be loaded from the server
-     *          automatically after the user successfully login; otherwise, the
-     *          client must load contacts manually.
-     */
-    void login(long accountId, String userName, String password, boolean autoLoadContacts);
-    void logout();
-    void cancelLogin();
-
-    Presence getUserPresence();
-    int updateUserPresence(in Presence newPresence);
-
-    /**
-     * Gets an array of presence status which are supported by the IM provider.
-     */
-    int[] getSupportedPresenceStatus();
-
-    int getState();
-
-    /**
-     * Gets the count of active ChatSessions of this connection.
-     */
-    int getChatSessionCount();
-
-    long getProviderId();
-    long getAccountId();
-
-    void acceptInvitation(long id);
-    void rejectInvitation(long id);
-}
diff --git a/src/com/android/im/IInvitationListener.aidl b/src/com/android/im/IInvitationListener.aidl
deleted file mode 100644 (file)
index 221ee7a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im;
-
-oneway interface IInvitationListener {
-    /**
-     * Called when a new invitation received.
-     *
-     * @param id the id of the invitation in content provider.
-     */
-    void onGroupInvitation(long id);
-}
diff --git a/src/com/android/im/IRemoteImService.aidl b/src/com/android/im/IRemoteImService.aidl
deleted file mode 100644 (file)
index 9612c92..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im;
-
-import com.android.im.IImConnection;
-import com.android.im.IConnectionCreationListener;
-
-interface IRemoteImService {
-
-    /**
-     * Gets a list of all installed plug-ins. Each item is an ImPluginInfo.
-     */
-    List getAllPlugins();
-
-    /**
-     * Register a listener on the service so that the client can be notified when
-     * there is a connection be created.
-     */
-    void addConnectionCreatedListener(IConnectionCreationListener listener);
-
-    /**
-     * Unregister the listener on the service so that the client doesn't ware of
-     * the connection creation anymore.
-     */
-    void removeConnectionCreatedListener(IConnectionCreationListener listener);
-
-    /**
-     * Create a connection for the given provider.
-     */
-    IImConnection createConnection(long providerId);
-
-    /**
-     * Get all the active connections.
-     */
-    List getActiveConnections();
-
-    /**
-     * Dismiss all notifications for an IM provider.
-     */
-    void dismissNotifications(long providerId);
-
-    /**
-     * Dismiss notification for the specified chat.
-     */
-    void dismissChatNotification(long providerId, String username);
-}
diff --git a/src/com/android/im/ISubscriptionListener.aidl b/src/com/android/im/ISubscriptionListener.aidl
deleted file mode 100644 (file)
index 67efb64..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im;
-
-import com.android.im.engine.Contact;
-
-oneway interface ISubscriptionListener {
-    /**
-     * Called when:
-     *  <ul>
-     *  <li> the request a contact has sent to client
-     *  </ul>
-     *
-     * @see com.android.im.engine.SubscriptionRequestListener#onSubScriptionRequest(Contact from)
-     */
-    void onSubScriptionRequest(in Contact from);
-
-    /**
-     * Called when the request is approved by user.
-     *
-     * @see com.android.im.engine.SubscriptionRequestListener#onSubscriptionApproved(String contact)
-     */
-    void onSubscriptionApproved(String contact);
-
-    /**
-     * Called when a subscription request is declined.
-     *
-     * @see com.android.im.engine.ContactListListener#onSubscriptionDeclined(String contact)
-     */
-    void onSubscriptionDeclined(String contact);
-}
diff --git a/src/com/android/im/app/AccountActivity.java b/src/com/android/im/app/AccountActivity.java
deleted file mode 100644 (file)
index fcd1ba3..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import com.android.im.R;
-import com.android.im.plugin.BrandingResourceIDs;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.database.Cursor;
-import android.graphics.drawable.Drawable;
-import android.net.Uri;
-import android.os.Bundle;
-import android.provider.Im;
-import android.text.Editable;
-import android.text.SpannableStringBuilder;
-import android.text.Spanned;
-import android.text.SpannableString;
-import android.text.TextUtils;
-import android.text.TextWatcher;
-import android.text.method.LinkMovementMethod;
-import android.text.style.URLSpan;
-import android.text.util.Linkify;
-import android.util.Log;
-import android.view.View;
-import android.view.Window;
-import android.view.View.OnClickListener;
-import android.widget.Button;
-import android.widget.CheckBox;
-import android.widget.CompoundButton;
-import android.widget.EditText;
-import android.widget.TextView;
-import android.widget.Toast;
-import android.widget.CompoundButton.OnCheckedChangeListener;
-
-public class AccountActivity extends Activity {
-    private static final String ACCOUNT_URI_KEY = "accountUri";
-
-    static final int REQUEST_SIGN_IN = RESULT_FIRST_USER + 1;
-
-    private static final String[] ACCOUNT_PROJECTION = {
-        Im.Account._ID,
-        Im.Account.PROVIDER,
-        Im.Account.USERNAME,
-        Im.Account.PASSWORD,
-        Im.Account.KEEP_SIGNED_IN,
-    };
-
-    private static final int ACCOUNT_PROVIDER_COLUMN = 1;
-    private static final int ACCOUNT_USERNAME_COLUMN = 2;
-    private static final int ACCOUNT_PASSWORD_COLUMN = 3;
-    private static final int ACCOUNT_KEEP_SIGNED_IN_COLUMN = 4;
-
-    Uri mAccountUri;
-
-    EditText mEditName;
-    EditText mEditPass;
-    CheckBox mRememberPass;
-    CheckBox mKeepSignIn;
-    Button   mBtnSignIn;
-
-    String mToAddress;
-
-    @Override
-    protected void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-
-        getWindow().requestFeature(Window.FEATURE_LEFT_ICON);
-
-        setContentView(R.layout.account_activity);
-        mEditName = (EditText)findViewById(R.id.edtName);
-        mEditPass = (EditText)findViewById(R.id.edtPass);
-        mRememberPass = (CheckBox)findViewById(R.id.rememberPassword);
-        mKeepSignIn = (CheckBox)findViewById(R.id.keepSignIn);
-        mBtnSignIn = (Button)findViewById(R.id.btnSignIn);
-        mRememberPass.setOnCheckedChangeListener(new OnCheckedChangeListener(){
-            public void onCheckedChanged(CompoundButton buttonView,
-                    boolean isChecked) {
-                updateWidgetState();
-            }
-        });
-
-        ImApp app = ImApp.getApplication(this);
-        Intent i = getIntent();
-        String action = i.getAction();
-        mToAddress = i.getStringExtra(ImApp.EXTRA_INTENT_SEND_TO_USER);
-        final String origUserName;
-        final long providerId;
-        final ProviderDef provider;
-
-        if(Intent.ACTION_INSERT.equals(action)) {
-            origUserName = "";
-            providerId = ContentUris.parseId(i.getData());
-            provider = app.getProvider(providerId);
-            setTitle(getResources().getString(R.string.add_account, provider.mFullName));
-        } else if(Intent.ACTION_EDIT.equals(action)) {
-            ContentResolver cr = getContentResolver();
-            Uri uri = i.getData();
-
-            if ((uri == null) || !Im.Account.CONTENT_ITEM_TYPE.equals(cr.getType(uri))) {
-                Log.w(ImApp.LOG_TAG, "<AccountActivity>Bad data");
-                return;
-            }
-
-            Cursor cursor = cr.query(uri, ACCOUNT_PROJECTION, null, null, null);
-
-            if (cursor == null) {
-                finish();
-                return;
-            }
-
-            if (!cursor.moveToFirst()) {
-                cursor.close();
-                finish();
-                return;
-            }
-
-            setTitle(R.string.sign_in);
-
-            providerId = cursor.getLong(ACCOUNT_PROVIDER_COLUMN);
-            provider = app.getProvider(providerId);
-
-            origUserName = cursor.getString(ACCOUNT_USERNAME_COLUMN);
-            mEditName.setText(origUserName);
-            mEditPass.setText(cursor.getString(ACCOUNT_PASSWORD_COLUMN));
-
-            mRememberPass.setChecked(!cursor.isNull(ACCOUNT_PASSWORD_COLUMN));
-
-            boolean keepSignIn = cursor.getInt(ACCOUNT_KEEP_SIGNED_IN_COLUMN) == 1;
-            mKeepSignIn.setChecked(keepSignIn);
-
-            cursor.close();
-        } else {
-            Log.w(ImApp.LOG_TAG, "<AccountActivity> unknown intent action " + action);
-            finish();
-            return;
-        }
-
-        final BrandingResources brandingRes = app.getBrandingResource(providerId);
-        mKeepSignIn.setOnClickListener(new OnClickListener() {
-            public void onClick(View v) {
-                CheckBox keepSignIn = (CheckBox) v;
-                if ( keepSignIn.isChecked() ) {
-                    String msg = brandingRes.getString(BrandingResourceIDs.STRING_TOAST_CHECK_AUTO_SIGN_IN);
-                    Toast.makeText(AccountActivity.this, msg, Toast.LENGTH_LONG).show();
-                }
-            }
-        });
-        mRememberPass.setOnClickListener(new OnClickListener() {
-            public void onClick(View v) {
-                CheckBox keepSignIn = (CheckBox) v;
-                if ( keepSignIn.isChecked() ) {
-                    String msg = brandingRes.getString(BrandingResourceIDs.STRING_TOAST_CHECK_SAVE_PASSWORD);
-                    Toast.makeText(AccountActivity.this, msg, Toast.LENGTH_LONG).show();
-                }
-            }
-        });
-        Drawable logo = brandingRes.getDrawable(BrandingResourceIDs.DRAWABLE_LOGO);
-        getWindow().setFeatureDrawable(Window.FEATURE_LEFT_ICON, logo);
-
-        TextView labelUsername = (TextView)findViewById(R.id.label_username);
-        labelUsername.setText(brandingRes.getString(BrandingResourceIDs.STRING_LABEL_USERNAME));
-        mEditName.addTextChangedListener(mTextWatcher);
-        mEditPass.addTextChangedListener(mTextWatcher);
-
-        mBtnSignIn.setOnClickListener(new OnClickListener() {
-            public void onClick(View v) {
-                String username = mEditName.getText().toString();
-                final String pass = mEditPass.getText().toString();
-                final boolean rememberPass = mRememberPass.isChecked();
-
-                ContentResolver cr = getContentResolver();
-
-                long accountId = ImApp.insertOrUpdateAccount(cr, providerId, username,
-                        rememberPass ? pass : null);
-                mAccountUri = ContentUris.withAppendedId(Im.Account.CONTENT_URI, accountId);
-
-                if (!origUserName.equals(username) && shouldShowTermOfUse(brandingRes)) {
-                    comfirmTermsOfUse(brandingRes, new DialogInterface.OnClickListener() {
-                        public void onClick(DialogInterface dialog, int which) {
-                            signIn(rememberPass, pass);
-                        }
-                    });
-                } else {
-                    signIn(rememberPass, pass);
-                }
-            }
-
-            void signIn(boolean rememberPass, String pass) {
-                Intent intent = new Intent(AccountActivity.this, SigningInActivity.class);
-                intent.setData(mAccountUri);
-                if (!rememberPass) {
-                    intent.putExtra(ImApp.EXTRA_INTENT_PASSWORD, pass);
-                }
-
-                if (mToAddress != null) {
-                    intent.putExtra(ImApp.EXTRA_INTENT_SEND_TO_USER, mToAddress);
-                }
-
-                startActivityForResult(intent, REQUEST_SIGN_IN);
-            }
-        });
-
-        // Make link for signing up.
-        String text = brandingRes.getString(BrandingResourceIDs.STRING_LABEL_SIGN_UP);
-        SpannableStringBuilder builder = new SpannableStringBuilder(text);
-        builder.setSpan(new URLSpan(provider.mSignUpUrl), 0, builder.length(),
-                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
-        TextView signUp = (TextView)findViewById(R.id.signUp);
-        signUp.setText(builder);
-        signUp.setMovementMethod(LinkMovementMethod.getInstance());
-
-        updateWidgetState();
-    }
-
-    void comfirmTermsOfUse(BrandingResources res, DialogInterface.OnClickListener accept) {
-        SpannableString message = new SpannableString(
-                res.getString(BrandingResourceIDs.STRING_TOU_MESSAGE));
-        Linkify.addLinks(message, Linkify.ALL);
-
-        new AlertDialog.Builder(this)
-            .setIcon(android.R.drawable.ic_dialog_alert)
-            .setTitle(res.getString(BrandingResourceIDs.STRING_TOU_TITLE))
-            .setMessage(message)
-            .setPositiveButton(res.getString(BrandingResourceIDs.STRING_TOU_DECLINE), null)
-            .setNegativeButton(res.getString(BrandingResourceIDs.STRING_TOU_ACCEPT), accept)
-            .show();
-    }
-
-    boolean shouldShowTermOfUse(BrandingResources res) {
-        return !TextUtils.isEmpty(res.getString(BrandingResourceIDs.STRING_TOU_MESSAGE));
-    }
-
-    @Override
-    protected void onRestoreInstanceState(Bundle savedInstanceState) {
-        super.onRestoreInstanceState(savedInstanceState);
-        mAccountUri = savedInstanceState.getParcelable(ACCOUNT_URI_KEY);
-    }
-
-    @Override
-    protected void onSaveInstanceState(Bundle outState) {
-        super.onSaveInstanceState(outState);
-        outState.putParcelable(ACCOUNT_URI_KEY, mAccountUri);
-    }
-
-    @Override
-    protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
-        if (requestCode == REQUEST_SIGN_IN) {
-            if (resultCode == RESULT_OK) {
-                boolean keepSignIn = mKeepSignIn.isChecked();
-                updateKeepSignedIn(keepSignIn);
-                finish();
-            } else {
-                // sign in failed, disable keep sign in, clear the password.
-                mKeepSignIn.setChecked(false);
-                updateKeepSignedIn(false);
-                mEditPass.setText("");
-                ContentValues values = new ContentValues();
-                values.put(Im.Account.PASSWORD, (String) null);
-                getContentResolver().update(mAccountUri, values, null, null);
-            }
-        }
-    }
-
-    void updateKeepSignedIn(boolean keepSignIn) {
-        ContentValues values = new ContentValues();
-        values.put(Im.Account.KEEP_SIGNED_IN, keepSignIn ? 1 : 0);
-        getContentResolver().update(mAccountUri, values, null, null);
-    }
-
-    void updateWidgetState() {
-        boolean goodUsername = mEditName.getText().length() > 0;
-        boolean goodPassword = mEditPass.getText().length() > 0;
-        boolean hasNameAndPassword = goodUsername && goodPassword;
-
-        mEditPass.setEnabled(goodUsername);
-        mEditPass.setFocusable(goodUsername);
-        mEditPass.setFocusableInTouchMode(goodUsername);
-
-        // enable keep sign in only when remember password is checked.
-        boolean rememberPass = mRememberPass.isChecked();
-        if (rememberPass && !hasNameAndPassword) {
-            mRememberPass.setChecked(false);
-            rememberPass = false;
-        }
-        mRememberPass.setEnabled(hasNameAndPassword);
-        mRememberPass.setFocusable(hasNameAndPassword);
-
-        if (!rememberPass) {
-            mKeepSignIn.setChecked(false);
-        }
-        mKeepSignIn.setEnabled(rememberPass);
-        mKeepSignIn.setFocusable(rememberPass);
-
-        mBtnSignIn.setEnabled(hasNameAndPassword);
-        mBtnSignIn.setFocusable(hasNameAndPassword);
-    }
-
-    private final TextWatcher mTextWatcher = new TextWatcher() {
-        public void beforeTextChanged(CharSequence s, int start, int before, int after) {
-        }
-
-        public void onTextChanged(CharSequence s, int start, int before, int after) {
-            updateWidgetState();
-        }
-
-        public void afterTextChanged(Editable s) {
-        }
-    };
-
-}
diff --git a/src/com/android/im/app/AddContactActivity.java b/src/com/android/im/app/AddContactActivity.java
deleted file mode 100644 (file)
index 6e8a92d..0000000
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import static android.provider.Contacts.ContactMethods.CONTENT_EMAIL_URI;
-import android.app.Activity;
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.Context;
-import android.content.Intent;
-import android.database.Cursor;
-import android.database.DatabaseUtils;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.IBinder;
-import android.os.RemoteException;
-import android.provider.Im;
-import android.provider.Contacts.ContactMethods;
-import android.text.Editable;
-import android.text.TextUtils;
-import android.text.TextWatcher;
-import android.text.util.Rfc822Token;
-import android.text.util.Rfc822Tokenizer;
-import android.util.Log;
-import android.view.View;
-import android.widget.Button;
-import android.widget.MultiAutoCompleteTextView;
-import android.widget.ResourceCursorAdapter;
-import android.widget.SimpleCursorAdapter;
-import android.widget.Spinner;
-import android.widget.TextView;
-import com.android.im.IContactList;
-import com.android.im.IContactListManager;
-import com.android.im.IImConnection;
-import com.android.im.R;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.plugin.BrandingResourceIDs;
-import com.android.im.plugin.ImpsConfigNames;
-import com.android.im.service.ImServiceConstants;
-
-import java.util.List;
-
-public class AddContactActivity extends Activity {
-
-    private static final String[] CONTACT_LIST_PROJECTION = {
-        Im.ContactList._ID,
-        Im.ContactList.NAME,
-    };
-    private static final int CONTACT_LIST_NAME_COLUMN = 1;
-
-    private MultiAutoCompleteTextView mAddressList;
-    private Spinner mListSpinner;
-    Button mInviteButton;
-    ImApp mApp;
-    SimpleAlertHandler mHandler;
-
-    private long mProviderId;
-    private long mAccountId;
-    private String mDefaultDomain;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        mApp = ImApp.getApplication(this);
-        mHandler = new SimpleAlertHandler(this);
-        resolveIntent(getIntent());
-
-        setContentView(R.layout.add_contact_activity);
-
-        BrandingResources brandingRes = mApp.getBrandingResource(mProviderId);
-        setTitle(brandingRes.getString(BrandingResourceIDs.STRING_ADD_CONTACT_TITLE));
-
-        TextView label = (TextView) findViewById(R.id.input_contact_label);
-        label.setText(brandingRes.getString(BrandingResourceIDs.STRING_LABEL_INPUT_CONTACT));
-
-        mAddressList = (MultiAutoCompleteTextView) findViewById(R.id.email);
-        mAddressList.setAdapter(new EmailAddressAdapter(this));
-        mAddressList.setTokenizer(new Rfc822Tokenizer());
-        mAddressList.addTextChangedListener(mTextWatcher);
-
-        mListSpinner = (Spinner) findViewById(R.id.choose_list);
-
-        Cursor c = queryContactLists();
-        int initSelection = searchInitListPos(c, getIntent().getStringExtra(
-                ImServiceConstants.EXTRA_INTENT_LIST_NAME));
-        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
-                android.R.layout.simple_spinner_item,
-                c,
-                new String[] {Im.ContactList.NAME},
-                new int[] {android.R.id.text1});
-        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
-        mListSpinner.setAdapter(adapter);
-        mListSpinner.setSelection(initSelection);
-
-        mInviteButton = (Button) findViewById(R.id.invite);
-        mInviteButton.setText(brandingRes.getString(
-                BrandingResourceIDs.STRING_BUTTON_ADD_CONTACT));
-        mInviteButton.setOnClickListener(mButtonHandler);
-        mInviteButton.setEnabled(false);
-    }
-
-    private Cursor queryContactLists() {
-        Uri uri = Im.ContactList.CONTENT_URI;
-        uri = ContentUris.withAppendedId(uri, mProviderId);
-        uri = ContentUris.withAppendedId(uri, mAccountId);
-        Cursor c = managedQuery(uri, CONTACT_LIST_PROJECTION, null, null);
-        return c;
-    }
-
-    private int searchInitListPos(Cursor c, String listName) {
-        if (TextUtils.isEmpty(listName)) {
-            return 0;
-        }
-        c.moveToPosition(-1);
-        while (c.moveToNext()) {
-            if (listName.equals(c.getString(CONTACT_LIST_NAME_COLUMN))) {
-                return c.getPosition();
-            }
-        }
-        return 0;
-    }
-
-    private void resolveIntent(Intent intent) {
-        mProviderId = intent.getLongExtra(
-                ImServiceConstants.EXTRA_INTENT_PROVIDER_ID, -1);
-        mAccountId = intent.getLongExtra(
-                ImServiceConstants.EXTRA_INTENT_ACCOUNT_ID, -1);
-        mDefaultDomain = Im.ProviderSettings.getStringValue(getContentResolver(),
-                mProviderId, ImpsConfigNames.DEFAULT_DOMAIN);
-    }
-
-    void inviteBuddies() {
-        Rfc822Token[] recipients = Rfc822Tokenizer.tokenize(mAddressList.getText());
-        try {
-            IImConnection conn = mApp.getConnection(mProviderId);
-            IContactList list = getContactList(conn);
-            if (list == null) {
-                Log.e(ImApp.LOG_TAG, "<AddContactActivity> can't find given contact list:"
-                        + getSelectedListName());
-                finish();
-            } else {
-                boolean fail = false;
-                for (Rfc822Token recipient : recipients) {
-                    String username = recipient.getAddress();
-                    if (mDefaultDomain != null && username.indexOf('@') == -1) {
-                        username = username + "@" + mDefaultDomain;
-                    }
-                    if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-                        log("addContact:" + username);
-                    }
-                    int res = list.addContact(username);
-                    if (res != ImErrorInfo.NO_ERROR) {
-                        fail = true;
-                        mHandler.showAlert(R.string.error,
-                                ErrorResUtils.getErrorRes(getResources(), res, username));
-                    }
-                }
-                // close the screen if there's no error.
-                if (!fail) {
-                    finish();
-                }
-            }
-        } catch (RemoteException ex) {
-            Log.e(ImApp.LOG_TAG, "<AddContactActivity> inviteBuddies: caught " + ex);
-        }
-    }
-
-    private IContactList getContactList(IImConnection conn) {
-        if (conn == null) {
-            return null;
-        }
-
-        try {
-            IContactListManager contactListMgr = conn.getContactListManager();
-            String listName = getSelectedListName();
-            if (!TextUtils.isEmpty(listName)) {
-                return contactListMgr.getContactList(listName);
-            } else {
-                // Use the default list
-                List<IBinder> lists = contactListMgr.getContactLists();
-                for (IBinder binder : lists) {
-                    IContactList list = IContactList.Stub.asInterface(binder);
-                    if (list.isDefault()) {
-                        return list;
-                    }
-                }
-                // No default list, use the first one as default list
-                if (!lists.isEmpty()) {
-                    return IContactList.Stub.asInterface(lists.get(0));
-                }
-                return null;
-            }
-        } catch (RemoteException e) {
-            // If the service has died, there is no list for now.
-            return null;
-        }
-    }
-
-    private String getSelectedListName() {
-        Cursor c = (Cursor) mListSpinner.getSelectedItem();
-        return (c == null) ? null : c.getString(CONTACT_LIST_NAME_COLUMN);
-    }
-
-    private View.OnClickListener mButtonHandler = new View.OnClickListener() {
-        public void onClick(View v) {
-            mApp.callWhenServiceConnected(mHandler, new Runnable() {
-                public void run() {
-                    inviteBuddies();
-                }
-            });
-        }
-    };
-
-    private TextWatcher mTextWatcher = new TextWatcher() {
-        public void afterTextChanged(Editable s) {
-            mInviteButton.setEnabled(s.length() != 0);
-        }
-
-        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
-            // noop
-        }
-
-        public void onTextChanged(CharSequence s, int start, int before, int count) {
-            // noop
-        }
-    };
-
-    private static void log(String msg) {
-        Log.d(ImApp.LOG_TAG, "<AddContactActivity> " + msg);
-    }
-
-    static class EmailAddressAdapter extends ResourceCursorAdapter {
-        public static final int DATA_INDEX = 1;
-
-        private static final String SORT_ORDER = "people.name, contact_methods.data";
-        private ContentResolver mContentResolver;
-
-        private static final String[] PROJECTION = {
-            ContactMethods._ID,     // 0
-            ContactMethods.DATA     // 1
-        };
-
-        public EmailAddressAdapter(Context context) {
-            super(context, android.R.layout.simple_dropdown_item_1line, null);
-            mContentResolver = context.getContentResolver();
-        }
-
-        @Override
-        public final String convertToString(Cursor cursor) {
-            return cursor.getString(DATA_INDEX);
-        }
-
-        @Override
-        public final void bindView(View view, Context context, Cursor cursor) {
-            ((TextView) view).setText(cursor.getString(DATA_INDEX));
-        }
-
-        @Override
-        public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
-            String where = null;
-
-            if (constraint != null) {
-                String filter = DatabaseUtils.sqlEscapeString(constraint.toString() + '%');
-
-                StringBuilder s = new StringBuilder();
-                s.append("(people.name LIKE ");
-                s.append(filter);
-                s.append(") OR (contact_methods.data LIKE ");
-                s.append(filter);
-                s.append(")");
-
-                where = s.toString();
-            }
-
-            return mContentResolver.query(CONTENT_EMAIL_URI, PROJECTION, where, null, SORT_ORDER);
-        }
-    }
-}
diff --git a/src/com/android/im/app/BlockedContactView.java b/src/com/android/im/app/BlockedContactView.java
deleted file mode 100644 (file)
index ac482ce..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import android.app.Activity;
-import android.content.Context;
-import android.database.Cursor;
-import android.graphics.drawable.Drawable;
-import android.util.AttributeSet;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-import com.android.im.R;
-import com.android.im.plugin.BrandingResourceIDs;
-
-public class BlockedContactView extends LinearLayout {
-    private ImageView mAvatar;
-    private ImageView mBlockedIcon;
-    private TextView  mLine1;
-    private TextView  mLine2;
-
-    public BlockedContactView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    @Override
-    protected void onFinishInflate() {
-        super.onFinishInflate();
-
-        mAvatar = (ImageView) findViewById(R.id.avatar);
-        mBlockedIcon = (ImageView)findViewById(R.id.blocked);
-        mLine1  = (TextView) findViewById(R.id.line1);
-        mLine2  = (TextView) findViewById(R.id.line2);
-    }
-
-    public void bind(Cursor cursor) {
-        long providerId = cursor.getLong(BlockedContactsActivity.PROVIDER_COLUMN);
-        String username = cursor.getString(BlockedContactsActivity.USERNAME_COLUMN);
-        String nickname = cursor.getString(BlockedContactsActivity.NICKNAME_COLUMN);
-
-        Drawable avatar = DatabaseUtils.getAvatarFromCursor(cursor,
-                BlockedContactsActivity.AVATAR_COLUMN);
-
-        if (avatar != null) {
-            mAvatar.setImageDrawable(avatar);
-        } else {
-            mAvatar.setImageResource(R.drawable.avatar_unknown);
-        }
-        ImApp app = ImApp.getApplication((Activity)mContext);
-        BrandingResources brandingRes = app.getBrandingResource(providerId);
-        mBlockedIcon.setImageDrawable(brandingRes.getDrawable(BrandingResourceIDs.DRAWABLE_BLOCK));
-        mLine1.setText(nickname);
-        mLine2.setText(ImpsAddressUtils.getDisplayableAddress(username));
-    }
-}
diff --git a/src/com/android/im/app/BlockedContactsActivity.java b/src/com/android/im/app/BlockedContactsActivity.java
deleted file mode 100644 (file)
index 014f596..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import android.app.AlertDialog;
-import android.app.ListActivity;
-import android.content.ContentUris;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.res.Resources;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.RemoteException;
-import android.provider.Im;
-import android.util.Log;
-import android.view.View;
-import android.view.Window;
-import android.widget.ListAdapter;
-import android.widget.ListView;
-import android.widget.ResourceCursorAdapter;
-
-import com.android.im.IContactListManager;
-import com.android.im.IImConnection;
-import com.android.im.R;
-import com.android.im.plugin.BrandingResourceIDs;
-
-public class BlockedContactsActivity extends ListActivity {
-    ImApp mApp;
-    SimpleAlertHandler mHandler;
-
-    private static final String[] PROJECTION = {
-        Im.BlockedList._ID,
-        Im.BlockedList.ACCOUNT,
-        Im.BlockedList.PROVIDER,
-        Im.BlockedList.NICKNAME,
-        Im.BlockedList.USERNAME,
-        Im.BlockedList.AVATAR_DATA,
-    };
-
-    static final int ACCOUNT_COLUMN  = 1;
-    static final int PROVIDER_COLUMN = 2;
-    static final int NICKNAME_COLUMN = 3;
-    static final int USERNAME_COLUMN = 4;
-    static final int AVATAR_COLUMN = 5;
-
-    @Override
-    protected void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-
-        requestWindowFeature(Window.FEATURE_LEFT_ICON);
-
-        setContentView(R.layout.blocked_contacts_activity);
-        mHandler = new SimpleAlertHandler(this);
-
-        mApp = ImApp.getApplication(this);
-        mApp.startImServiceIfNeed();
-        if (!resolveIntent()) {
-            finish();
-            return;
-        }
-    }
-
-    @Override
-    protected void onListItemClick(ListView l, View v, int position, long id) {
-        Cursor c = (Cursor) l.getAdapter().getItem(position);
-        if (c == null) {
-            mHandler.showAlert(R.string.error, R.string.select_contact);
-            return;
-        }
-        long providerId = c.getLong(PROVIDER_COLUMN);
-        String username = c.getString(USERNAME_COLUMN);
-        String nickname = c.getString(NICKNAME_COLUMN);
-        mApp.callWhenServiceConnected(mHandler, new UnblockAction(providerId, username, nickname));
-    }
-
-    private boolean resolveIntent() {
-        Intent i = getIntent();
-        Uri uri = i.getData();
-        if (uri == null) {
-            warning("No data to show");
-            return false;
-        }
-
-        long accountId = ContentUris.parseId(uri);
-        Uri accountUri = ContentUris.withAppendedId(Im.Account.CONTENT_URI, accountId);
-        Cursor accountCursor = getContentResolver().query(accountUri, null, null, null, null);
-        if (accountCursor == null) {
-            warning("Bad account");
-            return false;
-        }
-        if (!accountCursor.moveToFirst()) {
-            warning("Bad account");
-            accountCursor.close();
-            return false;
-        }
-
-        long providerId = accountCursor.getLong(
-                accountCursor.getColumnIndexOrThrow(Im.Account.PROVIDER));
-        String username = accountCursor.getString(
-                accountCursor.getColumnIndexOrThrow(Im.Account.USERNAME));
-
-        BrandingResources brandingRes = mApp.getBrandingResource(providerId);
-        getWindow().setFeatureDrawable(Window.FEATURE_LEFT_ICON,
-                brandingRes.getDrawable(BrandingResourceIDs.DRAWABLE_LOGO));
-
-        setTitle(getResources().getString(R.string.blocked_list_title, username));
-        accountCursor.close();
-
-        Cursor c = managedQuery(uri, PROJECTION, null, Im.BlockedList.DEFAULT_SORT_ORDER);
-        if (c == null) {
-            warning("Database error when query " + uri);
-            return false;
-        }
-
-        ListAdapter adapter = new BlockedContactsAdapter(c, this);
-        setListAdapter(adapter);
-        return true;
-    }
-
-    private static void warning(String msg) {
-        Log.w(ImApp.LOG_TAG, "<BlockContactsActivity> " + msg);
-    }
-
-    private static class BlockedContactsAdapter extends ResourceCursorAdapter {
-        public BlockedContactsAdapter(Cursor c, Context context) {
-            super(context, R.layout.blocked_contact_view, c);
-        }
-
-        @Override
-        public void bindView(View view, Context context, Cursor cursor) {
-            if (view instanceof BlockedContactView) {
-                ((BlockedContactView) view).bind(cursor);
-            }
-        }
-    }
-
-    private class UnblockAction implements Runnable {
-        private long mProviderId;
-        String mUserName;
-        private String mNickName;
-
-        public UnblockAction(long providerId, String userName, String nickName) {
-            mProviderId = providerId;
-            mUserName = userName;
-            mNickName = nickName;
-        }
-
-        public void run() {
-            final IImConnection conn = mApp.getConnection(mProviderId);
-            if (conn == null) {
-                mHandler.showAlert(R.string.error, R.string.disconnected);
-                return;
-            }
-            DialogInterface.OnClickListener confirmListener = new DialogInterface.OnClickListener(){
-                public void onClick(DialogInterface dialog, int whichButton) {
-                    try {
-                        IContactListManager manager = conn.getContactListManager();
-                        manager.unBlockContact(mUserName);
-                    } catch (RemoteException e) {
-                        mHandler.showServiceErrorAlert();
-                    }
-                }
-            };
-            Resources r = getResources();
-
-            new AlertDialog.Builder(BlockedContactsActivity.this)
-                .setTitle(R.string.confirm)
-                .setMessage(r.getString(R.string.confirm_unblock_contact, mNickName))
-                .setPositiveButton(R.string.yes, confirmListener) // default button
-                .setNegativeButton(R.string.no, null)
-                .setCancelable(false)
-                .show();
-        }
-
-    }
-}
diff --git a/src/com/android/im/app/BrandingResources.java b/src/com/android/im/app/BrandingResources.java
deleted file mode 100644 (file)
index 97dd698..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import com.android.im.plugin.IImPlugin;
-import com.android.im.plugin.ImPluginInfo;
-import dalvik.system.PathClassLoader;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.res.Resources;
-import android.graphics.drawable.Drawable;
-import android.os.RemoteException;
-import android.util.Log;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Map;
-
-/**
- * The provider specific branding resources.
- */
-public class BrandingResources {
-    private static final String TAG = ImApp.LOG_TAG;
-
-    private Map<Integer, Integer> mResMapping;
-    private Resources mPackageRes;
-    private int[] mSmileyIcons;
-
-    private BrandingResources mDefaultRes;
-
-    /**
-     * Creates a new BrandingResource of a specific plug-in. The resources will
-     * be retrieved from the plug-in package.
-     *
-     * @param context The current application context.
-     * @param pluginInfo The info about the plug-in.
-     * @param defaultRes The default branding resources. If the resource is not
-     *            found in the plug-in, the default resource will be returned.
-     */
-    public BrandingResources(Context context, ImPluginInfo pluginInfo,
-            BrandingResources defaultRes) {
-        mDefaultRes = defaultRes;
-
-        PackageManager pm = context.getPackageManager();
-        try {
-            mPackageRes = pm.getResourcesForApplication(pluginInfo.mPackageName);
-        } catch (NameNotFoundException e) {
-            Log.e(TAG, "Can not load resources from package: " + pluginInfo.mPackageName);
-        }
-        // Load the plug-in directly from the apk instead of binding the service
-        // and calling through the IPC binder API. It's more effective in this way
-        // and we can avoid the async behaviors of binding service.
-        PathClassLoader classLoader = new PathClassLoader(pluginInfo.mSrcPath,
-                context.getClassLoader());
-        try {
-            Class cls = classLoader.loadClass(pluginInfo.mClassName);
-            Method m = cls.getMethod("onBind", Intent.class);
-            IImPlugin plugin = (IImPlugin)m.invoke(cls.newInstance(), new Object[]{null});
-            mResMapping = plugin.getResourceMap();
-            mSmileyIcons = plugin.getSmileyIconIds();
-        } catch (ClassNotFoundException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        } catch (IllegalAccessException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        } catch (InstantiationException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        } catch (SecurityException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        } catch (NoSuchMethodException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        } catch (IllegalArgumentException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        } catch (InvocationTargetException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        } catch (RemoteException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        }
-    }
-
-    /**
-     * Creates a BrandingResource with application context and the resource ID map.
-     * The resource will be retrieved from the context directly instead from the plug-in package.
-     *
-     * @param context
-     * @param resMapping
-     */
-    public BrandingResources(Context context, Map<Integer, Integer> resMapping,
-            BrandingResources defaultRes) {
-        mPackageRes = context.getResources();
-        mResMapping = resMapping;
-        mDefaultRes = defaultRes;
-    }
-
-    /**
-     * Gets a drawable object associated with a particular resource ID defined
-     * in {@link com.android.im.plugin.BrandingResourceIDs}
-     *
-     * @param id The ID defined in
-     *            {@link com.android.im.plugin.BrandingResourceIDs}
-     * @return Drawable An object that can be used to draw this resource.
-     */
-    public Drawable getDrawable(int id) {
-        int resId = getPackageResourceId(id);
-        if (resId != 0) {
-            return mPackageRes.getDrawable(resId);
-        } else if (mDefaultRes != null){
-            return mDefaultRes.getDrawable(id);
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Gets an array of the IDs of the supported smiley of the provider. Use
-     * {@link #getSmileyIcon(int)} to get the drawable object of the smiley.
-     *
-     * @return An array of the IDs of the supported smileys.
-     */
-    public int[] getSmileyIcons() {
-        return mSmileyIcons;
-    }
-
-    /**
-     * Gets the drawable associated with particular smiley ID.
-     *
-     * @param smileyId The ID of the smiley returned in
-     *            {@link #getSmileyIcons()}
-     * @return Drawable An object that can be used to draw this smiley.
-     */
-    public Drawable getSmileyIcon(int smileyId){
-        if (mPackageRes == null) {
-            return null;
-        }
-        return mPackageRes.getDrawable(smileyId);
-    }
-
-    /**
-     * Gets the string value associated with a particular resource ID defined in
-     * {@link com.android.im.plugin.BrandingResourceIDs}
-     *
-     * @param id The ID of the string resource defined in
-     *            {@link com.android.im.plugin.BrandingResourceIDs}
-     * @param formatArgs The format arguments that will be used for
-     *            substitution.
-     * @return The string data associated with the resource
-     */
-    public String getString(int id, Object... formatArgs) {
-        int resId = getPackageResourceId(id);
-        if (resId != 0) {
-            return mPackageRes.getString(resId, formatArgs);
-        } else if (mDefaultRes != null){
-            return  mDefaultRes.getString(id, formatArgs);
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Gets the string array associated with a particular resource ID defined in
-     * {@link com.android.im.plugin.BrandingResourceIDs}
-     *
-     * @param id The ID of the string resource defined in
-     *            {@link com.android.im.plugin.BrandingResourceIDs}
-     * @return The string array associated with the resource.
-     */
-    public String[] getStringArray(int id) {
-        int resId = getPackageResourceId(id);
-        if (resId != 0) {
-            return mPackageRes.getStringArray(resId);
-        } else if (mDefaultRes != null){
-            return mDefaultRes.getStringArray(id);
-        } else {
-            return null;
-        }
-    }
-
-    private int getPackageResourceId(int id) {
-        if (mResMapping == null || mPackageRes == null) {
-            return 0;
-        }
-        Integer resId = mResMapping.get(id);
-        return resId == null ? 0 : resId;
-    }
-
-}
diff --git a/src/com/android/im/app/ChatBackgroundMaker.java b/src/com/android/im/app/ChatBackgroundMaker.java
deleted file mode 100644 (file)
index fe340e5..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import com.android.im.R;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.provider.Im;
-import android.view.View;
-
-public class ChatBackgroundMaker {
-    private final Drawable mIncomingBg;
-    private final Drawable mDivider;
-    private final Rect mPadding;
-
-    public ChatBackgroundMaker(Context context) {
-        Resources res = context.getResources();
-        mIncomingBg = res.getDrawable(R.drawable.textfield_im_received);
-        mDivider = res.getDrawable(R.drawable.text_divider_horizontal);
-        mPadding = new Rect();
-        mIncomingBg.getPadding(mPadding);
-    }
-
-    public void setBackground(MessageView view, String contact, int type) {
-        View msgText = view.findViewById(R.id.message);
-
-        switch (type) {
-            case Im.MessageType.INCOMING:
-                // TODO: set color according different contact
-                msgText.setBackgroundDrawable(mIncomingBg);
-                break;
-
-            case Im.MessageType.OUTGOING:
-            case Im.MessageType.POSTPONED:
-                msgText.setBackgroundDrawable(null);
-                msgText.setPadding(mPadding.left, mPadding.top, mPadding.right,
-                      mPadding.bottom);
-                break;
-
-            default:
-                msgText.setBackgroundDrawable(mDivider);
-        }
-    }
-}
diff --git a/src/com/android/im/app/ChatView.java b/src/com/android/im/app/ChatView.java
deleted file mode 100644 (file)
index bc1da91..0000000
+++ /dev/null
@@ -1,1552 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Map;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.AsyncQueryHandler;
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.res.Resources;
-import android.content.res.Configuration;
-import android.database.ContentObserver;
-import android.database.Cursor;
-import android.database.CursorIndexOutOfBoundsException;
-import android.database.DataSetObserver;
-import android.database.CharArrayBuffer;
-import android.graphics.Typeface;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Message;
-import android.os.RemoteException;
-import android.provider.Im;
-import android.text.Editable;
-import android.text.TextUtils;
-import android.text.TextWatcher;
-import android.text.style.StyleSpan;
-import android.text.style.URLSpan;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-import android.view.LayoutInflater;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.AbsListView;
-import android.widget.AdapterView;
-import android.widget.ArrayAdapter;
-import android.widget.Button;
-import android.widget.CursorAdapter;
-import android.widget.EditText;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.ListView;
-import android.widget.TextView;
-import android.widget.AbsListView.OnScrollListener;
-import android.widget.AdapterView.OnItemClickListener;
-
-import com.android.im.IChatListener;
-import com.android.im.IChatSession;
-import com.android.im.IChatSessionListener;
-import com.android.im.IChatSessionManager;
-import com.android.im.IContactList;
-import com.android.im.IContactListListener;
-import com.android.im.IContactListManager;
-import com.android.im.IImConnection;
-import com.android.im.R;
-import com.android.im.app.adapter.ChatListenerAdapter;
-import com.android.im.app.adapter.ChatSessionListenerAdapter;
-import com.android.im.engine.Contact;
-import com.android.im.engine.ImConnection;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.plugin.BrandingResourceIDs;
-
-public class ChatView extends LinearLayout {
-    // This projection and index are set for the query of active chats
-    static final String[] CHAT_PROJECTION = {
-        Im.Contacts._ID,
-        Im.Contacts.ACCOUNT,
-        Im.Contacts.PROVIDER,
-        Im.Contacts.USERNAME,
-        Im.Contacts.NICKNAME,
-        Im.Contacts.TYPE,
-        Im.Presence.PRESENCE_STATUS,
-        Im.Chats.LAST_UNREAD_MESSAGE,
-    };
-    static final int CONTACT_ID_COLUMN             = 0;
-    static final int ACCOUNT_COLUMN                = 1;
-    static final int PROVIDER_COLUMN               = 2;
-    static final int USERNAME_COLUMN               = 3;
-    static final int NICKNAME_COLUMN               = 4;
-    static final int TYPE_COLUMN                   = 5;
-    static final int PRESENCE_STATUS_COLUMN        = 6;
-    static final int LAST_UNREAD_MESSAGE_COLUMN    = 7;
-
-    static final String[] INVITATION_PROJECT = {
-        Im.Invitation._ID,
-        Im.Invitation.PROVIDER,
-        Im.Invitation.SENDER,
-    };
-    static final int INVITATION_ID_COLUMN = 0;
-    static final int INVITATION_PROVIDER_COLUMN = 1;
-    static final int INVITATION_SENDER_COLUMN = 2;
-
-    static final StyleSpan STYLE_BOLD = new StyleSpan(Typeface.BOLD);
-
-    Markup mMarkup;
-
-    Activity mScreen;
-    ImApp mApp;
-    SimpleAlertHandler mHandler;
-    Cursor mCursor;
-
-    private ImageView   mStatusIcon;
-    private TextView    mTitle;
-    /*package*/ListView    mHistory;
-    EditText    mEdtInput;
-    private Button      mSendButton;
-    private View mStatusWarningView;
-    private ImageView mWarningIcon;
-    private TextView mWarningText;
-
-    private MessageAdapter mMessageAdapter;
-    private IChatSessionManager mChatSessionMgr;
-    private IChatSessionListener mChatSessionListener;
-
-    private IChatSession mChatSession;
-    private long mChatId;
-    int mType;
-    String mNickName;
-    String mUserName;
-    long mProviderId;
-    long mAccountId;
-    long mInvitationId;
-    private int mPresenceStatus;
-
-    private int mViewType;
-
-    private static final int VIEW_TYPE_CHAT = 1;
-    private static final int VIEW_TYPE_INVITATION = 2;
-    private static final int VIEW_TYPE_SUBSCRIPTION = 3;
-
-    private static final long SHOW_TIME_STAMP_INTERVAL = 60 * 1000;     // 1 minute
-    private static final int QUERY_TOKEN = 10;
-
-    // Async QueryHandler
-    private final class QueryHandler extends AsyncQueryHandler {
-        public QueryHandler(Context context) {
-            super(context.getContentResolver());
-        }
-
-        @Override
-        protected void onQueryComplete(int token, Object cookie, Cursor c) {
-            Cursor cursor = new DeltaCursor(c);
-
-            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-                log("onQueryComplete: cursor.count=" + cursor.getCount());
-            }
-
-            mMessageAdapter.changeCursor(cursor);
-        }
-    }
-    private QueryHandler mQueryHandler;
-
-    private class RequeryCallback implements Runnable {
-        public void run() {
-            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-                log("RequeryCallback");
-            }
-            requeryCursor();
-        }
-    }
-    private RequeryCallback mRequeryCallback = null;
-
-    private OnItemClickListener mOnItemClickListener = new OnItemClickListener() {
-        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
-            if (!(view instanceof MessageView)) {
-                return;
-            }
-            URLSpan[] links = ((MessageView)view).getMessageLinks();
-            if (links.length == 0){
-                return;
-            }
-
-            final ArrayList<String> linkUrls = new ArrayList<String>(links.length);
-            for (URLSpan u : links) {
-                linkUrls.add(u.getURL());
-            }
-            ArrayAdapter<String> a = new ArrayAdapter<String>(mScreen,
-                    android.R.layout.select_dialog_item, linkUrls);
-            AlertDialog.Builder b = new AlertDialog.Builder(mScreen);
-            b.setTitle(R.string.select_link_title);
-            b.setCancelable(true);
-            b.setAdapter(a, new DialogInterface.OnClickListener() {
-                public void onClick(DialogInterface dialog, int which) {
-                    Uri uri = Uri.parse(linkUrls.get(which));
-                    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
-                    intent.addCategory(Intent.CATEGORY_BROWSABLE);
-                    mScreen.startActivity(intent);
-                }
-            });
-            b.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
-                public void onClick(DialogInterface dialog, int which) {
-                    dialog.dismiss();
-                }
-            });
-            b.show();
-        }
-    };
-
-    private IChatListener mChatListener = new ChatListenerAdapter() {
-        @Override
-        public void onIncomingMessage(IChatSession ses,
-                com.android.im.engine.Message msg) {
-            scheduleRequery(0);
-        }
-
-        @Override
-        public void onContactJoined(IChatSession ses, Contact contact) {
-            scheduleRequery(0);
-        }
-
-        @Override
-        public void onContactLeft(IChatSession ses, Contact contact) {
-            scheduleRequery(0);
-        }
-
-        @Override
-        public void onSendMessageError(IChatSession ses,
-                com.android.im.engine.Message msg, ImErrorInfo error) {
-            scheduleRequery(0);
-        }
-    };
-
-    private Runnable mUpdateChatCallback = new Runnable() {
-        public void run() {
-            if (mCursor.requery() && mCursor.moveToFirst()) {
-                updateChat();
-            }
-        }
-    };
-    private IContactListListener mContactListListener = new IContactListListener.Stub () {
-        public void onAllContactListsLoaded() {
-        }
-
-        public void onContactChange(int type, IContactList list, Contact contact){
-        }
-
-        public void onContactError(int errorType, ImErrorInfo error,
-                String listName, Contact contact) {
-        }
-
-        public void onContactsPresenceUpdate(Contact[] contacts) {
-            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
-                log("onContactsPresenceUpdate()");
-            }
-            for (Contact c : contacts) {
-                if (c.getAddress().getFullName().equals(mUserName)) {
-                    mHandler.post(mUpdateChatCallback);
-                    scheduleRequery(0);
-                    break;
-                }
-            }
-        }
-    };
-
-    static final void log(String msg) {
-        Log.d(ImApp.LOG_TAG, "<ChatView> " +msg);
-    }
-
-    public ChatView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        mScreen = (Activity) context;
-        mApp = ImApp.getApplication(mScreen);
-        mHandler = new ChatViewHandler();
-    }
-
-    void registerForConnEvents() {
-        mApp.registerForConnEvents(mHandler);
-    }
-
-    void unregisterForConnEvents() {
-        mApp.unregisterForConnEvents(mHandler);
-    }
-
-    @Override
-    protected void onFinishInflate() {
-        mStatusIcon     = (ImageView) findViewById(R.id.statusIcon);
-        mTitle          = (TextView) findViewById(R.id.title);
-        mHistory        = (ListView) findViewById(R.id.history);
-        mEdtInput       = (EditText) findViewById(R.id.edtInput);
-        mSendButton     = (Button)findViewById(R.id.btnSend);
-        mHistory.setOnItemClickListener(mOnItemClickListener);
-
-        mStatusWarningView = findViewById(R.id.warning);
-        mWarningIcon = (ImageView)findViewById(R.id.warningIcon);
-        mWarningText = (TextView)findViewById(R.id.warningText);
-
-        Button acceptInvitation = (Button)findViewById(R.id.btnAccept);
-        Button declineInvitation= (Button)findViewById(R.id.btnDecline);
-
-        Button approveSubscription = (Button)findViewById(R.id.btnApproveSubscription);
-        Button declineSubscription = (Button)findViewById(R.id.btnDeclineSubscription);
-
-        acceptInvitation.setOnClickListener(new OnClickListener() {
-            public void onClick(View v) {
-                acceptInvitation();
-            }
-        });
-        declineInvitation.setOnClickListener(new OnClickListener() {
-            public void onClick(View v) {
-                declineInvitation();
-            }
-        });
-
-        approveSubscription.setOnClickListener(new OnClickListener(){
-            public void onClick(View v) {
-                approveSubscription();
-            }
-        });
-        declineSubscription.setOnClickListener(new OnClickListener(){
-            public void onClick(View v) {
-                declineSubscription();
-            }
-        });
-
-        mEdtInput.setOnKeyListener(new OnKeyListener(){
-            public boolean onKey(View v, int keyCode, KeyEvent event) {
-                if (event.getAction() == KeyEvent.ACTION_DOWN) {
-                    switch (keyCode) {
-                        case KeyEvent.KEYCODE_DPAD_CENTER:
-                            sendMessage();
-                            return true;
-
-                        case KeyEvent.KEYCODE_ENTER:
-                            if (event.isAltPressed()) {
-                                mEdtInput.append("\n");
-                            } else {
-                                handleEnterKey();
-                            }
-                            return true;
-                    }
-                }
-                return false;
-            }
-        });
-        // TODO: this is a hack to implement BUG #1611278, when dispatchKeyEvent() works with
-        // the soft keyboard, we should remove this hack.
-        mEdtInput.addTextChangedListener(new TextWatcher() {
-            public void beforeTextChanged(CharSequence s, int start, int before, int after) {
-            }
-
-            public void onTextChanged(CharSequence s, int start, int before, int after) {
-                //log("TextWatcher: " + s);
-                userActionDetected();
-            }
-
-            public void afterTextChanged(Editable s) {
-            }
-        });
-
-        mSendButton.setOnClickListener(new OnClickListener() {
-            public void onClick(View v) {
-                sendMessage();
-            }
-        });
-    }
-
-    public void onResume(){
-        if (mViewType == VIEW_TYPE_CHAT) {
-            Cursor cursor = getMessageCursor();
-            if (cursor == null) {
-                startQuery();
-            } else {
-                requeryCursor();
-            }
-            updateWarningView();
-        }
-        registerChatListener();
-        registerForConnEvents();
-    }
-
-    public void onPause(){
-        Cursor cursor = getMessageCursor();
-        if (cursor != null) {
-            cursor.deactivate();
-        }
-        cancelRequery();
-        if (mViewType == VIEW_TYPE_CHAT && mChatSession != null) {
-            try {
-                mChatSession.markAsRead();
-            } catch (RemoteException e) {
-                mHandler.showServiceErrorAlert();
-            }
-        }
-        unregisterChatListener();
-        unregisterForConnEvents();
-        unregisterChatSessionListener();
-    }
-
-    private void handleEnterKey() {
-        Configuration config = getResources().getConfiguration();
-        if (config.orientation == config.ORIENTATION_LANDSCAPE) {
-            // in the landscape mode, we'll send the message if the user is using a physical
-            // keyboard. However, on the soft keyboard, we'll close the keyboard and put the
-            // focus on the Send button, in order to prevent accidental sending the message.
-            if (config.hardKeyboardHidden == config.HARDKEYBOARDHIDDEN_NO) {
-                sendMessage();
-            } else {
-                closeSoftKeyboard();
-                mSendButton.requestFocus();
-            }
-        } else {
-            // in the portrait mode, the user would always be using the soft keyboard, so pressing
-            // the Enter key would close the keyboard and puts the focus on the Send button.
-            closeSoftKeyboard();
-            mSendButton.requestFocus();
-        }
-    }
-
-    private void closeSoftKeyboard() {
-        InputMethodManager inputMethodManager =
-            (InputMethodManager)mApp.getSystemService(Context.INPUT_METHOD_SERVICE);
-
-        inputMethodManager.hideSoftInputFromWindow(mEdtInput.getWindowToken(), 0);
-    }
-
-    void updateChat() {
-        setViewType(VIEW_TYPE_CHAT);
-
-        long oldChatId = mChatId;
-
-        updateContactInfo();
-
-        setStatusIcon();
-        setTitle();
-
-        IImConnection conn = mApp.getConnection(mProviderId);
-        if (conn == null) {
-            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) log("Connection has been signed out");
-            mScreen.finish();
-            return;
-        }
-
-        BrandingResources brandingRes = mApp.getBrandingResource(mProviderId);
-        mHistory.setBackgroundDrawable(
-                brandingRes.getDrawable(BrandingResourceIDs.DRAWABLE_CHAT_WATERMARK));
-
-        if (mMarkup == null) {
-            mMarkup = new Markup(brandingRes);
-        }
-
-        if (mMessageAdapter == null) {
-            mMessageAdapter = new MessageAdapter(mScreen, null);
-            mHistory.setAdapter(mMessageAdapter);
-        }
-
-        // only change the message adapter when we switch to another chat
-        if (mChatId != oldChatId) {
-            startQuery();
-            mEdtInput.setText("");
-        }
-
-        updateWarningView();
-    }
-
-    private void updateContactInfo() {
-        mChatId = mCursor.getLong(CONTACT_ID_COLUMN);
-        mProviderId = mCursor.getLong(PROVIDER_COLUMN);
-        mAccountId = mCursor.getLong(ACCOUNT_COLUMN);
-        mPresenceStatus = mCursor.getInt(PRESENCE_STATUS_COLUMN);
-        mType = mCursor.getInt(TYPE_COLUMN);
-        mUserName = mCursor.getString(USERNAME_COLUMN);
-        mNickName = mCursor.getString(NICKNAME_COLUMN);
-    }
-
-    private void setTitle() {
-        if (mType == Im.Contacts.TYPE_GROUP) {
-            final String[] projection = {Im.GroupMembers.NICKNAME};
-            Uri memberUri = ContentUris.withAppendedId(Im.GroupMembers.CONTENT_URI, mChatId);
-            ContentResolver cr = mScreen.getContentResolver();
-            Cursor c = cr.query(memberUri, projection, null, null, null);
-            StringBuilder buf = new StringBuilder();
-            if(c != null) {
-                while(c.moveToNext()) {
-                    buf.append(c.getString(0));
-                    if(!c.isLast()) {
-                        buf.append(',');
-                    }
-                }
-                c.close();
-            }
-            mTitle.setText(mContext.getString(R.string.chat_with, buf.toString()));
-        } else {
-            mTitle.setText(mContext.getString(R.string.chat_with, mNickName));
-        }
-    }
-
-    private void setStatusIcon() {
-        if (mType == Im.Contacts.TYPE_GROUP) {
-            // hide the status icon for group chat.
-            mStatusIcon.setVisibility(GONE);
-        } else {
-            mStatusIcon.setVisibility(VISIBLE);
-            BrandingResources brandingRes = mApp.getBrandingResource(mProviderId);
-            int presenceResId = PresenceUtils.getStatusIconId(mPresenceStatus);
-            mStatusIcon.setImageDrawable(brandingRes.getDrawable(presenceResId));
-        }
-    }
-
-    public void bindChat(long chatId) {
-        if (mCursor != null) {
-            mCursor.deactivate();
-        }
-        Uri contactUri = ContentUris.withAppendedId(Im.Contacts.CONTENT_URI, chatId);
-        mCursor = mScreen.managedQuery(contactUri, CHAT_PROJECTION, null, null);
-        if (mCursor == null || !mCursor.moveToFirst()) {
-            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-                log("Failed to query chat: " + chatId);
-            }
-            mScreen.finish();
-            return;
-        } else {
-            mChatSession = getChatSession(mCursor);
-            updateChat();
-            registerChatListener();
-        }
-    }
-
-    public void bindInvitation(long invitationId) {
-        Uri uri = ContentUris.withAppendedId(Im.Invitation.CONTENT_URI, invitationId);
-        ContentResolver cr = mScreen.getContentResolver();
-        Cursor cursor = cr.query(uri, INVITATION_PROJECT, null, null, null);
-        if (cursor == null || !cursor.moveToFirst()) {
-            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-                log("Failed to query invitation: " + invitationId);
-            }
-            mScreen.finish();
-        } else {
-            setViewType(VIEW_TYPE_INVITATION);
-
-            mInvitationId = cursor.getLong(INVITATION_ID_COLUMN);
-            mProviderId = cursor.getLong(INVITATION_PROVIDER_COLUMN);
-            String sender = cursor.getString(INVITATION_SENDER_COLUMN);
-
-            TextView mInvitationText = (TextView)findViewById(R.id.txtInvitation);
-            mInvitationText.setText(mContext.getString(R.string.invitation_prompt, sender));
-            mTitle.setText(mContext.getString(R.string.chat_with, sender));
-        }
-
-        if (cursor != null) {
-            cursor.close();
-        }
-    }
-
-    public void bindSubscription(long providerId, String from) {
-        mProviderId = providerId;
-        mUserName = from;
-
-        setViewType(VIEW_TYPE_SUBSCRIPTION);
-
-        TextView text =  (TextView)findViewById(R.id.txtSubscription);
-        String displayableAddr = ImpsAddressUtils.getDisplayableAddress(from);
-        text.setText(mContext.getString(R.string.subscription_prompt, displayableAddr));
-        mTitle.setText(mContext.getString(R.string.chat_with, displayableAddr));
-
-        mApp.dismissChatNotification(providerId, from);
-    }
-
-    void acceptInvitation() {
-        try {
-
-            IImConnection conn = mApp.getConnection(mProviderId);
-            if (conn != null) {
-                // register a chat session listener and wait for a group chat
-                // session to be created after we accept the invitation.
-                registerChatSessionListener();
-                conn.acceptInvitation(mInvitationId);
-            }
-        } catch (RemoteException e) {
-            mHandler.showServiceErrorAlert();
-        }
-    }
-
-    void declineInvitation() {
-        try {
-            IImConnection conn = mApp.getConnection(mProviderId);
-            if (conn != null) {
-                conn.rejectInvitation(mInvitationId);
-            }
-            mScreen.finish();
-        } catch (RemoteException e) {
-            mHandler.showServiceErrorAlert();
-        }
-    }
-
-    void approveSubscription() {
-        IImConnection conn = mApp.getConnection(mProviderId);
-        try {
-            IContactListManager manager = conn.getContactListManager();
-            manager.approveSubscription(mUserName);
-        } catch (RemoteException ex) {
-            mHandler.showServiceErrorAlert();
-        }
-        mScreen.finish();
-    }
-
-    void declineSubscription() {
-        IImConnection conn = mApp.getConnection(mProviderId);
-        try {
-            IContactListManager manager = conn.getContactListManager();
-            manager.declineSubscription(mUserName);
-        } catch (RemoteException ex) {
-            mHandler.showServiceErrorAlert();
-        }
-        mScreen.finish();
-    }
-
-    private void setViewType(int type) {
-        mViewType = type;
-        if (type == VIEW_TYPE_CHAT) {
-            findViewById(R.id.invitationPanel).setVisibility(GONE);
-            findViewById(R.id.subscription).setVisibility(GONE);
-            setChatViewEnabled(true);
-        }  else if (type == VIEW_TYPE_INVITATION) {
-            setChatViewEnabled(false);
-            findViewById(R.id.invitationPanel).setVisibility(VISIBLE);
-            findViewById(R.id.btnAccept).requestFocus();
-        } else if (type == VIEW_TYPE_SUBSCRIPTION) {
-            setChatViewEnabled(false);
-            findViewById(R.id.subscription).setVisibility(VISIBLE);
-            findViewById(R.id.btnApproveSubscription).requestFocus();
-        }
-    }
-
-    private void setChatViewEnabled(boolean enabled) {
-        mEdtInput.setEnabled(enabled);
-        mSendButton.setEnabled(enabled);
-        if (enabled) {
-            mEdtInput.requestFocus();
-        } else {
-            mHistory.setAdapter(null);
-        }
-    }
-
-    private void startQuery() {
-        if (mQueryHandler == null) {
-            mQueryHandler = new QueryHandler(mContext);
-        } else {
-            // Cancel any pending queries
-            mQueryHandler.cancelOperation(QUERY_TOKEN);
-        }
-
-        Uri uri;
-        if (Im.Contacts.TYPE_GROUP == mType) {
-            uri = ContentUris.withAppendedId(Im.GroupMessages.CONTENT_URI_GROUP_MESSAGES_BY, mChatId);
-        } else {
-            uri = Im.Messages.getContentUriByContact(mProviderId, mAccountId, mUserName);
-        }
-
-        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-            log("queryCursor: uri=" + uri);
-        }
-
-        mQueryHandler.startQuery(QUERY_TOKEN, null,
-                uri,
-                null,
-                null /* selection */,
-                null /* selection args */,
-                null);
-    }
-
-    void scheduleRequery(long interval) {
-        if (mRequeryCallback == null) {
-            mRequeryCallback = new RequeryCallback();
-        } else {
-            mHandler.removeCallbacks(mRequeryCallback);
-        }
-
-        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-            log("scheduleRequery");
-        }
-        mHandler.postDelayed(mRequeryCallback, interval);
-    }
-
-    void cancelRequery() {
-        if (mRequeryCallback != null) {
-            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-                log("cancelRequery");
-            }
-            mHandler.removeCallbacks(mRequeryCallback);
-            mRequeryCallback = null;
-        }
-    }
-
-    void requeryCursor() {
-        if (mMessageAdapter.isScrolling()) {
-            mMessageAdapter.setNeedRequeryCursor(true);
-            return;
-        }
-        // TODO: async query?
-        Cursor cursor = getMessageCursor();
-        if (cursor != null) {
-            cursor.requery();
-        }
-    }
-
-    private Cursor getMessageCursor() {
-        return mMessageAdapter == null ? null : mMessageAdapter.getCursor();
-    }
-
-    public void insertSmiley(String smiley) {
-        mEdtInput.append(mMarkup.applyEmoticons(smiley));
-    }
-
-    public void closeChatSession() {
-        if (mChatSession != null) {
-            try {
-                mChatSession.leave();
-            } catch (RemoteException e) {
-                mHandler.showServiceErrorAlert();
-            }
-        } else {
-            // the conversation is already closed, clear data in database
-            ContentResolver cr = mContext.getContentResolver();
-            cr.delete(ContentUris.withAppendedId(Im.Chats.CONTENT_URI, mChatId),
-                    null, null);
-        }
-        mScreen.finish();
-    }
-
-    public void closeChatSessionIfInactive() {
-        if (mChatSession != null) {
-            try {
-                mChatSession.leaveIfInactive();
-            } catch (RemoteException e) {
-                mHandler.showServiceErrorAlert();
-            }
-        }
-    }
-
-    public void viewProfile() {
-        Uri data = ContentUris.withAppendedId(Im.Contacts.CONTENT_URI, mChatId);
-        Intent intent = new Intent(Intent.ACTION_VIEW, data);
-        mScreen.startActivity(intent);
-    }
-
-    public void blockContact() {
-        // TODO: unify with codes in ContactListView
-        DialogInterface.OnClickListener confirmListener = new DialogInterface.OnClickListener(){
-            public void onClick(DialogInterface dialog, int whichButton) {
-                try {
-                    IImConnection conn = mApp.getConnection(mProviderId);
-                    IContactListManager manager = conn.getContactListManager();
-                    manager.blockContact(mUserName);
-                    mScreen.finish();
-                } catch (RemoteException e) {
-                    mHandler.showServiceErrorAlert();
-                }
-            }
-        };
-
-        Resources r = getResources();
-
-        // The positive button is deliberately set as no so that
-        // the no is the default value
-        new AlertDialog.Builder(mContext)
-            .setTitle(R.string.confirm)
-            .setMessage(r.getString(R.string.confirm_block_contact, mNickName))
-            .setPositiveButton(R.string.no, null) // default button
-            .setNegativeButton(R.string.yes, confirmListener)
-            .setCancelable(false)
-            .show();
-    }
-
-    public long getProviderId() {
-        return mProviderId;
-    }
-
-    public long getAccountId() {
-        return mAccountId;
-    }
-
-    public String getUserName() {
-        return mUserName;
-    }
-
-    public long getChatId () {
-        try {
-            return mChatSession == null ? -1 : mChatSession.getId();
-        } catch (RemoteException e) {
-            mHandler.showServiceErrorAlert();
-            return -1;
-        }
-    }
-
-    public IChatSession getCurrentChatSession() {
-        return mChatSession;
-    }
-
-    private IChatSessionManager getChatSessionManager(long providerId) {
-        if (mChatSessionMgr == null) {
-            IImConnection conn = mApp.getConnection(providerId);
-            if (conn != null) {
-                try {
-                    mChatSessionMgr = conn.getChatSessionManager();
-                } catch (RemoteException e) {
-                    mHandler.showServiceErrorAlert();
-                }
-            }
-        }
-        return mChatSessionMgr;
-    }
-
-    private IChatSession getChatSession(Cursor cursor) {
-        long providerId = cursor.getLong(PROVIDER_COLUMN);
-        String username = cursor.getString(USERNAME_COLUMN);
-
-        IChatSessionManager sessionMgr = getChatSessionManager(providerId);
-        if (sessionMgr != null) {
-            try {
-                return sessionMgr.getChatSession(username);
-            } catch (RemoteException e) {
-                mHandler.showServiceErrorAlert();
-            }
-        }
-        return null;
-    }
-
-    boolean isGroupChat() {
-        return Im.Contacts.TYPE_GROUP == mType;
-    }
-
-    void sendMessage() {
-        String msg = mEdtInput.getText().toString();
-
-        if (TextUtils.isEmpty(msg.trim())) {
-            return;
-        }
-
-        if (mChatSession != null) {
-            try {
-                mChatSession.sendMessage(msg);
-                mEdtInput.setText("");
-                mEdtInput.requestFocus();
-                requeryCursor();
-            } catch (RemoteException e) {
-                mHandler.showServiceErrorAlert();
-            }
-        }
-
-        // Close the soft on-screen keyboard if we're in landscape mode so the user can see the
-        // conversation.
-        Configuration config = getResources().getConfiguration();
-        if (config.orientation == config.ORIENTATION_LANDSCAPE) {
-            closeSoftKeyboard();
-        }
-    }
-
-    void registerChatListener() {
-        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-            log("registerChatListener");
-        }
-        try {
-            if (mChatSession != null) {
-                mChatSession.registerChatListener(mChatListener);
-            }
-            IImConnection conn = mApp.getConnection(mProviderId);
-            if (conn != null) {
-                IContactListManager listMgr = conn.getContactListManager();
-                listMgr.registerContactListListener(mContactListListener);
-            }
-            mApp.dismissChatNotification(mProviderId, mUserName);
-        } catch (RemoteException e) {
-            Log.w(ImApp.LOG_TAG, "<ChatView> registerChatListener fail:" + e.getMessage());
-        }
-    }
-
-    void unregisterChatListener() {
-        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-            log("unregisterChatListener");
-        }
-        try {
-            if (mChatSession != null) {
-                mChatSession.unregisterChatListener(mChatListener);
-            }
-            IImConnection conn = mApp.getConnection(mProviderId);
-            if (conn != null) {
-                IContactListManager listMgr = conn.getContactListManager();
-                listMgr.unregisterContactListListener(mContactListListener);
-            }
-        } catch (RemoteException e) {
-            Log.w(ImApp.LOG_TAG, "<ChatView> unregisterChatListener fail:" + e.getMessage());
-        }
-    }
-
-    void registerChatSessionListener() {
-        IChatSessionManager sessionMgr = getChatSessionManager(mProviderId);
-        if (sessionMgr != null) {
-            mChatSessionListener = new ChatSessionListener();
-            try {
-                sessionMgr.registerChatSessionListener(mChatSessionListener);
-            } catch (RemoteException e) {
-                mHandler.showServiceErrorAlert();
-            }
-        }
-    }
-
-    void unregisterChatSessionListener() {
-        if (mChatSessionListener != null) {
-            try {
-                IChatSessionManager sessionMgr = getChatSessionManager(mProviderId);
-                sessionMgr.unregisterChatSessionListener(mChatSessionListener);
-                // We unregister the listener when the chat session we are
-                // waiting for has been created or the activity is stopped.
-                // Clear the listener so that we won't unregister the listener
-                // twice.
-                mChatSessionListener = null;
-            } catch (RemoteException e) {
-                mHandler.showServiceErrorAlert();
-            }
-        }
-    }
-
-    void updateWarningView() {
-        int visibility = View.GONE;
-        int iconVisibility = View.GONE;
-        String message = null;
-        boolean isConnected;
-
-        try {
-            IImConnection conn = mApp.getConnection(mProviderId);
-            isConnected = (conn == null) ? false
-                    : conn.getState() != ImConnection.SUSPENDED;
-        } catch (RemoteException e) {
-            // do nothing
-            return;
-        }
-
-        if (isConnected) {
-            if (mType == Im.Contacts.TYPE_TEMPORARY) {
-                visibility = View.VISIBLE;
-                message = mContext.getString(R.string.contact_not_in_list_warning, mNickName);
-            } else if (mPresenceStatus == Im.Presence.OFFLINE) {
-                visibility = View.VISIBLE;
-                message = mContext.getString(R.string.contact_offline_warning, mNickName);
-            }
-        } else {
-            visibility = View.VISIBLE;
-            iconVisibility = View.VISIBLE;
-            message = mContext.getString(R.string.disconnected_warning);
-        }
-
-        mStatusWarningView.setVisibility(visibility);
-        if (visibility == View.VISIBLE) {
-            mWarningIcon.setVisibility(iconVisibility);
-            mWarningText.setText(message);
-        }
-    }
-
-    @Override
-    public boolean dispatchKeyEvent(KeyEvent event) {
-        userActionDetected();
-        return super.dispatchKeyEvent(event);
-    }
-
-    @Override
-    public boolean dispatchTouchEvent(MotionEvent ev) {
-        userActionDetected();
-        return super.dispatchTouchEvent(ev);
-    }
-
-    @Override
-    public boolean dispatchTrackballEvent(MotionEvent ev) {
-        userActionDetected();
-        return super.dispatchTrackballEvent(ev);
-    }
-
-    private void userActionDetected() {
-        if (mChatSession != null) {
-            try {
-                mChatSession.markAsRead();
-            } catch (RemoteException e) {
-                mHandler.showServiceErrorAlert();
-            }
-        }
-    }
-
-    private final class ChatViewHandler extends SimpleAlertHandler {
-        public ChatViewHandler() {
-            super(mScreen);
-        }
-
-        @Override
-        public void handleMessage(Message msg) {
-            long providerId = ((long)msg.arg1 << 32) | msg.arg2;
-            if (providerId != mProviderId) {
-                return;
-            }
-
-            switch(msg.what) {
-            case ImApp.EVENT_CONNECTION_LOGGED_IN:
-                log("Connection resumed");
-                updateWarningView();
-                return;
-            case ImApp.EVENT_CONNECTION_SUSPENDED:
-                log("Connection suspended");
-                updateWarningView();
-                return;
-            }
-
-            super.handleMessage(msg);
-        }
-    }
-
-    class ChatSessionListener extends ChatSessionListenerAdapter {
-        @Override
-        public void onChatSessionCreated(IChatSession session) {
-            try {
-                if (session.isGroupChatSession()) {
-                    final long id = session.getId();
-                    unregisterChatSessionListener();
-                    mHandler.post(new Runnable() {
-                        public void run() {
-                            bindChat(id);
-                        }});
-                }
-            } catch (RemoteException e) {
-                mHandler.showServiceErrorAlert();
-            }
-        }
-    }
-
-    public static class DeltaCursor implements Cursor {
-        static final String DELTA_COLUMN_NAME = "delta";
-
-        private Cursor mInnerCursor;
-        private String[] mColumnNames;
-        private int mDateColumn = -1;
-        private int mDeltaColumn = -1;
-
-        DeltaCursor(Cursor cursor) {
-            mInnerCursor = cursor;
-
-            String[] columnNames = cursor.getColumnNames();
-            int len = columnNames.length;
-
-            mColumnNames = new String[len + 1];
-
-            for (int i = 0 ; i < len ; i++) {
-                mColumnNames[i] = columnNames[i];
-                if (mColumnNames[i].equals(Im.BaseMessageColumns.DATE)) {
-                    mDateColumn = i;
-                }
-            }
-
-            mDeltaColumn = len;
-            mColumnNames[mDeltaColumn] = DELTA_COLUMN_NAME;
-
-            //if (DBG) log("##### DeltaCursor constructor: mDeltaColumn=" +
-            //        mDeltaColumn + ", columnName=" + mColumnNames[mDeltaColumn]);
-        }
-
-        public int getCount() {
-            return mInnerCursor.getCount();
-        }
-
-        public int getPosition() {
-            return mInnerCursor.getPosition();
-        }
-
-        public boolean move(int offset) {
-            return mInnerCursor.move(offset);
-        }
-
-        public boolean moveToPosition(int position) {
-            return mInnerCursor.moveToPosition(position);
-        }
-
-        public boolean moveToFirst() {
-            return mInnerCursor.moveToFirst();
-        }
-
-        public boolean moveToLast() {
-            return mInnerCursor.moveToLast();
-        }
-
-        public boolean moveToNext() {
-            return mInnerCursor.moveToNext();
-        }
-
-        public boolean moveToPrevious() {
-            return mInnerCursor.moveToPrevious();
-        }
-
-        public boolean isFirst() {
-            return mInnerCursor.isFirst();
-        }
-
-        public boolean isLast() {
-            return mInnerCursor.isLast();
-        }
-
-        public boolean isBeforeFirst() {
-            return mInnerCursor.isBeforeFirst();
-        }
-
-        public boolean isAfterLast() {
-            return mInnerCursor.isAfterLast();
-        }
-
-        public boolean deleteRow() {
-            return mInnerCursor.deleteRow();
-        }
-
-        public int getColumnIndex(String columnName) {
-            if (DELTA_COLUMN_NAME.equals(columnName)) {
-                return mDeltaColumn;
-            }
-
-            int columnIndex = mInnerCursor.getColumnIndex(columnName);
-            return columnIndex;
-        }
-
-        public int getColumnIndexOrThrow(String columnName) throws IllegalArgumentException {
-            if (DELTA_COLUMN_NAME.equals(columnName)) {
-                return mDeltaColumn;
-            }
-
-            return mInnerCursor.getColumnIndexOrThrow(columnName);
-        }
-
-        public String getColumnName(int columnIndex) {
-            if (columnIndex == mDeltaColumn) {
-                return DELTA_COLUMN_NAME;
-            }
-
-            return mInnerCursor.getColumnName(columnIndex);
-        }
-
-        public int getColumnCount() {
-            return mInnerCursor.getColumnCount() + 1;
-        }
-
-        public boolean supportsUpdates() {
-            return mInnerCursor.supportsUpdates();
-        }
-
-        public boolean hasUpdates() {
-            return mInnerCursor.hasUpdates();
-        }
-
-        public boolean updateBlob(int columnIndex, byte[] value) {
-            if (columnIndex == mDeltaColumn) {
-                return false;
-            }
-
-            return mInnerCursor.updateBlob(columnIndex, value);
-        }
-
-        public boolean updateString(int columnIndex, String value) {
-            if (columnIndex == mDeltaColumn) {
-                return false;
-            }
-
-            return mInnerCursor.updateString(columnIndex, value);
-        }
-
-        public boolean updateShort(int columnIndex, short value) {
-            if (columnIndex == mDeltaColumn) {
-                return false;
-            }
-
-            return mInnerCursor.updateShort(columnIndex, value);
-        }
-
-        public boolean updateInt(int columnIndex, int value) {
-            if (columnIndex == mDeltaColumn) {
-                return false;
-            }
-
-            return mInnerCursor.updateInt(columnIndex, value);
-        }
-
-        public boolean updateLong(int columnIndex, long value) {
-            if (columnIndex == mDeltaColumn) {
-                return false;
-            }
-
-            return mInnerCursor.updateLong(columnIndex, value);
-        }
-
-        public boolean updateFloat(int columnIndex, float value) {
-            if (columnIndex == mDeltaColumn) {
-                return false;
-            }
-
-            return mInnerCursor.updateFloat(columnIndex, value);
-        }
-
-        public boolean updateDouble(int columnIndex, double value) {
-            if (columnIndex == mDeltaColumn) {
-                return false;
-            }
-
-            return mInnerCursor.updateDouble(columnIndex, value);
-        }
-
-        public boolean updateToNull(int columnIndex) {
-            if (columnIndex == mDeltaColumn) {
-                return false;
-            }
-
-            return mInnerCursor.updateToNull(columnIndex);
-        }
-
-        public boolean commitUpdates() {
-            return mInnerCursor.commitUpdates();
-        }
-
-        public boolean commitUpdates(Map<? extends Long,
-                ? extends Map<String,Object>> values) {
-            return mInnerCursor.commitUpdates(values);
-        }
-
-        public void abortUpdates() {
-            mInnerCursor.abortUpdates();
-        }
-
-        public void deactivate() {
-            mInnerCursor.deactivate();
-        }
-
-        public boolean requery() {
-            return mInnerCursor.requery();
-        }
-
-        public void close() {
-            mInnerCursor.close();
-        }
-
-        public boolean isClosed() {
-            return mInnerCursor.isClosed();
-        }
-
-        public void registerContentObserver(ContentObserver observer) {
-            mInnerCursor.registerContentObserver(observer);
-        }
-
-        public void unregisterContentObserver(ContentObserver observer) {
-            mInnerCursor.unregisterContentObserver(observer);
-        }
-
-        public void registerDataSetObserver(DataSetObserver observer) {
-            mInnerCursor.registerDataSetObserver(observer);
-        }
-
-        public void unregisterDataSetObserver(DataSetObserver observer) {
-            mInnerCursor.unregisterDataSetObserver(observer);
-        }
-
-        public void setNotificationUri(ContentResolver cr, Uri uri) {
-            mInnerCursor.setNotificationUri(cr, uri);
-        }
-
-        public boolean getWantsAllOnMoveCalls() {
-            return mInnerCursor.getWantsAllOnMoveCalls();
-        }
-
-        public Bundle getExtras() {
-            return mInnerCursor.getExtras();
-        }
-
-        public Bundle respond(Bundle extras) {
-            return mInnerCursor.respond(extras);
-        }
-
-        public String[] getColumnNames() {
-            return mColumnNames;
-        }
-
-        private void checkPosition() {
-            int pos = mInnerCursor.getPosition();
-            int count = mInnerCursor.getCount();
-
-            if (-1 == pos || count == pos) {
-                throw new CursorIndexOutOfBoundsException(pos, count);
-            }
-        }
-
-        public byte[] getBlob(int column) {
-            checkPosition();
-
-            if (column == mDeltaColumn) {
-                return null;
-            }
-
-            return mInnerCursor.getBlob(column);
-        }
-
-        public String getString(int column) {
-            checkPosition();
-
-            if (column == mDeltaColumn) {
-                long value = getDeltaValue();
-                return Long.toString(value);
-            }
-
-            return mInnerCursor.getString(column);
-        }
-
-        public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) {
-            checkPosition();
-
-            if (columnIndex == mDeltaColumn) {
-                long value = getDeltaValue();
-                String strValue = Long.toString(value);
-                int len = strValue.length();
-                char[] data = buffer.data;
-                if (data == null || data.length < len) {
-                    buffer.data = strValue.toCharArray();
-                } else {
-                    strValue.getChars(0, len, data, 0);
-                }
-                buffer.sizeCopied = strValue.length();
-            } else {
-                mInnerCursor.copyStringToBuffer(columnIndex, buffer);
-            }
-        }
-
-        public short getShort(int column) {
-            checkPosition();
-
-            if (column == mDeltaColumn) {
-                return (short)getDeltaValue();
-            }
-
-            return mInnerCursor.getShort(column);
-        }
-
-        public int getInt(int column) {
-            checkPosition();
-
-            if (column == mDeltaColumn) {
-                return (int)getDeltaValue();
-            }
-
-            return mInnerCursor.getInt(column);
-        }
-
-        public long getLong(int column) {
-        //if (DBG) log("DeltaCursor.getLong: column=" + column + ", mDeltaColumn=" + mDeltaColumn);
-            checkPosition();
-
-            if (column == mDeltaColumn) {
-                return getDeltaValue();
-            }
-
-            return mInnerCursor.getLong(column);
-        }
-
-        public float getFloat(int column) {
-            checkPosition();
-
-            if (column == mDeltaColumn) {
-                return getDeltaValue();
-            }
-
-            return mInnerCursor.getFloat(column);
-        }
-
-        public double getDouble(int column) {
-            checkPosition();
-
-            if (column == mDeltaColumn) {
-                return getDeltaValue();
-            }
-
-            return mInnerCursor.getDouble(column);
-        }
-
-        public boolean isNull(int column) {
-            checkPosition();
-
-            if (column == mDeltaColumn) {
-                return false;
-            }
-
-            return mInnerCursor.isNull(column);
-        }
-
-        private long getDeltaValue() {
-            int pos = mInnerCursor.getPosition();
-            //Log.i(LOG_TAG, "getDeltaValue: mPos=" + mPos);
-
-            long t2, t1;
-
-            if (pos == getCount()-1) {
-                t1 = mInnerCursor.getLong(mDateColumn);
-                t2 = System.currentTimeMillis();
-            } else {
-                mInnerCursor.moveToPosition(pos + 1);
-                t2 = mInnerCursor.getLong(mDateColumn);
-                mInnerCursor.moveToPosition(pos);
-                t1 = mInnerCursor.getLong(mDateColumn);
-            }
-
-            return t2 - t1;
-        }
-    }
-
-    private class MessageAdapter extends CursorAdapter implements AbsListView.OnScrollListener {
-        private int mScrollState;
-        private boolean mNeedRequeryCursor;
-
-        private int mContactColumn;
-        private int mBodyColumn;
-        private int mDateColumn;
-        private int mTypeColumn;
-        private int mErrCodeColumn;
-        private int mDeltaColumn;
-        private ChatBackgroundMaker mBgMaker;
-
-        private LayoutInflater mInflater;
-
-        public MessageAdapter(Activity context, Cursor c) {
-            super(context, c, false);
-            mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-            mBgMaker = new ChatBackgroundMaker(context);
-            if (c != null) {
-                resolveColumnIndex(c);
-            }
-        }
-
-        private void resolveColumnIndex(Cursor c) {
-            mContactColumn = c.getColumnIndexOrThrow(Im.BaseMessageColumns.CONTACT);
-            mBodyColumn = c.getColumnIndexOrThrow(Im.BaseMessageColumns.BODY);
-            mDateColumn = c.getColumnIndexOrThrow(Im.BaseMessageColumns.DATE);
-            mTypeColumn = c.getColumnIndexOrThrow(Im.BaseMessageColumns.TYPE);
-            mErrCodeColumn = c.getColumnIndexOrThrow(Im.BaseMessageColumns.ERROR_CODE);
-            mDeltaColumn = c.getColumnIndexOrThrow(DeltaCursor.DELTA_COLUMN_NAME);
-        }
-
-        @Override
-        public void changeCursor(Cursor cursor) {
-            super.changeCursor(cursor);
-            if (cursor != null) {
-                resolveColumnIndex(cursor);
-            }
-        }
-
-        @Override
-        public View newView(Context context, Cursor cursor, ViewGroup parent) {
-            return mInflater.inflate(R.layout.new_message_item, parent, false);
-        }
-
-        @Override
-        public void bindView(View view, Context context, Cursor cursor) {
-            MessageView chatMsgView = (MessageView) view;
-
-            int type = cursor.getInt(mTypeColumn);
-            String contact = isGroupChat() ? cursor.getString(mContactColumn) : mNickName;
-            String body = cursor.getString(mBodyColumn);
-            long delta = cursor.getLong(mDeltaColumn);
-            boolean showTimeStamp = (delta > SHOW_TIME_STAMP_INTERVAL);
-            Date date = showTimeStamp ? new Date(cursor.getLong(mDateColumn)) : null;
-
-            switch (type) {
-                case Im.MessageType.INCOMING:
-                    chatMsgView.bindIncomingMessage(contact, body, date, mMarkup, isScrolling());
-                    break;
-
-                case Im.MessageType.OUTGOING:
-                case Im.MessageType.POSTPONED:
-                    int errCode = cursor.getInt(mErrCodeColumn);
-                    if (errCode != 0) {
-                        chatMsgView.bindErrorMessage(errCode);
-                    } else {
-                        chatMsgView.bindOutgoingMessage(body, date, mMarkup, isScrolling());
-                    }
-                    break;
-
-                default:
-                    chatMsgView.bindPresenceMessage(contact, type, isGroupChat(), isScrolling());
-            }
-            if (!isScrolling()) {
-                mBgMaker.setBackground(chatMsgView, contact, type);
-            }
-
-            // if showTimeStamp is false for the latest message, then set a timer to query the
-            // cursor again in a minute, so we can update the last message timestamp if no new
-            // message is received
-            if (cursor.getPosition() == cursor.getCount()-1) {
-                if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-                    log("delta = " + delta + ", showTs=" + showTimeStamp);
-                }
-                if (!showTimeStamp) {
-                    scheduleRequery(SHOW_TIME_STAMP_INTERVAL);
-                } else {
-                    cancelRequery();
-                }
-            }
-        }
-
-        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,
-                int totalItemCount) {
-            // do nothing
-        }
-
-        public void onScrollStateChanged(AbsListView view, int scrollState) {
-            int oldState = mScrollState;
-            mScrollState = scrollState;
-
-            if (mChatSession != null) {
-                try {
-                    mChatSession.markAsRead();
-                } catch (RemoteException e) {
-                    mHandler.showServiceErrorAlert();
-                }
-            }
-
-            if (oldState == OnScrollListener.SCROLL_STATE_FLING) {
-                if (mNeedRequeryCursor) {
-                    requeryCursor();
-                } else {
-                    notifyDataSetChanged();
-                }
-            }
-        }
-
-        boolean isScrolling() {
-            return mScrollState == OnScrollListener.SCROLL_STATE_FLING;
-        }
-
-        void setNeedRequeryCursor(boolean requeryCursor) {
-            mNeedRequeryCursor = requeryCursor;
-        }
-    }
-}
diff --git a/src/com/android/im/app/ChooseAccountActivity.java b/src/com/android/im/app/ChooseAccountActivity.java
deleted file mode 100644 (file)
index b18b0b2..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.content.Intent;
-import android.provider.Im;
-
-public class ChooseAccountActivity extends Activity {
-    @Override
-    protected void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-
-        Intent intent = new Intent(Intent.ACTION_VIEW);
-        intent.setType(Im.Provider.CONTENT_TYPE);
-        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
-        startActivity(intent);
-
-        finish();
-    }
-}
\ No newline at end of file
diff --git a/src/com/android/im/app/ContactListActivity.java b/src/com/android/im/app/ContactListActivity.java
deleted file mode 100644 (file)
index cfb799d..0000000
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.app;
-
-import com.android.im.IImConnection;
-import com.android.im.R;
-import com.android.im.plugin.BrandingResourceIDs;
-import com.android.im.service.ImServiceConstants;
-
-import android.app.Activity;
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.Intent;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Message;
-import android.os.RemoteException;
-import android.provider.Im;
-import android.util.Log;
-import android.view.ContextMenu;
-import android.view.KeyEvent;
-import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.Window;
-import android.view.ContextMenu.ContextMenuInfo;
-import android.widget.AdapterView;
-import android.widget.AdapterView.AdapterContextMenuInfo;
-import android.widget.ExpandableListView.ExpandableListContextMenuInfo;
-
-import java.util.Observable;
-import java.util.Observer;
-
-public class ContactListActivity extends Activity implements View.OnCreateContextMenuListener{
-
-    private static final int MENU_START_CONVERSATION = Menu.FIRST;
-    private static final int MENU_VIEW_PROFILE       = Menu.FIRST + 1;
-    private static final int MENU_BLOCK_CONTACT      = Menu.FIRST + 2;
-    private static final int MENU_DELETE_CONTACT     = Menu.FIRST + 3;
-    private static final int MENU_END_CONVERSATION   = Menu.FIRST + 4;
-
-    private static final String FILTER_STATE_KEY = "Filtering";
-
-    ImApp mApp;
-
-    long mProviderId;
-    long mAccountId;
-    IImConnection mConn;
-    ContactListView mContactListView;
-    ContactListFilterView mFilterView;
-    SimpleAlertHandler mHandler;
-
-    ContextMenuHandler mContextMenuHandler;
-
-    boolean mIsFiltering;
-
-    Im.ProviderSettings.QueryMap mSettingMap;
-    boolean mDestroyed;
-
-    @Override
-    protected void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-
-        getWindow().requestFeature(Window.FEATURE_LEFT_ICON);
-
-        LayoutInflater inflate = getLayoutInflater();
-        mContactListView = (ContactListView) inflate.inflate(
-                R.layout.contact_list_view, null);
-
-        setContentView(mContactListView);
-
-        Intent intent = getIntent();
-        mAccountId = intent.getLongExtra(ImServiceConstants.EXTRA_INTENT_ACCOUNT_ID, -1);
-        if (mAccountId == -1) {
-            finish();
-            return;
-        }
-        mApp = ImApp.getApplication(this);
-
-        ContentResolver cr = getContentResolver();
-        Cursor c = cr.query(ContentUris.withAppendedId(Im.Account.CONTENT_URI, mAccountId),
-                null, null, null, null);
-        if (c == null) {
-            finish();
-            return;
-        }
-        if (!c.moveToFirst()) {
-            c.close();
-            finish();
-            return;
-        }
-
-        mProviderId = c.getLong(c.getColumnIndexOrThrow(Im.Account.PROVIDER));
-        mHandler = new MyHandler(this);
-        String username = c.getString(c.getColumnIndexOrThrow(Im.Account.USERNAME));
-
-        BrandingResources brandingRes = mApp.getBrandingResource(mProviderId);
-        setTitle(brandingRes.getString(
-                BrandingResourceIDs.STRING_BUDDY_LIST_TITLE, username));
-        getWindow().setFeatureDrawable(Window.FEATURE_LEFT_ICON,
-                brandingRes.getDrawable(BrandingResourceIDs.DRAWABLE_LOGO));
-
-        mSettingMap = new Im.ProviderSettings.QueryMap(
-                getContentResolver(), mProviderId, true, null);
-
-        mApp.callWhenServiceConnected(mHandler, new Runnable(){
-            public void run() {
-                if (!mDestroyed) {
-                    mApp.dismissNotifications(mProviderId);
-                    mConn = mApp.getConnection(mProviderId);
-                    if (mConn == null) {
-                        Log.e(ImApp.LOG_TAG, "The connection has disappeared!");
-                        clearConnectionStatus();
-                        finish();
-                    } else {
-                        mContactListView.setConnection(mConn);
-                        mContactListView.setHideOfflineContacts(
-                                mSettingMap.getHideOfflineContacts());
-                    }
-                }
-            }
-        });
-
-        mContextMenuHandler = new ContextMenuHandler();
-        mContactListView.getListView().setOnCreateContextMenuListener(this);
-
-        mSettingMap.addObserver(new Observer() {
-            public void update(Observable observed, Object updateData) {
-                if (!mDestroyed) {
-                    mContactListView.setHideOfflineContacts(
-                            mSettingMap.getHideOfflineContacts());
-                }
-            }
-        });
-    }
-
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        MenuInflater inflater = getMenuInflater();
-        inflater.inflate(R.menu.contact_list_menu, menu);
-
-        BrandingResources brandingRes = mApp.getBrandingResource(mProviderId);
-        menu.findItem(R.id.menu_invite_user).setTitle(
-            brandingRes.getString(BrandingResourceIDs.STRING_MENU_ADD_CONTACT));
-
-        return true;
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        switch (item.getItemId()) {
-            case R.id.menu_invite_user:
-                Intent i = new Intent(ContactListActivity.this, AddContactActivity.class);
-                i.putExtra(ImServiceConstants.EXTRA_INTENT_PROVIDER_ID, mProviderId);
-                i.putExtra(ImServiceConstants.EXTRA_INTENT_ACCOUNT_ID, mAccountId);
-                i.putExtra(ImServiceConstants.EXTRA_INTENT_LIST_NAME,
-                        mContactListView.getSelectedContactList());
-                startActivity(i);
-                return true;
-
-            case R.id.menu_blocked_contacts:
-                Uri.Builder builder = Im.BlockedList.CONTENT_URI.buildUpon();
-                ContentUris.appendId(builder, mProviderId);
-                ContentUris.appendId(builder, mAccountId);
-                startActivity(new Intent(Intent.ACTION_VIEW, builder.build()));
-                return true;
-
-            case R.id.menu_view_accounts:
-                Intent intent = new Intent(Intent.ACTION_VIEW);
-                intent.setType(Im.Provider.CONTENT_TYPE);
-                startActivity(intent);
-                finish();
-                return true;
-
-            case R.id.menu_settings:
-                intent = new Intent(this, SettingActivity.class);
-                intent.putExtra(ImServiceConstants.EXTRA_INTENT_PROVIDER_ID, mProviderId);
-                startActivity(intent);
-                return true;
-
-            case R.id.menu_sign_out:
-                try {
-                    if (mConn != null) {
-                        mConn.logout();
-                    }
-                } catch (RemoteException e) {
-                }
-                return true;
-        }
-        return super.onOptionsItemSelected(item);
-    }
-
-    @Override
-    protected void onSaveInstanceState(Bundle outState) {
-        super.onSaveInstanceState(outState);
-        outState.putBoolean(FILTER_STATE_KEY, mIsFiltering);
-
-    }
-
-    @Override
-    protected void onRestoreInstanceState(Bundle savedInstanceState) {
-        boolean isFiltering = savedInstanceState.getBoolean(FILTER_STATE_KEY);
-        if (isFiltering) {
-            showFilterView();
-        }
-        super.onRestoreInstanceState(savedInstanceState);
-    }
-
-    @Override
-    public boolean dispatchKeyEvent(KeyEvent event) {
-        int keyCode = event.getKeyCode();
-
-        boolean handled = false;
-        if (mIsFiltering) {
-            handled = mFilterView.dispatchKeyEvent(event);
-            if (!handled && (KeyEvent.KEYCODE_BACK == keyCode)
-                    && (KeyEvent.ACTION_DOWN == event.getAction())) {
-                showContactListView();
-                handled = true;
-            }
-        } else {
-            handled = mContactListView.dispatchKeyEvent(event);
-            if (!handled && isReadable(keyCode, event)
-                    && (KeyEvent.ACTION_DOWN == event.getAction())) {
-                showFilterView();
-                handled = mFilterView.dispatchKeyEvent(event);
-            }
-        }
-
-        if (!handled) {
-            handled = super.dispatchKeyEvent(event);
-        }
-
-        return handled;
-    }
-
-    private static boolean isReadable(int keyCode, KeyEvent event) {
-        if (KeyEvent.isModifierKey(keyCode) || event.isSystem()) {
-            return false;
-        }
-
-        switch (keyCode) {
-        case KeyEvent.KEYCODE_DPAD_CENTER:
-        case KeyEvent.KEYCODE_DPAD_DOWN:
-        case KeyEvent.KEYCODE_DPAD_LEFT:
-        case KeyEvent.KEYCODE_DPAD_RIGHT:
-        case KeyEvent.KEYCODE_DPAD_UP:
-        case KeyEvent.KEYCODE_ENTER:
-            return false;
-        }
-
-        return true;
-    }
-
-    private void showFilterView() {
-        if (mFilterView == null ) {
-            mFilterView = (ContactListFilterView)getLayoutInflater().inflate(
-                    R.layout.contact_list_filter_view, null);
-            mFilterView.getListView().setOnCreateContextMenuListener(this);
-        }
-        Uri uri = mSettingMap.getHideOfflineContacts() ? Im.Contacts.CONTENT_URI_ONLINE_CONTACTS_BY
-                : Im.Contacts.CONTENT_URI_CONTACTS_BY;
-        uri = ContentUris.withAppendedId(uri, mProviderId);
-        uri = ContentUris.withAppendedId(uri, mAccountId);
-        mFilterView.doFilter(uri, null);
-
-        setContentView(mFilterView);
-        mFilterView.requestFocus();
-        mIsFiltering = true;
-    }
-
-    void showContactListView() {
-        if (mIsFiltering) {
-            setContentView(mContactListView);
-            mContactListView.requestFocus();
-            mContactListView.invalidate();
-            mIsFiltering = false;
-        }
-    }
-
-    @Override
-    protected void onPause() {
-        super.onPause();
-        mApp.unregisterForConnEvents(mHandler);
-    }
-
-    @Override
-    protected void onResume() {
-        super.onResume();
-        mApp.registerForConnEvents(mHandler);
-    }
-
-    @Override
-    protected void onDestroy() {
-        mDestroyed = true;
-        // set connection to null to unregister listeners.
-        mContactListView.setConnection(null);
-        if (mSettingMap != null) {
-            mSettingMap.close();
-        }
-        super.onDestroy();
-    }
-
-    static void log(String msg) {
-        Log.d(ImApp.LOG_TAG, "<ContactListActivity> " +msg);
-    }
-
-    @Override
-    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
-        boolean chatSelected = false;
-        boolean contactSelected = false;
-        Cursor contactCursor;
-        if (mIsFiltering) {
-            AdapterView.AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
-            mContextMenuHandler.mPosition = info.position;
-            contactSelected = true;
-            contactCursor = mFilterView.getContactAtPosition(info.position);
-        } else {
-            ExpandableListContextMenuInfo info = (ExpandableListContextMenuInfo) menuInfo;
-            mContextMenuHandler.mPosition = info.packedPosition;
-            contactSelected = mContactListView.isContactAtPosition(info.packedPosition);
-            chatSelected = mContactListView.isConversationAtPosition(info.packedPosition);
-            contactCursor = mContactListView.getContactAtPosition(info.packedPosition);
-        }
-
-        boolean allowBlock = true;
-        if (contactCursor != null) {
-            //XXX HACK: Yahoo! doesn't allow to block a friend. We can only block a temporary contact.
-            ProviderDef provider = mApp.getProvider(mProviderId);
-            if (Im.ProviderNames.YAHOO.equals(provider.mName)) {
-                int type = contactCursor.getInt(contactCursor.getColumnIndexOrThrow(Im.Contacts.TYPE));
-                allowBlock = (type == Im.Contacts.TYPE_TEMPORARY);
-            }
-
-            int nickNameIndex = contactCursor.getColumnIndexOrThrow(Im.Contacts.NICKNAME);
-
-            menu.setHeaderTitle(contactCursor.getString(nickNameIndex));
-        }
-
-        BrandingResources brandingRes = mApp.getBrandingResource(mProviderId);
-        String menu_end_conversation = brandingRes.getString(
-                BrandingResourceIDs.STRING_MENU_END_CHAT);
-        String menu_view_profile = brandingRes.getString(
-                BrandingResourceIDs.STRING_MENU_VIEW_PROFILE);
-        String menu_block_contact = brandingRes.getString(
-                BrandingResourceIDs.STRING_MENU_BLOCK_CONTACT);
-        String menu_start_conversation = brandingRes.getString(
-                BrandingResourceIDs.STRING_MENU_START_CHAT);
-        String menu_delete_contact = brandingRes.getString(
-                BrandingResourceIDs.STRING_MENU_DELETE_CONTACT);
-
-        if (chatSelected) {
-            menu.add(0, MENU_END_CONVERSATION, 0, menu_end_conversation)
-                    .setIcon(com.android.internal.R.drawable.ic_menu_end_conversation)
-                    .setOnMenuItemClickListener(mContextMenuHandler);
-            menu.add(0, MENU_VIEW_PROFILE, 0, menu_view_profile)
-                    .setIcon(R.drawable.ic_menu_my_profile)
-                    .setOnMenuItemClickListener(mContextMenuHandler);
-            if (allowBlock) {
-                menu.add(0, MENU_BLOCK_CONTACT, 0, menu_block_contact)
-                        .setIcon(com.android.internal.R.drawable.ic_menu_block)
-                        .setOnMenuItemClickListener(mContextMenuHandler);
-            }
-        } else if (contactSelected) {
-            menu.add(0, MENU_START_CONVERSATION, 0, menu_start_conversation)
-                    .setIcon(com.android.internal.R.drawable.ic_menu_start_conversation)
-                    .setOnMenuItemClickListener(mContextMenuHandler);
-            menu.add(0, MENU_VIEW_PROFILE, 0, menu_view_profile)
-                    .setIcon(R.drawable.ic_menu_view_profile)
-                    .setOnMenuItemClickListener(mContextMenuHandler);
-            if (allowBlock) {
-                menu.add(0, MENU_BLOCK_CONTACT, 0, menu_block_contact)
-                        .setIcon(com.android.internal.R.drawable.ic_menu_block)
-                        .setOnMenuItemClickListener(mContextMenuHandler);
-            }
-            menu.add(0, MENU_DELETE_CONTACT, 0, menu_delete_contact)
-                    .setIcon(android.R.drawable.ic_menu_delete)
-                    .setOnMenuItemClickListener(mContextMenuHandler);
-        }
-    }
-
-    void clearConnectionStatus() {
-        ContentResolver cr = getContentResolver();
-        ContentValues values = new ContentValues(3);
-
-        values.put(Im.AccountStatus.ACCOUNT, mAccountId);
-        values.put(Im.AccountStatus.PRESENCE_STATUS, Im.Presence.OFFLINE);
-        values.put(Im.AccountStatus.CONNECTION_STATUS, Im.ConnectionStatus.OFFLINE);
-        // insert on the "account_status" uri actually replaces the existing value 
-        cr.insert(Im.AccountStatus.CONTENT_URI, values);
-    }
-
-    final class ContextMenuHandler implements MenuItem.OnMenuItemClickListener {
-        long mPosition;
-
-        public boolean onMenuItemClick(MenuItem item) {
-            Cursor c;
-            if (mIsFiltering) {
-                c = mFilterView.getContactAtPosition((int)mPosition);
-            } else {
-                c = mContactListView.getContactAtPosition(mPosition);
-            }
-
-            switch (item.getItemId()) {
-            case MENU_START_CONVERSATION:
-                mContactListView.startChat(c);
-                break;
-            case MENU_VIEW_PROFILE:
-                mContactListView.viewContactPresence(c);
-                break;
-            case MENU_BLOCK_CONTACT:
-                mContactListView.blockContact(c);
-                break;
-            case MENU_DELETE_CONTACT:
-                mContactListView.removeContact(c);
-                break;
-            case MENU_END_CONVERSATION:
-                mContactListView.endChat(c);
-                break;
-            default:
-                return false;
-            }
-
-            if (mIsFiltering) {
-                showContactListView();
-            }
-            return true;
-        }
-    }
-
-    final class MyHandler extends SimpleAlertHandler {
-        public MyHandler(Activity activity) {
-            super(activity);
-        }
-
-        @Override
-        public void handleMessage(Message msg) {
-            if (msg.what == ImApp.EVENT_CONNECTION_DISCONNECTED) {
-                if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
-                    log("Handle event connection disconnected.");
-                }
-                promptDisconnectedEvent(msg);
-                long providerId = ((long)msg.arg1 << 32) | msg.arg2;
-                if (providerId == mProviderId) {
-                    if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
-                        log("Current connection disconnected, finish");
-                    }
-                    finish();
-                }
-                return;
-            }
-            super.handleMessage(msg);
-        }
-    }
-}
diff --git a/src/com/android/im/app/ContactListFilterView.java b/src/com/android/im/app/ContactListFilterView.java
deleted file mode 100644 (file)
index 5607cde..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import android.content.Context;
-import android.database.Cursor;
-import android.database.DatabaseUtils;
-import android.net.Uri;
-import android.provider.Im;
-import android.util.AttributeSet;
-import android.view.View;
-import android.widget.AdapterView;
-import android.widget.Filter;
-import android.widget.LinearLayout;
-import android.widget.ListView;
-import android.widget.ResourceCursorAdapter;
-import android.widget.AdapterView.OnItemClickListener;
-
-import com.android.im.R;
-
-public class ContactListFilterView extends LinearLayout {
-
-    private ListView mContactListView;
-    private Filter mFilter;
-    private ContactAdapter mContactAdapter;
-
-    private Uri mUri;
-
-    public ContactListFilterView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    @Override
-    protected void onFinishInflate() {
-
-        mContactListView = (ListView) findViewById(R.id.filteredList);
-        mContactListView.setTextFilterEnabled(true);
-
-        mContactListView.setOnItemClickListener(new OnItemClickListener() {
-            public void onItemClick(AdapterView parent, View view, int position,
-                    long id) {
-                if (mContext instanceof ContactListActivity) {
-                    ContactListActivity list = (ContactListActivity) mContext;
-                    mContactListView.setSelection(position);
-                    Cursor c = (Cursor) mContactListView.getSelectedItem();
-                    list.mContactListView.startChat(c);
-                    list.showContactListView();
-                }
-            }
-        });
-    }
-
-    public ListView getListView() {
-        return mContactListView;
-    }
-
-    public Cursor getContactAtPosition(int position) {
-        return (Cursor) mContactAdapter.getItem(position);
-    }
-
-    public void doFilter(Uri uri, String filterString) {
-        if (!uri.equals(mUri)) {
-            mUri = uri;
-
-            Cursor contactCursor = runQuery(filterString);
-
-            if (mContactAdapter == null) {
-                mContactAdapter = new ContactAdapter(mContext, contactCursor);
-                mFilter = mContactAdapter.getFilter();
-                mContactListView.setAdapter(mContactAdapter);
-            } else {
-                mContactAdapter.changeCursor(contactCursor);
-            }
-        } else {
-            mFilter.filter(filterString);
-        }
-    }
-
-    Cursor runQuery(CharSequence constraint) {
-        StringBuilder buf = new StringBuilder();
-
-        // exclude chatting contact
-        buf.append(Im.Chats.LAST_MESSAGE_DATE);
-        buf.append(" IS NULL");
-
-        if (constraint != null) {
-            buf.append(" AND ");
-            buf.append(Im.Contacts.NICKNAME);
-            buf.append(" LIKE ");
-            DatabaseUtils.appendValueToSql(buf, "%" + constraint + "%");
-        }
-
-        return mContext.getContentResolver().query(mUri, ContactView.CONTACT_PROJECTION,
-                buf == null ? null : buf.toString(), null, Im.Contacts.DEFAULT_SORT_ORDER);
-    }
-
-    private class ContactAdapter extends ResourceCursorAdapter {
-        private String mSearchString;
-
-        public ContactAdapter(Context context, Cursor cursor) {
-            super(context, R.layout.contact_view, cursor);
-        }
-
-        @Override
-        public void bindView(View view, Context context, Cursor cursor) {
-            ContactView v = (ContactView) view;
-            v.setPadding(0, 0, 0, 0);
-            v.bind(cursor, mSearchString, false);
-        }
-
-        @Override
-        public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
-            if (constraint != null) {
-                mSearchString = constraint.toString();
-            }
-            return ContactListFilterView.this.runQuery(constraint);
-        }
-    }
-
-}
diff --git a/src/com/android/im/app/ContactListTreeAdapter.java b/src/com/android/im/app/ContactListTreeAdapter.java
deleted file mode 100644 (file)
index be8b2d9..0000000
+++ /dev/null
@@ -1,743 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.app;
-
-import android.app.Activity;
-import android.content.AsyncQueryHandler;
-import android.content.ContentQueryMap;
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.Context;
-import android.content.res.Resources;
-import android.database.ContentObserver;
-import android.database.Cursor;
-import android.database.DataSetObserver;
-import android.net.Uri;
-import android.os.RemoteException;
-import android.provider.Im;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.BaseExpandableListAdapter;
-import android.widget.CursorTreeAdapter;
-import android.widget.TextView;
-import android.widget.AbsListView;
-import android.widget.AbsListView.OnScrollListener;
-
-import com.android.im.IImConnection;
-import com.android.im.R;
-import com.android.im.plugin.BrandingResourceIDs;
-
-import java.util.ArrayList;
-import java.util.Observable;
-import java.util.Observer;
-
-public class ContactListTreeAdapter extends BaseExpandableListAdapter
-        implements AbsListView.OnScrollListener{
-
-    private static final String[] CONTACT_LIST_PROJECTION = {
-            Im.ContactList._ID,
-            Im.ContactList.NAME,
-    };
-
-    private static final int COLUMN_CONTACT_LIST_ID = 0;
-    private static final int COLUMN_CONTACT_LIST_NAME = 1;
-
-    Activity mActivity;
-    SimpleAlertHandler mHandler;
-    private LayoutInflater mInflate;
-    private long mProviderId;
-    long mAccountId;
-    Cursor mOngoingConversations;
-    Cursor mSubscriptions;
-    boolean mDataValid;
-    ListTreeAdapter mAdapter;
-    private boolean mHideOfflineContacts;
-
-    final MyContentObserver mContentObserver;
-    final MyDataSetObserver mDataSetObserver;
-
-    private ArrayList<Integer> mExpandedGroups;
-
-    private static final int TOKEN_CONTACT_LISTS = -1;
-    private static final int TOKEN_ONGOING_CONVERSATION = -2;
-    private static final int TOKEN_SUBSCRITPTION = -3;
-
-    private static final String NON_CHAT_AND_BLOCKED_CONTACTS = "("
-        + Im.Contacts.LAST_MESSAGE_DATE + " IS NULL) AND ("
-        + Im.Contacts.TYPE + "!=" + Im.Contacts.TYPE_BLOCKED + ")";
-
-    private static final String CONTACTS_SELECTION = Im.Contacts.CONTACTLIST
-            + "=? AND " + NON_CHAT_AND_BLOCKED_CONTACTS;
-
-    private static final String ONLINE_CONTACT_SELECTION = CONTACTS_SELECTION
-            + " AND "+ Im.Contacts.PRESENCE_STATUS + " != " + Im.Presence.OFFLINE;
-
-    static final void log(String msg) {
-        Log.d(ImApp.LOG_TAG, "<ContactListAdapter>" + msg);
-    }
-
-    static final String[] CONTACT_COUNT_PROJECTION = {
-        Im.Contacts.CONTACTLIST,
-        Im.Contacts._COUNT,
-    };
-
-    ContentQueryMap mOnlineContactsCountMap;
-
-    // Async QueryHandler
-    private final class QueryHandler extends AsyncQueryHandler {
-        public QueryHandler(Context context) {
-            super(context.getContentResolver());
-        }
-
-        @Override
-        protected void onQueryComplete(int token, Object cookie, Cursor c) {
-            if(Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-                log("onQueryComplete:token=" + token);
-            }
-
-            if (token == TOKEN_CONTACT_LISTS) {
-                mDataValid = true;
-                mAdapter.setGroupCursor(c);
-            } else if (token == TOKEN_ONGOING_CONVERSATION) {
-                setOngoingConversations(c);
-                notifyDataSetChanged();
-            } else if (token == TOKEN_SUBSCRITPTION) {
-                setSubscriptions(c);
-                notifyDataSetChanged();
-            } else {
-                int count = mAdapter.getGroupCount();
-                for (int pos = 0; pos < count; pos++) {
-                    long listId = mAdapter.getGroupId(pos);
-                    if (listId == token) {
-                        mAdapter.setChildrenCursor(pos, c);
-                        break;
-                    }
-                }
-            }
-        }
-    }
-    private QueryHandler mQueryHandler;
-
-    private int mScrollState;
-
-    private boolean mAutoRequery;
-    private boolean mRequeryPending;
-
-    public ContactListTreeAdapter(IImConnection conn, Activity activity) {
-        mActivity = activity;
-        mInflate = activity.getLayoutInflater();
-        mHandler = new SimpleAlertHandler(activity);
-
-        mAdapter = new ListTreeAdapter(null);
-
-        mContentObserver = new MyContentObserver();
-        mDataSetObserver = new MyDataSetObserver();
-        mExpandedGroups = new ArrayList<Integer>();
-        mQueryHandler = new QueryHandler(activity);
-
-        changeConnection(conn);
-    }
-
-    public void changeConnection(IImConnection conn) {
-        mQueryHandler.cancelOperation(TOKEN_ONGOING_CONVERSATION);
-        mQueryHandler.cancelOperation(TOKEN_SUBSCRITPTION);
-        mQueryHandler.cancelOperation(TOKEN_CONTACT_LISTS);
-
-        synchronized (this) {
-            if (mOngoingConversations != null) {
-                mOngoingConversations.close();
-                mOngoingConversations = null;
-            }
-            if (mSubscriptions != null) {
-                mSubscriptions.close();
-                mSubscriptions = null;
-            }
-            if (mOnlineContactsCountMap != null) {
-                mOnlineContactsCountMap.close();
-            }
-        }
-
-        mAdapter.notifyDataSetChanged();
-        if (conn != null) {
-            try {
-                mProviderId = conn.getProviderId();
-                mAccountId = conn.getAccountId();
-                startQueryOngoingConversations();
-                startQueryContactLists();
-                startQuerySubscriptions();
-            } catch (RemoteException e) {
-                // Service died!
-            }
-        }
-    }
-
-    public void setHideOfflineContacts(boolean hide) {
-        if (mHideOfflineContacts != hide) {
-            mHideOfflineContacts = hide;
-            mAdapter.notifyDataSetChanged();
-        }
-    }
-
-    public void startAutoRequery() {
-        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-            log("startAutoRequery()");
-        }
-        mAutoRequery = true;
-        if (mRequeryPending) {
-            mRequeryPending = false;
-            startQueryOngoingConversations();
-        }
-    }
-
-    private void startQueryContactLists() {
-        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-            log("startQueryContactLists()");
-        }
-
-        Uri uri = Im.ContactList.CONTENT_URI;
-        uri = ContentUris.withAppendedId(uri, mProviderId);
-        uri = ContentUris.withAppendedId(uri, mAccountId);
-
-        mQueryHandler.startQuery(TOKEN_CONTACT_LISTS, null, uri, CONTACT_LIST_PROJECTION,
-                null, null, Im.ContactList.DEFAULT_SORT_ORDER);
-    }
-
-    void startQueryOngoingConversations() {
-        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-            log("startQueryOngoingConversations()");
-        }
-
-        Uri uri = Im.Contacts.CONTENT_URI_CHAT_CONTACTS_BY;
-        uri = ContentUris.withAppendedId(uri, mProviderId);
-        uri = ContentUris.withAppendedId(uri, mAccountId);
-
-        mQueryHandler.startQuery(TOKEN_ONGOING_CONVERSATION, null, uri,
-                ContactView.CONTACT_PROJECTION, null, null, Im.Contacts.DEFAULT_SORT_ORDER);
-    }
-
-    void startQuerySubscriptions() {
-        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-            log("startQuerySubscriptions()");
-        }
-
-        Uri uri = Im.Contacts.CONTENT_URI_CONTACTS_BY;
-        uri = ContentUris.withAppendedId(uri, mProviderId);
-        uri = ContentUris.withAppendedId(uri, mAccountId);
-
-        mQueryHandler.startQuery(TOKEN_SUBSCRITPTION, null, uri,
-                ContactView.CONTACT_PROJECTION,
-                String.format("%s=%d AND %s=%d",
-                    Im.Contacts.SUBSCRIPTION_STATUS, Im.Contacts.SUBSCRIPTION_STATUS_SUBSCRIBE_PENDING,
-                    Im.Contacts.SUBSCRIPTION_TYPE, Im.Contacts.SUBSCRIPTION_TYPE_FROM),
-                null,Im.Contacts.DEFAULT_SORT_ORDER);
-    }
-
-    void startQueryContacts(long listId) {
-        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-            log("startQueryContacts - listId=" + listId);
-        }
-
-        String selection = mHideOfflineContacts ? ONLINE_CONTACT_SELECTION : CONTACTS_SELECTION;
-        String[] args = { Long.toString(listId) };
-        int token = (int)listId;
-        mQueryHandler.startQuery(token, null, Im.Contacts.CONTENT_URI,
-                ContactView.CONTACT_PROJECTION, selection, args, Im.Contacts.DEFAULT_SORT_ORDER);
-    }
-
-    public Object getChild(int groupPosition, int childPosition) {
-        if (isPosForOngoingConversation(groupPosition)) {
-            // No cursor exists for the "Empty" TextView item
-            if (getOngoingConversationCount() == 0) return null;
-            return moveTo(getOngoingConversations(), childPosition);
-        } else if (isPosForSubscription(groupPosition)) {
-            return moveTo(getSubscriptions(), childPosition);
-        } else {
-            return mAdapter.getChild(getChildAdapterPosition(groupPosition), childPosition);
-        }
-    }
-
-    public long getChildId(int groupPosition, int childPosition) {
-        if (isPosForOngoingConversation(groupPosition)) {
-            // No cursor id exists for the "Empty" TextView item
-            if (getOngoingConversationCount() == 0) return 0;
-            return getId(getOngoingConversations(), childPosition);
-        } else if (isPosForSubscription(groupPosition)) {
-            return getId(getSubscriptions(), childPosition);
-        } else {
-            return mAdapter.getChildId(getChildAdapterPosition(groupPosition), childPosition);
-        }
-    }
-
-    public View getChildView(int groupPosition, int childPosition, boolean isLastChild,
-            View convertView, ViewGroup parent) {
-        boolean isOngoingConversation = isPosForOngoingConversation(groupPosition);
-        boolean displayEmpty = isOngoingConversation && (getOngoingConversationCount() == 0);
-        if (isOngoingConversation || isPosForSubscription(groupPosition)) {
-            View view = null;
-            if (convertView != null) {
-                // use the convert view if it matches the type required by displayEmpty
-                if (displayEmpty && (convertView instanceof TextView)) {
-                    view = convertView;
-                    ((TextView) view).setText(mActivity.getText(R.string.empty_conversation_group));
-                } else if (!displayEmpty && (convertView instanceof ContactView)) {
-                     view = convertView;
-                }
-            }
-            if (view == null) {
-                if (displayEmpty) {
-                    view = newEmptyView(parent);
-                } else {
-                    view = newChildView(parent);
-                }
-            }
-            if (!displayEmpty) {
-                Cursor cursor = isPosForOngoingConversation(groupPosition)
-                        ? getOngoingConversations() : getSubscriptions();
-                cursor.moveToPosition(childPosition);
-                ((ContactView) view).bind(cursor, null, isScrolling());
-            }
-            return view;
-        } else {
-            return mAdapter.getChildView(getChildAdapterPosition(groupPosition), childPosition,
-                    isLastChild, convertView, parent);
-        }
-    }
-
-    public int getChildrenCount(int groupPosition) {
-        if (!mDataValid) {
-            return 0;
-        }
-        if (isPosForOngoingConversation(groupPosition)) {
-            // if there are no ongoing conversations, we want to display "empty" textview
-            int count = getOngoingConversationCount();
-            if (count == 0) {
-                count = 1;
-            }
-            return count;
-        } else if (isPosForSubscription(groupPosition)) {
-            return getSubscriptionCount();
-        } else {
-            // XXX getChildrenCount() may be called with an invalid groupPosition that is larger
-            // than the total number of all groups.
-            int position = getChildAdapterPosition(groupPosition);
-            if (position >= mAdapter.getGroupCount()) {
-                Log.w(ImApp.LOG_TAG, "getChildrenCount out of range");
-                return 0;
-            }
-            return mAdapter.getChildrenCount(position);
-        }
-    }
-
-    public Object getGroup(int groupPosition) {
-        if (isPosForOngoingConversation(groupPosition)
-                || isPosForSubscription(groupPosition)) {
-            return null;
-        } else {
-            return mAdapter.getGroup(getChildAdapterPosition(groupPosition));
-        }
-    }
-
-    public int getGroupCount() {
-        if (!mDataValid) {
-            return 0;
-        }
-        int count = mAdapter.getGroupCount();
-
-        // ongoing conversations
-        count++;
-
-        if (getSubscriptionCount() > 0) {
-            count++;
-        }
-
-        return count;
-    }
-
-    public long getGroupId(int groupPosition) {
-        if (isPosForOngoingConversation(groupPosition) || isPosForSubscription(groupPosition)) {
-            return 0;
-        } else {
-            return mAdapter.getGroupId(getChildAdapterPosition(groupPosition));
-        }
-    }
-
-    public View getGroupView(int groupPosition, boolean isExpanded, View convertView,
-            ViewGroup parent) {
-        if (isPosForOngoingConversation(groupPosition) || isPosForSubscription(groupPosition)) {
-            View v;
-            if (convertView != null) {
-                v = convertView;
-            } else {
-                v = newGroupView(parent);
-            }
-
-            TextView text1 = (TextView)v.findViewById(R.id.text1);
-            TextView text2 = (TextView)v.findViewById(R.id.text2);
-
-            Resources r = v.getResources();
-            ImApp app = ImApp.getApplication(mActivity);
-            BrandingResources brandingRes = app.getBrandingResource(mProviderId);
-            String text = isPosForOngoingConversation(groupPosition) ?
-                    brandingRes.getString(
-                            BrandingResourceIDs.STRING_ONGOING_CONVERSATION,
-                            getOngoingConversationCount()) :
-                    r.getString(R.string.subscriptions);
-            text1.setText(text);
-            text2.setVisibility(View.GONE);
-            return v;
-        } else {
-            return mAdapter.getGroupView(getChildAdapterPosition(groupPosition), isExpanded,
-                    convertView, parent);
-        }
-    }
-
-    public boolean isChildSelectable(int groupPosition, int childPosition) {
-        if (isPosForOngoingConversation(groupPosition)) {
-            // "Empty" TextView is not selectable
-            if (getOngoingConversationCount()==0) return false;
-            return true;
-        }
-        if (isPosForSubscription(groupPosition)) return true;
-        return mAdapter.isChildSelectable(getChildAdapterPosition(groupPosition), childPosition);
-    }
-
-    public boolean stableIds() {
-        return true;
-    }
-
-    @Override
-    public void registerDataSetObserver(DataSetObserver observer) {
-        mAdapter.registerDataSetObserver(observer);
-        super.registerDataSetObserver(observer);
-    }
-
-    @Override
-    public void unregisterDataSetObserver(DataSetObserver observer) {
-        mAdapter.unregisterDataSetObserver(observer);
-        super.unregisterDataSetObserver(observer);
-    }
-
-    public boolean hasStableIds() {
-        return true;
-    }
-
-    @Override
-    public void onGroupCollapsed(int groupPosition) {
-        super.onGroupCollapsed(groupPosition);
-        mExpandedGroups.remove(Integer.valueOf(groupPosition));
-        int pos = getChildAdapterPosition(groupPosition);
-        if (pos >= 0) {
-            mAdapter.onGroupCollapsed(pos);
-        }
-    }
-
-    @Override
-    public void onGroupExpanded(int groupPosition) {
-        super.onGroupExpanded(groupPosition);
-        mExpandedGroups.add(groupPosition);
-        int pos = getChildAdapterPosition(groupPosition);
-        if (pos >= 0) {
-            mAdapter.onGroupExpanded(pos);
-        }
-    }
-
-    public int[] getExpandedGroups() {
-        ArrayList<Integer> expandedGroups = mExpandedGroups;
-        int size = expandedGroups.size();
-        int[] res = new int[size];
-        for (int i = 0; i < size; i++) {
-            res[i] = expandedGroups.get(i);
-        }
-        return res;
-    }
-
-    View newChildView(ViewGroup parent) {
-        return mInflate.inflate(R.layout.contact_view, parent, false);
-    }
-
-    View newEmptyView(ViewGroup parent) {
-        return mInflate.inflate(R.layout.empty_conversation_group_view, parent, false);
-    }
-
-    View newGroupView(ViewGroup parent) {
-        return mInflate.inflate(R.layout.group_view, parent, false);
-    }
-
-    private synchronized Cursor getOngoingConversations() {
-        if (mOngoingConversations == null) {
-            startQueryOngoingConversations();
-        }
-        return mOngoingConversations;
-    }
-
-    synchronized void setOngoingConversations(Cursor c) {
-        if (mOngoingConversations != null) {
-            mOngoingConversations.unregisterContentObserver(mContentObserver);
-            mOngoingConversations.unregisterDataSetObserver(mDataSetObserver);
-            mOngoingConversations.close();
-        }
-        c.registerContentObserver(mContentObserver);
-        c.registerDataSetObserver(mDataSetObserver);
-        mOngoingConversations = c;
-    }
-
-    private int getOngoingConversationCount() {
-        Cursor c = getOngoingConversations();
-        return c == null ? 0 : c.getCount();
-    }
-
-    private synchronized Cursor getSubscriptions() {
-        if (mSubscriptions == null) {
-            startQuerySubscriptions();
-        }
-        return mSubscriptions;
-    }
-
-    synchronized void setSubscriptions(Cursor c) {
-        if (mSubscriptions != null) {
-            mSubscriptions.close();
-        }
-        // we don't need to register observers on mSubscriptions because
-        // we already have observers on mOngoingConversations and they
-        // will be notified if there is any changes of subscription
-        // since the two cursors come from the same table.
-        mSubscriptions = c;
-    }
-
-    private int getSubscriptionCount() {
-        Cursor c = getSubscriptions();
-        return c == null ? 0 : c.getCount();
-    }
-
-    public boolean isPosForOngoingConversation(int groupPosition) {
-        return groupPosition == 0;
-    }
-
-    public boolean isPosForSubscription(int groupPosition) {
-        return groupPosition == 1 && getSubscriptionCount() > 0;
-    }
-
-    private int getChildAdapterPosition(int groupPosition) {
-        if (getSubscriptionCount() > 0) {
-            return groupPosition - 2;
-        } else {
-            return groupPosition - 1;
-        }
-    }
-
-    private Cursor moveTo(Cursor cursor, int position) {
-        if (cursor.moveToPosition(position)) {
-            return cursor;
-        }
-        return null;
-    }
-
-    private long getId(Cursor cursor, int position) {
-        if (cursor.moveToPosition(position)) {
-            return cursor.getLong(ContactView.COLUMN_CONTACT_ID);
-        }
-        return 0;
-    }
-
-    class ListTreeAdapter extends CursorTreeAdapter {
-
-        public ListTreeAdapter(Cursor cursor) {
-            super(cursor, mActivity);
-        }
-
-        @Override
-        protected void bindChildView(View view, Context context, Cursor cursor,
-                boolean isLastChild) {
-            // binding when child is text view for an empty group
-            if (view instanceof TextView) {
-                ((TextView) view).setText(mActivity.getText(R.string.empty_contact_group));
-            } else {
-                ((ContactView) view).bind(cursor, null, isScrolling());
-            }
-        }
-
-        @Override
-        protected void bindGroupView(View view, Context context, Cursor cursor,
-                boolean isExpanded) {
-            TextView text1 = (TextView)view.findViewById(R.id.text1);
-            TextView text2 = (TextView)view.findViewById(R.id.text2);
-            Resources r = view.getResources();
-
-            text1.setText(cursor.getString(COLUMN_CONTACT_LIST_NAME));
-            text2.setVisibility(View.VISIBLE);
-            text2.setText(r.getString(R.string.online_count, getOnlineChildCount(cursor)));
-        }
-
-        View newEmptyView(ViewGroup parent) {
-            return mInflate.inflate(R.layout.empty_contact_group_view, parent, false);
-        }
-
-        // if the group is empty, provide a text view. The infrastructure provides a "convertView"
-        // as a possible suggestion to reuse an existing view's data. It may be null, it may be a
-        // TextView, or it may be a ContactView, so we need to test the possible cases.
-        @Override
-        public View getChildView(int groupPosition, int childPosition, boolean isLastChild,
-                View convertView, ViewGroup parent) {
-            // Provide a TextView if the group is empty
-            if (super.getChildrenCount(groupPosition)==0) {
-                if (convertView != null) {
-                    if (convertView instanceof TextView) {
-                        ((TextView) convertView).setText(
-                                mActivity.getText(R.string.empty_contact_group));
-                        return convertView;
-                    }
-                }
-                return newEmptyView(parent);
-            }
-            if ( !(convertView instanceof ContactView) ) {
-                convertView = null;
-            }
-            return super.getChildView(groupPosition, childPosition, isLastChild, convertView,
-                    parent);
-        }
-
-        @Override
-        protected Cursor getChildrenCursor(Cursor groupCursor) {
-            long listId = groupCursor.getLong(COLUMN_CONTACT_LIST_ID);
-            startQueryContacts(listId);
-            return null;
-        }
-
-        // return a TextView for empty groups
-        @Override
-        protected View newChildView(Context context, Cursor cursor, boolean isLastChild,
-                ViewGroup parent) {
-            if (cursor.getCount() == 0) {
-                return newEmptyView(parent);
-            } else {
-                return ContactListTreeAdapter.this.newChildView(parent);
-            }
-        }
-
-        @Override
-        protected View newGroupView(Context context, Cursor cursor, boolean isExpanded,
-                ViewGroup parent) {
-            return ContactListTreeAdapter.this.newGroupView(parent);
-        }
-
-        private int getOnlineChildCount(Cursor groupCursor) {
-            long listId = groupCursor.getLong(COLUMN_CONTACT_LIST_ID);
-            if (mOnlineContactsCountMap == null) {
-                String where = Im.Contacts.ACCOUNT + "=" + mAccountId;
-                ContentResolver cr = mActivity.getContentResolver();
-
-                Cursor c = cr.query(Im.Contacts.CONTENT_URI_ONLINE_COUNT,
-                        CONTACT_COUNT_PROJECTION, where, null, null);
-                mOnlineContactsCountMap = new ContentQueryMap(c,
-                        Im.Contacts.CONTACTLIST, true, mHandler);
-                mOnlineContactsCountMap.addObserver(new Observer(){
-                    public void update(Observable observable, Object data) {
-                        notifyDataSetChanged();
-                    }});
-            }
-            ContentValues value = mOnlineContactsCountMap.getValues(String.valueOf(listId));
-            return  value == null ? 0 : value.getAsInteger(Im.Contacts._COUNT);
-        }
-
-        @Override
-        public int getChildrenCount(int groupPosition) {
-            int children = super.getChildrenCount(groupPosition);
-            if (children == 0) {
-                // Count the empty group text item as a child
-                return 1;
-            }
-            return children;
-        }
-
-        // Don't allow the empty group text item to be selected
-        @Override
-        public boolean isChildSelectable(int groupPosition, int childPosition) {
-            return (super.getChildrenCount(groupPosition) > 0);
-        }
-    }
-
-    private class MyContentObserver extends ContentObserver {
-
-        public MyContentObserver() {
-            super(mHandler);
-        }
-
-        @Override
-        public void onChange(boolean selfChange) {
-            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-                log("MyContentObserver.onChange() autoRequery=" + mAutoRequery);
-            }
-            // Don't requery when fling. We will schedule a requery when the fling is complete.
-            if (isScrolling()) {
-                return;
-            }
-            if (mAutoRequery) {
-                startQueryOngoingConversations();
-            } else {
-                mRequeryPending = true;
-            }
-        }
-    }
-
-    private class MyDataSetObserver extends DataSetObserver {
-        public MyDataSetObserver() {
-        }
-
-        @Override
-        public void onChanged() {
-            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-                log("MyDataSetObserver.onChanged()");
-            }
-
-            mDataValid = true;
-            notifyDataSetChanged();
-        }
-
-        @Override
-        public void onInvalidated() {
-            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-                log("MyDataSetObserver.onInvalidated()");
-            }
-
-            mDataValid = false;
-            notifyDataSetInvalidated();
-        }
-    }
-
-    public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,
-            int totalItemCount) {
-        // no op
-    }
-
-    public void onScrollStateChanged(AbsListView view, int scrollState) {
-        int oldState = mScrollState;
-
-        mScrollState = scrollState;
-        //  If we just finished a fling then some items may not have an icon
-        //  So force a full redraw now that the fling is complete
-        if (oldState == OnScrollListener.SCROLL_STATE_FLING) {
-            notifyDataSetChanged();
-        }
-    }
-
-    public boolean isScrolling() {
-        return mScrollState == OnScrollListener.SCROLL_STATE_FLING;
-    }
-}
diff --git a/src/com/android/im/app/ContactListView.java b/src/com/android/im/app/ContactListView.java
deleted file mode 100644 (file)
index 7e62d7f..0000000
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.app;
-
-import com.android.im.IChatSession;
-import com.android.im.IChatSessionManager;
-import com.android.im.IContactListListener;
-import com.android.im.IContactListManager;
-import com.android.im.IImConnection;
-import com.android.im.ISubscriptionListener;
-import com.android.im.R;
-import com.android.im.app.adapter.ContactListListenerAdapter;
-import com.android.im.engine.Contact;
-import com.android.im.engine.ContactListManager;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.service.ImServiceConstants;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.ContentUris;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.res.Resources;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.os.RemoteException;
-import android.provider.Im;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.View;
-import android.widget.ExpandableListView;
-import android.widget.LinearLayout;
-import android.widget.ExpandableListView.OnChildClickListener;
-
-public class ContactListView extends LinearLayout {
-
-    Activity mScreen;
-    IImConnection mConn;
-    SimpleAlertHandler mHandler;
-    private final IContactListListener mContactListListener;
-
-    UserPresenceView mPresenceView;
-    ExpandableListView mContactsList;
-    private ContactListTreeAdapter mAdapter;
-    private boolean mHideOfflineContacts;
-    private SavedState mSavedState;
-
-    public ContactListView(Context screen, AttributeSet attrs) {
-        super(screen, attrs);
-        mScreen = (Activity)screen;
-        mHandler = new SimpleAlertHandler(mScreen);
-        mContactListListener = new MyContactListListener(mHandler);
-    }
-
-    private class MyContactListListener extends ContactListListenerAdapter {
-        public MyContactListListener(SimpleAlertHandler handler) {
-            super(handler);
-        }
-
-        @Override
-        public void onAllContactListsLoaded() {
-            if (mAdapter != null) {
-                mAdapter.startAutoRequery();
-            }
-        }
-    }
-
-    private final ISubscriptionListener.Stub mSubscriptionListener = new ISubscriptionListener.Stub() {
-
-        public void onSubScriptionRequest(Contact from) {
-            querySubscription();
-        }
-
-        public void onSubscriptionApproved(String contact) {
-            querySubscription();
-        }
-
-        public void onSubscriptionDeclined(String contact) {
-            querySubscription();
-        }
-
-        private void querySubscription() {
-            if (mAdapter != null) {
-                mAdapter.startQuerySubscriptions();
-            }
-        }
-     };
-
-    @Override
-    protected void onFinishInflate() {
-        super.onFinishInflate();
-        mPresenceView = (UserPresenceView)findViewById(R.id.userPresence);
-        mContactsList = (ExpandableListView) findViewById(R.id.contactsList);
-        mContactsList.setOnChildClickListener(mOnChildClickListener);
-    }
-
-    public ExpandableListView getListView() {
-        return mContactsList;
-    }
-
-    public void setConnection(IImConnection conn) {
-        if (mConn != conn) {
-            if (mConn != null) {
-                unregisterListeners();
-            }
-            mConn = conn;
-
-            if (conn != null) {
-                registerListeners();
-                mPresenceView.setConnection(conn);
-
-                if (mAdapter == null) {
-                    mAdapter = new ContactListTreeAdapter(conn, mScreen);
-                    mAdapter.setHideOfflineContacts(mHideOfflineContacts);
-                    mContactsList.setAdapter(mAdapter);
-                    mContactsList.setOnScrollListener(mAdapter);
-                    if (mSavedState != null) {
-                        int[] expandedGroups = mSavedState.mExpandedGroups;
-                        if(expandedGroups != null) {
-                            for (int group : expandedGroups) {
-                                mContactsList.expandGroup(group);
-                            }
-                        }
-                    }
-                } else {
-                    mAdapter.changeConnection(conn);
-                }
-                try {
-                    IContactListManager listMgr = conn.getContactListManager();
-                    if (listMgr.getState() == ContactListManager.LISTS_LOADED) {
-                        mAdapter.startAutoRequery();
-                    }
-                } catch (RemoteException e) {
-                    Log.e(ImApp.LOG_TAG, "Service died!");
-                }
-            }
-        } else {
-            mContactsList.invalidateViews();
-        }
-    }
-
-    public void setHideOfflineContacts(boolean hide) {
-        if (mAdapter != null) {
-            mAdapter.setHideOfflineContacts(hide);
-        } else {
-            mHideOfflineContacts = hide;
-        }
-    }
-
-    public void startChat() {
-        startChat(getSelectedContact());
-    }
-
-    public void startChatAtPosition(long packedPosition) {
-        startChat(getContactAtPosition(packedPosition));
-    }
-
-    void startChat(Cursor c) {
-        if (c != null) {
-            long id = c.getLong(c.getColumnIndexOrThrow(Im.Contacts._ID));
-            String username = c.getString(c.getColumnIndexOrThrow(Im.Contacts.USERNAME));
-            try {
-                IChatSessionManager manager = mConn.getChatSessionManager();
-                IChatSession session = manager.getChatSession(username);
-                if(session == null) {
-                    manager.createChatSession(username);
-                }
-
-                Uri data = ContentUris.withAppendedId(Im.Chats.CONTENT_URI, id);
-                Intent i = new Intent(Intent.ACTION_VIEW, data);
-                i.addCategory(ImApp.IMPS_CATEGORY);
-                mScreen.startActivity(i);
-            } catch (RemoteException e) {
-                mHandler.showServiceErrorAlert();
-            }
-            clearFocusIfEmpty(c);
-        }
-    }
-
-    private void clearFocusIfEmpty(Cursor c) {
-        // clear focus if there's only one item so that it would focus on the
-        // "empty" item after the contact removed.
-        if (c.getCount() == 1) {
-            clearFocus();
-        }
-    }
-
-    public void endChat() {
-        endChat(getSelectedContact());
-    }
-
-    public void endChatAtPosition(long packedPosition) {
-        endChat(getContactAtPosition(packedPosition));
-    }
-
-    void endChat(Cursor c) {
-        if(c != null) {
-            String username = c.getString(c.getColumnIndexOrThrow(Im.Contacts.USERNAME));
-            try {
-                IChatSessionManager manager = mConn.getChatSessionManager();
-                IChatSession session = manager.getChatSession(username);
-                if(session != null) {
-                    session.leave();
-                }
-            } catch (RemoteException e) {
-                mHandler.showServiceErrorAlert();
-            }
-            clearFocusIfEmpty(c);
-        }
-    }
-
-    public void viewContactPresence() {
-        viewContactPresence(getSelectedContact());
-    }
-
-    public void viewContactPresenceAtPostion(long packedPosition) {
-        viewContactPresence(getContactAtPosition(packedPosition));
-    }
-
-    public void viewContactPresence(Cursor c) {
-        if (c != null) {
-            long id = c.getLong(c.getColumnIndexOrThrow(Im.Contacts._ID));
-            Uri data = ContentUris.withAppendedId(Im.Contacts.CONTENT_URI, id);
-            Intent i = new Intent(Intent.ACTION_VIEW, data);
-            mScreen.startActivity(i);
-        }
-    }
-
-    public boolean isContactAtPosition(long packedPosition) {
-        int type = ExpandableListView.getPackedPositionType(packedPosition);
-        int groupPosition = ExpandableListView.getPackedPositionGroup(packedPosition);
-        return (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD)
-                && !mAdapter.isPosForSubscription(groupPosition);
-    }
-
-    public boolean isContactSelected() {
-        long pos = mContactsList.getSelectedPosition();
-        return isContactAtPosition(pos);
-    }
-
-    public boolean isConversationAtPosition(long packedPosition) {
-        int type = ExpandableListView.getPackedPositionType(packedPosition);
-        int groupPosition = ExpandableListView.getPackedPositionGroup(packedPosition);
-        return (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD)
-                && mAdapter.isPosForOngoingConversation(groupPosition);
-    }
-
-    public boolean isConversationSelected () {
-        long pos = mContactsList.getSelectedPosition();
-        return isConversationAtPosition(pos);
-    }
-
-    public boolean isContactsLoaded() {
-        try {
-            IContactListManager manager = mConn.getContactListManager();
-            return (manager.getState() == ContactListManager.LISTS_LOADED);
-        } catch (RemoteException e) {
-            mHandler.showServiceErrorAlert();
-            return false;
-        }
-    }
-
-    public void removeContact() {
-        removeContact(getSelectedContact());
-    }
-
-    public void removeContactAtPosition(long packedPosition) {
-        removeContact(getContactAtPosition(packedPosition));
-    }
-
-    void removeContact(Cursor c) {
-        if (c == null) {
-            mHandler.showAlert(R.string.error, R.string.select_contact);
-        } else {
-            String nickname = c.getString(c.getColumnIndexOrThrow(Im.Contacts.NICKNAME));
-            final String address = c.getString(c.getColumnIndexOrThrow(Im.Contacts.USERNAME));
-            DialogInterface.OnClickListener confirmListener = new DialogInterface.OnClickListener(){
-                public void onClick(DialogInterface dialog, int whichButton) {
-                    try {
-                        IContactListManager manager = mConn.getContactListManager();
-                        int res = manager.removeContact(address);
-                        if (res != ImErrorInfo.NO_ERROR) {
-                            mHandler.showAlert(R.string.error,
-                                    ErrorResUtils.getErrorRes(getResources(), res, address));
-                        }
-                    } catch (RemoteException e) {
-                        mHandler.showServiceErrorAlert();
-                    }
-                }
-            };
-            Resources r = getResources();
-
-            new AlertDialog.Builder(mContext)
-                .setTitle(R.string.confirm)
-                .setMessage(r.getString(R.string.confirm_delete_contact, nickname))
-                .setPositiveButton(R.string.yes, confirmListener) // default button
-                .setNegativeButton(R.string.no, null)
-                .setCancelable(false)
-                .show();
-
-            clearFocusIfEmpty(c);
-        }
-    }
-
-    public void blockContact() {
-        blockContact(getSelectedContact());
-    }
-
-    public void blockContactAtPosition(long packedPosition) {
-        blockContact(getContactAtPosition(packedPosition));
-    }
-
-    void blockContact(Cursor c) {
-        if (c == null) {
-            mHandler.showAlert(R.string.error, R.string.select_contact);
-        } else {
-            String nickname = c.getString(c.getColumnIndexOrThrow(Im.Contacts.NICKNAME));
-            final String address = c.getString(c.getColumnIndexOrThrow(Im.Contacts.USERNAME));
-            DialogInterface.OnClickListener confirmListener = new DialogInterface.OnClickListener(){
-                public void onClick(DialogInterface dialog, int whichButton) {
-                    try {
-                        IContactListManager manager = mConn.getContactListManager();
-                        int res = manager.blockContact(address);
-                        if (res != ImErrorInfo.NO_ERROR) {
-                            mHandler.showAlert(R.string.error,
-                                    ErrorResUtils.getErrorRes(getResources(), res, address));
-                        }
-                    } catch (RemoteException e) {
-                        mHandler.showServiceErrorAlert();
-                    }
-                }
-            };
-
-            Resources r = getResources();
-
-            new AlertDialog.Builder(mContext)
-                .setTitle(R.string.confirm)
-                .setMessage(r.getString(R.string.confirm_block_contact, nickname))
-                .setPositiveButton(R.string.yes, confirmListener) // default button
-                .setNegativeButton(R.string.no, null)
-                .setCancelable(false)
-                .show();
-            clearFocusIfEmpty(c);
-        }
-    }
-
-    public Cursor getContactAtPosition(long packedPosition) {
-        int type = ExpandableListView.getPackedPositionType(packedPosition);
-        if (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
-            int groupPosition = ExpandableListView.getPackedPositionGroup(packedPosition);
-            int childPosition = ExpandableListView.getPackedPositionChild(packedPosition);
-            return (Cursor) mAdapter.getChild(groupPosition, childPosition);
-        }
-        return null;
-    }
-
-    public Cursor getSelectedContact() {
-        long pos = mContactsList.getSelectedPosition();
-        if (ExpandableListView.getPackedPositionType(pos)
-                == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
-            return (Cursor)mContactsList.getSelectedItem();
-        }
-        return null;
-    }
-
-    public String getSelectedContactList() {
-        long pos = mContactsList.getSelectedPosition();
-        int groupPos = ExpandableListView.getPackedPositionGroup(pos);
-        if (groupPos == -1) {
-            return null;
-        }
-
-        Cursor cursor = (Cursor)mAdapter.getGroup(groupPos);
-        if (cursor == null) {
-            return null;
-        }
-        return cursor.getString(cursor.getColumnIndexOrThrow(Im.ContactList.NAME));
-    }
-
-    private void registerListeners() {
-        try{
-            IContactListManager listManager = mConn.getContactListManager();
-            listManager.registerContactListListener(mContactListListener);
-            listManager.registerSubscriptionListener(mSubscriptionListener);
-        }catch(RemoteException e) {
-            mHandler.showServiceErrorAlert();
-        }
-    }
-
-    private void unregisterListeners() {
-        try{
-            IContactListManager listManager = mConn.getContactListManager();
-            listManager.unregisterContactListListener(mContactListListener);
-            listManager.unregisterSubscriptionListener(mSubscriptionListener);
-        }catch(RemoteException e) {
-            mHandler.showServiceErrorAlert();
-        }
-    }
-
-    private final OnChildClickListener mOnChildClickListener = new OnChildClickListener() {
-        public boolean onChildClick(ExpandableListView parent, View v, int groupPosition,
-                int childPosition, long id) {
-            Cursor cursor = (Cursor)parent.getExpandableListAdapter().getChild(
-                    groupPosition, childPosition);
-            if (cursor == null) {
-                Log.w(ImApp.LOG_TAG,
-                        "[ContactListView.OnChildClickListener.onChildClick] cursor null! groupPos="
-                                + groupPosition + ", childPos=" + childPosition,
-                        new RuntimeException());
-                return false;
-            }
-            
-            int subscriptionType = cursor.getInt(ContactView.COLUMN_SUBSCRIPTION_TYPE);
-            int subscriptionStatus = cursor.getInt(ContactView.COLUMN_SUBSCRIPTION_STATUS);
-            if ((subscriptionType == Im.Contacts.SUBSCRIPTION_TYPE_FROM)
-                    && (subscriptionStatus == Im.Contacts.SUBSCRIPTION_STATUS_SUBSCRIBE_PENDING)){
-                long providerId = cursor.getLong(ContactView.COLUMN_CONTACT_PROVIDER);
-                String username = cursor.getString(ContactView.COLUMN_CONTACT_USERNAME);
-                Intent intent = new Intent(ImServiceConstants.ACTION_MANAGE_SUBSCRIPTION,
-                        ContentUris.withAppendedId(Im.Contacts.CONTENT_URI, id));
-                intent.putExtra(ImServiceConstants.EXTRA_INTENT_PROVIDER_ID, providerId);
-                intent.putExtra(ImServiceConstants.EXTRA_INTENT_FROM_ADDRESS, username);
-                mScreen.startActivity(intent);
-            } else {
-                startChat(cursor);
-            }
-            return true;
-        }
-    };
-
-    static class SavedState extends BaseSavedState {
-        int[] mExpandedGroups;
-
-        SavedState(Parcelable superState, int[] expandedGroups) {
-            super(superState);
-            mExpandedGroups = expandedGroups;
-        }
-
-        private SavedState(Parcel in) {
-            super(in);
-            mExpandedGroups = in.createIntArray();
-        }
-
-        @Override
-        public void writeToParcel(Parcel out, int flags) {
-            super.writeToParcel(out, flags);
-            out.writeIntArray(mExpandedGroups);
-        }
-
-        public static final Parcelable.Creator<SavedState> CREATOR
-                = new Parcelable.Creator<SavedState>() {
-            public SavedState createFromParcel(Parcel in) {
-                return new SavedState(in);
-            }
-
-            public SavedState[] newArray(int size) {
-                return new SavedState[size];
-            }
-        };
-    }
-
-    @Override
-    public Parcelable onSaveInstanceState() {
-        Parcelable superState = super.onSaveInstanceState();
-        int[] expandedGroups = mAdapter == null ? null
-                : mAdapter.getExpandedGroups();
-        return new SavedState(superState, expandedGroups);
-    }
-
-    @Override
-    public void onRestoreInstanceState(Parcelable state) {
-        SavedState ss = (SavedState) state;
-
-        super.onRestoreInstanceState(ss.getSuperState());
-
-        mSavedState = ss;
-    }
-}
diff --git a/src/com/android/im/app/ContactPresenceActivity.java b/src/com/android/im/app/ContactPresenceActivity.java
deleted file mode 100644 (file)
index 6531503..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import android.app.Activity;
-import android.content.ContentResolver;
-import android.content.Intent;
-import android.content.res.Resources;
-import android.database.Cursor;
-import android.graphics.drawable.Drawable;
-import android.net.Uri;
-import android.os.Bundle;
-import android.provider.Im;
-import android.text.SpannableString;
-import android.text.TextUtils;
-import android.text.style.ImageSpan;
-import android.util.Log;
-import android.view.View;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import com.android.im.R;
-import com.android.im.plugin.BrandingResourceIDs;
-
-public class ContactPresenceActivity extends Activity {
-
-    @Override
-    public void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-
-        setTheme(android.R.style.Theme_Dialog);
-        setContentView(R.layout.contact_presence_activity);
-
-        ImageView imgAvatar = (ImageView) findViewById(R.id.imgAvatar);
-        TextView labelName = (TextView) findViewById(R.id.labelName);
-        TextView txtName = (TextView) findViewById(R.id.txtName);
-        TextView txtStatus = (TextView) findViewById(R.id.txtStatus);
-        TextView txtClientType = (TextView) findViewById(R.id.txtClientType);
-        TextView txtCustomStatus = (TextView) findViewById(R.id.txtStatusText);
-
-        Intent i = getIntent();
-        Uri uri = i.getData();
-        if(uri == null) {
-            warning("No data to show");
-            finish();
-            return;
-        }
-
-        ContentResolver cr = getContentResolver();
-        Cursor c = cr.query(uri, null, null, null, null);
-        if(c == null) {
-            warning("Database error when query " + uri);
-            finish();
-            return;
-        }
-
-        if(c.moveToFirst()) {
-            long providerId = c.getLong(c.getColumnIndexOrThrow(Im.Contacts.PROVIDER));
-            String username = c.getString(c.getColumnIndexOrThrow(Im.Contacts.USERNAME));
-            String nickname   = c.getString(c.getColumnIndexOrThrow(Im.Contacts.NICKNAME));
-            int status    = c.getInt(c.getColumnIndexOrThrow(Im.Contacts.PRESENCE_STATUS));
-            int clientType = c.getInt(c.getColumnIndexOrThrow(Im.Contacts.CLIENT_TYPE));
-            String customStatus = c.getString(c.getColumnIndexOrThrow(Im.Contacts.PRESENCE_CUSTOM_STATUS));
-
-            ImApp app = ImApp.getApplication(this);
-            BrandingResources brandingRes = app.getBrandingResource(providerId);
-            setTitle(brandingRes.getString(BrandingResourceIDs.STRING_CONTACT_INFO_TITLE));
-
-            Drawable avatar = DatabaseUtils.getAvatarFromCursor(c,
-                    c.getColumnIndexOrThrow(Im.Contacts.AVATAR_DATA));
-            if (avatar != null) {
-                imgAvatar.setImageDrawable(avatar);
-            } else {
-                imgAvatar.setImageResource(R.drawable.avatar_unknown);
-            }
-
-            labelName.setText(brandingRes.getString(
-                    BrandingResourceIDs.STRING_LABEL_USERNAME));
-            txtName.setText(ImpsAddressUtils.getDisplayableAddress(username));
-
-            String statusString = brandingRes.getString(
-                    PresenceUtils.getStatusStringRes(status));
-            SpannableString s = new SpannableString("+ " + statusString);
-            Drawable statusIcon = brandingRes.getDrawable(
-                    PresenceUtils.getStatusIconId(status));
-            statusIcon.setBounds(0, 0, statusIcon.getIntrinsicWidth(),
-                    statusIcon.getIntrinsicHeight());
-            s.setSpan(new ImageSpan(statusIcon), 0, 1,
-                    SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
-            txtStatus.setText(s);
-
-            txtClientType.setText(getClientTypeString(clientType));
-
-            if (!TextUtils.isEmpty(customStatus)) {
-                txtCustomStatus.setVisibility(View.VISIBLE);
-                txtCustomStatus.setText("\"" + customStatus + "\"");
-            } else {
-                txtCustomStatus.setVisibility(View.GONE);
-            }
-        }
-        c.close();
-    }
-
-    private String getClientTypeString(int clientType) {
-        Resources res = getResources();
-        switch (clientType) {
-            case Im.Contacts.CLIENT_TYPE_MOBILE:
-                return res.getString(R.string.client_type_mobile);
-
-            default:
-                return res.getString(R.string.client_type_computer);
-        }
-    }
-
-    private static void warning(String msg) {
-        Log.w(ImApp.LOG_TAG, "<ContactPresenceActivity> " + msg);
-    }
-}
diff --git a/src/com/android/im/app/ContactView.java b/src/com/android/im/app/ContactView.java
deleted file mode 100644 (file)
index c5d807d..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import android.app.Activity;
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.Context;
-import android.content.res.Resources;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Handler;
-import android.provider.Im;
-import android.text.Spannable;
-import android.text.SpannableString;
-import android.text.SpannableStringBuilder;
-import android.text.TextUtils;
-import android.text.style.RelativeSizeSpan;
-import android.text.style.UnderlineSpan;
-import android.util.AttributeSet;
-import android.view.View;
-import android.view.animation.Animation;
-import android.view.animation.TranslateAnimation;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-import android.graphics.drawable.Drawable;
-
-import com.android.im.R;
-import com.android.im.plugin.BrandingResourceIDs;
-
-import java.text.DateFormat;
-import java.util.Calendar;
-
-public class ContactView extends LinearLayout {
-    static final String[] CONTACT_PROJECTION = {
-        Im.Contacts._ID,
-        Im.Contacts.PROVIDER,
-        Im.Contacts.ACCOUNT,
-        Im.Contacts.USERNAME,
-        Im.Contacts.NICKNAME,
-        Im.Contacts.TYPE,
-        Im.Contacts.SUBSCRIPTION_TYPE,
-        Im.Contacts.SUBSCRIPTION_STATUS,
-        Im.Presence.PRESENCE_STATUS,
-        Im.Presence.PRESENCE_CUSTOM_STATUS,
-        Im.Chats.LAST_MESSAGE_DATE,
-        Im.Chats.LAST_UNREAD_MESSAGE,
-    };
-
-    static final int COLUMN_CONTACT_ID = 0;
-    static final int COLUMN_CONTACT_PROVIDER = 1;
-    static final int COLUMN_CONTACT_ACCOUNT = 2;
-    static final int COLUMN_CONTACT_USERNAME = 3;
-    static final int COLUMN_CONTACT_NICKNAME = 4;
-    static final int COLUMN_CONTACT_TYPE = 5;
-    static final int COLUMN_SUBSCRIPTION_TYPE = 6;
-    static final int COLUMN_SUBSCRIPTION_STATUS = 7;
-    static final int COLUMN_CONTACT_PRESENCE_STATUS = 8;
-    static final int COLUMN_CONTACT_CUSTOM_STATUS = 9;
-    static final int COLUMN_LAST_MESSAGE_DATE = 10;
-    static final int COLUMN_LAST_MESSAGE = 11;
-
-    //private ImageView mPresence;
-    private TextView mLine1;
-    private TextView mLine2;
-    private TextView mTimeStamp;
-
-    private Handler mHandler;
-    private boolean mLayoutDirty;
-
-    public ContactView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        mLayoutDirty = true;
-    }
-
-    @Override
-    protected void onFinishInflate() {
-        super.onFinishInflate();
-
-        //mPresence = (ImageView) findViewById(R.id.presence);
-        mLine1 = (TextView) findViewById(R.id.line1);
-        mLine2 = (TextView) findViewById(R.id.line2);
-        mLine2.setCompoundDrawablePadding(5);
-        mTimeStamp = (TextView)findViewById(R.id.timestamp);
-
-        mHandler = new Handler();
-    }
-
-    @Override
-    public void setSelected(boolean selected) {
-        super.setSelected(selected);
-        if(selected) {
-            // While layout, the width of children is unknown, we have to start
-            // animation when layout is done.
-            if (mLayoutDirty) {
-                mHandler.post(new Runnable() {
-                    public void run() {
-                        startAnimationNow();
-                    }
-                });
-            } else {
-                startAnimationNow();
-            }
-        } else {
-            mLine2.clearAnimation();
-        }
-    }
-
-    @Override
-    protected void onLayout(boolean changed, int l, int t, int r, int b) {
-        mLayoutDirty = false;
-        super.onLayout(changed, l, t, r, b);
-    }
-
-    @Override
-    public void requestLayout() {
-        super.requestLayout();
-        mLayoutDirty = true;
-    }
-
-    /*package*/ void startAnimationNow() {
-        View parent = (View)mLine2.getParent();
-        int width = mLine2.getWidth();
-
-        int parentWidth = parent.getWidth() - parent.getPaddingLeft()
-                - parent.getPaddingRight();
-        if(width > parentWidth) {
-            int fromXDelta = parentWidth;
-            int toXDelta = - width;
-            int duration = (fromXDelta - toXDelta) * 32;
-            Animation animation = new TranslateAnimation(fromXDelta, toXDelta, 0, 0);
-            animation.setDuration(duration);
-            animation.setRepeatMode(Animation.RESTART);
-            animation.setRepeatCount(Animation.INFINITE);
-            mLine2.startAnimation(animation);
-        }
-    }
-
-    public void bind(Cursor cursor, String underLineText, boolean scrolling) {
-        bind(cursor, underLineText, true, scrolling);
-    }
-
-    public void bind(Cursor cursor, String underLineText, boolean showChatMsg, boolean scrolling) {
-        Resources r = getResources();
-        long providerId = cursor.getLong(COLUMN_CONTACT_PROVIDER);
-        String username = cursor.getString(COLUMN_CONTACT_USERNAME);
-        String nickname = cursor.getString(COLUMN_CONTACT_NICKNAME);
-        int type = cursor.getInt(COLUMN_CONTACT_TYPE);
-        String statusText = cursor.getString(COLUMN_CONTACT_CUSTOM_STATUS);
-        String lastMsg = cursor.getString(COLUMN_LAST_MESSAGE);
-
-        boolean hasChat = !cursor.isNull(COLUMN_LAST_MESSAGE_DATE);
-
-        ImApp app = ImApp.getApplication((Activity)mContext);
-        BrandingResources brandingRes = app.getBrandingResource(providerId);
-
-        int presence = cursor.getInt(COLUMN_CONTACT_PRESENCE_STATUS);
-        int iconId = 0;
-
-        // status icon
-
-        if (Im.Contacts.TYPE_GROUP == type) {
-            iconId = lastMsg == null ? R.drawable.group_chat : R.drawable.group_chat_new;
-        } else if (hasChat) {
-            iconId = lastMsg == null ? BrandingResourceIDs.DRAWABLE_READ_CHAT
-                    : BrandingResourceIDs.DRAWABLE_UNREAD_CHAT;
-        } else {
-            iconId = PresenceUtils.getStatusIconId(presence);
-        }
-
-        //mPresence.setImageDrawable(brandingRes.getDrawable(iconId));
-        Drawable presenceIcon = brandingRes.getDrawable(iconId);
-
-        // line1
-        CharSequence line1;
-        if (Im.Contacts.TYPE_GROUP == type) {
-            ContentResolver resolver = getContext().getContentResolver();
-            long id = cursor.getLong(ContactView.COLUMN_CONTACT_ID);
-            line1 = queryGroupMembers(resolver, id);
-        } else {
-            line1 = TextUtils.isEmpty(nickname) ?
-                    ImpsAddressUtils.getDisplayableAddress(username) : nickname;
-
-            if (!TextUtils.isEmpty(underLineText)) {
-                // highlight/underline the word being searched
-                String lowercase = line1.toString().toLowerCase();
-                int start = lowercase.indexOf(underLineText.toLowerCase());
-                if (start >= 0) {
-                    int end = start + underLineText.length();
-                    SpannableString str = new SpannableString(line1);
-                    str.setSpan(new UnderlineSpan(), start, end,
-                            Spannable.SPAN_INCLUSIVE_INCLUSIVE);
-                    line1 = str;
-                }
-            }
-
-            if (Im.Contacts.TYPE_TEMPORARY == type) {
-                // Add a mark at the front of name if it's only a temporary
-                // contact.
-                SpannableStringBuilder str = new SpannableStringBuilder(
-                        r.getText(R.string.unknown_contact));
-                str.setSpan(new RelativeSizeSpan(0.8f), 0, str.length(),
-                        Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
-                str.append(line1);
-                line1 = str;
-            }
-        }
-        mLine1.setText(line1);
-
-        // time stamp
-        if (showChatMsg && hasChat) {
-            mTimeStamp.setVisibility(VISIBLE);
-            Calendar cal = Calendar.getInstance();
-            cal.setTimeInMillis(cursor.getLong(COLUMN_LAST_MESSAGE_DATE));
-            DateFormat formatter = DateFormat.getTimeInstance(DateFormat.SHORT);
-            mTimeStamp.setText(formatter.format(cal.getTime()));
-        } else {
-            mTimeStamp.setVisibility(GONE);
-        }
-
-        // line2
-        CharSequence line2 = null;
-        if (showChatMsg) {
-            line2 = lastMsg;
-        }
-
-        if (TextUtils.isEmpty(line2)){
-            if (Im.Contacts.TYPE_GROUP == type) {
-                // Show nothing in line2 if it's a group and don't
-                // have any unread message.
-                line2 = null;
-            } else {
-                // Show the custom status text if there's no new message.
-                line2 = statusText;
-            }
-        }
-
-        if (TextUtils.isEmpty(line2)) {
-            // Show a string of presence if there is neither new message nor
-            // custom status text.
-            line2 = brandingRes.getString(PresenceUtils.getStatusStringRes(presence));
-        }
-
-        mLine2.setText(line2);
-        mLine2.setCompoundDrawablesWithIntrinsicBounds(null, null, presenceIcon, null);
-
-
-        View contactInfoPanel = findViewById(R.id.contactInfo);
-        if (hasChat && showChatMsg) {
-            contactInfoPanel.setBackgroundResource(R.drawable.list_item_im_bubble);
-            mLine1.setTextColor(r.getColor(R.color.chat_contact));
-        } else {
-            contactInfoPanel.setBackgroundDrawable(null);
-            contactInfoPanel.setPadding(4, 0, 0, 0);
-            mLine1.setTextColor(r.getColor(R.color.nonchat_contact));
-        }
-    }
-
-    private String queryGroupMembers(ContentResolver resolver, long groupId) {
-        String[] projection = { Im.GroupMembers.NICKNAME };
-        Uri uri = ContentUris.withAppendedId(Im.GroupMembers.CONTENT_URI, groupId);
-        Cursor c = resolver.query(uri, projection, null, null, null);
-        StringBuilder buf = new StringBuilder();
-        if(c != null) {
-            while(c.moveToNext()) {
-                buf.append(c.getString(0));
-                if(!c.isLast()) {
-                    buf.append(',');
-                }
-            }
-            c.close();
-        }
-        return buf.toString();
-    }
-}
diff --git a/src/com/android/im/app/ContactsPickerActivity.java b/src/com/android/im/app/ContactsPickerActivity.java
deleted file mode 100644 (file)
index eb52aa3..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import com.android.im.R;
-
-import android.app.ListActivity;
-import android.content.Context;
-import android.content.Intent;
-import android.database.Cursor;
-import android.database.DatabaseUtils;
-import android.net.Uri;
-import android.os.Bundle;
-import android.provider.Im;
-import android.text.Editable;
-import android.text.TextWatcher;
-import android.util.Log;
-import android.view.View;
-import android.widget.EditText;
-import android.widget.Filter;
-import android.widget.ListView;
-import android.widget.ResourceCursorAdapter;
-
-/**
- * Activity used to pick a contact.
- */
-public class ContactsPickerActivity extends ListActivity {
-    public final static String EXTRA_EXCLUDED_CONTACTS = "excludes";
-
-    public final static String EXTRA_RESULT_USERNAME = "result";
-
-    private ContactsAdapter mAdapter;
-    private String mExcludeClause;
-    Uri mData;
-    Filter mFilter;
-
-    private static final void log(String msg) {
-        Log.d(ImApp.LOG_TAG, "<ContactsPickerActivity> " + msg);
-    }
-
-    @Override
-    protected void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-
-        setContentView(R.layout.contacts_picker_activity);
-        if(!resolveIntent()){
-            if(Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
-                log("no data, finish");
-            }
-            finish();
-            return;
-        }
-
-        EditText filter = (EditText)findViewById(R.id.filter);
-        filter.addTextChangedListener(new TextWatcher() {
-            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
-            }
-
-            public void onTextChanged(CharSequence s, int start, int before, int count) {
-                mFilter.filter(s);
-            }
-
-            public void afterTextChanged(Editable s) {
-            }
-        });
-    }
-
-    private boolean resolveIntent() {
-        Intent i = getIntent();
-        mData = i.getData();
-
-        if(mData == null) {
-            return false;
-        }
-        mExcludeClause = buildExcludeClause(i.getStringArrayExtra(EXTRA_EXCLUDED_CONTACTS));
-        Cursor cursor = managedQuery(mData, ContactView.CONTACT_PROJECTION,
-                mExcludeClause, Im.Contacts.DEFAULT_SORT_ORDER);
-        if (cursor == null) {
-            return false;
-        }
-
-        mAdapter = new ContactsAdapter(this, cursor);
-        mFilter = mAdapter.getFilter();
-        setListAdapter(mAdapter);
-        return true;
-    }
-
-    @Override
-    protected void onListItemClick(ListView l, View v, int position, long id) {
-        Cursor cursor = (Cursor)mAdapter.getItem(position);
-        Intent data = new Intent();
-        data.putExtra(EXTRA_RESULT_USERNAME,
-                cursor.getString(ContactView.COLUMN_CONTACT_USERNAME));
-        setResult(RESULT_OK, data);
-        finish();
-    }
-
-    private static String buildExcludeClause(String[] excluded) {
-        if (excluded == null || excluded.length == 0) {
-            return null;
-        }
-
-        StringBuilder clause = new StringBuilder();
-        clause.append(Im.Contacts.USERNAME);
-        clause.append(" NOT IN (");
-        int len = excluded.length;
-        for (int i = 0; i < len - 1; i++) {
-            DatabaseUtils.appendValueToSql(clause, excluded[i]);
-            clause.append(',');
-        }
-        DatabaseUtils.appendValueToSql(clause, excluded[len - 1]);
-        clause.append(')');
-        return clause.toString();
-    }
-
-    Cursor runQuery(CharSequence constraint) {
-        String where;
-        if (constraint == null) {
-            where = mExcludeClause;
-        } else {
-            StringBuilder buf = new StringBuilder();
-            if (mExcludeClause != null) {
-                buf.append(mExcludeClause).append(" AND ");
-            }
-
-            buf.append(Im.Contacts.NICKNAME);
-            buf.append(" LIKE ");
-            DatabaseUtils.appendValueToSql(buf, "%" + constraint + "%");
-
-            where = buf.toString();
-        }
-        return managedQuery(mData, ContactView.CONTACT_PROJECTION, where,
-                Im.Contacts.DEFAULT_SORT_ORDER);
-    }
-
-    private class ContactsAdapter extends ResourceCursorAdapter {
-        private String mConstraints;
-
-        public ContactsAdapter(Context context, Cursor c) {
-            super(context, R.layout.contact_view, c);
-        }
-
-        @Override
-        public void bindView(View view, Context context, Cursor cursor) {
-            ContactView v = (ContactView)view;
-            v.setPadding(0, 0, 0, 0);
-            v.bind(cursor, mConstraints, false);
-        }
-
-        @Override
-        public void changeCursor(Cursor cursor) {
-            if(mCursor != null && mCursor != cursor) {
-                mCursor.deactivate();
-            }
-            super.changeCursor(cursor);
-        }
-
-        @Override
-        public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
-            mConstraints = constraint.toString();
-
-            return ContactsPickerActivity.this.runQuery(constraint);
-        }
-    }
-
-}
diff --git a/src/com/android/im/app/Dashboard.java b/src/com/android/im/app/Dashboard.java
deleted file mode 100644 (file)
index 6715fd1..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import com.android.im.R;
-import com.android.im.plugin.BrandingResourceIDs;
-
-import android.app.Activity;
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.Context;
-import android.content.Intent;
-import android.content.res.Resources;
-import android.database.Cursor;
-import android.graphics.PixelFormat;
-import android.graphics.drawable.Drawable;
-import android.provider.Im;
-import android.text.TextUtils;
-import android.util.AttributeSet;
-import android.view.KeyEvent;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.WindowManager;
-import android.view.WindowManagerImpl;
-import android.widget.AdapterView;
-import android.widget.Gallery;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.ResourceCursorAdapter;
-import android.widget.TextView;
-
-public class Dashboard extends LinearLayout implements Gallery.OnItemClickListener {
-    private static final String[] PROVIDER_CATEGORY_PROJECTION = new String[] {
-            Im.Provider.CATEGORY
-    };
-    private static final int PROVIDER_CATEGORY_COLUMN = 0;
-
-    private Gallery mGallery;
-    private Cursor mChats;
-    private long mAccountId;
-    private String mUserName;
-    Activity mActivity;
-    private OnCancelListener mCancelListener;
-
-    private int mProviderIdColumn;
-    private int mAccountIdColumn;
-    private int mUsernameColumn;
-    private int mNicknameColumn;
-    private int mPresenceStatusColumn;
-    private int mLastUnreadMessageColumn;
-    private int mShortcutColumn;
-
-    public Dashboard(Context screen, AttributeSet attrs) {
-        super(screen, attrs);
-    }
-
-    public static final Dashboard openDashboard(Activity parent, long accountId, String username) {
-        LayoutInflater inflate = LayoutInflater.from(parent);
-        View v = inflate.inflate(R.layout.dashboard, null);
-
-        WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
-            WindowManager.LayoutParams.TYPE_APPLICATION_PANEL,
-            WindowManager.LayoutParams.FLAG_DIM_BEHIND,
-            PixelFormat.TRANSLUCENT);
-        lp.dimAmount = .5F;
-
-        lp.width = WindowManager.LayoutParams.FILL_PARENT;
-        lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
-        lp.token = parent.getWindow().peekDecorView().getWindowToken();
-
-        WindowManagerImpl.getDefault().addView(v, lp);
-
-        Dashboard dashboard = (Dashboard) v;
-        dashboard.init(parent, accountId, username);
-        return dashboard;
-    }
-
-    public final void init(Activity activity, long accountId, String username) {
-        mActivity = activity;
-        mAccountId = accountId;
-        mUserName = username;
-        mGallery = (Gallery) findViewById(R.id.chats_gallery);
-
-        mGallery.setEmptyView(findViewById(R.id.empty));
-
-        ContentResolver cr = mContext.getContentResolver();
-
-        Cursor c = cr.query(Im.Contacts.CONTENT_URI_CHAT_CONTACTS,
-                null, null, null, null);
-
-        mProviderIdColumn = c.getColumnIndexOrThrow(Im.Contacts.PROVIDER);
-        mAccountIdColumn = c.getColumnIndexOrThrow(Im.Contacts.ACCOUNT);
-        mUsernameColumn = c.getColumnIndexOrThrow(Im.Contacts.USERNAME);
-        mNicknameColumn = c.getColumnIndexOrThrow(Im.Contacts.NICKNAME);
-        mPresenceStatusColumn = c.getColumnIndexOrThrow(Im.Contacts.PRESENCE_STATUS);
-        mLastUnreadMessageColumn = c.getColumnIndexOrThrow(Im.Chats.LAST_UNREAD_MESSAGE);
-        mShortcutColumn = c.getColumnIndexOrThrow(Im.Chats.SHORTCUT);
-        mChats = c;
-
-        mGallery.setAdapter(new DashboardAdapter(mContext, mChats));
-        mGallery.setSelection(getInitialPosition());
-        mGallery.setOnItemClickListener(this);
-        mGallery.requestFocus();
-    }
-
-    public final void init(Activity activity) {
-        init(activity, -1L, null);
-    }
-
-    @Override
-    public final boolean dispatchKeyEvent(KeyEvent event) {
-        int code = event.getKeyCode();
-        if (code == KeyEvent.KEYCODE_BACK) {
-            closeDashboard();
-            if (mCancelListener != null) {
-                mCancelListener.onCancel();
-            }
-            return true;
-        }
-
-        if (code >= KeyEvent.KEYCODE_0 && code <= KeyEvent.KEYCODE_9) {
-            if (quickSwitch(mActivity, mChats, code - KeyEvent.KEYCODE_0)) {
-                mActivity.finish();
-                closeDashboard();
-                return true;
-            }
-        }
-        return super.dispatchKeyEvent(event);
-    }
-
-    void closeDashboard() {
-        WindowManagerImpl.getDefault().removeView(this);
-        if (mChats != null) {
-            mChats.deactivate();
-        }
-    }
-
-    private int getInitialPosition() {
-        if ((mAccountId == -1) || (mUserName == null)) {
-            return -1;
-        }
-
-        mChats.moveToPosition(-1);
-        while (mChats.moveToNext()) {
-            if ((mAccountId == mChats.getLong(mAccountIdColumn))
-                    && mUserName.equals(mChats.getString(mUsernameColumn))) {
-                return mChats.getPosition();
-            }
-        }
-        return -1;
-    }
-
-    private class DashboardAdapter extends ResourceCursorAdapter {
-        private String mMenuPlus;
-
-        public DashboardAdapter(Context context, Cursor c) {
-            super(context, R.layout.dashboard_item, c);
-
-            mMenuPlus = context.getString(R.string.menu_plus);
-        }
-
-        @Override
-        public void bindView(View view, Context context, Cursor c) {
-
-            long providerId = c.getLong(mProviderIdColumn);
-            String nickname = c.getString(mNicknameColumn);
-            TextView t = (TextView) view.findViewById(R.id.name);
-
-            t.setText(nickname);
-
-            ImageView i = (ImageView) view.findViewById(R.id.presence);
-            int presenceMode = c.getInt(mPresenceStatusColumn);
-            String lastUnreadMsg = c.getString(mLastUnreadMessageColumn);
-
-            ImApp app = ImApp.getApplication(mActivity);
-            BrandingResources brandingRes = app.getBrandingResource(providerId);
-            if (!TextUtils.isEmpty(lastUnreadMsg)) {
-                i.setImageDrawable(brandingRes.getDrawable(
-                        BrandingResourceIDs.DRAWABLE_UNREAD_CHAT));
-            } else {
-                i.setImageDrawable(brandingRes.getDrawable(
-                        PresenceUtils.getStatusIconId(presenceMode)));
-            }
-
-            String shortcut = c.getString(mShortcutColumn);
-            TextView shortcutView = (TextView) view.findViewById(R.id.shortcut);
-            if (TextUtils.isEmpty(shortcut)) {
-                shortcutView.setVisibility(View.GONE);
-            } else {
-                shortcutView.setVisibility(View.VISIBLE);
-                shortcutView.setText(mMenuPlus + shortcut);
-            }
-
-            setAvatar(c, view);
-        }
-
-        private void setAvatar(Cursor c, View v) {
-            ImageView i = (ImageView) v.findViewById(R.id.avatar);
-
-            int avatarDataColumn = c.getColumnIndexOrThrow(Im.Contacts.AVATAR_DATA);
-            Drawable avatar = DatabaseUtils.getAvatarFromCursor(c, avatarDataColumn);
-
-            if (avatar == null) {
-                setBitmapResource(i, R.drawable.avatar_unknown);
-            } else {
-                i.setImageDrawable(avatar);
-            }
-        }
-
-        private final void setBitmapResource(ImageView i, int r) {
-            Resources res = mContext.getResources();
-
-            i.setImageDrawable(res.getDrawable(r));
-        }
-    }
-
-    public final void onItemClick(AdapterView parent, View view, int position, long id) {
-        Cursor c  = (Cursor) mGallery.getItemAtPosition(position);
-        String contact = c.getString(mUsernameColumn);
-        long account = c.getLong(mAccountIdColumn);
-        long provider = c.getLong(mProviderIdColumn);
-
-        closeDashboard();
-
-        if ((account == mAccountId) && contact.equals(mUserName)) {
-            return;
-        }
-
-        mActivity.startActivity(
-                makeChatIntent(mActivity.getContentResolver(), provider, account, contact, id));
-        mActivity.finish();
-    }
-
-    public void setOnCancelListener(OnCancelListener listener) {
-        mCancelListener = listener;
-    }
-
-    private static String findCategory(ContentResolver resolver, long providerId) {
-        // find the provider category for this chat
-        Cursor providerCursor = resolver.query(
-                Im.Provider.CONTENT_URI,
-                PROVIDER_CATEGORY_PROJECTION,
-                "_id = " + providerId,
-                null /* selection args */,
-                null /* sort order */
-        );
-        String category = null;
-
-        try {
-            if (providerCursor.moveToFirst()) {
-                category = providerCursor.getString(PROVIDER_CATEGORY_COLUMN);
-            }
-        } finally {
-            providerCursor.close();
-        }
-
-        return category;
-    }
-
-    public static boolean quickSwitch(Activity parent, Cursor cursor, int slot) {
-        if (cursor == null) {
-            return false;
-        }
-
-        if (slot < 0 || slot > 9) {
-            return false;
-        }
-
-        int shortcutColumn = cursor.getColumnIndexOrThrow(Im.Chats.SHORTCUT);
-        cursor.moveToPosition(-1);
-        while (cursor.moveToNext()) {
-            int shortcut = cursor.getInt(shortcutColumn);
-            if (shortcut == slot) {
-                long provider = cursor.getLong(
-                        cursor.getColumnIndexOrThrow(Im.Contacts.PROVIDER));
-                long account = cursor.getLong(
-                        cursor.getColumnIndexOrThrow(Im.Contacts.ACCOUNT));
-                String username = cursor.getString(
-                        cursor.getColumnIndexOrThrow(Im.Contacts.USERNAME));
-                long chatId = cursor.getLong(
-                        cursor.getColumnIndexOrThrow("_id"));
-
-                ContentResolver cr = parent.getContentResolver();
-                parent.startActivity(
-                        makeChatIntent(cr, provider, account, username, chatId));
-
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static Intent makeChatIntent(ContentResolver resolver, long provider, long account,
-            String contact, long chatId) {
-        Intent intent = new Intent(Intent.ACTION_VIEW,
-                ContentUris.withAppendedId(Im.Chats.CONTENT_URI, chatId));
-        intent.addCategory(findCategory(resolver, provider));
-        intent.putExtra("from", contact);
-        intent.putExtra("providerId", provider);
-        intent.putExtra("accountId", account);
-
-        return intent;
-    }
-
-    public interface OnCancelListener {
-        void onCancel();
-    }
-}
diff --git a/src/com/android/im/app/DatabaseUtils.java b/src/com/android/im/app/DatabaseUtils.java
deleted file mode 100644 (file)
index 90d0433..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.database.Cursor;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.drawable.BitmapDrawable;
-import android.graphics.drawable.Drawable;
-import android.net.Uri;
-import android.provider.Im;
-
-public class DatabaseUtils {
-    private DatabaseUtils() {
-    }
-
-    public static Cursor queryAccountsForProvider(ContentResolver cr,
-            String[] projection, long providerId) {
-        StringBuilder where = new StringBuilder(Im.Account.ACTIVE);
-        where.append("=1 AND ").append(Im.Account.PROVIDER).append('=').append(providerId);
-        Cursor c = cr.query(Im.Account.CONTENT_URI, projection, where.toString(), null, null);
-        if (c != null && !c.moveToFirst()) {
-            c.close();
-            return null;
-        }
-        return c;
-    }
-
-    public static Drawable getAvatarFromCursor(Cursor cursor, int dataColumn) {
-        byte[] rawData = cursor.getBlob(dataColumn);
-        if (rawData == null) {
-            return null;
-        }
-        return decodeAvatar(rawData);
-    }
-
-    public static Uri getAvatarUri(Uri baseUri, long providerId, long accountId) {
-        Uri.Builder builder = baseUri.buildUpon();
-        ContentUris.appendId(builder, providerId);
-        ContentUris.appendId(builder, accountId);
-        return builder.build();
-    }
-
-    public static Drawable getAvatarFromCursor(Cursor cursor, int dataColumn,
-            int encodedDataColumn, String username, boolean updateBlobUseCursor,
-            ContentResolver resolver, Uri updateBlobUri) {
-        /**
-         * Optimization: the avatar table in IM content provider have two
-         * columns, one for the raw blob data, another for the base64 encoded
-         * data. The reason for this is when the avatars are initially
-         * downloaded, they are in the base64 encoded form, and instead of
-         * base64 decode the avatars for all the buddies up front, we can just
-         * simply store the encoded data in the table, and decode them on demand
-         * when displaying them. Once we decode the avatar, we store the decoded
-         * data as a blob, and null out the encoded column in the avatars table.
-         * query the raw blob data first, if present, great; if not, query the
-         * encoded data, decode it and store as the blob, and null out the
-         * encoded column.
-         */
-        byte[] rawData = cursor.getBlob(dataColumn);
-
-        if (rawData == null) {
-            String encodedData = cursor.getString(encodedDataColumn);
-            if (encodedData == null) {
-                // Log.e(LogTag.LOG_TAG, "getAvatarFromCursor for " + username +
-                // ", no raw or encoded data!");
-                return null;
-            }
-
-            rawData = android.os.Base64Utils.decodeBase64(encodedData);
-
-            // if (DBG) {
-            // log("getAvatarFromCursor for " + username + ": found encoded
-            // data,"
-            // + " update blob with data, len=" + rawData.length);
-            // }
-
-            if (updateBlobUseCursor) {
-                cursor.updateBlob(dataColumn, rawData);
-                cursor.updateString(encodedDataColumn, null);
-                cursor.commitUpdates();
-            } else {
-                updateAvatarBlob(resolver, updateBlobUri, rawData, username);
-            }
-        }
-
-        return decodeAvatar(rawData);
-    }
-
-    private static void updateAvatarBlob(ContentResolver resolver, Uri updateUri, byte[] data,
-            String username) {
-        ContentValues values = new ContentValues(3);
-        values.put(Im.Avatars.DATA, data);
-
-        StringBuilder buf = new StringBuilder(Im.Avatars.CONTACT);
-        buf.append("=?");
-
-        String[] selectionArgs = new String[] {
-            username
-        };
-
-        resolver.update(updateUri, values, buf.toString(), selectionArgs);
-    }
-
-    private static Drawable decodeAvatar(byte[] data) {
-        Bitmap b = BitmapFactory.decodeByteArray(data, 0, data.length);
-        Drawable avatar = new BitmapDrawable(b);
-        return avatar;
-    }
-}
diff --git a/src/com/android/im/app/ErrorResUtils.java b/src/com/android/im/app/ErrorResUtils.java
deleted file mode 100644 (file)
index 3f6eee0..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import com.android.im.R;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.imps.ImpsErrorInfo;
-
-import android.content.res.Resources;
-
-public class ErrorResUtils {
-
-    public static String getErrorRes(Resources res, int code, Object... args) {
-        int resId = getErrorResId(code);
-        if (resId == 0) {
-            return res.getString(R.string.general_error, code);
-        } else {
-            return res.getString(resId, args);
-        }
-    }
-
-    private static int getErrorResId(int code) {
-        switch (code) {
-            case ImErrorInfo.ILLEGAL_CONTACT_LIST_MANAGER_STATE:
-                return R.string.contact_not_loaded;
-
-            case ImErrorInfo.CONTACT_EXISTS_IN_LIST:
-                return R.string.contact_already_exist;
-
-            case ImErrorInfo.CANT_ADD_BLOCKED_CONTACT:
-                return R.string.contact_blocked;
-
-            case ImErrorInfo.CANT_CONNECT_TO_SERVER:
-                return R.string.cant_connect_to_server;
-
-            case ImErrorInfo.NETWORK_ERROR:
-                return R.string.network_error;
-
-            case ImpsErrorInfo.SERVICE_NOT_SUPPORTED:
-                return R.string.service_not_support;
-
-            case ImpsErrorInfo.INVALID_PASSWORD:
-                return R.string.invalid_password;
-
-            case ImpsErrorInfo.INTERNAL_SERVER_OR_NETWORK_ERROR:
-                return R.string.internal_server_error;
-
-            case ImpsErrorInfo.NOT_IMPLMENTED:
-                return R.string.not_implemented;
-
-            case ImpsErrorInfo.SERVER_UNAVAILABLE:
-                return R.string.service_unavaiable;
-
-            case ImpsErrorInfo.TIMEOUT:
-                return R.string.timeout;
-
-            case ImpsErrorInfo.VERSION_NOT_SUPPORTED:
-                return R.string.version_not_supported;
-
-            case ImpsErrorInfo.MESSAGE_QUEUE_FULL:
-                return R.string.message_queue_full;
-
-            case ImpsErrorInfo.DOMAIN_NOT_SUPPORTED:
-                return R.string.domain_not_supported;
-
-            case ImpsErrorInfo.UNKNOWN_USER:
-                return R.string.unknown_user;
-
-            case ImpsErrorInfo.RECIPIENT_BLOCKED_SENDER:
-                return R.string.recipient_blocked_the_user;
-
-            case ImpsErrorInfo.SESSION_EXPIRED:
-                return R.string.session_expired;
-
-            case ImpsErrorInfo.FORCED_LOGOUT:
-                return R.string.forced_logout;
-
-            case ImpsErrorInfo.ALREADY_LOGGED:
-                return R.string.already_logged_in;
-
-            case ImErrorInfo.NOT_LOGGED_IN:
-                return R.string.not_signed_in;
-       
-            case ImpsErrorInfo.MSISDN_ERROR:
-                return R.string.msisdn_error;
-
-            default:
-                return 0;
-        }
-    }
-}
diff --git a/src/com/android/im/app/FrontDoorPlugin.java b/src/com/android/im/app/FrontDoorPlugin.java
deleted file mode 100644 (file)
index 4ef7041..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.app;
-
-import com.android.im.plugin.ImPluginConstants;
-
-import android.app.Service;
-import android.content.Intent;
-import android.content.ContentUris;
-import android.content.ContentResolver;
-import android.content.ContentValues;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.content.pm.ServiceInfo;
-import android.im.IImPlugin;
-import android.os.IBinder;
-import android.os.RemoteException;
-import android.os.Bundle;
-import android.provider.Im;
-import android.util.Log;
-import android.text.TextUtils;
-import android.database.Cursor;
-import android.net.Uri;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.List;
-import java.util.ArrayList;
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
-
-import dalvik.system.PathClassLoader;
-
-
-public class FrontDoorPlugin extends Service {
-    private final static String TAG = ImApp.LOG_TAG;
-    private final static boolean LOCAL_DEBUG = false;
-
-    private ArrayList<String> mProviderNames;
-    private HashMap<String, String> mPackageNames;
-    private HashMap<String, String> mClassNames;
-    private HashMap<String, String> mSrcPaths;
-    private HashMap<String, Map<Integer, Integer>> mBrandingResources;
-
-    @Override
-    public IBinder onBind(Intent intent) {
-        loadThirdPartyPlugins();
-        loadBrandingResources();
-        return mBinder;
-    }
-
-    private void loadThirdPartyPlugins() {
-        mProviderNames = new ArrayList<String>();
-        mPackageNames = new HashMap<String, String>();
-        mClassNames = new HashMap<String, String>();
-        mSrcPaths = new HashMap<String, String>();
-
-        PackageManager pm = getPackageManager();
-        List<ResolveInfo> plugins = pm.queryIntentServices(
-                new Intent(ImPluginConstants.PLUGIN_ACTION_NAME), PackageManager.GET_META_DATA);
-        for (ResolveInfo info : plugins) {
-            if (LOCAL_DEBUG) log("loadThirdPartyPlugins: found plugin " + info);
-
-            ServiceInfo serviceInfo = info.serviceInfo;
-            if (serviceInfo == null) {
-                Log.e(TAG, "loadThirdPartyPlugins: ignore bad plugin: " + info);
-                continue;
-            }
-
-            String providerName = null;
-            String providerFullName = null;
-            String signUpUrl = null;
-            Bundle metaData = serviceInfo.metaData;
-            if (metaData != null) {
-                providerName = metaData.getString(ImPluginConstants.METADATA_PROVIDER_NAME);
-                providerFullName = metaData.getString(ImPluginConstants.METADATA_PROVIDER_FULL_NAME);
-                signUpUrl = metaData.getString(ImPluginConstants.METADATA_SIGN_UP_URL);
-            }
-            if (TextUtils.isEmpty(providerName) || TextUtils.isEmpty(providerFullName)) {
-                Log.e(TAG, "Ignore bad IM plugin: " + info + ". Lack of required meta data");
-                continue;
-            }
-
-            mProviderNames.add(providerName);
-            mPackageNames.put(providerName, serviceInfo.packageName);
-            mClassNames.put(providerName, serviceInfo.name);
-            mSrcPaths.put(providerName, serviceInfo.applicationInfo.sourceDir);
-
-            updateProviderDb(providerName, providerFullName, signUpUrl);
-        }
-    }
-
-    private long updateProviderDb(String providerName, String providerFullName, String signUpUrl) {
-        long providerId;
-        ContentResolver cr = getContentResolver();
-        String where = Im.Provider.NAME + "=?";
-        String[] selectionArgs = new String[]{providerName};
-        Cursor c = cr.query(Im.Provider.CONTENT_URI, null, where, selectionArgs, null);
-
-        try {
-            if (c.moveToFirst()) {
-                providerId = c.getLong(c.getColumnIndexOrThrow(Im.Provider._ID));
-                String origFullName = c.getString(
-                        c.getColumnIndexOrThrow(Im.Provider.FULLNAME));
-                String origCategory = c.getString(
-                        c.getColumnIndexOrThrow(Im.Provider.CATEGORY));
-                String origSignupUrl = c.getString(
-                        c.getColumnIndexOrThrow(Im.Provider.SIGNUP_URL));
-                ContentValues values = new ContentValues();
-                if (origFullName == null || !origFullName.equals(providerFullName)) {
-                    values.put(Im.Provider.FULLNAME, providerFullName);
-                }
-                if (origCategory == null) {
-                    values.put(Im.Provider.CATEGORY, ImApp.IMPS_CATEGORY);
-                }
-                if (origSignupUrl == null || !origSignupUrl.equals(signUpUrl)) {
-                    values.put(Im.Provider.SIGNUP_URL, signUpUrl);
-                }
-                if (values.size() > 0) {
-                    Uri uri = ContentUris.withAppendedId(Im.Provider.CONTENT_URI, providerId);
-                    cr.update(uri, values, null, null);
-                }
-            } else {
-                ContentValues values = new ContentValues(3);
-                values.put(Im.Provider.NAME, providerName);
-                values.put(Im.Provider.FULLNAME, providerFullName);
-                values.put(Im.Provider.CATEGORY, ImApp.IMPS_CATEGORY);
-                values.put(Im.Provider.SIGNUP_URL, signUpUrl);
-
-                Uri result = cr.insert(Im.Provider.CONTENT_URI, values);
-                providerId = ContentUris.parseId(result);
-            }
-        } finally {
-            c.close();
-        }
-
-        return providerId;
-    }
-
-    private void loadBrandingResources() {
-        mBrandingResources = new HashMap<String, Map<Integer, Integer>>();
-
-        for (String provider : mProviderNames) {
-            if (!mBrandingResources.containsKey(provider)) {
-                if (LOCAL_DEBUG) log("loadBrandingResources: load resource map for " + provider);
-                Map<Integer, Integer> map = loadBrandingResource(mClassNames.get(provider),
-                        mSrcPaths.get(provider));
-                if (map != null) {
-                    mBrandingResources.put(provider, map);
-                }
-            }
-        }
-    }
-
-    private Map<Integer, Integer> loadBrandingResource(String className, String srcPath) {
-        Map retVal = null;
-
-        if (LOCAL_DEBUG) log("loadBrandingResource: className=" + className +
-                ", srcPath=" + srcPath);
-
-        PathClassLoader classLoader = new PathClassLoader(srcPath,
-                getCustomClassLoader());
-
-        try {
-            Class cls = classLoader.loadClass(className);
-            Method m = cls.getMethod("getResourceMap");
-
-            // TODO: this would still cause a VM verifier exception to be thrown if.
-            // the landing page Android.mk and AndroidManifest.xml don't include use-library for
-            // "com.android.im.plugin". This is even with getCustomClassLoader() as the parent
-            // class loader.
-            retVal = (Map)m.invoke(cls.newInstance(), new Object[]{});
-
-        } catch (ClassNotFoundException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        } catch (IllegalAccessException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        } catch (InstantiationException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        } catch (SecurityException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        } catch (NoSuchMethodException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        } catch (IllegalArgumentException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        } catch (InvocationTargetException e) {
-            Log.e(TAG, "Failed load the plugin resource map", e);
-        }
-
-        return retVal;
-    }
-
-    private ClassLoader getCustomClassLoader() {
-        /*
-        // TODO: should not hard code the path!
-        ClassLoader retVal = new PathClassLoader("/System/framework/com.android.im.plugin.jar",
-                getClassLoader());
-        if (LOCAL_DEBUG) log("getCustomClassLoader: " + retVal);
-        return retVal;
-        */
-        return getClassLoader();
-    }
-
-    private void log(String msg) {
-        Log.d(TAG, "[ImFrontDoor] " + msg);
-    }
-
-
-    /**
-     * The implementation of IImFrontDoorPlugin defined through AIDL.
-     */
-    private final IImPlugin.Stub mBinder = new IImPlugin.Stub() {
-
-        /**
-         * Notify the plugin the front door activity is created. This gives the plugin a chance to
-         * start its own servics, etc.
-         */
-        public void onStart() {
-        }
-
-        /**
-         * Notify the plugin the front door activity is stopping.
-         */
-        public void onStop() {
-        }
-
-        /**
-         * Sign in to the service for the account passed in.
-         */
-        public void signIn(long account) {
-            if (LOCAL_DEBUG) log("signIn for account " + account);
-
-            Intent intent = new Intent();
-            intent.setData(ContentUris.withAppendedId(Im.Account.CONTENT_URI, account));
-            intent.setClassName("com.android.im", "com.android.im.app.SigningInActivity");
-
-            startActivity(intent);
-        }
-
-        /**
-         * Sign out of the service for the account passed in.
-         */
-        public void signOut(long account) {
-            if (LOCAL_DEBUG) log("signOut for account " + account);
-            Intent intent = new Intent();
-            intent.setData(ContentUris.withAppendedId(Im.Account.CONTENT_URI, account));
-            intent.setClassName("com.android.im", "com.android.im.app.SignoutActivity");
-
-            startActivity(intent);
-        }
-
-        public String getResourcePackageNameForProvider(String providerName) {
-            return mPackageNames.get(providerName);
-        }
-
-        public Map getResourceMapForProvider(String providerName) throws RemoteException {
-            return mBrandingResources.get(providerName);
-        }
-
-        public List getSupportedProviders() {
-            return mProviderNames;
-        }
-    };
-
-}
diff --git a/src/com/android/im/app/ImApp.java b/src/com/android/im/app/ImApp.java
deleted file mode 100644 (file)
index 3b33560..0000000
+++ /dev/null
@@ -1,717 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import android.app.Activity;
-import android.app.Application;
-import android.content.ComponentName;
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.Context;
-import android.content.Intent;
-import android.content.ServiceConnection;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.content.pm.ServiceInfo;
-import android.content.res.Resources;
-import android.database.Cursor;
-import android.net.ConnectivityManager;
-import android.net.Uri;
-import android.os.Broadcaster;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.os.RemoteException;
-import android.provider.Im;
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.android.im.IConnectionCreationListener;
-import com.android.im.IImConnection;
-import com.android.im.IRemoteImService;
-import com.android.im.R;
-import com.android.im.app.adapter.ConnectionListenerAdapter;
-import com.android.im.engine.ImConnection;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.plugin.BrandingResourceIDs;
-import com.android.im.plugin.ImPluginConstants;
-import com.android.im.plugin.ImPluginInfo;
-import com.android.im.service.ImServiceConstants;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-public class ImApp extends Application {
-    public static final String LOG_TAG = "ImApp";
-
-    public static final String EXTRA_INTENT_SEND_TO_USER = "Send2_U";
-    public static final String EXTRA_INTENT_PASSWORD = "password";
-
-    public static final String IMPS_CATEGORY = "com.android.im.IMPS_CATEGORY";
-
-    private static ImApp sImApp;
-
-    IRemoteImService mImService;
-
-    HashMap<Long, IImConnection> mConnections;
-    MyConnListener mConnectionListener;
-    HashMap<Long, ProviderDef> mProviders;
-
-    Broadcaster mBroadcaster;
-
-    /** A queue of messages that are waiting to be sent when service is connected.*/
-    ArrayList<Message> mQueue = new ArrayList<Message>();
-
-    /** A flag indicates that we have called to start the service.*/
-    private boolean mServiceStarted;
-    private Context mApplicationContext;
-    private Resources mPrivateResources;
-
-    private HashMap<String, BrandingResources> mBrandingResources;
-    private BrandingResources mDefaultBrandingResources;
-
-    public static final int EVENT_SERVICE_CONNECTED = 100;
-    public static final int EVENT_CONNECTION_CREATED = 150;
-    public static final int EVENT_CONNECTION_LOGGING_IN = 200;
-    public static final int EVENT_CONNECTION_LOGGED_IN = 201;
-    public static final int EVENT_CONNECTION_LOGGING_OUT = 202;
-    public static final int EVENT_CONNECTION_DISCONNECTED = 203;
-    public static final int EVENT_CONNECTION_SUSPENDED = 204;
-    public static final int EVENT_USER_PRESENCE_UPDATED = 300;
-    public static final int EVENT_UPDATE_USER_PRESENCE_ERROR = 301;
-
-    private static final String[] PROVIDER_PROJECTION = {
-        Im.Provider._ID,
-        Im.Provider.NAME,
-        Im.Provider.FULLNAME,
-        Im.Provider.SIGNUP_URL,
-    };
-
-    private static final String[] ACCOUNT_PROJECTION = {
-        Im.Account._ID,
-        Im.Account.PROVIDER,
-        Im.Account.NAME,
-        Im.Account.USERNAME,
-        Im.Account.PASSWORD,
-    };
-
-    static final void log(String log) {
-        Log.d(LOG_TAG, log);
-    }
-
-    public static ImApp getApplication(Activity activity) {
-        // TODO should this be synchronized?
-        if (sImApp == null) {
-            initialize(activity);
-        }
-
-        return sImApp;
-    }
-
-    /**
-     * Initialize performs the manual ImApp instantiation and initialization. When the
-     * ImApp is started first in the process, the ImApp public constructor should be called,
-     * and sImApp initialized. So calling initialize() later should have no effect. However,
-     * if another application runs in the same process and is started first, the ImApp
-     * application object won't be instantiated, and we need to call initialize() manually to
-     * instantiate and initialize it.
-     */
-    private static void initialize(Activity activity) {
-        // construct the TalkApp manually and call onCreate().
-        sImApp = new ImApp();
-        sImApp.mApplicationContext = activity.getApplication();
-        sImApp.mPrivateResources = activity.getResources();
-        sImApp.onCreate();
-    }
-
-    @Override
-    public Resources getResources() {
-        if (mApplicationContext == this) {
-            return super.getResources();
-        }
-
-        return mPrivateResources;
-    }
-
-    @Override
-    public ContentResolver getContentResolver() {
-        if (mApplicationContext == this) {
-            return super.getContentResolver();
-        }
-
-        return mApplicationContext.getContentResolver();
-    }
-
-    public ImApp() {
-        super();
-        mConnections = new HashMap<Long, IImConnection>();
-        mApplicationContext = this;
-        sImApp = this;
-    }
-
-    @Override
-    public void onCreate() {
-        super.onCreate();
-        mBroadcaster = new Broadcaster();
-        loadDefaultBrandingRes();
-        mBrandingResources = new HashMap<String, BrandingResources>();
-        loadThirdPartyResources();
-    }
-
-    @Override
-    public void onTerminate() {
-        stopImServiceIfInactive();
-        if (mImService != null) {
-            try {
-                mImService.removeConnectionCreatedListener(mConnCreationListener);
-            } catch (RemoteException e) {
-                Log.w(LOG_TAG, "failed to remove ConnectionCreatedListener");
-            }
-        }
-
-        super.onTerminate();
-    }
-
-    public synchronized void startImServiceIfNeed() {
-        if(!mServiceStarted) {
-            if(Log.isLoggable(LOG_TAG, Log.DEBUG)) log("start ImService");
-
-            Intent serviceIntent = new Intent();
-            serviceIntent.setComponent(ImServiceConstants.IM_SERVICE_COMPONENT);
-            mApplicationContext.startService(serviceIntent);
-            mApplicationContext.bindService(serviceIntent, mImServiceConn, Context.BIND_AUTO_CREATE);
-            mServiceStarted = true;
-
-            mConnectionListener = new MyConnListener(new Handler());
-        }
-    }
-
-    public synchronized void stopImServiceIfInactive() {
-        boolean hasActiveConnection = true;
-        synchronized (mConnections) {
-            hasActiveConnection = !mConnections.isEmpty();
-        }
-
-        if (!hasActiveConnection && mServiceStarted) {
-            if (Log.isLoggable(LOG_TAG, Log.DEBUG))
-                log("stop ImService because there's no active connections");
-
-            if(mImService != null) {
-                mApplicationContext.unbindService(mImServiceConn);
-                mImService = null;
-            }
-            Intent intent = new Intent();
-            intent.setComponent(ImServiceConstants.IM_SERVICE_COMPONENT);
-            mApplicationContext.stopService(intent);
-            mServiceStarted = false;
-        }
-    }
-
-    private ServiceConnection mImServiceConn = new ServiceConnection() {
-        public void onServiceConnected(ComponentName className, IBinder service) {
-            if(Log.isLoggable(LOG_TAG, Log.DEBUG))
-                log("service connected");
-
-            mImService = IRemoteImService.Stub.asInterface(service);
-            fetchActiveConnections();
-
-            synchronized (mQueue) {
-                for (Message msg : mQueue) {
-                    msg.sendToTarget();
-                }
-                mQueue.clear();
-            }
-            Message msg = Message.obtain(null, EVENT_SERVICE_CONNECTED);
-            mBroadcaster.broadcast(msg);
-        }
-
-        public void onServiceDisconnected(ComponentName className) {
-            if(Log.isLoggable(LOG_TAG, Log.DEBUG))
-                log("service disconnected");
-
-            mConnections.clear();
-            mImService = null;
-        }
-    };
-
-    public boolean serviceConnected() {
-        return mImService != null;
-    }
-
-    public boolean isBackgroundDataEnabled() {
-        ConnectivityManager manager =
-                (ConnectivityManager) mApplicationContext.getSystemService(CONNECTIVITY_SERVICE);
-        return manager.getBackgroundDataSetting();
-    }
-
-    public static long insertOrUpdateAccount(ContentResolver cr,
-            long providerId, String userName, String pw) {
-        String selection = Im.Account.PROVIDER + "=? AND " + Im.Account.USERNAME + "=?";
-        String[] selectionArgs = {Long.toString(providerId), userName };
-
-        Cursor c = cr.query(Im.Account.CONTENT_URI, ACCOUNT_PROJECTION,
-                selection, selectionArgs, null);
-        if (c != null && c.moveToFirst()) {
-            // Update the password
-            c.updateString(c.getColumnIndexOrThrow(Im.Account.PASSWORD), pw);
-            c.commitUpdates();
-
-            long id = c.getLong(c.getColumnIndexOrThrow(Im.Account._ID));
-            c.close();
-            return id;
-        } else {
-            ContentValues values = new ContentValues(4);
-            values.put(Im.Account.PROVIDER, providerId);
-            values.put(Im.Account.NAME, userName);
-            values.put(Im.Account.USERNAME, userName);
-            values.put(Im.Account.PASSWORD, pw);
-
-            Uri result = cr.insert(Im.Account.CONTENT_URI, values);
-            return ContentUris.parseId(result);
-        }
-    }
-
-    private void loadImProviderSettings() {
-        if (mProviders != null) {
-            return;
-        }
-        mProviders = new HashMap<Long, ProviderDef>();
-        ContentResolver cr = getContentResolver();
-        Cursor c = cr.query(Im.Provider.CONTENT_URI, PROVIDER_PROJECTION,
-                null, null, null);
-        if (c == null) {
-            return;
-        }
-
-        while (c.moveToNext()) {
-            long id = c.getLong(0);
-            String providerName = c.getString(1);
-            String fullName = c.getString(2);
-            String signUpUrl = c.getString(3);
-
-            mProviders.put(id, new ProviderDef(id, providerName, fullName, signUpUrl));
-        }
-
-        c.close();
-    }
-
-    private void loadDefaultBrandingRes() {
-        HashMap<Integer, Integer> resMapping = new HashMap<Integer, Integer>();
-
-        resMapping.put(BrandingResourceIDs.DRAWABLE_LOGO, R.drawable.imlogo_s);
-        resMapping.put(BrandingResourceIDs.DRAWABLE_PRESENCE_ONLINE,
-                android.R.drawable.presence_online);
-        resMapping.put(BrandingResourceIDs.DRAWABLE_PRESENCE_AWAY,
-                android.R.drawable.presence_away);
-        resMapping.put(BrandingResourceIDs.DRAWABLE_PRESENCE_BUSY,
-                android.R.drawable.presence_busy);
-        resMapping.put(BrandingResourceIDs.DRAWABLE_PRESENCE_INVISIBLE,
-                android.R.drawable.presence_invisible);
-        resMapping.put(BrandingResourceIDs.DRAWABLE_PRESENCE_OFFLINE,
-                android.R.drawable.presence_offline);
-        resMapping.put(BrandingResourceIDs.DRAWABLE_READ_CHAT,
-                R.drawable.status_chat);
-        resMapping.put(BrandingResourceIDs.DRAWABLE_UNREAD_CHAT,
-                R.drawable.status_chat_new);
-        resMapping.put(BrandingResourceIDs.DRAWABLE_BLOCK,
-                R.drawable.ic_im_block);
-
-        resMapping.put(BrandingResourceIDs.STRING_ARRAY_SMILEY_NAMES,
-                R.array.default_smiley_names);
-        resMapping.put(BrandingResourceIDs.STRING_ARRAY_SMILEY_TEXTS,
-                R.array.default_smiley_texts);
-
-        resMapping.put(BrandingResourceIDs.STRING_PRESENCE_AVAILABLE,
-                R.string.presence_available);
-        resMapping.put(BrandingResourceIDs.STRING_PRESENCE_BUSY,
-                R.string.presence_busy);
-        resMapping.put(BrandingResourceIDs.STRING_PRESENCE_AWAY,
-                R.string.presence_away);
-        resMapping.put(BrandingResourceIDs.STRING_PRESENCE_IDLE,
-                R.string.presence_idle);
-        resMapping.put(BrandingResourceIDs.STRING_PRESENCE_OFFLINE,
-                R.string.presence_offline);
-        resMapping.put(BrandingResourceIDs.STRING_PRESENCE_INVISIBLE,
-                R.string.presence_invisible);
-        resMapping.put(BrandingResourceIDs.STRING_LABEL_USERNAME,
-                R.string.label_username);
-        resMapping.put(BrandingResourceIDs.STRING_ONGOING_CONVERSATION,
-                R.string.ongoing_conversation);
-        resMapping.put(BrandingResourceIDs.STRING_ADD_CONTACT_TITLE,
-                R.string.add_contact_title);
-        resMapping.put(BrandingResourceIDs.STRING_LABEL_INPUT_CONTACT,
-                R.string.input_contact_label);
-        resMapping.put(BrandingResourceIDs.STRING_BUTTON_ADD_CONTACT,
-                R.string.invite_label);
-        resMapping.put(BrandingResourceIDs.STRING_CONTACT_INFO_TITLE,
-                R.string.contact_profile_title);
-
-        resMapping.put(BrandingResourceIDs.STRING_MENU_ADD_CONTACT,
-                R.string.menu_add_contact);
-        resMapping.put(BrandingResourceIDs.STRING_MENU_BLOCK_CONTACT,
-                R.string.menu_block_contact);
-        resMapping.put(BrandingResourceIDs.STRING_MENU_CONTACT_LIST,
-                R.string.menu_view_contact_list);
-        resMapping.put(BrandingResourceIDs.STRING_MENU_DELETE_CONTACT,
-                R.string.menu_remove_contact);
-        resMapping.put(BrandingResourceIDs.STRING_MENU_END_CHAT,
-                R.string.menu_end_conversation);
-        resMapping.put(BrandingResourceIDs.STRING_MENU_INSERT_SMILEY,
-                R.string.menu_insert_smiley);
-        resMapping.put(BrandingResourceIDs.STRING_MENU_START_CHAT,
-                R.string.menu_start_chat);
-        resMapping.put(BrandingResourceIDs.STRING_MENU_VIEW_PROFILE,
-                R.string.menu_view_profile);
-        resMapping.put(BrandingResourceIDs.STRING_MENU_SWITCH_CHATS,
-                R.string.menu_switch_chats);
-
-        resMapping.put(BrandingResourceIDs.STRING_TOAST_CHECK_AUTO_SIGN_IN,
-                R.string.check_auto_sign_in);
-        resMapping.put(BrandingResourceIDs.STRING_LABEL_SIGN_UP,
-                R.string.sign_up);
-
-        mDefaultBrandingResources = new BrandingResources(this, resMapping,
-                null /* default res */);
-    }
-
-    private void loadThirdPartyResources() {
-        PackageManager pm = getPackageManager();
-        List<ResolveInfo> plugins = pm.queryIntentServices(
-                new Intent(ImPluginConstants.PLUGIN_ACTION_NAME), PackageManager.GET_META_DATA);
-        for (ResolveInfo info : plugins) {
-            Log.d(LOG_TAG, "Found plugin " + info);
-
-            ServiceInfo serviceInfo = info.serviceInfo;
-            if (serviceInfo == null) {
-                Log.e(LOG_TAG, "Ignore bad IM plugin: " + info);
-                continue;
-            }
-            String providerName = null;
-            String providerFullName = null;
-            Bundle metaData = serviceInfo.metaData;
-            if (metaData != null) {
-                providerName = metaData.getString(
-                        ImPluginConstants.METADATA_PROVIDER_NAME);
-                providerFullName = metaData.getString(
-                        ImPluginConstants.METADATA_PROVIDER_FULL_NAME);
-            }
-            if (TextUtils.isEmpty(providerName)
-                    || TextUtils.isEmpty(providerFullName)) {
-                Log.e(LOG_TAG, "Ignore bad IM plugin: " + info
-                        + ". Lack of required meta data");
-                continue;
-            }
-
-            ImPluginInfo pluginInfo = new ImPluginInfo(providerName,
-                    serviceInfo.packageName, serviceInfo.name,
-                    serviceInfo.applicationInfo.sourceDir);
-
-            BrandingResources res = new BrandingResources(this, pluginInfo,
-                    mDefaultBrandingResources);
-            mBrandingResources.put(providerName, res);
-        }
-    }
-
-    public long getProviderId(String name) {
-        loadImProviderSettings();
-        for (ProviderDef provider: mProviders.values()) {
-            if(provider.mName.equals(name)) {
-                return provider.mId;
-            }
-        }
-        return -1;
-    }
-
-    public ProviderDef getProvider(long id) {
-        loadImProviderSettings();
-        return mProviders.get(id);
-    }
-
-    public List<ProviderDef> getProviders() {
-        loadImProviderSettings();
-        ArrayList<ProviderDef> result = new ArrayList<ProviderDef>();
-        result.addAll(mProviders.values());
-        return result;
-    }
-
-    public BrandingResources getBrandingResource(long providerId) {
-        ProviderDef provider = getProvider(providerId);
-        if (provider == null) {
-            return mDefaultBrandingResources;
-        }
-        BrandingResources res = mBrandingResources.get(provider.mName);
-        return res == null ? mDefaultBrandingResources : res;
-    }
-
-    public IImConnection createConnection(long providerId) throws RemoteException {
-        if (mImService == null) {
-            // Service hasn't been connected or has died.
-            return null;
-        }
-        IImConnection conn = getConnection(providerId);
-        if (conn == null) {
-            conn = mImService.createConnection(providerId);
-        }
-        return conn;
-    }
-
-    IImConnection getConnection(long providerId) {
-        synchronized (mConnections) {
-            return mConnections.get(providerId);
-        }
-    }
-
-    public IImConnection getConnectionByAccount(long accountId) {
-        synchronized (mConnections) {
-            for (IImConnection conn : mConnections.values()) {
-                try {
-                    if (conn.getAccountId() == accountId) {
-                        return conn;
-                    }
-                } catch (RemoteException e) {
-                    // No server!
-                }
-            }
-            return null;
-        }
-    }
-
-    public List<IImConnection> getActiveConnections() {
-        synchronized (mConnections) {
-            ArrayList<IImConnection> result = new ArrayList<IImConnection>();
-            result.addAll(mConnections.values());
-            return result;
-        }
-    }
-
-    public void callWhenServiceConnected(Handler target, Runnable callback) {
-        Message msg = Message.obtain(target, callback);
-        if (serviceConnected()) {
-            msg.sendToTarget();
-        } else {
-            startImServiceIfNeed();
-            synchronized (mQueue) {
-                mQueue.add(msg);
-            }
-        }
-    }
-
-    public void removePendingCall(Handler target) {
-        synchronized (mQueue) {
-           Iterator<Message> iter = mQueue.iterator();
-           while (iter.hasNext()) {
-               Message msg = iter.next();
-               if (msg.getTarget() == target) {
-                   iter.remove();
-               }
-           }
-       }
-   }
-
-    public void registerForBroadcastEvent(int what, Handler target) {
-        mBroadcaster.request(what, target, what);
-    }
-
-    public void unregisterForBroadcastEvent(int what, Handler target) {
-        mBroadcaster.cancelRequest(what, target, what);
-    }
-
-    public void registerForConnEvents(Handler handler) {
-        mBroadcaster.request(EVENT_CONNECTION_CREATED, handler,
-                EVENT_CONNECTION_CREATED);
-        mBroadcaster.request(EVENT_CONNECTION_LOGGING_IN, handler,
-                EVENT_CONNECTION_LOGGING_IN);
-        mBroadcaster.request(EVENT_CONNECTION_LOGGED_IN, handler,
-                EVENT_CONNECTION_LOGGED_IN);
-        mBroadcaster.request(EVENT_CONNECTION_LOGGING_OUT, handler,
-                EVENT_CONNECTION_LOGGING_OUT);
-        mBroadcaster.request(EVENT_CONNECTION_SUSPENDED, handler,
-                EVENT_CONNECTION_SUSPENDED);
-        mBroadcaster.request(EVENT_CONNECTION_DISCONNECTED, handler,
-                EVENT_CONNECTION_DISCONNECTED);
-        mBroadcaster.request(EVENT_USER_PRESENCE_UPDATED, handler,
-                EVENT_USER_PRESENCE_UPDATED);
-        mBroadcaster.request(EVENT_UPDATE_USER_PRESENCE_ERROR, handler,
-                EVENT_UPDATE_USER_PRESENCE_ERROR);
-    }
-
-    public void unregisterForConnEvents(Handler handler) {
-        mBroadcaster.cancelRequest(EVENT_CONNECTION_CREATED, handler,
-                EVENT_CONNECTION_CREATED);
-        mBroadcaster.cancelRequest(EVENT_CONNECTION_LOGGING_IN, handler,
-                EVENT_CONNECTION_LOGGING_IN);
-        mBroadcaster.cancelRequest(EVENT_CONNECTION_LOGGED_IN, handler,
-                EVENT_CONNECTION_LOGGED_IN);
-        mBroadcaster.cancelRequest(EVENT_CONNECTION_LOGGING_OUT, handler,
-                EVENT_CONNECTION_LOGGING_OUT);
-        mBroadcaster.cancelRequest(EVENT_CONNECTION_SUSPENDED, handler,
-                EVENT_CONNECTION_SUSPENDED);
-        mBroadcaster.cancelRequest(EVENT_CONNECTION_DISCONNECTED, handler,
-                EVENT_CONNECTION_DISCONNECTED);
-        mBroadcaster.cancelRequest(EVENT_USER_PRESENCE_UPDATED, handler,
-                EVENT_USER_PRESENCE_UPDATED);
-        mBroadcaster.cancelRequest(EVENT_UPDATE_USER_PRESENCE_ERROR, handler,
-                EVENT_UPDATE_USER_PRESENCE_ERROR);
-    }
-
-    void broadcastConnEvent(int what, long providerId, ImErrorInfo error) {
-        if(Log.isLoggable(LOG_TAG, Log.DEBUG)){
-            log("broadcasting connection event " + what + ", provider id " + providerId);
-        }
-        android.os.Message msg = android.os.Message.obtain(
-                null,
-                what,
-                (int)(providerId >> 32), (int)providerId,
-                error);
-        mBroadcaster.broadcast(msg);
-    }
-
-    public void dismissNotifications(long providerId) {
-        if (mImService != null) {
-            try {
-                mImService.dismissNotifications(providerId);
-            } catch (RemoteException e) {
-            }
-        }
-    }
-
-    public void dismissChatNotification(long providerId, String username) {
-        if (mImService != null) {
-            try {
-                mImService.dismissChatNotification(providerId, username);
-            } catch (RemoteException e) {
-            }
-        }
-    }
-
-    private void fetchActiveConnections() {
-          try {
-            // register the listener before fetch so that we won't miss any connection.
-            mImService.addConnectionCreatedListener(mConnCreationListener);
-            synchronized (mConnections) {
-                for(IBinder binder: (List<IBinder>) mImService.getActiveConnections()) {
-                    IImConnection conn = IImConnection.Stub.asInterface(binder);
-                    long providerId = conn.getProviderId();
-                    if (!mConnections.containsKey(providerId)) {
-                        mConnections.put(providerId, conn);
-                        conn.registerConnectionListener(mConnectionListener);
-                    }
-                }
-            }
-        } catch (RemoteException e) {
-            Log.e(LOG_TAG, "fetching active connections", e);
-        }
-    }
-
-    private final IConnectionCreationListener mConnCreationListener
-            = new IConnectionCreationListener.Stub() {
-        public void onConnectionCreated(IImConnection conn)
-                throws RemoteException {
-            long providerId = conn.getProviderId();
-            synchronized (mConnections) {
-                if (!mConnections.containsKey(providerId)) {
-                    mConnections.put(providerId, conn);
-                    conn.registerConnectionListener(mConnectionListener);
-                }
-            }
-            broadcastConnEvent(EVENT_CONNECTION_CREATED, providerId, null);
-        }
-      };
-
-    private final class MyConnListener extends ConnectionListenerAdapter {
-        public MyConnListener(Handler handler) {
-            super(handler);
-        }
-
-        @Override
-        public void onConnectionStateChange(IImConnection conn, int state,
-                ImErrorInfo error) {
-            if(Log.isLoggable(LOG_TAG, Log.DEBUG)){
-                log("onConnectionStateChange(" + state + ", " + error + ")");
-            }
-
-            try {
-                int what = -1;
-                long providerId = conn.getProviderId();
-                switch (state) {
-                case ImConnection.LOGGED_IN:
-                    what = EVENT_CONNECTION_LOGGED_IN;
-                    break;
-
-                case ImConnection.LOGGING_IN:
-                    what = EVENT_CONNECTION_LOGGING_IN;
-                    break;
-
-                case ImConnection.LOGGING_OUT:
-                    what = EVENT_CONNECTION_LOGGING_OUT;
-                    break;
-
-                case ImConnection.DISCONNECTED:
-                    what = EVENT_CONNECTION_DISCONNECTED;
-                    synchronized (mConnections) {
-                        mConnections.remove(providerId);
-                    }
-                    // stop the service if there isn't an active connection anymore.
-                    stopImServiceIfInactive();
-                    break;
-
-                case ImConnection.SUSPENDED:
-                    what = EVENT_CONNECTION_SUSPENDED;
-                    break;
-                }
-                if (what != -1) {
-                    broadcastConnEvent(what, providerId, error);
-                }
-            } catch (RemoteException e) {
-                Log.e(LOG_TAG, "onConnectionStateChange", e);
-            }
-        }
-
-        @Override
-        public void onUpdateSelfPresenceError(IImConnection connection,
-                ImErrorInfo error) {
-            if(Log.isLoggable(LOG_TAG, Log.DEBUG)){
-                log("onUpdateUserPresenceError(" + error + ")");
-            }
-            try {
-                long providerId = connection.getProviderId();
-                broadcastConnEvent(EVENT_UPDATE_USER_PRESENCE_ERROR, providerId,
-                        error);
-            } catch (RemoteException e) {
-                Log.e(LOG_TAG, "onUpdateUserPresenceError", e);
-            }
-        }
-
-        @Override
-        public void onSelfPresenceUpdated(IImConnection connection) {
-            if(Log.isLoggable(LOG_TAG, Log.DEBUG)) log("onUserPresenceUpdated");
-
-            try {
-                long providerId = connection.getProviderId();
-                broadcastConnEvent(EVENT_USER_PRESENCE_UPDATED, providerId,
-                        null);
-            } catch (RemoteException e) {
-                Log.e(LOG_TAG, "onUserPresenceUpdated", e);
-            }
-        }
-    }
-}
diff --git a/src/com/android/im/app/ImRingtonePreference.java b/src/com/android/im/app/ImRingtonePreference.java
deleted file mode 100644 (file)
index 9f89c61..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy
- * of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.android.im.app;
-
-import com.android.im.service.ImServiceConstants;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-import android.preference.RingtonePreference;
-import android.provider.Im;
-import android.text.TextUtils;
-import android.util.AttributeSet;
-import android.util.Log;
-
-/**
- * RingtonePreference subclass to save/restore ringtone value from ImProvider.
- */
-public class ImRingtonePreference extends RingtonePreference {
-    private long mProviderId;
-
-    public ImRingtonePreference(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        Intent intent = ((Activity)context).getIntent();
-        mProviderId = intent.getLongExtra(ImServiceConstants.EXTRA_INTENT_PROVIDER_ID, -1);
-        if (mProviderId < 0) {
-            Log.e(ImApp.LOG_TAG,"ImRingtonePreference intent requires provider id extra");
-            throw new RuntimeException("ImRingtonePreference must be created with an provider id");
-        }
-    }
-
-    @Override
-    protected Uri onRestoreRingtone() {
-        final Im.ProviderSettings.QueryMap settings = new Im.ProviderSettings.QueryMap(
-                getContext().getContentResolver(), mProviderId, 
-                false /* keep updated */, null /* no handler */);
-        
-        String uri = settings.getRingtoneURI();
-        if (Log.isLoggable(ImApp.LOG_TAG, Log.VERBOSE)) {
-            Log.v(ImApp.LOG_TAG, "onRestoreRingtone() finds uri=" + uri + " key=" + getKey());
-        }
-
-        
-        if (TextUtils.isEmpty(uri)) {
-            return null;
-        }
-        
-        Uri result = Uri.parse(uri);
-        
-        settings.close();
-        
-        return result;
-    }
-
-    @Override
-    protected void onSaveRingtone(Uri ringtoneUri) {
-        final Im.ProviderSettings.QueryMap settings = new Im.ProviderSettings.QueryMap(
-                getContext().getContentResolver(), mProviderId, 
-               false /* keep updated */, null /* no handler */);
-        
-        // When ringtoneUri is null, that means 'Silent' was chosen
-        settings.setRingtoneURI(ringtoneUri == null ? "" : ringtoneUri.toString());
-        settings.close();
-    }
-}
-
diff --git a/src/com/android/im/app/ImUrlActivity.java b/src/com/android/im/app/ImUrlActivity.java
deleted file mode 100644 (file)
index a23a7fd..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.app;
-
-import com.android.im.IChatSession;
-import com.android.im.IChatSessionManager;
-import com.android.im.IImConnection;
-import com.android.im.engine.ImConnection;
-import android.app.Activity;
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.Intent;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.RemoteException;
-import android.provider.Im;
-import android.text.TextUtils;
-import android.util.Log;
-
-import java.util.Iterator;
-import java.util.Set;
-
-public class ImUrlActivity extends Activity {
-    private static final String[] ACCOUNT_PROJECTION = {
-        Im.Account._ID,
-        Im.Account.PASSWORD,
-    };
-    private static final int ACCOUNT_ID_COLUMN = 0;
-    private static final int ACCOUNT_PW_COLUMN = 1;
-
-    private String mProviderName;
-    private String mToAddress;
-
-    private ImApp mApp;
-    private IImConnection mConn;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        Intent intent = getIntent();
-        if (Intent.ACTION_SENDTO.equals(intent.getAction())) {
-            if (!resolveIntent(intent)) {
-                finish();
-                return;
-            }
-
-            if (TextUtils.isEmpty(mToAddress)) {
-                Log.w(ImApp.LOG_TAG, "<ImUrlActivity>Invalid to address:" + mToAddress);
-                finish();
-                return;
-            }
-            mApp = ImApp.getApplication(this);
-            mApp.callWhenServiceConnected(new Handler(), new Runnable(){
-                public void run() {
-                    handleIntent();
-                }});
-
-        } else {
-            finish();
-        }
-    }
-
-    void handleIntent() {
-        ContentResolver cr = getContentResolver();
-        long providerId = Im.Provider.getProviderIdForName(cr, mProviderName);
-        long accountId;
-
-        mConn= mApp.getConnection(providerId);
-        if (mConn == null) {
-            Cursor c = DatabaseUtils.queryAccountsForProvider(cr, ACCOUNT_PROJECTION, providerId);
-            if (c == null) {
-                addAccount(providerId);
-            } else {
-                accountId = c.getLong(ACCOUNT_ID_COLUMN);
-                if (c.isNull(ACCOUNT_PW_COLUMN)) {
-                    editAccount(accountId);
-                } else {
-                    signInAccount(accountId);
-                }
-            }
-        } else {
-            try {
-                int state = mConn.getState();
-                accountId = mConn.getAccountId();
-
-                if (state < ImConnection.LOGGED_IN) {
-                    signInAccount(accountId);
-                } else if (state == ImConnection.LOGGED_IN || state == ImConnection.SUSPENDED) {
-                    if (!isValidToAddress()) {
-                        showContactList(accountId);
-                    } else {
-                        openChat(providerId, accountId);
-                    }
-                }
-            } catch (RemoteException e) {
-                // Ouch!  Service died!  We'll just disappear.
-                Log.w("ImUrlActivity", "Connection disappeared!");
-            }
-        }
-        finish();
-    }
-
-    private void addAccount(long providerId) {
-        Intent  intent = new Intent(this, AccountActivity.class);
-        intent.setAction(Intent.ACTION_INSERT);
-        intent.setData(ContentUris.withAppendedId(Im.Provider.CONTENT_URI, providerId));
-        intent.putExtra(ImApp.EXTRA_INTENT_SEND_TO_USER, mToAddress);
-        startActivity(intent);
-    }
-
-    private void editAccount(long accountId) {
-        Uri accountUri = ContentUris.withAppendedId(Im.Account.CONTENT_URI, accountId);
-        Intent intent = new Intent(this, AccountActivity.class);
-        intent.setAction(Intent.ACTION_EDIT);
-        intent.setData(accountUri);
-        intent.putExtra(ImApp.EXTRA_INTENT_SEND_TO_USER, mToAddress);
-        startActivity(intent);
-    }
-
-    private void signInAccount(long accountId) {
-        Uri accountUri = ContentUris.withAppendedId(Im.Account.CONTENT_URI, accountId);
-        Intent intent = new Intent(this, SigningInActivity.class);
-        intent.setData(accountUri);
-        intent.putExtra(ImApp.EXTRA_INTENT_SEND_TO_USER, mToAddress);
-        startActivity(intent);
-    }
-
-    private void showContactList(long accountId) {
-        Intent intent = new Intent(Intent.ACTION_VIEW);
-        intent.setData(Im.Contacts.CONTENT_URI);
-        intent.addCategory(ImApp.IMPS_CATEGORY);
-        intent.putExtra("accountId", accountId);
-
-        startActivity(intent);
-    }
-
-    private void openChat(long provider, long account) {
-        try {
-            IChatSessionManager manager = mConn.getChatSessionManager();
-            IChatSession session = manager.getChatSession(mToAddress);
-            if(session == null) {
-                session = manager.createChatSession(mToAddress);
-            }
-
-            Uri data = ContentUris.withAppendedId(Im.Chats.CONTENT_URI, session.getId());
-            Intent i = new Intent(Intent.ACTION_VIEW, data);
-            i.putExtra("from", mToAddress);
-            i.putExtra("providerId", provider);
-            i.putExtra("accountId", account);
-            i.addCategory(ImApp.IMPS_CATEGORY);
-            startActivity(i);
-        } catch (RemoteException e) {
-            // Ouch!  Service died!  We'll just disappear.
-            Log.w("ImUrlActivity", "Connection disappeared!");
-        }
-    }
-
-    private boolean resolveIntent(Intent intent) {
-        Uri data = intent.getData();
-        String host = data.getHost();
-
-        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
-            log("resolveIntent: host=" + host);
-        }
-
-        if (TextUtils.isEmpty(host)) {
-            Set<String> categories = intent.getCategories();
-            if (categories != null) {
-                Iterator<String> iter = categories.iterator();
-                if (iter.hasNext()) {
-                    String category = iter.next();
-                    String providerName = getProviderNameForCategory(category);
-                    mProviderName = findMatchingProvider(providerName);
-                    if (mProviderName == null) {
-                        Log.w(ImApp.LOG_TAG,
-                                "resolveIntent: IM provider "+ category + " not supported");
-                        return false;
-                    }
-                }
-            }
-            mToAddress = data.getSchemeSpecificPart();
-        } else {
-            mProviderName = findMatchingProvider(host);
-
-            if (mProviderName == null) {
-                Log.w(ImApp.LOG_TAG, "resolveIntent: IM provider "+ host + " not supported");
-                return false;
-            }
-
-            String path = data.getPath();
-
-            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) log("resolveIntent: path=" + path);
-
-            if (!TextUtils.isEmpty(path)) {
-                int index;
-                if ((index = path.indexOf('/')) != -1) {
-                    mToAddress = path.substring(index+1);
-                }
-            }
-        }
-
-        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
-            log("resolveIntent: provider=" + mProviderName + ", to=" + mToAddress);
-        }
-
-        return true;
-    }
-
-    private String getProviderNameForCategory(String providerCategory) {
-        if (providerCategory != null) {
-            if (providerCategory.equalsIgnoreCase("com.android.im.category.AIM")) {
-                return Im.ProviderNames.AIM;
-            } else if (providerCategory.equalsIgnoreCase("com.android.im.category.MSN")) {
-                return Im.ProviderNames.MSN;
-            } else if (providerCategory.equalsIgnoreCase("com.android.im.category.YAHOO")) {
-                return Im.ProviderNames.YAHOO;
-            }
-        }
-
-        return null;
-    }
-
-    private String findMatchingProvider(String provider) {
-        if (TextUtils.isEmpty(provider)) {
-            return null;
-        }
-
-        if (Im.ProviderNames.AIM.equalsIgnoreCase(provider)) {
-            return Im.ProviderNames.AIM;
-        }
-
-        if (Im.ProviderNames.MSN.equalsIgnoreCase(provider)) {
-            return Im.ProviderNames.MSN;
-        }
-
-        if (Im.ProviderNames.YAHOO.equalsIgnoreCase(provider)) {
-            return Im.ProviderNames.YAHOO;
-        }
-
-        return null;
-    }
-
-    private boolean isValidToAddress() {
-        if (TextUtils.isEmpty(mToAddress)) {
-            return false;
-        }
-
-        if (mToAddress.indexOf('/') != -1) {
-            return false;
-        }
-
-        return true;
-    }
-
-    private static void log(String msg) {
-        Log.d(ImApp.LOG_TAG, "<ImUrlActivity> " + msg);
-    }
-}
diff --git a/src/com/android/im/app/ImageListAdapter.java b/src/com/android/im/app/ImageListAdapter.java
deleted file mode 100644 (file)
index 5ac77ee..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.app;
-
-import com.android.im.R;
-
-import android.content.Context;
-import android.graphics.drawable.Drawable;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.LayoutInflater;
-import android.widget.BaseAdapter;
-import android.widget.ImageView;
-import android.widget.ListAdapter;
-import android.widget.TextView;
-
-import java.util.List;
-
-/**
- * A general image list adapter.
- */
-public class ImageListAdapter extends BaseAdapter implements ListAdapter {
-
-    public static interface ImageListItem {
-        public Drawable getDrawable();
-
-        public CharSequence getText();
-    }
-
-    private final LayoutInflater mInflater;
-    private final List<? extends ImageListItem> mData;
-    private final int mItemViewId;
-    private final int mImageId;
-    private final int mTextId;
-    private final boolean mAreAllItemsSelectable;
-    private final int mSeparatorId;
-
-    public ImageListAdapter(Context context, List<? extends ImageListItem> data) {
-        this(context, data, R.layout.imglist_item, R.id.image, R.id.text, R.id.separator);
-    }
-
-    public ImageListAdapter(Context context, List<? extends ImageListItem> data,
-            int itemViewId, int imgId, int textId, int separatorId) {
-        mData = data;
-        mItemViewId = itemViewId;
-        mImageId = imgId;
-        mTextId = textId;
-        mAreAllItemsSelectable = !data.contains(null);
-        mSeparatorId = separatorId;
-        mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-    }
-
-    public int getCount() {
-        return mData.size();
-    }
-
-    public Object getItem(int position) {
-        return mData.get(position);
-    }
-
-    public long getItemId(int position) {
-        return position;
-    }
-
-    public View getView(int position, View convertView, ViewGroup parent) {
-        View v;
-        if (convertView == null) {
-            v = mInflater.inflate(mItemViewId, parent, false);
-        } else {
-            v = convertView;
-        }
-        setupView(position, v);
-        return v;
-    }
-
-    private void setupView(int position, View view) {
-        ImageView iv = (ImageView) view.findViewById(mImageId);
-        TextView tv = (TextView)view.findViewById(mTextId);
-        View separator = view.findViewById(mSeparatorId);
-
-        if (!isEnabled(position)) {
-            if (iv != null) {
-                iv.setVisibility(View.GONE);
-            }
-            if (tv != null) {
-                tv.setVisibility(View.GONE);
-            }
-            if (separator != null) {
-                separator.setVisibility(View.VISIBLE);
-            }
-        } else {
-            if (separator != null) {
-                separator.setVisibility(View.GONE);
-            }
-            final ImageListItem item = mData.get(position);
-            if (iv != null) {
-                iv.setVisibility(View.VISIBLE);
-                iv.setImageDrawable(item.getDrawable());
-            }
-            if (tv != null) {
-                tv.setVisibility(View.VISIBLE);
-                tv.setText(item.getText());
-            }
-        }
-    }
-
-    @Override
-    public boolean areAllItemsEnabled() {
-        return mAreAllItemsSelectable;
-    }
-
-    @Override
-    public boolean isEnabled(int position) {
-        return mData.get(position) != null;
-    }
-
-}
diff --git a/src/com/android/im/app/ImpsAddressUtils.java b/src/com/android/im/app/ImpsAddressUtils.java
deleted file mode 100644 (file)
index c47b1ff..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.app;
-
-public class ImpsAddressUtils {
-
-    public static String getDisplayableAddress(String impsAddress) {
-        if (impsAddress.startsWith("wv:")) {
-            return impsAddress.substring(3);
-        }
-        return impsAddress;
-    }
-}
diff --git a/src/com/android/im/app/IntTrie.java b/src/com/android/im/app/IntTrie.java
deleted file mode 100644 (file)
index cec56ba..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-public class IntTrie {
-    private Node mHead;
-
-    class Node {
-        private Node mFirstChild;
-        private Node mNextSibling;
-        private char mKey;
-        int mValue;
-
-        public final void add(String key, int value) {
-            final int len = key.length();
-            Node n = this;
-            int index = 0;
-
-            while (index < len) {
-                n = n.getOrCreateNode(key.charAt(index++));
-            }
-
-            n.mValue = value;
-        }
-
-        private Node getOrCreateNode(char key) {
-            for (Node n = mFirstChild; n != null; n = n.mNextSibling) {
-                if (n.mKey == key) {
-                    return n;
-                }
-            }
-
-            Node n = new Node();
-
-            n.mKey = key;
-            n.mNextSibling = mFirstChild;
-            mFirstChild = n;
-
-            return n;
-        }
-
-        Node getNode(char key) {
-            for (Node n = mFirstChild; n != null; n = n.mNextSibling) {
-                if (n.mKey == key) {
-                    return n;
-                }
-            }
-
-            return null;
-        }
-    }
-
-    public IntTrie(String[] dictionary, int[] values) {
-        final int len = dictionary.length;
-
-        if (len != values.length) {
-            throw new IllegalArgumentException("dictionary[] and values[] must be the same length");
-        }
-
-        mHead = new Node();
-
-        for (int i = 0; i < len; i++) {
-            mHead.add(dictionary[i], values[i]);
-        }
-    }
-
-    public Node getNode(char key) {
-        return mHead.getNode(key);
-    }
-}
diff --git a/src/com/android/im/app/Markup.java b/src/com/android/im/app/Markup.java
deleted file mode 100644 (file)
index f94ee13..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import com.android.im.plugin.BrandingResourceIDs;
-
-import android.graphics.drawable.Drawable;
-import android.text.Spannable;
-import android.text.SpannableString;
-import android.text.style.ImageSpan;
-import android.text.util.Linkify;
-
-public class Markup {
-    private BrandingResources mRes;
-    private IntTrie mSmileys;
-
-    public Markup(BrandingResources res) {
-        mRes = res;
-        mSmileys = new IntTrie(
-                res.getStringArray(BrandingResourceIDs.STRING_ARRAY_SMILEY_TEXTS), res.getSmileyIcons());
-    }
-
-    public final CharSequence markup(CharSequence text) {
-        SpannableString result;
-
-        if (text instanceof SpannableString) {
-            result = (SpannableString) text;
-        } else {
-            result = new SpannableString(text);
-        }
-
-        Linkify.addLinks(result, Linkify.ALL);
-        applyEmoticons(result);
-
-        return result;
-    }
-
-    public final CharSequence applyEmoticons(CharSequence text) {
-        int offset = 0;
-        final int len = text.length();
-        SpannableString result = null;
-
-        while (offset < len) {
-            int index = offset;
-            IntTrie.Node n = mSmileys.getNode(text.charAt(index++));
-            int candidate = 0;
-            int lastMatchEnd = -1;
-
-            //  Search the trie until we stop matching
-            while (n != null) {
-                //  Record the value and position of the longest match
-                if (n.mValue != 0) {
-                    candidate = n.mValue;
-                    lastMatchEnd = index;
-                }
-
-                //  Let's not run off the end of the input
-                if (index >= len) {
-                    break;
-                }
-
-                n = n.getNode(text.charAt(index++));
-            }
-
-            //  If we matched a smiley, apply its image over the text
-            if (candidate != 0) {
-                //  Lazy-convert the result text to a SpannableString if we have to
-                if (result == null) {
-                    if (text instanceof SpannableString) {
-                        result = (SpannableString) text;
-                    } else {
-                        result = new SpannableString(text);
-                        text = result;
-                    }
-                }
-                Drawable smiley = mRes.getSmileyIcon(candidate);
-                smiley.setBounds(0, 0, smiley.getIntrinsicWidth(), smiley.getIntrinsicHeight());
-                result.setSpan(new ImageSpan(smiley, ImageSpan.ALIGN_BASELINE),
-                    offset, lastMatchEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
-
-                candidate = 0;
-            }
-
-            //  if there was a match, start searching for the next one after it
-            //  if no match, start at the next character
-            if (lastMatchEnd != -1) {
-                offset = lastMatchEnd;
-                lastMatchEnd = -1;
-            } else {
-                offset++;
-            }
-        }
-
-        //  If there were no modifications, return the original string
-        if (result == null) {
-            return text;
-        }
-
-        return result;
-    }
-}
diff --git a/src/com/android/im/app/MessageView.java b/src/com/android/im/app/MessageView.java
deleted file mode 100644 (file)
index 9a42cbb..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.Typeface;
-import android.provider.Im;
-import android.text.Spannable;
-import android.text.SpannableString;
-import android.text.SpannableStringBuilder;
-import android.text.style.ForegroundColorSpan;
-import android.text.style.RelativeSizeSpan;
-import android.text.style.StyleSpan;
-import android.text.style.URLSpan;
-import android.util.AttributeSet;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-import com.android.im.R;
-
-public class MessageView extends LinearLayout {
-
-    private TextView mMessage;
-
-    private Resources mResources;
-
-    public MessageView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    @Override
-    protected void onFinishInflate() {
-        super.onFinishInflate();
-
-        mMessage = (TextView) findViewById(R.id.message);
-
-        mResources = getResources();
-    }
-
-    public URLSpan[] getMessageLinks() {
-        return mMessage.getUrls();
-    }
-
-    public void bindIncomingMessage(String contact, String body, Date date,
-            Markup smileyRes, boolean scrolling) {
-        CharSequence message =  formatMessage(contact, body, date, smileyRes, scrolling);
-        mMessage.setText(message);
-        mMessage.setTextColor(mResources.getColor(R.color.chat_msg));
-    }
-
-    public void bindOutgoingMessage(String body, Date date, Markup smileyRes, boolean scrolling) {
-        String contact = mResources.getString(R.string.me);
-        CharSequence message = formatMessage(contact, body, date, smileyRes, scrolling);
-        mMessage.setText(message);
-        mMessage.setTextColor(mResources.getColor(R.color.chat_msg));
-    }
-
-    public void bindPresenceMessage(String contact, int type, boolean isGroupChat,
-            boolean scrolling) {
-        CharSequence message = formatPresenceUpdates(contact, type, isGroupChat, scrolling);
-        mMessage.setText(message);
-        mMessage.setTextColor(mResources.getColor(R.color.chat_msg_presence));
-    }
-
-    public void bindErrorMessage(int errCode) {
-        mMessage.setText(R.string.msg_sent_failed);
-        mMessage.setTextColor(mResources.getColor(R.color.error));
-    }
-
-    private CharSequence formatMessage(String contact, String body,
-            Date date, Markup smileyRes, boolean scrolling) {
-        if (body.indexOf('\r') != -1) {
-            // first convert \r\n pair to \n, then single \r to \n.
-            // here we can't use HideReturnsTransformationMethod because
-            // it does only 1 to 1 transformation and is unable to handle
-            // the "\r\n" case.
-            body = body.replace("\r\n", "\n").replace('\r', '\n');
-        }
-
-        SpannableStringBuilder buf = new SpannableStringBuilder(contact);
-        buf.append(": ");
-        if (scrolling) {
-            buf.append(body);
-        } else {
-            buf.setSpan(ChatView.STYLE_BOLD, 0, buf.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
-
-            buf.append(smileyRes.markup(body));
-
-            if (date != null) {
-                appendTimeStamp(buf, date);
-            }
-        }
-        return buf;
-    }
-
-    private void appendTimeStamp(SpannableStringBuilder buf, Date date) {
-        DateFormat format = new SimpleDateFormat(mResources.getString(R.string.time_stamp));
-        String dateStr = format.format(date);
-        SpannableString spanText = new SpannableString(dateStr);
-        int len = spanText.length();
-        spanText.setSpan(new StyleSpan(Typeface.ITALIC),
-                0, len, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
-        spanText.setSpan(new RelativeSizeSpan(0.8f),
-                0, len, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
-        spanText.setSpan(new ForegroundColorSpan(
-                mResources.getColor(android.R.color.darker_gray)),
-                0, len, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
-        buf.append('\n');
-        buf.append(spanText);
-    }
-
-    private CharSequence formatPresenceUpdates(String contact, int type,
-            boolean isGroupChat, boolean scrolling) {
-        String body;
-        switch (type) {
-            case Im.MessageType.PRESENCE_AVAILABLE:
-                body = mResources.getString(isGroupChat ? R.string.contact_joined
-                        : R.string.contact_online, contact);
-                break;
-
-            case Im.MessageType.PRESENCE_AWAY:
-                body = mResources.getString(R.string.contact_away, contact);
-                break;
-
-            case Im.MessageType.PRESENCE_DND:
-                body = mResources.getString(R.string.contact_busy, contact);
-                break;
-
-            case Im.MessageType.PRESENCE_UNAVAILABLE:
-                body = mResources.getString(isGroupChat ? R.string.contact_left
-                        : R.string.contact_offline, contact);
-                break;
-
-            default:
-                return null;
-        }
-
-        if (scrolling) {
-            return body;
-        } else {
-            SpannableString spanText = new SpannableString(body);
-            int len = spanText.length();
-            spanText.setSpan(new StyleSpan(Typeface.ITALIC),
-                    0, len, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
-            spanText.setSpan(new RelativeSizeSpan((float)0.8),
-                    0, len, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
-            return spanText;
-        }
-    }
-}
diff --git a/src/com/android/im/app/NewChatActivity.java b/src/com/android/im/app/NewChatActivity.java
deleted file mode 100644 (file)
index a01d2dc..0000000
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.android.im.app;
-
-import static com.android.im.service.ImServiceConstants.ACTION_MANAGE_SUBSCRIPTION;
-import static com.android.im.service.ImServiceConstants.EXTRA_INTENT_ACCOUNT_ID;
-import static com.android.im.service.ImServiceConstants.EXTRA_INTENT_FROM_ADDRESS;
-import static com.android.im.service.ImServiceConstants.EXTRA_INTENT_PROVIDER_ID;
-import static com.android.im.service.ImServiceConstants.EXTRA_INTENT_SHOW_MULTIPLE;
-
-import com.android.im.IChatSession;
-import com.android.im.R;
-import com.android.im.app.Dashboard.OnCancelListener;
-import com.android.im.app.adapter.ChatListenerAdapter;
-import com.android.im.plugin.BrandingResourceIDs;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.database.Cursor;
-import android.graphics.drawable.Drawable;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.RemoteException;
-import android.provider.Im;
-import android.view.KeyEvent;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.Window;
-import android.widget.ImageView;
-import android.widget.SimpleAdapter;
-import android.widget.Toast;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class NewChatActivity extends Activity {
-    private static final String GTALK_PACKAGE_NAME_= "com.google.android.talk";
-    private static final String GTALK_CHAT_SCREEN_COMPONENT_NAME =
-        "com.google.android.talk.ChatScreen";
-
-    private static final String[] CHAT_SWITCHER_PROJECTION = {
-            Im.Contacts._ID,
-            Im.Contacts.PROVIDER,
-            Im.Contacts.ACCOUNT,
-            Im.Contacts.USERNAME,
-            Im.Chats.GROUP_CHAT,
-    };
-
-    private static final int CHAT_SWITCHER_ID_COLUMN = 0;
-    private static final int CHAT_SWITCHER_PROVIDER_COLUMN = 1;
-    private static final int CHAT_SWITCHER_ACCOUNT_COLUMN = 2;
-    private static final int CHAT_SWITCHER_USERNAME_COLUMN = 3;
-    private static final int CHAT_SWITCHER_GROUP_COLUMN = 4;
-
-    private static final int REQUEST_PICK_CONTACTS = RESULT_FIRST_USER + 1;
-
-    ImApp mApp;
-
-    ChatView mChatView;
-    SimpleAlertHandler mHandler;
-
-    private AlertDialog mSmileyDialog;
-    private Dashboard mDashboard;
-
-    @Override
-    protected void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-
-        requestWindowFeature(Window.FEATURE_NO_TITLE);
-
-        setContentView(R.layout.chat_view);
-
-        mChatView = (ChatView) findViewById(R.id.chatView);
-        mHandler = mChatView.mHandler;
-
-        final Handler handler = new Handler();
-        mApp= ImApp.getApplication(this);
-        mApp.callWhenServiceConnected(handler, new Runnable() {
-            public void run() {
-                resolveIntent(getIntent());
-            }
-        });
-    }
-
-    @Override
-    protected void onResume() {
-        super.onResume();
-        mChatView.onResume();
-    }
-
-    @Override
-    protected void onPause() {
-        mChatView.onPause();
-        super.onPause();
-    }
-
-    @Override
-    protected void onNewIntent(Intent intent) {
-        resolveIntent(intent);
-    }
-
-    void resolveIntent(Intent intent) {
-        if (requireOpenDashboardOnStart(intent)) {
-            long providerId = intent.getLongExtra(EXTRA_INTENT_PROVIDER_ID, -1L);
-            final long accountId = intent.getLongExtra(EXTRA_INTENT_ACCOUNT_ID, -1L);
-            if (providerId == -1L || accountId == -1L) {
-                finish();
-            } else {
-                mApp.dismissNotifications(providerId);
-                // TODO: the delay runnable is a hack. If we don't put any delay, showing the
-                // Dashboard window will cause
-                //
-                //   android.view.WindowManager$BadTokenException: Unable to add window --
-                //           token null is not valid; is your activity running?
-                //
-                // exception. This problem should go away when the new chat switcher UI is
-                // implemented. The new chat switcher is just another view in the chat screen.
-                mHandler.postDelayed(new Runnable() {
-                    public void run() {
-                        mDashboard = Dashboard.openDashboard(NewChatActivity.this, accountId, null);
-                        mDashboard.setOnCancelListener(new OnCancelListener() {
-                            public void onCancel() {
-                                finish();
-                            }
-                        });
-                    }
-                }, 500);
-            }
-            return;
-        }
-
-        if (ACTION_MANAGE_SUBSCRIPTION.equals(intent.getAction())) {
-            long providerId = intent.getLongExtra(EXTRA_INTENT_PROVIDER_ID, -1);
-            String from = intent.getStringExtra(EXTRA_INTENT_FROM_ADDRESS);
-            if ((providerId == -1) || (from == null)) {
-                finish();
-            } else {
-                mChatView.bindSubscription(providerId, from);
-            }
-        } else {
-            Uri data = intent.getData();
-            String type = getContentResolver().getType(data);
-            if (Im.Chats.CONTENT_ITEM_TYPE.equals(type)) {
-                mChatView.bindChat(ContentUris.parseId(data));
-            } else if (Im.Invitation.CONTENT_ITEM_TYPE.equals(type)) {
-                mChatView.bindInvitation(ContentUris.parseId(data));
-            }
-        }
-    }
-
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        MenuInflater inflater = getMenuInflater();
-        inflater.inflate(R.menu.chat_screen_menu, menu);
-
-        long providerId = mChatView.getProviderId();
-        BrandingResources brandingRes = mApp.getBrandingResource(providerId);
-        menu.findItem(R.id.menu_view_friend_list).setTitle(
-                brandingRes.getString(BrandingResourceIDs.STRING_MENU_CONTACT_LIST));
-        menu.findItem(R.id.menu_switch_chats).setTitle(
-                brandingRes.getString(BrandingResourceIDs.STRING_MENU_SWITCH_CHATS));
-        menu.findItem(R.id.menu_insert_smiley).setTitle(
-                brandingRes.getString(BrandingResourceIDs.STRING_MENU_INSERT_SMILEY));
-        menu.findItem(R.id.menu_end_conversation).setTitle(
-                brandingRes.getString(BrandingResourceIDs.STRING_MENU_END_CHAT));
-        menu.findItem(R.id.menu_view_profile).setTitle(
-                brandingRes.getString(BrandingResourceIDs.STRING_MENU_VIEW_PROFILE));
-        menu.findItem(R.id.menu_block_contact).setTitle(
-                brandingRes.getString(BrandingResourceIDs.STRING_MENU_BLOCK_CONTACT));
-        return true;
-    }
-
-    @Override
-    public boolean onPrepareOptionsMenu(Menu menu) {
-        super.onPrepareOptionsMenu(menu);
-
-        //XXX hide the invite menu, group chat is not supported by the server.
-        menu.findItem(R.id.menu_invite_contact).setVisible(false);
-
-        //XXX HACK: Yahoo! doesn't allow to block a friend. We can only block a temporary contact.
-        ProviderDef provider = mApp.getProvider(mChatView.getProviderId());
-        if ((provider != null) && Im.ProviderNames.YAHOO.equals(provider.mName)) {
-            if (Im.Contacts.TYPE_TEMPORARY != mChatView.mType) {
-                menu.findItem(R.id.menu_block_contact).setVisible(false);
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        switch (item.getItemId()) {
-            case R.id.menu_view_friend_list:
-                finish();
-                showRosterScreen();
-                return true;
-
-            case R.id.menu_insert_smiley:
-                showSmileyDialog();
-                return true;
-
-            case R.id.menu_end_conversation:
-                mChatView.closeChatSession();
-                return true;
-
-            case R.id.menu_switch_chats:
-                Dashboard.openDashboard(this, mChatView.getAccountId(),
-                        mChatView.getUserName());
-                return true;
-
-            case R.id.menu_invite_contact:
-                startContactPicker();
-                return true;
-
-            case R.id.menu_view_profile:
-                mChatView.viewProfile();
-                return true;
-
-            case R.id.menu_block_contact:
-                mChatView.blockContact();
-                return true;
-
-            case R.id.menu_prev_chat:
-                switchChat(-1);
-                return true;
-
-            case R.id.menu_next_chat:
-                switchChat(1);
-                return true;
-
-            case R.id.menu_quick_switch_0:
-            case R.id.menu_quick_switch_1:
-            case R.id.menu_quick_switch_2:
-            case R.id.menu_quick_switch_3:
-            case R.id.menu_quick_switch_4:
-            case R.id.menu_quick_switch_5:
-            case R.id.menu_quick_switch_6:
-            case R.id.menu_quick_switch_7:
-            case R.id.menu_quick_switch_8:
-            case R.id.menu_quick_switch_9:
-                ContentResolver cr = getContentResolver();
-                Cursor c = cr.query(Im.Contacts.CONTENT_URI_CHAT_CONTACTS,
-                        null,
-                        null,
-                        null,
-                        null);
-                int slot = item.getAlphabeticShortcut() - '0';
-                if (Dashboard.quickSwitch(this, c, slot)) {
-                    finish();
-                }
-                c.close();
-                return true;
-        }
-
-        return super.onOptionsItemSelected(item);
-    }
-
-    @Override
-    public boolean dispatchKeyEvent(KeyEvent event) {
-        if (event.getKeyCode() == KeyEvent.KEYCODE_BACK
-                && event.getAction() == KeyEvent.ACTION_DOWN) {
-            mChatView.closeChatSessionIfInactive();
-        }
-        return super.dispatchKeyEvent(event);
-    }
-
-    /**
-     * Check whether we are asked to open Dashboard on startup.
-     */
-    private boolean requireOpenDashboardOnStart(Intent intent) {
-        return intent.getBooleanExtra(EXTRA_INTENT_SHOW_MULTIPLE, false);
-    }
-
-    private void showRosterScreen() {
-        Intent intent = new Intent(Intent.ACTION_VIEW);
-        intent.setClass(this, ContactListActivity.class);
-        intent.putExtra(EXTRA_INTENT_ACCOUNT_ID, mChatView.getAccountId());
-        startActivity(intent);
-    }
-
-    private void showSmileyDialog() {
-        if (mSmileyDialog == null) {
-            long providerId = mChatView.getProviderId();
-
-            final BrandingResources brandingRes = mApp.getBrandingResource(providerId);
-            int[] icons = brandingRes.getSmileyIcons();
-            String[] names = brandingRes.getStringArray(
-                    BrandingResourceIDs.STRING_ARRAY_SMILEY_NAMES);
-            final String[] texts = brandingRes.getStringArray(
-                    BrandingResourceIDs.STRING_ARRAY_SMILEY_TEXTS);
-
-            final int N = names.length;
-
-            List<Map<String, ?>> entries = new ArrayList<Map<String, ?>>();
-            for (int i = 0; i < N; i++) {
-                // We might have different ASCII for the same icon, skip it if
-                // the icon is already added.
-                boolean added = false;
-                for (int j = 0; j < i; j++) {
-                    if (icons[i] == icons[j]) {
-                        added = true;
-                        break;
-                    }
-                }
-                if (!added) {
-                    HashMap<String, Object> entry = new HashMap<String, Object>();
-
-                    entry. put("icon", icons[i]);
-                    entry. put("name", names[i]);
-                    entry.put("text", texts[i]);
-
-                    entries.add(entry);
-                }
-            }
-
-            final SimpleAdapter a = new SimpleAdapter(
-                    this,
-                    entries,
-                    R.layout.smiley_menu_item,
-                    new String[] {"icon", "name", "text"},
-                    new int[] {R.id.smiley_icon, R.id.smiley_name, R.id.smiley_text});
-            SimpleAdapter.ViewBinder viewBinder = new SimpleAdapter.ViewBinder() {
-                public boolean setViewValue(View view, Object data, String textRepresentation) {
-                    if (view instanceof ImageView) {
-                        Drawable img = brandingRes.getSmileyIcon((Integer)data);
-                        ((ImageView)view).setImageDrawable(img);
-                        return true;
-                    }
-                    return false;
-                }
-            };
-            a.setViewBinder(viewBinder);
-
-            AlertDialog.Builder b = new AlertDialog.Builder(this);
-
-            b.setTitle(brandingRes.getString(
-                    BrandingResourceIDs.STRING_MENU_INSERT_SMILEY));
-
-            b.setCancelable(true);
-            b.setAdapter(a, new DialogInterface.OnClickListener() {
-                public final void onClick(DialogInterface dialog, int which) {
-                    HashMap<String, Object> item = (HashMap<String, Object>) a.getItem(which);
-                    mChatView.insertSmiley((String)item.get("text"));
-                }
-            });
-
-            mSmileyDialog = b.create();
-        }
-
-        mSmileyDialog.show();
-    }
-
-    private void switchChat(int delta) {
-        Cursor c = getContentResolver().query(Im.Contacts.CONTENT_URI_CHAT_CONTACTS,
-                CHAT_SWITCHER_PROJECTION, null, null, null);
-
-        try {
-            final int N = c.getCount();
-            if (N <= 1) {
-                return;
-            }
-
-            int current = -1;
-            // find current position
-            for (int i = 0; i < N; i++) {
-                c.moveToNext();
-                long id = c.getLong(CHAT_SWITCHER_ID_COLUMN);
-                if (id == mChatView.getChatId()) {
-                    current = i;
-                }
-            }
-            if (current == -1) {
-                return;
-            }
-
-            int newPosition = (current + delta) % N;
-            if (newPosition < 0) {
-                newPosition += N;
-            }
-
-            c.moveToPosition(newPosition);
-
-            long providerId = c.getLong(CHAT_SWITCHER_PROVIDER_COLUMN);
-            long accountId = c.getLong(CHAT_SWITCHER_ACCOUNT_COLUMN);
-            String contact = c.getString(CHAT_SWITCHER_USERNAME_COLUMN);
-            long chatId = c.getLong(CHAT_SWITCHER_ID_COLUMN);
-            Intent intent = Dashboard.makeChatIntent(getContentResolver(), providerId, accountId,
-                    contact, chatId);
-
-            startActivity(intent);
-            finish();
-        } finally {
-            c.close();
-        }
-    }
-
-    private void startContactPicker() {
-        Uri.Builder builder = Im.Contacts.CONTENT_URI_ONLINE_CONTACTS_BY.buildUpon();
-        ContentUris.appendId(builder, mChatView.getProviderId());
-        ContentUris.appendId(builder, mChatView.getAccountId());
-        Uri data = builder.build();
-
-        try {
-            Intent i = new Intent(Intent.ACTION_PICK, data);
-            i.putExtra(ContactsPickerActivity.EXTRA_EXCLUDED_CONTACTS,
-                    mChatView.getCurrentChatSession().getPariticipants());
-            startActivityForResult(i, REQUEST_PICK_CONTACTS);
-        } catch (RemoteException e) {
-            mHandler.showServiceErrorAlert();
-        }
-    }
-
-    @Override
-    protected void onActivityResult(int requestCode, int resultCode,
-            Intent data) {
-        if (resultCode == RESULT_OK) {
-            if (requestCode == REQUEST_PICK_CONTACTS) {
-                String username = data.getStringExtra(
-                        ContactsPickerActivity.EXTRA_RESULT_USERNAME);
-                try {
-                    IChatSession chatSession = mChatView.getCurrentChatSession();
-                    if (chatSession.isGroupChatSession()) {
-                        chatSession.inviteContact(username);
-                        showInvitationHasSent(username);
-                    } else {
-                        chatSession.convertToGroupChat();
-                        new ContactInvitor(chatSession, username).start();
-                    }
-                } catch (RemoteException e) {
-                    mHandler.showServiceErrorAlert();
-                }
-            }
-        }
-    }
-
-    void showInvitationHasSent(String contact) {
-        Toast.makeText(NewChatActivity.this,
-                getString(R.string.invitation_sent_prompt, contact),
-                Toast.LENGTH_SHORT).show();
-    }
-
-    private class ContactInvitor extends ChatListenerAdapter {
-        private final IChatSession mChatSession;
-        String mContact;
-
-        public ContactInvitor(IChatSession session, String data) {
-            mChatSession = session;
-            mContact = data;
-        }
-
-        @Override
-        public void onConvertedToGroupChat(IChatSession ses) {
-            try {
-                final long chatId = mChatSession.getId();
-                mChatSession.inviteContact(mContact);
-                mHandler.post(new Runnable(){
-                    public void run() {
-                        mChatView.bindChat(chatId);
-                        showInvitationHasSent(mContact);
-                    }
-                });
-                mChatSession.unregisterChatListener(this);
-            } catch (RemoteException e) {
-                mHandler.showServiceErrorAlert();
-            }
-        }
-
-        public void start() throws RemoteException {
-            mChatSession.registerChatListener(this);
-        }
-    }
-}
diff --git a/src/com/android/im/app/PreferenceActivity.java b/src/com/android/im/app/PreferenceActivity.java
deleted file mode 100644 (file)
index 99e3f6e..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import java.util.HashMap;
-
-import android.app.Activity;
-import android.content.ContentValues;
-import android.content.Intent;
-import android.database.Cursor;
-import android.os.Bundle;
-import android.provider.Im;
-import android.util.Log;
-import android.view.View;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.RadioGroup;
-
-import com.android.im.R;
-import com.android.im.imps.ImpsConnectionConfig.CirMethod;
-import com.android.im.imps.ImpsConnectionConfig.EncodingType;
-import com.android.im.imps.ImpsConnectionConfig.TransportType;
-import com.android.im.plugin.ImConfigNames;
-import com.android.im.plugin.ImpsConfigNames;
-
-public class PreferenceActivity extends Activity {
-
-    RadioGroup mRgDataChannel;
-    RadioGroup mRgDataEncoding;
-    RadioGroup mRgCirChannel;
-
-    EditText mEdtHost;
-    EditText mEdtMsisdn;
-
-    long mProviderId;
-    String mProviderName;
-    HashMap<String, String> mPref;
-
-    static final void log(String log) {
-         Log.d(ImApp.LOG_TAG, "<PreferenceActivity> " + log);
-    }
-
-    @Override
-    public void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-
-        resolveIntent();
-        setTitle(getString(R.string.preference_title, mProviderName));
-        setContentView(R.layout.preference_activity);
-
-        mRgDataChannel  = (RadioGroup) findViewById(R.id.rgDataChannel);
-        mRgDataEncoding = (RadioGroup) findViewById(R.id.rgDataEncoding);
-        mRgCirChannel   = (RadioGroup) findViewById(R.id.rgCirChannel);
-        mEdtHost        = (EditText) findViewById(R.id.etHost);
-        mEdtMsisdn      = (EditText) findViewById(R.id.etMsisdn);
-
-        String dataChannel = getPreference(ImpsConfigNames.DATA_CHANNEL,
-                TransportType.HTTP.name());
-        if (TransportType.HTTP.name().equals(dataChannel)) {
-            mRgDataChannel.check(R.id.DATA_HTTP);
-        } else if (TransportType.SMS.name().equals(dataChannel)) {
-            mRgDataChannel.check(R.id.DATA_SMS);
-        }
-
-        String cirChannel = getPreference(ImpsConfigNames.CIR_CHANNEL,
-                CirMethod.STCP.name());
-        if (CirMethod.STCP.name().equals(cirChannel)) {
-            mRgCirChannel.check(R.id.CIR_STCP);
-        } else if (CirMethod.SHTTP.name().equals(cirChannel)) {
-            mRgCirChannel.check(R.id.CIR_SHTTP);
-        } else if (CirMethod.SSMS.name().equals(cirChannel)) {
-            mRgCirChannel.check(R.id.CIR_SSMS);
-        }
-
-        String dataEncoding = getPreference(ImpsConfigNames.DATA_ENCODING,
-                EncodingType.XML.name());
-        if (EncodingType.XML.name().equals(dataEncoding)) {
-            mRgDataEncoding.check(R.id.ENC_XML);
-        } else if (EncodingType.WBXML.name().equals(dataEncoding)) {
-            mRgDataEncoding.check(R.id.ENC_WBXML);
-        } else if (EncodingType.SMS.name().equals(dataEncoding)) {
-            mRgDataEncoding.check(R.id.ENC_SMS);
-        }
-
-        mEdtHost.setText(getPreference(ImpsConfigNames.HOST, "http://"));
-        mEdtMsisdn.setText(getPreference(ImpsConfigNames.MSISDN, ""));
-
-        final Button btnSave = (Button) findViewById(R.id.btnSave);
-        btnSave.setOnClickListener(new Button.OnClickListener() {
-            public void onClick(View v) {
-                savePreferences();
-            }
-        });
-    }
-
-    private String getPreference(String prefName, String defaultValue) {
-        String value = mPref.get(prefName);
-
-        return value == null ? defaultValue : value;
-    }
-
-    void resolveIntent() {
-        Intent i = getIntent();
-        if(i.getData() == null){
-            Log.w(ImApp.LOG_TAG, "No data passed to PreferenceActivity");
-            finish();
-        } else {
-            Cursor c = getContentResolver().query(i.getData(),
-                    new String[]{Im.Provider._ID, Im.Provider.NAME}, null, null, null);
-            if (c == null || !c.moveToFirst()) {
-                Log.w(ImApp.LOG_TAG, "Can't query data from given URI.");
-                finish();
-            } else {
-                mProviderId   = c.getLong(0);
-                mProviderName = c.getString(1);
-
-                c.close();
-
-                mPref = Im.ProviderSettings.queryProviderSettings(getContentResolver(), mProviderId);
-            }
-        }
-    }
-
-    void savePreferences() {
-        TransportType dataChannel;
-        switch (mRgDataChannel.getCheckedRadioButtonId()) {
-        case R.id.DATA_HTTP:
-            dataChannel = TransportType.HTTP;
-            break;
-        case R.id.DATA_SMS:
-            dataChannel = TransportType.SMS;
-            break;
-        default:
-            Log.w(ImApp.LOG_TAG, "Unexpected dataChannel button ID; defaulting to HTTP");
-            dataChannel = TransportType.HTTP;
-            break;
-        }
-
-        CirMethod cirChannel;
-        switch (mRgCirChannel.getCheckedRadioButtonId()) {
-        case R.id.CIR_STCP:
-            cirChannel = CirMethod.STCP;
-            break;
-        case R.id.CIR_SHTTP:
-            cirChannel = CirMethod.SHTTP;
-            break;
-        case R.id.CIR_SSMS:
-            cirChannel = CirMethod.SSMS;
-            break;
-        default:
-            Log.w(ImApp.LOG_TAG, "Unexpected cirChannel button ID; defaulting to STCP");
-            cirChannel = CirMethod.STCP;
-            break;
-        }
-
-        EncodingType dataEncoding;
-        switch (mRgDataEncoding.getCheckedRadioButtonId()) {
-        case R.id.ENC_WBXML:
-            dataEncoding = EncodingType.WBXML;
-            break;
-        case R.id.ENC_XML:
-            dataEncoding = EncodingType.XML;
-            break;
-        case R.id.ENC_SMS:
-            dataEncoding = EncodingType.SMS;
-            break;
-        default:
-            Log.w(ImApp.LOG_TAG, "Unexpected dataEncoding button ID; defaulting to WBXML");
-            dataEncoding = EncodingType.WBXML;
-            break;
-        }
-
-        String host = mEdtHost.getText().toString();
-        String msisdn = mEdtMsisdn.getText().toString();
-
-        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)){
-            log("set connection preference, DataChannel: " + dataChannel
-                    + ", CirChannel: " + cirChannel
-                    + ", DataEncoding: " + dataEncoding
-                    + ", Host: " + host
-                    + ", MSISDN: " + msisdn);
-        }
-        ContentValues[] valuesList = new ContentValues[7];
-        valuesList[0] = getValues(ImConfigNames.PROTOCOL_NAME, "IMPS");
-        valuesList[1] = getValues(ImpsConfigNames.DATA_CHANNEL, dataChannel.name());
-        valuesList[2] = getValues(ImpsConfigNames.DATA_ENCODING, dataEncoding.name());
-        valuesList[3] = getValues(ImpsConfigNames.CIR_CHANNEL, cirChannel.name());
-        valuesList[4] = getValues(ImpsConfigNames.HOST, host);
-        valuesList[6] = getValues(ImpsConfigNames.MSISDN, msisdn);
-
-        getContentResolver().bulkInsert(Im.ProviderSettings.CONTENT_URI, valuesList);
-
-        finish();
-    }
-
-    private ContentValues getValues(String name, String value) {
-        ContentValues values = new ContentValues();
-        values.put(Im.ProviderSettings.PROVIDER, mProviderId);
-        values.put(Im.ProviderSettings.NAME, name);
-        values.put(Im.ProviderSettings.VALUE, value);
-
-        return values;
-    }
-}
diff --git a/src/com/android/im/app/PresenceUtils.java b/src/com/android/im/app/PresenceUtils.java
deleted file mode 100644 (file)
index dcc806c..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.app;
-
-import android.provider.Im;
-import android.util.Log;
-
-import com.android.im.engine.Presence;
-import com.android.im.plugin.BrandingResourceIDs;
-
-public final class PresenceUtils {
-    private PresenceUtils() {}
-
-    public static int convertStatus(int status) {
-        switch (status) {
-        case Presence.AVAILABLE:
-            return Im.Presence.AVAILABLE;
-
-        case Presence.AWAY:
-            return Im.Presence.AWAY;
-
-        case Presence.DO_NOT_DISTURB:
-            return Im.Presence.DO_NOT_DISTURB;
-
-        case Presence.IDLE:
-            return Im.Presence.IDLE;
-
-        case Presence.OFFLINE:
-            return Im.Presence.OFFLINE;
-
-        default:
-            Log.w(ImApp.LOG_TAG, "[ContactView] Unknown presence status " + status);
-            return Im.Presence.AVAILABLE;
-        }
-    }
-
-    public static int getStatusStringRes(int status) {
-        switch (status) {
-        case Im.Presence.AVAILABLE:
-            return BrandingResourceIDs.STRING_PRESENCE_AVAILABLE;
-
-        case Im.Presence.AWAY:
-            return BrandingResourceIDs.STRING_PRESENCE_AWAY;
-
-        case Im.Presence.DO_NOT_DISTURB:
-            return BrandingResourceIDs.STRING_PRESENCE_BUSY;
-
-        case Im.Presence.IDLE:
-            return BrandingResourceIDs.STRING_PRESENCE_IDLE;
-
-        case Im.Presence.INVISIBLE:
-            return BrandingResourceIDs.STRING_PRESENCE_INVISIBLE;
-
-        case Im.Presence.OFFLINE:
-            return BrandingResourceIDs.STRING_PRESENCE_OFFLINE;
-
-        default:
-            return BrandingResourceIDs.STRING_PRESENCE_AVAILABLE;
-        }
-    }
-
-    public static int getStatusIconId(int status) {
-        switch (status) {
-        case Im.Presence.AVAILABLE:
-            return BrandingResourceIDs.DRAWABLE_PRESENCE_ONLINE;
-
-        case Im.Presence.IDLE:
-            return BrandingResourceIDs.DRAWABLE_PRESENCE_AWAY;
-
-        case Im.Presence.AWAY:
-            return BrandingResourceIDs.DRAWABLE_PRESENCE_AWAY;
-
-        case Im.Presence.DO_NOT_DISTURB:
-            return BrandingResourceIDs.DRAWABLE_PRESENCE_BUSY;
-
-        case Im.Presence.INVISIBLE:
-            return BrandingResourceIDs.DRAWABLE_PRESENCE_INVISIBLE;
-
-        default:
-            return BrandingResourceIDs.DRAWABLE_PRESENCE_OFFLINE;
-        }
-    }
-
-}
diff --git a/src/com/android/im/app/ProviderDef.java b/src/com/android/im/app/ProviderDef.java
deleted file mode 100644 (file)
index 00ad6fc..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-public class ProviderDef {
-    public long mId;
-    public String mName;
-    public String mFullName;
-    public String mSignUpUrl;
-
-    public ProviderDef(long id, String name, String fullName, String signUpUrl) {
-        mId = id;
-        mName = name;
-        if (fullName != null) {
-            mFullName = fullName;
-        } else {
-            mFullName = name;
-        }
-        mSignUpUrl = signUpUrl;
-    }
-}
diff --git a/src/com/android/im/app/SettingActivity.java b/src/com/android/im/app/SettingActivity.java
deleted file mode 100644 (file)
index 1a5f73b..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.preference.Preference;
-import android.preference.PreferenceScreen;
-import android.preference.CheckBoxPreference;
-import android.provider.Im;
-import android.util.Log;
-
-import com.android.im.R;
-import com.android.im.service.ImServiceConstants;
-
-public class SettingActivity extends android.preference.PreferenceActivity {
-    private static final String KEY_NOTIFICATION_SOUND = "notification-sound";
-    private static final String KEY_NOTIFICATION_VIBRATE = "notification-vibrate";
-    private static final String KEY_ENABLE_NOTIFICATIONS = "enable-notifications";
-    private static final String KEY_HIDE_OFFLINE_CONTACTS = "hide-offline-contacts";
-
-    private long mProviderId;
-
-    @Override
-    public void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-        addPreferencesFromResource(R.xml.preferences);
-        Intent intent = getIntent();
-        mProviderId = intent.getLongExtra(ImServiceConstants.EXTRA_INTENT_PROVIDER_ID, -1);
-        if (mProviderId < 0) {
-            Log.e(ImApp.LOG_TAG,"SettingActivity intent requires provider id extra");
-            throw new RuntimeException("SettingActivity must be created with an provider id");
-        }
-        setInitialValues();
-    }
-
-    private void setInitialValues() {
-        Im.ProviderSettings.QueryMap settings = new Im.ProviderSettings.QueryMap(
-                getContentResolver(), mProviderId,
-                false /* keep updated */, null /* no handler */);
-
-        CheckBoxPreference pref = (CheckBoxPreference) findPreference(KEY_HIDE_OFFLINE_CONTACTS);
-        pref.setChecked(settings.getHideOfflineContacts());
-
-        pref = (CheckBoxPreference) findPreference(KEY_ENABLE_NOTIFICATIONS);
-        pref.setChecked(settings.getEnableNotification());
-
-        pref = (CheckBoxPreference) findPreference(KEY_NOTIFICATION_VIBRATE);
-        pref.setChecked(settings.getVibrate());
-
-        pref = (CheckBoxPreference) findPreference(KEY_NOTIFICATION_SOUND);
-        pref.setChecked(settings.getRingtoneURI() != null);
-        settings.close();
-    }
-
-    @Override
-    public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
-        if (preference instanceof CheckBoxPreference) {
-            final Im.ProviderSettings.QueryMap settings = new Im.ProviderSettings.QueryMap(
-                    getContentResolver(), mProviderId,
-                    false /* keep updated */, null /* no handler */);
-            String key = preference.getKey();
-            boolean value = ((CheckBoxPreference) preference).isChecked();
-
-            if (key.equals(KEY_HIDE_OFFLINE_CONTACTS)) {
-                settings.setHideOfflineContacts(value);
-            } else if (key.equals(KEY_ENABLE_NOTIFICATIONS)) {
-                settings.setEnableNotification(value);
-            } else if (key.equals(KEY_NOTIFICATION_VIBRATE)) {
-                settings.setVibrate(value);
-            } else if (key.equals(KEY_NOTIFICATION_SOUND)){
-                if (!value) {
-                    settings.setRingtoneURI(null);
-                }
-            }
-            settings.close();
-            return true;
-        }
-        
-        return false;
-    }
-}
diff --git a/src/com/android/im/app/SigningInActivity.java b/src/com/android/im/app/SigningInActivity.java
deleted file mode 100644 (file)
index bcd7825..0000000
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.app;
-
-import com.android.im.IChatSession;
-import com.android.im.IChatSessionManager;
-import com.android.im.IConnectionListener;
-import com.android.im.IImConnection;
-import com.android.im.R;
-import com.android.im.app.adapter.ConnectionListenerAdapter;
-import com.android.im.engine.ImConnection;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.plugin.BrandingResourceIDs;
-import com.android.im.service.ImServiceConstants;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.res.Resources;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Bundle;
-import android.os.RemoteException;
-import android.os.Handler;
-import android.provider.Im;
-import android.util.Log;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.Window;
-import android.widget.ImageView;
-
-public class SigningInActivity extends Activity {
-    private static final String SYNC_SETTINGS_ACTION = "android.settings.SYNC_SETTINGS";
-    private static final String SYNC_SETTINGS_CATEGORY = "android.intent.category.DEFAULT";
-
-    private IImConnection mConn;
-    private IConnectionListener mListener;
-    private SimpleAlertHandler mHandler;
-    private ImApp mApp;
-    private long mProviderId;
-    private long mAccountId;
-    private String mProviderName;
-
-    private String mUserName;
-    private String mPassword;
-
-    private String mToAddress;
-
-    protected static final int ID_CANCEL_SIGNIN = Menu.FIRST + 1;
-
-    @Override
-    protected void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-
-        //setTheme(android.R.style.Theme_Dialog);
-        getWindow().requestFeature(Window.FEATURE_LEFT_ICON);
-        setContentView(R.layout.signing_in_activity);
-        Intent intent = getIntent();
-        mToAddress = intent.getStringExtra(ImApp.EXTRA_INTENT_SEND_TO_USER);
-
-        Uri data = intent.getData();
-        if (data == null) {
-            if(Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
-                log("Need account data to sign in");
-            }
-            finish();
-            return;
-        }
-        ContentResolver cr = getContentResolver();
-        Cursor c = cr.query(data, null, null, null, null);
-        if (c == null) {
-            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
-                log("Query fail:" + data);
-            }
-            finish();
-            return;
-        }
-        if (!c.moveToFirst()) {
-            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
-                log("No data for " + data);
-            }
-            c.close();
-            finish();
-            return;
-        }
-
-        mProviderId = c.getLong(c.getColumnIndexOrThrow(Im.Account.PROVIDER));
-        mAccountId = c.getLong(c.getColumnIndexOrThrow(Im.Account._ID));
-        mUserName = c.getString(c.getColumnIndexOrThrow(Im.Account.USERNAME));
-        String pwExtra = intent.getStringExtra(ImApp.EXTRA_INTENT_PASSWORD);
-        mPassword = pwExtra != null ? pwExtra
-                : c.getString(c.getColumnIndexOrThrow(Im.Account.PASSWORD));
-        final boolean isActive = c.getInt(c.getColumnIndexOrThrow(Im.Account.ACTIVE)) == 1;
-
-        c.close();
-        mApp = ImApp.getApplication(this);
-        final ProviderDef provider = mApp.getProvider(mProviderId);
-        mProviderName = provider.mName;
-
-        BrandingResources brandingRes = mApp.getBrandingResource(mProviderId);
-        getWindow().setFeatureDrawable(Window.FEATURE_LEFT_ICON,
-                brandingRes.getDrawable(BrandingResourceIDs.DRAWABLE_LOGO));
-
-        setTitle(getResources().getString(R.string.signing_in_to,
-                provider.mFullName));
-
-        ImageView splash = (ImageView)findViewById(R.id.splashscr);
-        splash.setImageDrawable(brandingRes.getDrawable(
-                BrandingResourceIDs.DRAWABLE_SPLASH_SCREEN));
-
-        mHandler = new SimpleAlertHandler(this);
-        mListener = new MyConnectionListener(mHandler);
-
-        mApp.callWhenServiceConnected(mHandler, new Runnable() {
-            public void run() {
-                if (mApp.serviceConnected()) {
-                    if (!isActive) {
-                        activateAccount(mProviderId, mAccountId);
-                    }
-                    signInAccount();
-                }
-            }
-        });
-
-        // assume we can sign in successfully.
-        setResult(RESULT_OK);
-    }
-
-    @Override
-    protected void onRestart() {
-        super.onRestart();
-
-        if (mApp.serviceConnected() && mApp.isBackgroundDataEnabled()) {
-            signInAccount();
-        } else {
-            if(Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
-                log("onRestart: service disconnected or background data disabled...");
-            }
-            setResult(RESULT_CANCELED);
-            finish();
-        }
-    }
-
-    void signInAccount() {
-        try {
-            IImConnection conn = mApp.getConnection(mProviderId);
-            if (conn != null) {
-                mConn = conn;
-                // register listener before get state so that we won't miss
-                // any state change event.
-                conn.registerConnectionListener(mListener);
-                int state = conn.getState();
-                if (state != ImConnection.LOGGING_IN) {
-                    // already signed in or failed
-                    conn.unregisterConnectionListener(mListener);
-                    handleConnectionEvent(state, null);
-                }
-            } else {
-                if (mApp.isBackgroundDataEnabled()) {
-                    mConn = mApp.createConnection(mProviderId);
-                    mConn.registerConnectionListener(mListener);
-                    mConn.login(mAccountId, mUserName, mPassword, true);
-                } else {
-                    promptForBackgroundDataSetting();
-                    return;
-                }
-            }
-
-        } catch (RemoteException e) {
-            mHandler.showServiceErrorAlert();
-            finish();
-        }
-    }
-
-    private void activateAccount(long providerId, long accountId) {
-        // Update the active value. We restrict to only one active
-        // account per provider right now, so update all accounts of
-        // this provider to inactive first and then update this
-        // account to active.
-        ContentValues values = new ContentValues(1);
-        values.put(Im.Account.ACTIVE, 0);
-        ContentResolver cr = getContentResolver();
-        cr.update(Im.Account.CONTENT_URI, values,
-                Im.Account.PROVIDER + "=" + providerId, null);
-
-        values.put(Im.Account.ACTIVE, 1);
-        cr.update(ContentUris.withAppendedId(Im.Account.CONTENT_URI, accountId),
-                values, null, null);
-    }
-
-    @Override
-    protected void onStop() {
-        super.onStop();
-
-        if (mApp != null) {
-            mApp.removePendingCall(mHandler);
-        }
-        if (mConn != null) {
-            try {
-                if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
-                    log("unregisterConnectonListener");
-                }
-                mConn.unregisterConnectionListener(mListener);
-            } catch (RemoteException e) {
-                Log.w(ImApp.LOG_TAG, "<SigningInActivity> Connection disappeared!");
-            }
-        }
-        // When background data is enabled, we don't want this activity in the backlist
-        // so we always call finish() when we leave signing in screen. Otherwise, we
-        // don't finish since we need to keep signing in if user choose to enable background.
-        if (mApp.isBackgroundDataEnabled()) {
-            finish();
-        }
-    }
-
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        menu.add(0, ID_CANCEL_SIGNIN, 0, R.string.menu_cancel_signin)
-            .setIcon(android.R.drawable.ic_menu_close_clear_cancel);
-
-        return true;
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        if (item.getItemId() == ID_CANCEL_SIGNIN) {
-            if (mConn != null) {
-                try {
-                    if (mConn.getState() == ImConnection.LOGGING_IN) {
-                        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
-                            log("Cancelling sign in");
-                        }
-                        mConn.logout();
-                        finish();
-                    }
-                } catch (RemoteException e) {
-                    Log.w(ImApp.LOG_TAG, "<SigningInActivity> Connection disappeared!");
-                }
-            }
-            return true;
-        } else {
-            return super.onOptionsItemSelected(item);
-        }
-    }
-
-    /**
-     * Popup a dialog to ask the user whether he/she wants to enable
-     * background connection to continue. If yes, enable the setting
-     * and broadcast the change. Otherwise, quit the signing in window
-     * immediately.
-     */
-    private void promptForBackgroundDataSetting() {
-        new AlertDialog.Builder(SigningInActivity.this)
-            .setTitle(R.string.bg_data_prompt_title)
-            .setIcon(android.R.drawable.ic_dialog_alert)
-            .setMessage(getString(R.string.bg_data_prompt_message, mProviderName))
-            .setPositiveButton(R.string.bg_data_prompt_ok, new DialogInterface.OnClickListener() {
-                public void onClick(DialogInterface dialog, int whichButton) {
-                    Intent intent = new Intent(SYNC_SETTINGS_ACTION);
-                    intent.addCategory(SYNC_SETTINGS_CATEGORY);
-                    startActivity(intent);
-                }
-             })
-            .setNegativeButton(R.string.bg_data_prompt_cancel,
-                new DialogInterface.OnClickListener() {
-                    public void onClick(DialogInterface dialog, int whichButton) {
-                        setResult(RESULT_CANCELED);
-                        finish();
-                    }
-             })
-            .show();
-    }
-
-    void handleConnectionEvent(int state, ImErrorInfo error) {
-        if (isFinishing()) {
-            return;
-        }
-
-        if (state == ImConnection.LOGGED_IN) {
-            // sign in successfully, finish and switch to contact list
-            finish();
-            try {
-                Intent intent;
-                long accountId = mConn.getAccountId();
-
-                if (mToAddress != null) {
-                    IChatSessionManager manager = mConn.getChatSessionManager();
-                    IChatSession session = manager.getChatSession(mToAddress);
-                    if(session == null) {
-                        session = manager.createChatSession(mToAddress);
-                    }
-                    Uri data = ContentUris.withAppendedId(Im.Chats.CONTENT_URI, session.getId());
-                    intent = new Intent(Intent.ACTION_VIEW, data);
-                    intent.putExtra("from", mToAddress);
-                    intent.putExtra("providerId", mProviderId);
-                    intent.putExtra("accountId", accountId);
-                    intent.addCategory(ImApp.IMPS_CATEGORY);
-
-                } else {
-                    intent = new Intent(this, ContactListActivity.class);
-                    intent.putExtra(ImServiceConstants.EXTRA_INTENT_ACCOUNT_ID, accountId);
-                }
-                startActivity(intent);
-            } catch (RemoteException e) {
-                // Ouch!  Service died!  We'll just disappear.
-                Log.w(ImApp.LOG_TAG, "<SigningInActivity> Connection disappeared while signing in!");
-            }
-        } else if (state == ImConnection.DISCONNECTED) {
-            // sign in failed
-            Resources r = getResources();
-            new AlertDialog.Builder(this)
-                .setTitle(R.string.error)
-                .setMessage(r.getString(R.string.login_service_failed, mProviderName,
-                            error == null? "": ErrorResUtils.getErrorRes(r, error.getCode())))
-                .setPositiveButton(R.string.ok,
-                        new DialogInterface.OnClickListener() {
-                            public void onClick(DialogInterface dialog, int whichButton) {
-                                setResult(RESULT_CANCELED);
-                                finish();
-                            }
-                        })
-                .setCancelable(false)
-                .show();
-        }
-    }
-
-    private static final void log(String msg) {
-        Log.d(ImApp.LOG_TAG, "<SigningInActivity>" + msg);
-    }
-
-    private final class MyConnectionListener extends ConnectionListenerAdapter {
-        MyConnectionListener(Handler handler) {
-            super(handler);
-        }
-
-        @Override
-        public void onConnectionStateChange(IImConnection connection,
-                int state, ImErrorInfo error) {
-            handleConnectionEvent(state, error);
-        }
-    }
-}
diff --git a/src/com/android/im/app/SignoutActivity.java b/src/com/android/im/app/SignoutActivity.java
deleted file mode 100644 (file)
index 2cb3bcb..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.app;
-
-import android.app.Activity;
-import android.provider.Im;
-import android.os.Handler;
-import android.os.Bundle;
-import android.os.RemoteException;
-import android.content.ContentValues;
-import android.content.Intent;
-import android.content.ContentResolver;
-import android.net.Uri;
-import android.util.Log;
-import android.database.Cursor;
-import com.android.im.IImConnection;
-
-
-public class SignoutActivity extends Activity {
-
-    private String[] ACCOUNT_SELECTION = new String[] {
-            Im.Account._ID,
-            Im.Account.PROVIDER,
-    };
-
-    private ImApp mApp;
-
-    private Handler mHandler = new Handler();
-
-    @Override
-    protected void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-
-        Intent intent = getIntent();
-        Uri data = intent.getData();
-        if (data == null) {
-            Log.e(ImApp.LOG_TAG, "Need account data to sign in");
-            finish();
-            return;
-        }
-
-        ContentResolver cr = getContentResolver();
-        Cursor c = cr.query(data,
-                ACCOUNT_SELECTION,
-                null /* selection */,
-                null /* selection args */,
-                null /* sort order */);
-        final long providerId;
-        final long accountId;
-
-        try {
-            if (!c.moveToFirst()) {
-                Log.w(ImApp.LOG_TAG, "[SignoutActivity] No data for " + data);
-                finish();
-                return;
-            }
-
-            providerId = c.getLong(c.getColumnIndexOrThrow(Im.Account.PROVIDER));
-            accountId = c.getLong(c.getColumnIndexOrThrow(Im.Account._ID));
-        } finally {
-            c.close();
-        }
-
-        mApp = ImApp.getApplication(this);
-        mApp.callWhenServiceConnected(mHandler, new Runnable() {
-            public void run() {
-                signOut(providerId, accountId);
-            }
-        });
-    }
-
-    private void signOut(long providerId, long accountId) {
-        try {
-            IImConnection conn = mApp.getConnection(providerId);
-            if (conn != null) {
-                conn.logout();
-            } else {
-                // Normally, we can always get the connection when user chose to
-                // sign out. However, if the application crash unexpectedly, the
-                // status will never be updated. Clear the status in this case
-                // to make it recoverable from the crash.
-                ContentValues values = new ContentValues(2);
-                values.put(Im.AccountStatus.PRESENCE_STATUS,
-                        Im.Presence.OFFLINE);
-                values.put(Im.AccountStatus.CONNECTION_STATUS,
-                        Im.ConnectionStatus.OFFLINE);
-                String where = Im.AccountStatus.ACCOUNT + "=?";
-                getContentResolver().update(Im.AccountStatus.CONTENT_URI,
-                        values, where,
-                        new String[] { Long.toString(accountId) });
-            }
-        } catch (RemoteException ex) {
-            Log.e(ImApp.LOG_TAG, "signout: caught ", ex);
-        } finally {
-            finish();
-        }
-    }
-
-    @Override
-    protected void onStop() {
-        super.onStop();
-
-        // always call finish here, because we don't want to be in the backlist ever, and
-        // we don't handle onRestart()
-        finish();
-    }
-
-
-    static void log(String msg) {
-        Log.d(ImApp.LOG_TAG, "[Signout] " + msg);
-    }
-}
diff --git a/src/com/android/im/app/SimpleAlertHandler.java b/src/com/android/im/app/SimpleAlertHandler.java
deleted file mode 100644 (file)
index e677ddf..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.res.Resources;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-import android.widget.Toast;
-
-import com.android.im.R;
-import com.android.im.engine.Contact;
-import com.android.im.engine.ContactListListener;
-import com.android.im.engine.ImErrorInfo;
-
-public class SimpleAlertHandler extends Handler {
-
-    Activity mActivity;
-    Resources mRes;
-
-    public SimpleAlertHandler(Activity activity) {
-        mActivity = activity;
-        mRes = mActivity.getResources();
-    }
-
-    protected void promptDisconnectedEvent(Message msg) {
-        long providerId = ((long)msg.arg1 << 32) | msg.arg2;
-        ImApp app = ImApp.getApplication(mActivity);
-        ProviderDef provider = app.getProvider(providerId);
-        ImErrorInfo error = (ImErrorInfo) msg.obj;
-        String promptMsg;
-        if (error != null) {
-            promptMsg = mActivity.getString(R.string.signed_out_prompt_with_error,
-                    provider.mName, ErrorResUtils.getErrorRes(mRes, error.getCode()));
-        } else {
-            promptMsg = mActivity.getString(R.string.signed_out_prompt, provider.mName);
-        }
-        Toast.makeText(mActivity, promptMsg, Toast.LENGTH_SHORT).show();
-    }
-
-    public void registerForBroadcastEvents() {
-         ImApp.getApplication(mActivity).registerForBroadcastEvent(
-                ImApp.EVENT_CONNECTION_DISCONNECTED,
-                this);
-    }
-
-    public void unregisterForBroadcastEvents() {
-        ImApp.getApplication(mActivity).unregisterForBroadcastEvent(
-                ImApp.EVENT_CONNECTION_DISCONNECTED,
-                this);
-    }
-
-    public void showAlert(int titleId, int messageId) {
-        showAlert(mRes.getString(titleId), mRes.getString(messageId));
-    }
-
-    public void showAlert(int titleId, CharSequence message) {
-        showAlert(mRes.getString(titleId), message);
-    }
-
-    public void showAlert(CharSequence title, int messageId) {
-        showAlert(title, mRes.getString(messageId));
-    }
-
-    public void showAlert(final CharSequence title, final CharSequence message) {
-        if (Looper.myLooper() == getLooper()) {
-            new AlertDialog.Builder(mActivity)
-                    .setTitle(title)
-                    .setMessage(message)
-                    .setPositiveButton(R.string.ok, null)
-                    .show();
-        } else {
-            post(new Runnable() {
-                public void run() {
-                    new AlertDialog.Builder(mActivity)
-                            .setTitle(title)
-                            .setMessage(message)
-                            .setPositiveButton(R.string.ok, null)
-                            .show();
-                }
-            });
-        }
-    }
-
-    public void showServiceErrorAlert() {
-        showAlert(R.string.error, R.string.service_error);
-    }
-
-    public void showContactError(int errorType, ImErrorInfo error,
-            String listName, Contact contact) {
-        int id = 0;
-        switch (errorType) {
-        case ContactListListener.ERROR_LOADING_LIST:
-            id = R.string.load_contact_list_failed;
-            break;
-
-        case ContactListListener.ERROR_CREATING_LIST:
-            id = R.string.add_list_failed;
-            break;
-
-        case ContactListListener.ERROR_BLOCKING_CONTACT:
-            id = R.string.block_contact_failed;
-            break;
-
-        case ContactListListener.ERROR_UNBLOCKING_CONTACT:
-            id = R.string.unblock_contact_failed;
-            break;
-        }
-
-        String errorInfo = ErrorResUtils.getErrorRes(mRes, error.getCode());
-        if (id != 0) {
-            errorInfo = mRes.getText(id) + "\n" + errorInfo;
-        }
-
-        showAlert(R.string.error, errorInfo);
-    }
-
-}
diff --git a/src/com/android/im/app/SimpleInputActivity.java b/src/com/android/im/app/SimpleInputActivity.java
deleted file mode 100644 (file)
index 84e3bad..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.View;
-import android.view.ViewGroup.LayoutParams;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.TextView;
-
-import com.android.im.R;
-
-public class SimpleInputActivity extends Activity {
-
-    public static final String EXTRA_TITLE = "title";
-    public static final String EXTRA_PROMPT = "prompt";
-    public static final String EXTRA_DEFAULT_CONTENT = "content";
-    public static final String EXTRA_OK_BUTTON_TEXT = "button_ok";
-
-    TextView mPrompt;
-    EditText mEdit;
-    Button mBtnOk;
-    Button mBtnCancel;
-
-    @Override
-    public void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-
-        setTheme(android.R.style.Theme_Dialog);
-        setContentView(R.layout.simple_input_activity);
-
-        Bundle extras = getIntent().getExtras();
-
-        CharSequence title = extras.getCharSequence(EXTRA_TITLE);
-        if (title != null) {
-            setTitle(title);
-        } else {
-            setTitle(R.string.default_input_title);
-        }
-
-        CharSequence prompt = extras.getCharSequence(EXTRA_PROMPT);
-        mPrompt = (TextView) findViewById(R.id.prompt);
-        if (prompt != null) {
-            mPrompt.setText(prompt);
-        } else {
-            mPrompt.setVisibility(View.GONE);
-        }
-
-        mEdit = (EditText) findViewById(R.id.edit);
-        CharSequence defaultText = extras.getCharSequence(EXTRA_DEFAULT_CONTENT);
-        if (defaultText != null) {
-            mEdit.setText(defaultText);
-        }
-
-        mBtnOk = (Button) findViewById(R.id.btnOk);
-        mBtnOk.setOnClickListener(new Button.OnClickListener() {
-            public void onClick(View v) {
-                setResult(RESULT_OK,
-                        (new Intent()).setAction(mEdit.getText().toString()));
-                finish();
-            }
-        });
-        CharSequence okText = extras.getCharSequence(EXTRA_OK_BUTTON_TEXT);
-        if (okText != null) {
-            mBtnOk.setText(okText);
-        }
-
-        mBtnCancel = (Button) findViewById(R.id.btnCancel);
-        mBtnCancel.setOnClickListener(new Button.OnClickListener() {
-            public void onClick(View v) {
-                finish();
-            }
-        });
-
-        // XXX Hack from GoogleLogin.java. The android:layout_width="fill_parent"
-        // defined in the layout xml doesn't seem to work for LinearLayout.
-        getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
-    }
-
-}
diff --git a/src/com/android/im/app/Ticker.java b/src/com/android/im/app/Ticker.java
deleted file mode 100644 (file)
index 53d1ae1..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.View;
-import android.widget.FrameLayout;
-
-public class Ticker extends FrameLayout {
-
-    public Ticker(Context context) {
-        super(context);
-    }
-
-    public Ticker(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    public Ticker(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-    }
-    
-    @Override
-    protected void measureChild(View child, int parentWidthMeasureSpec, 
-            int parentHeightMeasureSpec) {
-        LayoutParams lp = (LayoutParams) child.getLayoutParams();
-
-        int childWidthMeasureSpec;
-        int childHeightMeasureSpec;
-
-        // Let the child be as wide as it wants, regardless of our bounds
-        childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
-        childHeightMeasureSpec = getChildMeasureSpec(parentHeightMeasureSpec, mPaddingLeft
-                + mPaddingRight, lp.width);
-
-        child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
-    }
-}
diff --git a/src/com/android/im/app/UserPresenceView.java b/src/com/android/im/app/UserPresenceView.java
deleted file mode 100644 (file)
index d07a00d..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.app;
-
-import com.android.im.IImConnection;
-import com.android.im.R;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.Presence;
-import com.google.android.collect.Lists;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.graphics.drawable.Drawable;
-import android.os.RemoteException;
-import android.provider.Im;
-import android.text.TextUtils;
-import android.util.AttributeSet;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.EditText;
-import android.widget.ImageButton;
-import android.widget.LinearLayout;
-
-import java.util.List;
-
-public class UserPresenceView extends LinearLayout {
-
-    private ImageButton mStatusDialogButton;
-
-    // views of the popup window
-    EditText mStatusEditor;
-
-    private final SimpleAlertHandler mHandler;
-
-    private IImConnection mConn;
-    private long mProviderId;
-    Presence mPresence;
-
-    private String mLastStatusEditText;
-    final List<StatusItem> mStatusItems = Lists.newArrayList();
-
-    public UserPresenceView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        mHandler = new SimpleAlertHandler((Activity)context);
-    }
-
-    @Override
-    protected void onFinishInflate() {
-        super.onFinishInflate();
-
-        mStatusDialogButton = (ImageButton)findViewById(R.id.statusDropDownButton);
-        mStatusEditor = (EditText)findViewById(R.id.statusEdit);
-
-        mStatusDialogButton.setOnClickListener(new OnClickListener() {
-            public void onClick(View v) {
-                showStatusListDialog();
-            }
-        });
-
-        mStatusEditor.setOnKeyListener(new OnKeyListener() {
-            public boolean onKey(View v, int keyCode, KeyEvent event) {
-                if (KeyEvent.ACTION_DOWN == event.getAction()) {
-                    switch (keyCode) {
-                        case KeyEvent.KEYCODE_DPAD_CENTER:
-                        case KeyEvent.KEYCODE_ENTER:
-                            updateStatusText();
-                            return true;
-                    }
-                }
-                return false;
-            }
-        });
-
-        mStatusEditor.setOnFocusChangeListener(new View.OnFocusChangeListener(){
-            public void onFocusChange(View v, boolean hasFocus) {
-                if (!hasFocus) {
-                    updateStatusText();
-                }
-            }
-        });
-    }
-
-    private void showStatusListDialog() {
-        if (mConn == null) {
-            return;
-        }
-
-        AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
-        builder.setAdapter(getStatusAdapter(),
-                new DialogInterface.OnClickListener() {
-                    public void onClick(DialogInterface dialog, int which) {
-                        StatusItem item = mStatusItems.get(which);
-                        int oldStatus = mPresence.getStatus();
-                        if (item.getStatus() != oldStatus) {
-                            updatePresence(item.getStatus(), item.getText().toString());
-                        }
-                    }
-                });
-        builder.show();
-    }
-
-    private StatusIconAdapter getStatusAdapter() {
-        try {
-            mStatusItems.clear();
-            int[] supportedStatus = mConn.getSupportedPresenceStatus();
-            for (int i = 0; i < supportedStatus.length; i++) {
-                int s = PresenceUtils.convertStatus(supportedStatus[i]);
-                if (s == Im.Presence.OFFLINE) {
-                    s = Im.Presence.INVISIBLE;
-                }
-                ImApp app = ImApp.getApplication((Activity)mContext);
-                BrandingResources brandingRes = app.getBrandingResource(mProviderId);
-                Drawable icon = brandingRes.getDrawable(PresenceUtils.getStatusIconId(s));
-                String text = brandingRes.getString(PresenceUtils.getStatusStringRes(s));
-                mStatusItems.add(new StatusItem(supportedStatus[i], icon, text));
-            }
-        } catch (RemoteException e) {
-            mHandler.showServiceErrorAlert();
-        }
-
-        return new StatusIconAdapter(mContext, mStatusItems);
-    }
-
-    void updateStatusText() {
-        String newStatusText = mStatusEditor.getText().toString();
-        if (TextUtils.isEmpty(newStatusText)) {
-            newStatusText = "";
-        }
-        if (!newStatusText.equals(mLastStatusEditText)) {
-            updatePresence(-1, newStatusText);
-        }
-    }
-
-    public void setConnection(IImConnection conn) {
-        mConn = conn;
-        try {
-            mPresence = conn.getUserPresence();
-            mProviderId = conn.getProviderId();
-        } catch (RemoteException e) {
-            mHandler.showServiceErrorAlert();
-        }
-        if (mPresence == null) {
-            mPresence = new Presence();
-        }
-        updateView();
-    }
-
-    private void updateView() {
-        ImApp app = ImApp.getApplication((Activity)mContext);
-        BrandingResources brandingRes = app.getBrandingResource(mProviderId);
-        int status = PresenceUtils.convertStatus(mPresence.getStatus());
-        mStatusDialogButton.setImageDrawable(brandingRes.getDrawable(
-                PresenceUtils.getStatusIconId(status)));
-
-        String statusText = mPresence.getStatusText();
-        if (TextUtils.isEmpty(statusText)) {
-            statusText = brandingRes.getString(PresenceUtils.getStatusStringRes(status));
-        }
-        mStatusEditor.setText(statusText);
-        mLastStatusEditText = statusText;
-
-        // Disable the user to edit the custom status text because
-        // the AIM and MSN server don't support it now.
-        ProviderDef provider = app.getProvider(mProviderId);
-        String providerName = provider == null ? null : provider.mName;
-        if (Im.ProviderNames.AIM.equals(providerName)
-                || Im.ProviderNames.MSN.equals(providerName)) {
-            mStatusEditor.setFocusable(false);
-        }
-    }
-
-    void updatePresence(int status, String statusText) {
-        if (mPresence == null) {
-            // We haven't get the connection yet. Don't allow to update presence now.
-            return;
-        }
-
-        Presence newPresence = new Presence(mPresence);
-
-        if (status != -1) {
-            newPresence.setStatus(status);
-        }
-        newPresence.setStatusText(statusText);
-
-        try {
-            int res = mConn.updateUserPresence(newPresence);
-            if (res != ImErrorInfo.NO_ERROR) {
-                mHandler.showAlert(R.string.error,
-                        ErrorResUtils.getErrorRes(getResources(), res));
-            } else {
-                mPresence = newPresence;
-                updateView();
-            }
-        } catch (RemoteException e) {
-            mHandler.showServiceErrorAlert();
-        }
-    }
-
-    private static class StatusItem implements ImageListAdapter.ImageListItem {
-        private final int mStatus;
-        private final Drawable mIcon;
-        private final String   mText;
-
-        public StatusItem(int status, Drawable icon, String text) {
-            mStatus = status;
-            mIcon = icon;
-            mText = text;
-        }
-
-        public Drawable getDrawable() {
-            return mIcon;
-        }
-
-        public CharSequence getText() {
-            return mText;
-        }
-
-        public int getStatus() {
-            return mStatus;
-        }
-    }
-
-    private static class StatusIconAdapter extends ImageListAdapter {
-        public StatusIconAdapter(Context context, List<StatusItem> data) {
-            super(context, data);
-        }
-
-        @Override
-        public long getItemId(int position) {
-            StatusItem item = (StatusItem)getItem(position);
-            return item.getStatus();
-        }
-
-        @Override
-        public View getView(int position, View convertView, ViewGroup parent) {
-            View view = super.getView(position, convertView, parent);
-            return view;
-        }
-    }
-}
diff --git a/src/com/android/im/app/adapter/ChatListenerAdapter.java b/src/com/android/im/app/adapter/ChatListenerAdapter.java
deleted file mode 100644 (file)
index 6f6776f..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app.adapter;
-
-import android.util.Log;
-
-import com.android.im.IChatListener;
-import com.android.im.IChatSession;
-import com.android.im.app.ImApp;
-import com.android.im.engine.Contact;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.Message;
-
-public class ChatListenerAdapter extends IChatListener.Stub {
-
-    private static final String TAG = ImApp.LOG_TAG;
-
-    public void onContactJoined(IChatSession ses, Contact contact) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "onContactJoined(" + ses + ", " + contact + ")");
-        }
-    }
-
-    public void onContactLeft(IChatSession ses, Contact contact) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "onContactLeft(" + ses + ", " + contact + ")");
-        }
-    }
-
-    public void onIncomingMessage(IChatSession ses, Message msg) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "onIncomingMessage(" + ses + ", " + msg + ")");
-        }
-    }
-
-    public void onSendMessageError(IChatSession ses, Message msg,
-            ImErrorInfo error) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "onSendMessageError(" + ses + ", " + msg + ", " + error + ")");
-        }
-    }
-
-    public void onInviteError(IChatSession ses, ImErrorInfo error) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "onInviteError(" + ses + ", " + error + ")");
-        }
-    }
-
-    public void onConvertedToGroupChat(IChatSession ses) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "onConvertedToGroupChat(" + ses + ")");
-        }
-    }
-
-}
diff --git a/src/com/android/im/app/adapter/ChatSessionListenerAdapter.java b/src/com/android/im/app/adapter/ChatSessionListenerAdapter.java
deleted file mode 100644 (file)
index 8fb4ba8..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app.adapter;
-
-import android.util.Log;
-
-import com.android.im.IChatSession;
-import com.android.im.IChatSessionListener;
-import com.android.im.app.ImApp;
-import com.android.im.engine.ImErrorInfo;
-
-public class ChatSessionListenerAdapter extends IChatSessionListener.Stub {
-
-    private static final String TAG = ImApp.LOG_TAG;
-
-    public void onChatSessionCreated(IChatSession session) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "notifyChatSessionCreated(" + session + ")");
-        }
-    }
-
-    public void onChatSessionCreateError(String name, ImErrorInfo error) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "notifyChatSessionCreateError(" + name + ", " + error + ")");
-        }
-    }
-
-}
diff --git a/src/com/android/im/app/adapter/ConnectionListenerAdapter.java b/src/com/android/im/app/adapter/ConnectionListenerAdapter.java
deleted file mode 100644 (file)
index 921e0fb..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app.adapter;
-
-import android.os.Handler;
-import android.util.Log;
-
-import com.android.im.IConnectionListener;
-import com.android.im.IImConnection;
-import com.android.im.app.ImApp;
-import com.android.im.engine.ImErrorInfo;
-
-public class ConnectionListenerAdapter extends IConnectionListener.Stub {
-
-    private static final String TAG = ImApp.LOG_TAG;
-    private Handler mHandler;
-
-    public ConnectionListenerAdapter(Handler handler) {
-        mHandler = handler;
-    }
-
-    public void onConnectionStateChange(IImConnection connection, int state, ImErrorInfo error) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "onConnectionStateChange(" + state + ", " + error + ")");
-        }
-    }
-
-    public void onUpdateSelfPresenceError(IImConnection connection, ImErrorInfo error) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "onUpdateSelfPresenceError(" + error + ")");
-        }
-    }
-
-    public void onSelfPresenceUpdated(IImConnection connection) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "onSelfPresenceUpdated()");
-        }
-    }
-
-    final public void onStateChanged(final IImConnection conn,
-            final int state, final ImErrorInfo error) {
-        mHandler.post(new Runnable() {
-            public void run() {
-                onConnectionStateChange(conn, state, error);
-            }
-        });
-    }
-
-    final public void onUpdatePresenceError(final IImConnection conn,
-            final ImErrorInfo error) {
-        mHandler.post(new Runnable() {
-            public void run() {
-                onUpdateSelfPresenceError(conn, error);
-            }
-        });
-    }
-
-    final public void onUserPresenceUpdated(final IImConnection conn) {
-        mHandler.post(new Runnable() {
-            public void run() {
-                onSelfPresenceUpdated(conn);
-            }
-        });
-    }
-}
diff --git a/src/com/android/im/app/adapter/ContactListListenerAdapter.java b/src/com/android/im/app/adapter/ContactListListenerAdapter.java
deleted file mode 100644 (file)
index 6c8229f..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.app.adapter;
-
-import android.util.Log;
-
-import com.android.im.IContactList;
-import com.android.im.IContactListListener;
-import com.android.im.app.ImApp;
-import com.android.im.app.SimpleAlertHandler;
-import com.android.im.engine.Contact;
-import com.android.im.engine.ImErrorInfo;
-
-public class ContactListListenerAdapter extends IContactListListener.Stub {
-
-    private static final String TAG = ImApp.LOG_TAG;
-
-    private final SimpleAlertHandler mHandler;
-
-    public ContactListListenerAdapter(SimpleAlertHandler handler) {
-        mHandler = handler;
-    }
-
-    public void onContactChange(int type, IContactList list,
-            Contact contact) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "onContactListChanged(" + type + ", " + list + ", "
-                    + contact + ")");
-        }
-    }
-
-    public void onAllContactListsLoaded() {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "onAllContactListsLoaded");
-        }
-    }
-
-    public void onContactsPresenceUpdate(Contact[] contacts) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "onContactsPresenceUpdate(" + contacts.length + ")");
-        }
-    }
-
-    public void onContactError(int errorType, ImErrorInfo error,
-            String listName, Contact contact) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            Log.d(TAG, "onContactError(" + errorType + ", " + error + ", "
-                    + listName + ", " + contact + ")");
-        }
-        mHandler.showContactError(errorType, error, listName, contact);
-    }
-}
diff --git a/src/com/android/im/engine/Address.java b/src/com/android/im/engine/Address.java
deleted file mode 100644 (file)
index be72479..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import android.os.Parcel;
-
-/**
- * An abstract representation of the address to any addressable entities such as
- * User, Contact list, User Group, etc.
- */
-public abstract class Address {
-    /**
-     * Gets a string representation of this address.
-     *
-     * @return a string representation of this address.
-     */
-    public abstract String getFullName();
-
-    /**
-     * Gets a user friendly screen name of this address object.
-     * @return the screen name.
-     */
-    public abstract String getScreenName();
-
-    public abstract void writeToParcel(Parcel dest);
-
-    public abstract void readFromParcel(Parcel source);
-
-    public boolean equals(Object other) {
-        return other instanceof Address
-                && this.getFullName().equals(((Address)other).getFullName());
-    }
-
-    public int hashCode() {
-        return getFullName().hashCode();
-    }
-}
diff --git a/src/com/android/im/engine/AddressParcelHelper.java b/src/com/android/im/engine/AddressParcelHelper.java
deleted file mode 100644 (file)
index 015266c..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import android.os.Parcel;
-import android.util.Log;
-
-import com.android.im.imps.ImpsContactListAddress;
-import com.android.im.imps.ImpsGroupAddress;
-import com.android.im.imps.ImpsUserAddress;
-
-/**
- * A helper for marshalling and unmarshaling an Address Object to a Parcel.
- * The Address is only an abstract representation, the underlying protocol
- * implementation MUST provide a public default constructor and register
- * their implementing class here.
- */
-public class AddressParcelHelper {
-    private static Class[] sAddressClasses = new Class[] {
-        ImpsUserAddress.class,
-        ImpsGroupAddress.class,
-        ImpsContactListAddress.class,
-    };
-
-    private AddressParcelHelper() {
-    }
-
-    public static Address readFromParcel(Parcel source) {
-        int classIndex = source.readInt();
-        if(classIndex == -1) {
-            return null;
-        }
-        if(classIndex < 0 || classIndex >= sAddressClasses.length) {
-            throw new RuntimeException("Unknown Address type index: " + classIndex);
-        }
-        try {
-            Address address = (Address)sAddressClasses[classIndex].newInstance();
-            address.readFromParcel(source);
-            return address;
-        } catch (InstantiationException e) {
-            Log.e("AddressParcel", "Default constructor are required on Class"
-                    + sAddressClasses[classIndex].getName());
-            throw new RuntimeException(e);
-        } catch (IllegalAccessException e) {
-            Log.e("AddressParcel", "Default constructor are required on Class"
-                    + sAddressClasses[classIndex].getName());
-            throw new RuntimeException(e);
-        }
-    }
-
-    public static void writeToParcel(Parcel dest, Address address) {
-        if(address == null) {
-            dest.writeInt(-1);
-        } else {
-            dest.writeInt(getClassIndex(address));
-            address.writeToParcel(dest);
-        }
-    }
-
-    private static int getClassIndex(Address address) {
-        for(int i = 0; i < sAddressClasses.length; i++) {
-            if(address.getClass() == sAddressClasses[i]) {
-                return i;
-            }
-        }
-        throw new RuntimeException("Unregistered Address type: " + address);
-    }
-}
diff --git a/src/com/android/im/engine/ChatGroup.java b/src/com/android/im/engine/ChatGroup.java
deleted file mode 100644 (file)
index 4189b0c..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Vector;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-public class ChatGroup extends ImEntity{
-    private ChatGroupManager mManager;
-    private Address mAddress;
-    private String mName;
-    private Vector<Contact> mMembers;
-    private CopyOnWriteArrayList<GroupMemberListener> mMemberListeners;
-
-    public ChatGroup(Address address, String name, ChatGroupManager manager) {
-        this(address, name, null, manager);
-    }
-
-    public ChatGroup(Address address, String name, Collection<Contact> members,
-            ChatGroupManager manager) {
-        mAddress = address;
-        mName = name;
-        mManager = manager;
-        mMembers = new Vector<Contact>();
-
-        if(members != null) {
-            mMembers.addAll(members);
-        }
-        mMemberListeners = new CopyOnWriteArrayList<GroupMemberListener>();
-    }
-
-    @Override
-    public Address getAddress() {
-        return mAddress;
-    }
-
-    /**
-     * Gets the name of the group.
-     *
-     * @return the name of the group.
-     */
-    public String getName() {
-        return mName;
-    }
-
-    public void addMemberListener(GroupMemberListener listener) {
-        mMemberListeners.add(listener);
-    }
-
-    public void removeMemberListener(GroupMemberListener listener) {
-        mMemberListeners.remove(listener);
-    }
-
-    /**
-     * Gets an unmodifiable collection of the members of the group.
-     *
-     * @return an unmodifiable collection of the members of the group.
-     */
-    public List<Contact> getMembers(){
-        return Collections.unmodifiableList(mMembers);
-    }
-
-    /**
-     * Adds a member to this group.
-     * TODO: more docs on async callbacks.
-     *
-     * @param contact the member to add.
-     */
-    public synchronized void addMemberAsync(Contact contact) {
-        mManager.addGroupMemberAsync(this, contact);
-    }
-
-    /**
-     * Removes a member from this group.
-     * TODO: more docs on async callbacks.
-     *
-     * @param contact the member to remove.
-     */
-    public synchronized void removeMemberAsync(Contact contact) {
-        mManager.removeGroupMemberAsync(this, contact);
-    }
-
-    /**
-     * Notifies that a contact has joined into this group.
-     *
-     * @param contact the contact who has joined into the group.
-     */
-    void notifyMemberJoined(Contact contact) {
-        mMembers.add(contact);
-        for(GroupMemberListener listener : mMemberListeners) {
-            listener.onMemberJoined(this, contact);
-        }
-    }
-
-    /**
-     * Notifies that a contact has left this group.
-     *
-     * @param contact the contact who has left this group.
-     */
-    void notifyMemberLeft(Contact contact) {
-        if(mMembers.remove(contact)) {
-            for(GroupMemberListener listener : mMemberListeners) {
-                listener.onMemberLeft(this, contact);
-            }
-        }
-    }
-
-    /**
-     * Notifies that previous operation on this group has failed.
-     *
-     * @param error the error information.
-     */
-    void notifyGroupMemberError(ImErrorInfo error) {
-        for(GroupMemberListener listener : mMemberListeners) {
-            listener.onError(this, error);
-        }
-    }
-}
diff --git a/src/com/android/im/engine/ChatGroupManager.java b/src/com/android/im/engine/ChatGroupManager.java
deleted file mode 100644 (file)
index 8616139..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-/**
- * ChatGroupManager manages the creating, removing and the member of ChatGroups.
- */
-public abstract class ChatGroupManager {
-    protected HashMap<Address, ChatGroup> mGroups;
-
-    protected HashMap<String, Invitation> mInvitations;
-
-    protected CopyOnWriteArrayList<GroupListener> mGroupListeners;
-
-    protected InvitationListener mInvitationListener;
-
-    protected ChatGroupManager() {
-        mGroups = new HashMap<Address, ChatGroup>();
-        mInvitations = new HashMap<String, Invitation>();
-        mGroupListeners = new CopyOnWriteArrayList<GroupListener>();
-    }
-
-    /**
-     * Adds a GroupListener to this manager so that it will be notified when a
-     * certain group changes.
-     *
-     * @param listener the listener to be notified.
-     */
-    public void addGroupListener(GroupListener listener) {
-        mGroupListeners.add(listener);
-    }
-
-    /**
-     * Removes a GroupListener from this manager so that it won't be notified
-     * any more.
-     *
-     * @param listener the listener to remove.
-     */
-    public void removeGroupListener(GroupListener listener) {
-        mGroupListeners.remove(listener);
-    }
-
-    /**
-     * Sets the InvitationListener to the manager so that it will be notified
-     * when an invitation from another users received.
-     *
-     * @param listener the InvitationListener.
-     */
-    public synchronized void setInvitationListener(InvitationListener listener) {
-        mInvitationListener = listener;
-    }
-
-    /**
-     * Creates a new ChatGroup with specified name. This method returns
-     * immediately and the registered GroupListeners will be notified when the
-     * group is created or any error occurs. The newly created group is a
-     * temporary group and will be automatically deleted when all joined users
-     * have left.
-     *
-     * @param name the name of the ChatGroup to be created.
-     */
-    public abstract void createChatGroupAsync(String name);
-
-    /**
-     * Deletes a certain ChatGroup. This method returns immediately and the
-     * registered GroupListeners will be notified when the group is deleted or
-     * any error occurs. Only the administrator of the ChatGroup can delete it.
-     *
-     * @param group the ChatGroup to be deleted.
-     */
-    public abstract void deleteChatGroupAsync(ChatGroup group);
-
-    /**
-     * Adds a member to a certain ChatGroup. This method returns immediately and
-     * the GroupGroupListeners registered on the group will be notified when the
-     * member is added or any error occurs. Only the administrator of the
-     * ChatGroup can add member to it.
-     *
-     * @param group the ChatGroup to which the member will add.
-     * @param contact the member to add.
-     */
-    protected abstract void addGroupMemberAsync(ChatGroup group, Contact contact);
-
-    /**
-     * Removes a member from certain ChatGroup. This method returns immediately
-     * and the GroupGroupListeners registered on the group will be notified when
-     * the member is added or any error occurs. Only the administrator of the
-     * ChatGroup can remove its members.
-     *
-     * @param group the ChatGroup whose member will be removed.
-     * @param contact the member to be removed.
-     */
-    protected abstract void removeGroupMemberAsync(ChatGroup group, Contact contact);
-
-    /**
-     * Joins into a certain ChatGroup. This method returns immediately and the
-     * registered GroupListeners will be notified when the user joined into the
-     * group or any error occurs.
-     *
-     * @param address the address of the ChatGroup.
-     */
-    public abstract void joinChatGroupAsync(Address address);
-
-    /**
-     * Leaves a certain ChatGroup.This method returns immediately and the
-     * registered GroupListeners will be notified when the the user left the
-     * group or any error occurs.
-     *
-     * @param group the ChatGroup.
-     */
-    public abstract void leaveChatGroupAsync(ChatGroup group);
-
-    /**
-     * Invites a user to join a certain ChatGroup. If success, the invitee will
-     * receive an invitation with information of the group. Otherwise, the
-     * registered GroupListeners will be notified if any error occurs.
-     *
-     * @param group the ChatGroup.
-     * @param invitee the invitee.
-     */
-    public abstract void inviteUserAsync(ChatGroup group, Contact invitee);
-
-    /**
-     * Accepts an invitation. The user will join the group automatically after
-     * accept the invitation.
-     *
-     * @param invitation the invitation to accept.
-     */
-    public abstract void acceptInvitationAsync(Invitation invitation);
-
-    /**
-     * Accepts an invitation. The user can only accept or reject the same
-     * invitation only once.
-     *
-     * @param inviteId the id of the invitation to accept.
-     * @see #acceptInvitationAsync(Invitation)
-     */
-    public void acceptInvitationAsync(String inviteId) {
-        Invitation invitation = mInvitations.remove(inviteId);
-        if (invitation != null) {
-            acceptInvitationAsync(invitation);
-        }
-    }
-
-    /**
-     * Rejects an invitation.
-     *
-     * @param inviteId the id of the invitation to reject.
-     * @see #rejectInvitationAsync(Invitation)
-     */
-    public void rejectInvitationAsync(String inviteId) {
-        Invitation invitation = mInvitations.remove(inviteId);
-        if (invitation != null) {
-            rejectInvitationAsync(invitation);
-        }
-    }
-
-    /**
-     * Rejects an invitation.
-     *
-     * @param invitation the invitation to reject.
-     */
-    public abstract void rejectInvitationAsync(Invitation invitation);
-
-    /**
-     * Gets a ChatGroup by address.
-     *
-     * @param address the address of the ChatGroup.
-     * @return a ChatGroup.
-     */
-    public ChatGroup getChatGroup(Address address) {
-        return mGroups.get(address);
-    }
-
-    /**
-     * Notifies the GroupListeners that a ChatGroup has changed.
-     *
-     * @param groupAddress the address of group which has changed.
-     * @param joined a list of users that have joined the group.
-     * @param left a list of users that have left the group.
-     */
-    protected void notifyGroupChanged(Address groupAddress, ArrayList<Contact> joined,
-            ArrayList<Contact> left) {
-        ChatGroup group = mGroups.get(groupAddress);
-        if (group == null) {
-            group = new ChatGroup(groupAddress, groupAddress.getScreenName(), this);
-            mGroups.put(groupAddress, group);
-        }
-        if (joined != null) {
-            for (Contact contact : joined) {
-                notifyMemberJoined(group, contact);
-            }
-        }
-        if (left != null) {
-            for (Contact contact : left) {
-                notifyMemberLeft(group, contact);
-            }
-        }
-    }
-
-    protected synchronized void notifyGroupCreated(ChatGroup group) {
-        mGroups.put(group.getAddress(), group);
-        for (GroupListener listener : mGroupListeners) {
-            listener.onGroupCreated(group);
-        }
-    }
-
-    protected synchronized void notifyGroupDeleted(ChatGroup group) {
-        mGroups.remove(group.getAddress());
-        for (GroupListener listener : mGroupListeners) {
-            listener.onGroupDeleted(group);
-        }
-    }
-
-    protected synchronized void notifyJoinedGroup(ChatGroup group) {
-        mGroups.put(group.getAddress(), group);
-        for (GroupListener listener : mGroupListeners) {
-            listener.onJoinedGroup(group);
-        }
-    }
-
-    /**
-     * Notifies the GroupListeners that the user has left a certain group.
-     *
-     * @param groupAddress the address of the group.
-     */
-    protected synchronized void notifyLeftGroup(ChatGroup group) {
-        mGroups.remove(group.getAddress());
-        for (GroupListener listener : mGroupListeners) {
-            listener.onLeftGroup(group);
-        }
-    }
-
-    protected synchronized void notifyGroupError(int errorType, String groupName, ImErrorInfo error) {
-        for (GroupListener listener : mGroupListeners) {
-            listener.onGroupError(errorType, groupName, error);
-        }
-    }
-
-    /**
-     * Notifies the InvitationListener that another user invited the current
-     * logged user to join a group chat.
-     */
-    protected synchronized void notifyGroupInvitation(Invitation invitation) {
-        mInvitations.put(invitation.getInviteID(), invitation);
-        if (mInvitationListener != null) {
-            mInvitationListener.onGroupInvitation(invitation);
-        }
-    }
-
-    /**
-     * Notifies that a contact has joined into this group.
-     *
-     * @param group the group into which the contact has joined.
-     * @param contact the contact who has joined into the group.
-     */
-    protected void notifyMemberJoined(ChatGroup group, Contact contact) {
-        group.notifyMemberJoined(contact);
-    }
-
-    /**
-     * Notifies that a contact has left this group.
-     *
-     * @param group the group which the contact has left.
-     * @param contact the contact who has left this group.
-     */
-    protected void notifyMemberLeft(ChatGroup group, Contact contact) {
-        group.notifyMemberLeft(contact);
-    }
-
-    /**
-     * Notifies that previous operation on this group has failed.
-     *
-     * @param error the error information.
-     */
-    protected void notifyGroupMemberError(ChatGroup group, ImErrorInfo error) {
-        group.notifyGroupMemberError(error);
-    }
-}
diff --git a/src/com/android/im/engine/ChatSession.java b/src/com/android/im/engine/ChatSession.java
deleted file mode 100644 (file)
index a08d649..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Vector;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import android.util.Log;
-
-/**
- * A ChatSession represents a conversation between two users. A ChatSession has
- * a unique participant which is either another user or a group.
- */
-public class ChatSession {
-    private ImEntity mParticipant;
-    private ChatSessionManager mManager;
-    private CopyOnWriteArrayList<MessageListener> mListeners;
-    private Vector<Message> mHistoryMessages;
-
-    /**
-     * Creates a new ChatSession with a particular participant.
-     *
-     * @param participant the participant with who the user communicates.
-     * @param connection the underlying network connection.
-     */
-    ChatSession(ImEntity participant, ChatSessionManager manager) {
-        mParticipant = participant;
-        mManager = manager;
-        mListeners = new CopyOnWriteArrayList<MessageListener>();
-        mHistoryMessages = new Vector<Message>();
-    }
-
-    public ImEntity getParticipant() {
-        return mParticipant;
-    }
-
-    public void setParticipant(ImEntity participant) {
-        mParticipant = participant;
-    }
-
-    /**
-     * Adds a MessageListener so that it can be notified of any new message in
-     * this session.
-     *
-     * @param listener
-     */
-    public synchronized void addMessageListener(MessageListener listener) {
-        if ((listener != null) && !mListeners.contains(listener)) {
-            mListeners.add(listener);
-        }
-    }
-
-    /**
-     * Removes a listener from this session.
-     *
-     * @param listener
-     */
-    public synchronized void removeMessageListener(MessageListener listener) {
-        mListeners.remove(listener);
-    }
-
-    /**
-     * Sends a text message to other participant(s) in this session
-     * asynchronously.
-     * TODO: more docs on async callbacks.
-     *
-     * @param text the text to send.
-     */
-    public void sendMessageAsync(String text) {
-        Message message = new Message(text);
-        sendMessageAsync(message);
-    }
-
-    /**
-     * Sends a message to other participant(s) in this session asynchronously.
-     * TODO: more docs on async callbacks.
-     *
-     * @param msg the message to send.
-     */
-    public void sendMessageAsync(Message msg) {
-        msg.setTo(mParticipant.getAddress());
-
-        mHistoryMessages.add(msg);
-        mManager.sendMessageAsync(this, msg);
-    }
-
-    /**
-     * Called by ChatSessionManager when received a message of the ChatSession.
-     * All the listeners registered in this session will be notified.
-     *
-     * @param msg the received message.
-     */
-    public void onReceiveMessage(Message msg) {
-        mHistoryMessages.add(msg);
-
-        for (MessageListener listener : mListeners) {
-            listener.onIncomingMessage(this, msg);
-        }
-    }
-
-    /**
-     * Called by ChatSessionManager when an error occurs to send a message.
-     * @param message
-     *
-     * @param error the error information.
-     */
-    public void onSendMessageError(Message message, ImErrorInfo error) {
-        for (MessageListener listener : mListeners) {
-            listener.onSendMessageError(this, message, error);
-        }
-    }
-
-    public void onSendMessageError(String msgId, ImErrorInfo error) {
-        for(Message msg : mHistoryMessages){
-            if(msgId.equals(msg.getID())){
-                onSendMessageError(msg, error);
-                return;
-            }
-        }
-        Log.i("ChatSession", "Message has been removed when we get delivery error:"
-                + error);
-    }
-
-    /**
-     * Returns a unmodifiable list of the history messages in this session.
-     *
-     * @return a unmodifiable list of the history messages in this session.
-     */
-    public List<Message> getHistoryMessages() {
-        return Collections.unmodifiableList(mHistoryMessages);
-    }
-}
diff --git a/src/com/android/im/engine/ChatSessionListener.java b/src/com/android/im/engine/ChatSessionListener.java
deleted file mode 100644 (file)
index ec31861..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-/**
- * Interface that allows the implementing classes to listen for ChatSession
- * creation. The typical implementation will register MessageListener with the
- * created session so that it will be notified when new message arrived to the
- * session. Listeners are registered with ChatSessionManager.
- */
-public interface ChatSessionListener {
-
-    /**
-     * Called when a new ChatSession is created.
-     *
-     * @param session the created ChatSession.
-     */
-    public void onChatSessionCreated(ChatSession session);
-}
diff --git a/src/com/android/im/engine/ChatSessionManager.java b/src/com/android/im/engine/ChatSessionManager.java
deleted file mode 100644 (file)
index c24fab7..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import java.util.Vector;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-/**
- * The ChatSessionManager keeps track of all current chat sessions and is also
- * responsible to dispatch the new incoming message to the right session.
- */
-public abstract class ChatSessionManager {
-
-    private CopyOnWriteArrayList<ChatSessionListener> mListeners;
-
-    /** Map session to the participant communicate with. */
-    protected Vector<ChatSession> mSessions;
-
-    protected ChatSessionManager() {
-        mListeners = new CopyOnWriteArrayList<ChatSessionListener>();
-        mSessions = new Vector<ChatSession>();
-    }
-
-    /**
-     * Registers a ChatSessionListener with the ChatSessionManager to receive
-     * events related to ChatSession.
-     *
-     * @param listener the listener
-     */
-    public synchronized void addChatSessionListener(ChatSessionListener listener) {
-        if ((listener != null) && !mListeners.contains(listener)) {
-            mListeners.add(listener);
-        }
-    }
-
-    /**
-     * Removes a ChatSessionListener so that it will no longer be notified.
-     *
-     * @param listener the listener to remove.
-     */
-    public synchronized void removeChatSessionListener(ChatSessionListener listener) {
-        mListeners.remove(listener);
-    }
-
-    /**
-     * Creates a new ChatSession with specified participant.
-     *
-     * @param participant the participant.
-     * @return the created ChatSession.
-     */
-    public synchronized ChatSession createChatSession(ImEntity participant) {
-        for(ChatSession session : mSessions) {
-            if(session.getParticipant().equals(participant)) {
-                return session;
-            }
-        }
-
-        ChatSession session = new ChatSession(participant, this);
-        for (ChatSessionListener listener : mListeners) {
-            listener.onChatSessionCreated(session);
-        }
-
-        mSessions.add(session);
-
-        return session;
-    }
-
-    /**
-     * Closes a ChatSession. This only removes the session from the list; the
-     * protocol implementation should override this if it has special work to
-     * do.
-     *
-     * @param session the ChatSession to close.
-     */
-    public void closeChatSession(ChatSession session) {
-        mSessions.remove(session);
-    }
-
-    /**
-     * Sends a message to specified participant(s) asynchronously.
-     * TODO: more docs on async callbacks.
-     *
-     * @param message the message to send.
-     */
-    protected abstract void sendMessageAsync(ChatSession session, Message message);
-}
diff --git a/src/com/android/im/engine/ConnectionConfig.java b/src/com/android/im/engine/ConnectionConfig.java
deleted file mode 100644 (file)
index 69407c8..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-/**
- * Represents the configuration of a connection. Default procotols will extends
- * this class to provide their own configuration.
- */
-public abstract class ConnectionConfig {
-
-    /**
-     * Gets the name of the protocol.
-     *
-     * @return the name protocol.
-     */
-    public abstract String getProtocolName();
-}
diff --git a/src/com/android/im/engine/ConnectionFactory.java b/src/com/android/im/engine/ConnectionFactory.java
deleted file mode 100644 (file)
index c1d58a4..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import com.android.im.imps.ImpsConnection;
-import com.android.im.imps.ImpsConnectionConfig;
-
-/**
- * The factory used to create an instance of ImConnection.
- */
-public class ConnectionFactory {
-    private static ConnectionFactory sInstance;
-
-    private ConnectionFactory() {
-    }
-
-    /**
-     * Gets the singleton instance of the factory.
-     *
-     * @return the singleton instance.
-     */
-    public synchronized static ConnectionFactory getInstance() {
-        if (sInstance == null) {
-            sInstance = new ConnectionFactory();
-        }
-        return sInstance;
-    }
-
-    /**
-     * Creates a new ImConnection.
-     *
-     * @return the new ImConnection.
-     * @throws IMException if an error occurs during creating a connection.
-     */
-    public ImConnection createConnection(ConnectionConfig config) throws ImException {
-        if ("IMPS".equals(config.getProtocolName())) {
-            return new ImpsConnection((ImpsConnectionConfig) config);
-        } else {
-            throw new ImException("Unsupported protocol");
-        }
-    }
-}
diff --git a/src/com/android/im/engine/ConnectionListener.java b/src/com/android/im/engine/ConnectionListener.java
deleted file mode 100644 (file)
index 14601c4..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-/**
- * Interface that allows the implementing classes to listen to connection
- * relative events. Listeners are registered with ImConnection.
- */
-public interface ConnectionListener {
-    /**
-     * Called when the connection's state has changed.
-     *
-     * @param state
-     *        the new state of the connection.
-     * @param error
-     *        the error which caused the state change or <code>null</code>
-     *        it's a normal state change.
-     */
-    public void onStateChanged(int state, ImErrorInfo error);
-
-    public void onUserPresenceUpdated();
-
-    public void onUpdatePresenceError(ImErrorInfo error);
-}
diff --git a/src/com/android/im/engine/Contact.aidl b/src/com/android/im/engine/Contact.aidl
deleted file mode 100644 (file)
index 8500011..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-parcelable Contact;
diff --git a/src/com/android/im/engine/Contact.java b/src/com/android/im/engine/Contact.java
deleted file mode 100644 (file)
index f683c03..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-public class Contact extends ImEntity implements Parcelable{
-    private Address mAddress;
-    private String mName;
-    private Presence mPresence;
-
-    public Contact(Address address, String name) {
-        mAddress = address;
-        mName = name;
-
-        mPresence = new Presence();
-    }
-
-    public Contact(Parcel source) {
-        mAddress = AddressParcelHelper.readFromParcel(source);
-        mName = source.readString();
-        mPresence = new Presence(source);
-    }
-
-    public Address getAddress() {
-        return mAddress;
-    }
-
-    public String getName() {
-        return mName;
-    }
-
-    public Presence getPresence() {
-        return mPresence;
-    }
-
-    public boolean equals(Object other) {
-        return other instanceof Contact
-            && mAddress.equals(((Contact)other).mAddress);
-    }
-
-    public int hashCode() {
-        return mAddress.hashCode();
-    }
-
-    /**
-     * Set the presence of the Contact. Note that this method is public
-     * but not provide to the user.
-     * @param presence the new presence
-     */
-    public void setPresence(Presence presence) {
-        mPresence = presence;
-    }
-
-    public void writeToParcel(Parcel dest, int flags) {
-        AddressParcelHelper.writeToParcel(dest, mAddress);
-        dest.writeString(mName);
-        mPresence.writeToParcel(dest, 0);
-    }
-
-    public int describeContents() {
-        return 0;
-    }
-
-    public final static Parcelable.Creator<Contact> CREATOR = new Parcelable.Creator<Contact>() {
-        public Contact createFromParcel(Parcel source) {
-            return new Contact(source);
-        }
-
-        public Contact[] newArray(int size) {
-            return new Contact[size];
-        }
-    };
-}
diff --git a/src/com/android/im/engine/ContactList.java b/src/com/android/im/engine/ContactList.java
deleted file mode 100644 (file)
index abaad49..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-
-public class ContactList extends ImEntity {
-    protected Address mAddress;
-    protected String mName;
-    protected boolean mDefault;
-    protected ContactListManager mManager;
-
-    private HashMap<String, Contact> mContactsCache;
-
-    public ContactList(Address address, String name, boolean isDefault,
-            Collection<Contact> contacts, ContactListManager manager) {
-        mAddress = address;
-        mDefault = isDefault;
-        mName = name;
-        mManager = manager;
-
-        mContactsCache = new HashMap<String, Contact>();
-        if (contacts != null) {
-            for (Contact c : contacts) {
-                mContactsCache.put(manager.normalizeAddress(c.getAddress().getFullName()), c);
-            }
-        }
-    }
-
-    @Override
-    public Address getAddress() {
-        return mAddress;
-    }
-
-    public String getName() {
-        return mName;
-    }
-
-    public void setName(String name) {
-        if (null == name) {
-            throw new NullPointerException();
-        }
-
-        mManager.setListNameAsync(name, this);
-    }
-
-    public void setDefault(boolean isDefault) {
-        this.mDefault = isDefault;
-    }
-
-    public boolean isDefault() {
-        return mDefault;
-    }
-
-    /**
-     * Add a contact to the list. The contact is specified by its address
-     * string.
-     *
-     * @param address
-     *            the address string specifies the contact.
-     * @throws IllegalArgumentException
-     *             if the address is invalid.
-     * @throws NullPointerException
-     *             if the address string is null
-     * @throws ImException
-     *             if the contact is not allowed to be added
-     */
-    public void addContact(String address) throws ImException {
-        address = mManager.normalizeAddress(address);
-
-        if (null == address) {
-            throw new NullPointerException();
-        }
-
-        if (mManager.isBlocked(address)) {
-            throw new ImException(ImErrorInfo.CANT_ADD_BLOCKED_CONTACT,
-                    "Contact has been blocked");
-        }
-
-        if(containsContact(address)){
-            throw new ImException(ImErrorInfo.CONTACT_EXISTS_IN_LIST,
-                    "Contact already exists in the list");
-        }
-
-        mManager.addContactToListAsync(address, this);
-    }
-
-    /**
-     * Remove a contact from the list. If the contact is not in the list,
-     * nothing will happen. Otherwise, the contact will be removed from
-     * the list on the server asynchronously.
-     *
-     * @param address
-     *            the address of the contact to be removed from the list
-     * @throws NullPointerException
-     *             If the address is null
-     */
-    public void removeContact(Address address) throws ImException {
-        if(address == null) {
-            throw new NullPointerException();
-        }
-        Contact c = getContact(address);
-        if(c != null) {
-            removeContact(c);
-        }
-    }
-
-    /**
-     * Remove a contact from the list. If the contact is not in the list,
-     * nothing will happen. Otherwise, the contact will be removed from
-     * the list on the server asynchronously.
-     *
-     * @param contact
-     *            the contact to be removed from the list
-     * @throws NullPointerException
-     *             If the contact is null
-     */
-    public void removeContact(Contact contact) throws ImException {
-        if(contact == null) {
-            throw new NullPointerException();
-        }
-
-        if(containsContact(contact)) {
-            mManager.removeContactFromListAsync(contact, this);
-        }
-    }
-
-    public synchronized Contact getContact(Address address) {
-        return mContactsCache.get(mManager.normalizeAddress(address.getFullName()));
-    }
-
-    public synchronized Contact getContact(String address) {
-        return mContactsCache.get(mManager.normalizeAddress(address));
-    }
-
-    public synchronized int getContactsCount() {
-        return mContactsCache.size();
-    }
-
-    public synchronized Collection<Contact> getContacts() {
-        return new ArrayList<Contact>(mContactsCache.values());
-    }
-
-    public synchronized boolean containsContact(String address) {
-        return mContactsCache.containsKey(mManager.normalizeAddress(address));
-    }
-
-    public synchronized boolean containsContact(Address address) {
-        return address == null ? false
-                : mContactsCache.containsKey(mManager.normalizeAddress(address.getFullName()));
-    }
-
-    public synchronized boolean containsContact(Contact c) {
-        return c == null ? false
-                : mContactsCache.containsKey(mManager.normalizeAddress(c.getAddress().getFullName()));
-    }
-
-    protected void insertToCache(Contact contact) {
-        mContactsCache.put(mManager.normalizeAddress(contact.getAddress().getFullName()), contact);
-    }
-
-    protected void removeFromCache(Contact contact) {
-        mContactsCache.remove(mManager.normalizeAddress(contact.getAddress().getFullName()));
-    }
-
-}
diff --git a/src/com/android/im/engine/ContactListListener.java b/src/com/android/im/engine/ContactListListener.java
deleted file mode 100644 (file)
index 152d6bc..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-/**
- * Interfaces that allows the implementing classes to listen to contact list
- * relative events. Listeners are registered with ContactListManager.
- */
-public interface ContactListListener {
-    public static final int LIST_CREATED        = 1;
-    public static final int LIST_DELETED        = 2;
-    public static final int LIST_LOADED         = 3;
-    public static final int LIST_RENAMED        = 4;
-    public static final int LIST_CONTACT_ADDED  = 5;
-    public static final int LIST_CONTACT_REMOVED = 6;
-    public static final int CONTACT_BLOCKED     = 7;
-    public static final int CONTACT_UNBLOCKED   = 8;
-
-    public static final int ERROR_CREATING_LIST = -1;
-    public static final int ERROR_DELETING_LIST = -2;
-    public static final int ERROR_RENAMING_LIST = -3;
-
-    public static final int ERROR_LOADING_LIST          = -4;
-    public static final int ERROR_LOADING_BLOCK_LIST    = -5;
-
-    public static final int ERROR_RETRIEVING_PRESENCE   = -6;
-
-    public static final int ERROR_ADDING_CONTACT    = -7;
-    public static final int ERROR_REMOVING_CONTACT  = -8;
-    public static final int ERROR_BLOCKING_CONTACT  = -9;
-    public static final int ERROR_UNBLOCKING_CONTACT = -10;
-
-    /**
-     * Called when:
-     *  <ul>
-     *  <li> a contact list has been created, deleted, renamed or loaded, or
-     *  <li> a contact has been added to or removed from a list, or
-     *  <li> a contact has been blocked or unblocked
-     *  </ul>
-     *
-     * @param type one of the following values:
-     *      <ul>
-     *      <li>{@link #LIST_CREATED} list: the newly created list;
-     *          contact: null
-     *      <li>{@link #LIST_DELETED} list: the delete list; contact: null
-     *      <li>{@link #LIST_LOADED}  list: the newly loaded list;
-     *          contact: null
-     *      <li>{@link #LIST_RENAMED} list: the list renamed; contact: null
-     *      <li>{@link #LIST_CONTACT_ADDED}   list: the list to which the
-     *          contact is added, contact: the added contact
-     *      <li>{@link #LIST_CONTACT_REMOVED} list: the list from which the
-     *          contact is removed, contact: the removed contact
-     *      <li>{@link #CONTACT_BLOCKED}   list: null, contact: the blocked
-     *          contact
-     *      <li>{@link #CONTACT_UNBLOCKED} list: null, contact: the unblocked
-     *          contact
-     *      </ul>
-     * @param list
-     * @param contact
-     */
-    public void onContactChange(int type, ContactList list, Contact contact);
-
-    /**
-     * Called when all the contact lists (including the block list) and
-     * contacts have been loaded from the server.
-     */
-    public void onAllContactListsLoaded();
-
-    /**
-     * Called when received one or more contacts' updated presence
-     * information from the server.
-     *
-     * @param contacts one or more contacts that have updated presence
-     *      information.
-     */
-    public void onContactsPresenceUpdate(Contact[] contacts);
-
-    /**
-     *
-     * @param errorType one of the following values:
-     *      <ul>
-     *      <li>{@link #ERROR_CREATING_LIST} listName: the name of the list
-     *          to be created; contact: null
-     *      <li>{@link #ERROR_DELETING_LIST} listName: the name of the list
-     *          to be deleted; contact: null
-     *      <li>{@link #ERROR_LOADING_LIST}  listName: the name of the list
-     *          to be loaded, or null if the error occurred while fetching
-     *          the list of contact lists; contact: null
-     *      <li>{@link #ERROR_RENAMING_LIST} listName: the original name of
-     *          the list to be renamed; contact: null
-     *      <li>{@link #ERROR_LOADING_BLOCK_LIST} list: null; contact: null
-     *      <li>{@link #ERROR_RETRIEVING_PRESENCE}
-     *          <ul>
-     *          <li>when retrieving presence for a list: listName: the name
-     *              of the list, or null, depending on the implementation;
-     *              contact: null
-     *          <li>when retrieving presence for a contact: listName: the
-     *              name of the list that the contact belongs to, or null,
-     *              depending on the implementation;
-     *              contact: the contact
-     *          </ul>
-     *      <li>{@link #ERROR_ADDING_CONTACT} listName: the name of the list
-     *          to which the contact was to be added;
-     *          contact: the contact to add
-     *      <li>{@link #ERROR_REMOVING_CONTACT} listName: the name of the
-     *          list from which the contact was to be removed;
-     *          contact: the contact to remove
-     *      <li>{@link #ERROR_BLOCKING_CONTACT} list: null;
-     *          contact: the contact to block
-     *      <li>{@link #ERROR_UNBLOCKING_CONTACT} list: null;
-     *          contact: the contact to be unblocked
-     *      </ul>
-     * @param error
-     * @param listName
-     * @param contact
-     */
-    public void onContactError(int errorType, ImErrorInfo error,
-            String listName, Contact contact);
-}
diff --git a/src/com/android/im/engine/ContactListManager.java b/src/com/android/im/engine/ContactListManager.java
deleted file mode 100644 (file)
index 7b3d92d..0000000
+++ /dev/null
@@ -1,642 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Vector;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-/**
- * ContactListManager manages the creating, removing and retrieving contact
- * lists.
- */
-public abstract class ContactListManager {
-    /**
-     * ContactListManager state that indicates the contact list(s) has not been loaded.
-     */
-    public static final int LISTS_NOT_LOADED = 0;
-
-    /**
-     * ContactListManager state that indicates the contact list(s) is loading.
-     */
-    public static final int LISTS_LOADING = 1;
-
-    /**
-     * ContactListManager state that indicates the blocked list has been loaded.
-     */
-    public static final int BLOCKED_LIST_LOADED = 2;
-
-    /**
-     * ContactListManager state that indicates the contact list(s) has been loaded.
-     */
-    public static final int LISTS_LOADED = 3;
-
-    protected ContactList mDefaultContactList;
-    protected Vector<ContactList> mContactLists;
-
-    protected CopyOnWriteArrayList<ContactListListener> mContactListListeners;
-    protected SubscriptionRequestListener mSubscriptionRequestListener;
-
-    protected Vector<Contact> mBlockedList;
-
-    private int mState;
-
-    /**
-     * A pending list of blocking contacts which is used for checking duplicated
-     * block operation.
-     */
-    private Vector<String> mBlockPending;
-    /**
-     * A pending list of deleting contacts which is used for checking duplicated
-     * delete operation.
-     */
-    private Vector<Contact> mDeletePending;
-
-    /**
-     * Creates a new ContactListManager.
-     *
-     * @param conn The underlying protocol connection.
-     */
-    protected ContactListManager() {
-        mContactLists = new Vector<ContactList>();
-        mContactListListeners = new CopyOnWriteArrayList<ContactListListener>();
-        mBlockedList = new Vector<Contact>();
-
-        mBlockPending = new Vector<String>(4);
-        mDeletePending = new Vector<Contact>(4);
-
-        mState = LISTS_NOT_LOADED;
-    }
-
-    /**
-     * Set the state of the ContactListManager
-     *
-     * @param state the new state
-     */
-    protected synchronized void setState(int state) {
-        if (state < LISTS_NOT_LOADED || state > LISTS_LOADED) {
-            throw new IllegalArgumentException();
-        }
-
-        mState = state;
-    }
-
-    /**
-     * Get the state of the ContactListManager
-     *
-     * @return the current state of the manager
-     */
-    public synchronized int getState() {
-        return mState;
-    }
-
-    /**
-     * Adds a listener to the manager so that it will be notified for contact
-     * list changed.
-     *
-     * @param listener the listener to add.
-     */
-    public synchronized void addContactListListener(ContactListListener listener) {
-        if ((listener != null) && !mContactListListeners.contains(listener)) {
-            mContactListListeners.add(listener);
-        }
-    }
-
-    /**
-     * Removes a listener from this manager.
-     *
-     * @param listener the listener to remove.
-     */
-    public synchronized void removeContactListListener(ContactListListener listener) {
-        mContactListListeners.remove(listener);
-    }
-
-    /**
-     * Sets the SubscriptionRequestListener to the manager so that it will be notified
-     * when a subscription request from another user is received.
-     *
-     * @param listener the ContactInvitationListener.
-     */
-    public synchronized void setSubscriptionRequestListener(
-            SubscriptionRequestListener listener) {
-        mSubscriptionRequestListener = listener;
-    }
-
-    public synchronized SubscriptionRequestListener getSubscriptionRequestListener() {
-        return mSubscriptionRequestListener;
-    }
-
-    /**
-     * Gets a collection of the contact lists.
-     *
-     * @return a collection of the contact lists.
-     */
-    public Collection<ContactList> getContactLists() {
-        return Collections.unmodifiableCollection(mContactLists);
-    }
-
-    /**
-     * Gets a contact by address.
-     *
-     * @param address the address of the Contact.
-     * @return the Contact or null if the Contact doesn't exist in any list.
-     */
-    public Contact getContact(Address address) {
-        return getContact(address.getFullName());
-    }
-
-    public Contact getContact(String address) {
-        for (ContactList list : mContactLists) {
-            Contact c = list.getContact(address);
-            if( c != null) {
-                return c;
-            }
-        }
-        return null;
-    }
-
-    public abstract String normalizeAddress(String address);
-
-    /**
-     * Creates a temporary contact. It's usually used when we want to create
-     * a chat with someone not in the list.
-     *
-     * @param address the address of the temporary contact.
-     * @return the created temporary contact
-     */
-    public abstract Contact createTemporaryContact(String address);
-
-    /**
-     * Tell whether the manager contains the specified contact
-     *
-     * @param contact the specified contact
-     * @return true if the contact is contained in the lists of the manager,
-     *          otherwise, return false
-     */
-    public boolean containsContact(Contact contact) {
-        for (ContactList list : mContactLists) {
-            if (list.containsContact(contact)) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Gets a contact list by name.
-     *
-     * @param name the name of the contact list.
-     * @return the ContactList or null if the contact list doesn't exist.
-     */
-    public ContactList getContactList(String name) {
-        for (ContactList list : mContactLists) {
-            if (list.getName() != null && list.getName().equals(name)) {
-                return list;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Get the contact list by the address
-     *
-     * @param address the address of the contact list
-     * @return the <code>ContactList</code> or null if the list doesn't exist
-     */
-    public ContactList getContactList(Address address) {
-        for (ContactList list : mContactLists) {
-            if (list.getAddress().equals(address)) {
-                return list;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Gets the default contact list.
-     *
-     * @return the default contact list.
-     * @throws ImException
-     */
-    public ContactList getDefaultContactList() throws ImException {
-        checkState();
-        return mDefaultContactList;
-    }
-
-    /**
-     * Create a contact list with the specified name asynchronously.
-     *
-     * @param name the specific name of the contact list
-     * @throws ImException
-     */
-    public void createContactListAsync(String name) throws ImException {
-        createContactListAsync(name, null, false);
-    }
-
-    /**
-     * Create a contact list with specified name and whether it is to be
-     * created as the default list.
-     *
-     * @param name the specific name of the contact list
-     * @param isDefault whether the contact list is to be created as the
-     *                  default list
-     * @throws ImException
-     */
-    public void createContactListAsync(String name, boolean isDefault) throws ImException {
-        createContactListAsync(name, null, isDefault);
-    }
-
-    /**
-     * Create a contact list with specified name and contacts asynchronously.
-     *
-     * @param name the specific name of the contact list
-     * @param contacts the initial contacts of the contact list
-     * @throws ImException
-     */
-    public void createContactListAsync(String name,
-            Collection<Contact> contacts) throws ImException {
-        createContactListAsync(name, contacts, false);
-    }
-
-    /**
-     * Create a contact list with specified name and contacts asynchronously,
-     * and whether it is to be created as the default contact list.
-     *
-     * @param name the name of the contact list
-     * @param contacts the initial contacts of the list
-     * @param isDefault whether the contact list is the default list
-     * @throws ImException
-     */
-    public synchronized void createContactListAsync(String name,
-            Collection<Contact> contacts, boolean isDefault) throws ImException {
-        checkState();
-
-        if (getContactList(name) != null) {
-            throw new ImException(ImErrorInfo.CONTACT_LIST_EXISTS,
-                    "Contact list already exists");
-        }
-
-        if (mContactLists.isEmpty()) {
-            isDefault = true;
-        }
-
-        doCreateContactListAsync(name, contacts, isDefault);
-    }
-
-    /**
-     * Delete a contact list of the specified name asynchronously
-     * @param name the specific name of the contact list
-     * @throws ImException
-     */
-    public void deleteContactListAsync(String name) throws ImException {
-        deleteContactListAsync(getContactList(name));
-    }
-
-    /**
-     * Delete a specified contact list asynchronously
-     * @param list the contact list to be deleted
-     * @throws ImException if any error raised
-     */
-    public synchronized void deleteContactListAsync(ContactList list) throws ImException {
-        checkState();
-
-        if (null == list) {
-            throw new ImException(ImErrorInfo.CONTACT_LIST_NOT_FOUND,
-                    "Contact list doesn't exist");
-        }
-
-        doDeleteContactListAsync(list);
-    }
-
-    public void blockContactAsync(Contact contact) throws ImException {
-        blockContactAsync(contact.getAddress().getFullName());
-    }
-
-    /**
-     * Blocks a certain Contact. The contact will be removed from any
-     * ContactList after be blocked. If the contact has already been blocked,
-     * the method does nothing.
-     *
-     * @param address the address of the contact to block.
-     * @throws ImException if an error occurs
-     */
-    public void blockContactAsync(String address) throws ImException {
-        checkState();
-
-        if(isBlocked(address)){
-            return;
-        }
-
-        if (mBlockPending.contains(address)) {
-            return;
-        }
-        doBlockContactAsync(address, true);
-    }
-
-    public void unblockContactAsync(Contact contact) throws ImException {
-        unblockContactAsync(contact.getAddress().getFullName());
-    }
-
-    /**
-     * Unblock a certain contact. It will removes the contact from the blocked
-     * list and allows the contact to send message or invitation to the client
-     * again. If the contact is not blocked on the client, this method does
-     * nothing. Whether the unblocked contact will be added to the ContactList
-     * it belongs before blocked or not depends on the underlying protocol
-     * implementation.
-     *
-     * @param address the address of the contact to unblock.
-     * @throws ImException if the current state is illegal
-     */
-    public void unblockContactAsync(String address) throws ImException {
-        checkState();
-
-        if(!isBlocked(address)) {
-            return;
-        }
-
-        doBlockContactAsync(address, false);
-    }
-
-    protected void addContactToListAsync(String address, ContactList list)
-            throws ImException {
-        checkState();
-
-        doAddContactToListAsync(address, list);
-    }
-
-    protected void removeContactFromListAsync(Contact contact, ContactList list)
-            throws ImException {
-        checkState();
-
-        if (mDeletePending.contains(contact)) {
-            return;
-        }
-
-        doRemoveContactFromListAsync(contact, list);
-    }
-
-    /**
-     * Gets a unmodifiable list of blocked contacts.
-     *
-     * @return a unmodifiable list of blocked contacts.
-     * @throws ImException
-     */
-    public List<Contact> getBlockedList() throws ImException {
-        checkState();
-
-        return Collections.unmodifiableList(mBlockedList);
-    }
-
-    /**
-     * Checks if a contact is blocked.
-     *
-     * @param contact the contact.
-     * @return true if it's blocked, false otherwise.
-     * @throws ImException if contacts has not been loaded.
-     */
-    public boolean isBlocked(Contact contact) throws ImException {
-        return isBlocked(contact.getAddress().getFullName());
-    }
-
-    /**
-     * Checks if a contact is blocked.
-     *
-     * @param address the address of the contact.
-     * @return true if it's blocked, false otherwise.
-     * @throws ImException if contacts has not been loaded.
-     */
-    public synchronized boolean isBlocked(String address) throws ImException {
-        if(mState < BLOCKED_LIST_LOADED) {
-            throw new ImException(ImErrorInfo.ILLEGAL_CONTACT_LIST_MANAGER_STATE,
-                "Blocked list hasn't been loaded");
-        }
-        for(Contact c : mBlockedList) {
-            if(c.getAddress().getFullName().equals(address)){
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Check the state of the ContactListManager. Only the LIST_LOADED state
-     * is permitted.
-     *
-     * @throws ImException if the current state is not LIST_LOADED
-     */
-    protected void checkState() throws ImException {
-        if (getConnection().getState() != ImConnection.LOGGED_IN) {
-            throw new ImException(ImErrorInfo.CANT_CONNECT_TO_SERVER,
-                    "Can't connect to server");
-        }
-
-        if (getState() != LISTS_LOADED) {
-            throw new ImException(ImErrorInfo.ILLEGAL_CONTACT_LIST_MANAGER_STATE,
-                    "Illegal contact list manager state");
-        }
-    }
-
-    /**
-     * Load the contact lists from the server. This method will normally called
-     * after the user logged in to get the initial/saved contact lists from
-     * server. After called once, this method should not be called again.
-     */
-    public abstract void loadContactListsAsync();
-
-    public abstract void approveSubscriptionRequest(String contact);
-    public abstract void declineSubscriptionRequest(String contact);
-
-    protected abstract ImConnection getConnection();
-
-    /**
-     * Block or unblock a contact.
-     *
-     * @param address
-     *            the address of the contact to block or unblock.
-     * @param block
-     *            <code>true</code> to block the contact; <code>false</code>
-     *            to unblock the contact.
-     */
-    protected abstract void doBlockContactAsync(String address, boolean block);
-    protected abstract void doCreateContactListAsync(String name,
-            Collection<Contact> contacts, boolean isDefault);
-    protected abstract void doDeleteContactListAsync(ContactList list);
-
-    /**
-     * Notify that the presence of the contact has been updated
-     *
-     * @param contacts the contacts who have updated presence information
-     */
-    protected void notifyContactsPresenceUpdated(Contact[] contacts) {
-        for (ContactListListener listener : mContactListListeners) {
-            listener.onContactsPresenceUpdate(contacts);
-        }
-    }
-
-    /**
-     * Notify that a contact list related error has been raised.
-     *
-     * @param type the type of the error
-     * @param error the raised error
-     * @param listName the list name, if any, associated with the error
-     * @param contact the contact, if any, associated with the error
-     */
-    protected void notifyContactError(int type, ImErrorInfo error,
-            String listName, Contact contact) {
-        if (type == ContactListListener.ERROR_REMOVING_CONTACT) {
-            mDeletePending.remove(contact);
-        } else if (type == ContactListListener.ERROR_BLOCKING_CONTACT) {
-            mBlockPending.remove(contact.getAddress().getFullName());
-        }
-        for (ContactListListener listener : mContactListListeners) {
-            listener.onContactError(type, error, listName, contact);
-        }
-    }
-
-    /**
-     * Notify that a contact list has been loaded
-     *
-     * @param list the loaded list
-     */
-    protected void notifyContactListLoaded(ContactList list) {
-        for (ContactListListener listener : mContactListListeners) {
-            listener.onContactChange(ContactListListener.LIST_LOADED,
-                    list, null);
-        }
-    }
-
-    /**
-     * Notify that all contact lists has been loaded
-     */
-    protected void notifyContactListsLoaded() {
-        setState(LISTS_LOADED);
-        for (ContactListListener listener : mContactListListeners) {
-            listener.onAllContactListsLoaded();
-        }
-    }
-
-    /**
-     * Notify that a contact has been added to or removed from a list.
-     *
-     * @param list the updated contact list
-     * @param type the type of the update
-     * @param contact the involved contact, null if no contact involved.
-     */
-    protected void notifyContactListUpdated(ContactList list, int type,
-            Contact contact) {
-        synchronized (this) {
-            if (type == ContactListListener.LIST_CONTACT_ADDED) {
-                list.insertToCache(contact);
-            } else if (type == ContactListListener.LIST_CONTACT_REMOVED) {
-                list.removeFromCache(contact);
-                mDeletePending.remove(contact);
-            }
-        }
-
-        for (ContactListListener listener : mContactListListeners) {
-            listener.onContactChange(type, list, contact);
-        }
-    }
-
-    /**
-     * Notify that the name of the specified contact list has been updated.
-     *
-     * @param list
-     * @param name the new name of the list
-     */
-    protected void notifyContactListNameUpdated(ContactList list, String name) {
-        list.mName = name;
-
-        for (ContactListListener listener : mContactListListeners) {
-            listener.onContactChange(ContactListListener.LIST_RENAMED,
-                    list, null);
-        }
-    }
-
-    /**
-     * Notify that a contact list has been created.
-     *
-     * @param list the created list
-     */
-    protected void notifyContactListCreated(ContactList list) {
-        synchronized (this) {
-            if (list.isDefault()) {
-                for (ContactList l : mContactLists) {
-                    l.setDefault(false);
-                }
-                mDefaultContactList = list;
-            }
-            mContactLists.add(list);
-        }
-
-        for (ContactListListener listener : mContactListListeners) {
-            listener.onContactChange(ContactListListener.LIST_CREATED,
-                    list, null);
-        }
-    }
-
-    /**
-     * Notify that a contact list has been deleted
-     *
-     * @param list the deleted list
-     */
-    protected void notifyContactListDeleted(ContactList list) {
-        synchronized(this) {
-            mContactLists.remove(list);
-            if (list.isDefault() && mContactLists.size() > 0) {
-                mContactLists.get(0).setDefault(true);
-            }
-        }
-
-        for (ContactListListener listener : mContactListListeners) {
-            listener.onContactChange(ContactListListener.LIST_DELETED,
-                    list, null);
-        }
-    }
-
-    /**
-     * Notify that a contact has been blocked/unblocked.
-     *
-     * @param contact the blocked/unblocked contact
-     */
-    protected void notifyBlockContact(Contact contact, boolean blocked) {
-        synchronized (this) {
-            if (blocked) {
-                mBlockedList.add(contact);
-                String addr = contact.getAddress().getFullName();
-                mBlockPending.remove(addr);
-            } else {
-                mBlockedList.remove(contact);
-            }
-        }
-        for (ContactListListener listener : mContactListListeners) {
-            listener.onContactChange(blocked ? ContactListListener.CONTACT_BLOCKED
-                    : ContactListListener.CONTACT_UNBLOCKED, null, contact);
-        }
-    }
-
-    protected abstract void doAddContactToListAsync(String address,
-            ContactList list) throws ImException;
-    protected abstract void doRemoveContactFromListAsync(Contact contact, ContactList list);
-    protected abstract void setListNameAsync(String name, ContactList list);
-}
diff --git a/src/com/android/im/engine/GroupListener.java b/src/com/android/im/engine/GroupListener.java
deleted file mode 100644 (file)
index da1a9c6..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-/**
- * Interface for group change events.
- */
-public interface GroupListener {
-    public static final int ERROR_CREATING_GROUP = -1;
-    public static final int ERROR_DELETING_GROUP = -2;
-    public static final int ERROR_JOINING_IN_GROUP = -3;
-    public static final int ERROR_LEAVING_GROUP = -4;
-
-    /**
-     * Called when a chat group was successfully created.
-     *
-     * @param group the group was created.
-     */
-    public void onGroupCreated(ChatGroup group);
-
-    /**
-     * Called when a chat group was successfully deleted.
-     *
-     * @param group the group was deleted.
-     */
-    public void onGroupDeleted(ChatGroup group);
-
-    /**
-     * Called on joining in a chat group successfully.
-     *
-     * @param group the group which was joined into.
-     */
-    public void onJoinedGroup(ChatGroup group);
-
-    /**
-     * Called on leaving a chat group. It may be triggered by the user leaving
-     * a group or a server initiated group leaving, e.g. the user got kicked
-     * out of the group, the group is deleted, etc.
-     *
-     * @param group the group has left.
-     */
-    public void onLeftGroup(ChatGroup group);
-
-    /**
-     * Called when an error occurs with a certain group operation.
-     *
-     * @param errorType the type of the error
-     * @param error the error information.
-     */
-    public void onGroupError(int errorType, String groupName, ImErrorInfo error);
-}
diff --git a/src/com/android/im/engine/GroupMemberListener.java b/src/com/android/im/engine/GroupMemberListener.java
deleted file mode 100644 (file)
index a897452..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-public interface GroupMemberListener {
-    /**
-     * Notifies that a contact has joined into this group.
-     *
-     * @param contact the contact who has joined into this group.
-     */
-    public void onMemberJoined(ChatGroup group, Contact contact);
-
-    /**
-     * Notifies that a contact has left this group.
-     *
-     * @param contact the contact who has left the group.
-     */
-    public void onMemberLeft(ChatGroup group, Contact contact);
-
-    /**
-     * Called when a previous request to add or remove a member to/from a
-     * group failed.
-     *
-     * @param error the error information
-     */
-    public void onError(ChatGroup group, ImErrorInfo error);
-}
diff --git a/src/com/android/im/engine/HeartbeatService.java b/src/com/android/im/engine/HeartbeatService.java
deleted file mode 100644 (file)
index 82249f9..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.engine;
-
-public interface HeartbeatService {
-    public interface Callback {
-        /**
-         * Called on heartbeat schedule.
-         *
-         * @return the offset in milliseconds that the method wants to
-         * be called the next time. Return 0 or negative value indicates to stop
-         * the schedule of this callback.
-         */
-        public long sendHeartbeat();
-    }
-
-    /**
-     * Start to schedule a heartbeat operation.
-     *
-     * @param callback The operation wants to be called repeat.
-     * @param triggerTime The time(in milliseconds) until the operation
-     *            will be executed the first time.
-     */
-    public void startHeartbeat(Callback callback, long triggerTime);
-
-    /**
-     * Stop scheduling a heartbeat operation.
-     *
-     * @param callback The operation will be stopped.
-     */
-    public void stopHeartbeat(Callback callback);
-}
diff --git a/src/com/android/im/engine/ImConnection.java b/src/com/android/im/engine/ImConnection.java
deleted file mode 100644 (file)
index bd0f2ab..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import java.util.HashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-/**
- * An <code>ImConnection</code> is an abstract representation of a connection
- * to the IM server.
- */
-public abstract class ImConnection {
-    /**
-     * Connection state that indicates the connection is not connected yet.
-     */
-    public static final int DISCONNECTED = 0;
-
-    /**
-     * Connection state that indicates the user is logging into the server.
-     */
-    public static final int LOGGING_IN = 1;
-
-    /**
-     * Connection state that indicates the user has logged into the server.
-     */
-    public static final int LOGGED_IN = 2;
-
-    /**
-     * Connection state that indicates the user is logging out the server.
-     */
-    public static final int LOGGING_OUT = 3;
-
-    /**
-     * Connection state that indicate the connection is suspending.
-     */
-    public static final int SUSPENDING = 4;
-
-    /**
-     * Connection state that indicate the connection has been suspended.
-     */
-    public static final int SUSPENDED = 5;
-
-    /**
-     * The capability of supporting group chat.
-     */
-    public static final int CAPABILITY_GROUP_CHAT = 1;
-    /**
-     * The capability of supporting session re-establishment.
-     */
-    public static final int CAPABILITY_SESSION_REESTABLISHMENT = 2;
-
-    /**
-     * The current state of the connection.
-     */
-    protected int mState;
-
-    protected CopyOnWriteArrayList<ConnectionListener> mConnectionListeners;
-    protected Presence mUserPresence;
-
-    protected ImConnection() {
-        mConnectionListeners = new CopyOnWriteArrayList<ConnectionListener>();
-        mState = DISCONNECTED;
-    }
-
-    public void addConnectionListener(ConnectionListener listener) {
-        if (listener != null) {
-            mConnectionListeners.add(listener);
-        }
-    }
-
-    public void removeConnectionListener(ConnectionListener listener) {
-        mConnectionListeners.remove(listener);
-    }
-
-    public abstract Contact getLoginUser();
-
-    public String getLoginUserName() {
-        Contact loginUser = getLoginUser();
-        return loginUser == null ? null : loginUser.getName();
-    }
-
-    public abstract int[] getSupportedPresenceStatus();
-
-    public Presence getUserPresence() {
-        if (mState == SUSPENDING || mState == SUSPENDED) {
-            return new Presence();
-        }
-
-        if (mState != LOGGED_IN) {
-            // In most cases we have a valid mUserPresence instance also
-            // in the LOGGING_OUT state. However there is one exception:
-            // if logout() is called before login finishes, the state may
-            // jump from LOGGING_IN directly to LOGGING_OUT, skipping the
-            // LOGGED_IN state. In this case we won't have a valid Presence
-            // in the LOGGING_OUT state.
-            return null;
-        }
-
-        return new Presence(mUserPresence);
-    }
-
-    public void updateUserPresenceAsync(Presence newPresence) throws ImException {
-        if (mState != LOGGED_IN) {
-            throw new ImException(ImErrorInfo.NOT_LOGGED_IN, "NOT logged in");
-        }
-
-        doUpdateUserPresenceAsync(newPresence);
-    }
-
-    /**
-     * Tells the engine that the network type has changed, e.g. switch from gprs
-     * to wifi. The engine should drop all the network connections created before
-     * because they are not available anymore.
-     *
-     * The engine might also need to redo authentication on the new network depending
-     * on the underlying protocol.
-     */
-    public void networkTypeChanged(){
-    }
-
-    /**
-     * Tells the current state of the connection.
-     */
-    public int getState() {
-        return mState;
-    }
-
-    /**
-     * Sets the state of the connection.
-     *
-     * @param state the new state of the connection.
-     * @param error the error information which caused the state change or null.
-     */
-    protected void setState(int state, ImErrorInfo error) {
-        if(state < DISCONNECTED || state > SUSPENDED){
-            throw new IllegalArgumentException("Invalid state: " + state);
-        }
-        if(mState != state){
-            mState = state;
-            for(ConnectionListener listener : mConnectionListeners){
-                listener.onStateChanged(state, error);
-            }
-        }
-    }
-
-    protected void notifyUserPresenceUpdated() {
-        for (ConnectionListener listener : mConnectionListeners) {
-            listener.onUserPresenceUpdated();
-        }
-    }
-
-    protected void notifyUpdateUserPresenceError(ImErrorInfo error) {
-        for (ConnectionListener listener : mConnectionListeners) {
-            listener.onUpdatePresenceError(error);
-        }
-    }
-
-    /**
-     * Gets bit-or of capabilities supported by the underlying protocol. Valid
-     * capability bits are: {@value #CAPABILITY_GROUP_CHAT},
-     * {@value #CAPABILITY_SESSION_REESTABLISHMENT}
-     *
-     * @return bit-or of capabilities supported by the underlying protocol
-     */
-    public abstract int getCapability();
-
-    /**
-     * Log in to the IM server.
-     *
-     * @param loginInfo the login information.
-     */
-    public abstract void loginAsync(LoginInfo loginInfo);
-
-    /**
-     * Re-establish previous session using the session context persisted by the
-     * client. Only sessions that were dropped unexpectedly(e.g. power loss, crash,
-     * etc) can be re-established using the stored session context. If the
-     * session was terminated normally by either user logging out or server
-     * initiated disconnection, it can't be re-established again therefore the
-     * stored context should be removed by the client.
-     * <p>
-     * The client can query if session re-establishment is supported through
-     * {@link #getCapability()}.
-     *
-     * @param sessionContext
-     *            the session context which was fetched from previous session by
-     *            {@link #getSessionContext()} and persisted by the client.
-     * @throws UnsupportedOperationException
-     *             if session re-establishment is not supported by the
-     *             underlying protocol.
-     */
-    public abstract void reestablishSessionAsync(HashMap<String, String> sessionContext);
-
-    /**
-     * Log out from the IM server.
-     */
-    public abstract void logoutAsync();
-
-    /**
-     * Suspend connection with the IM server.
-     */
-    public abstract void suspend();
-
-    /**
-     * Gets the cookie of the current session. The client could store the
-     * context and use it to re-establish the session by
-     * {@link #reestablishSessionAsync(HashMap)}}. The stored context MUST be
-     * removed upon the connection logout/disconnect.
-     *
-     * @return the context of the current session or <code>null</code> if the
-     *         user has not logged in yet.
-     * @throws UnsupportedOperationException
-     *             if session re-establishment is not supported by the
-     *             underlying protocol.
-     */
-    public abstract HashMap<String, String> getSessionContext();
-
-    /**
-     * Gets the instance of ChatSessionManager for the connection.
-     *
-     * @return the instance of ChatSessionManager for the connection.
-     */
-    public abstract ChatSessionManager getChatSessionManager();
-
-    /**
-     * Gets the instance of ContactListManager for the connection.
-     *
-     * @return the instance of ContactListManager for the connection.
-     */
-    public abstract ContactListManager getContactListManager();
-
-    /**
-     * Gets the instance of ChatGroupManager for the connection.
-     *
-     * @return the instance of ChatGroupManager for the connection.
-     * @throws UnsupportedOperationException
-     *             if group chat is not supported by the underlying protocol.
-     */
-    public abstract ChatGroupManager getChatGroupManager();
-
-    protected abstract void doUpdateUserPresenceAsync(Presence presence);
-
-}
diff --git a/src/com/android/im/engine/ImEntity.java b/src/com/android/im/engine/ImEntity.java
deleted file mode 100644 (file)
index 1b0deda..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-/**
- * The abstract representation of any addressable entities.
- */
-public abstract class ImEntity {
-    public abstract Address getAddress();
-}
diff --git a/src/com/android/im/engine/ImErrorInfo.aidl b/src/com/android/im/engine/ImErrorInfo.aidl
deleted file mode 100644 (file)
index af6a24a..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-parcelable ImErrorInfo;
diff --git a/src/com/android/im/engine/ImErrorInfo.java b/src/com/android/im/engine/ImErrorInfo.java
deleted file mode 100644 (file)
index 4e6145e..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import java.io.Serializable;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * Represents a generic error returned from the server. The IM servers can
- * respond to an error condition with an error code and possibly a description
- * of the problem. Different IM protocol may have different set of error codes
- * and descriptions.
- */
-public class ImErrorInfo implements Parcelable, Serializable {
-    public static final int NO_ERROR = 0;
-
-    public static final int ILLEGAL_CONTACT_LIST_MANAGER_STATE = -100;
-    public static final int CONTACT_LIST_EXISTS = -101;
-    public static final int CONTACT_LIST_NOT_FOUND = -102;
-
-    public static final int INVALID_HOST_NAME = -200;
-    public static final int UNKNOWN_SERVER = -201;
-    public static final int CANT_CONNECT_TO_SERVER = -202;
-    public static final int INVALID_USERNAME = -203;
-    public static final int INVALID_SESSION_CONTEXT = -204;
-    public static final int UNKNOWN_LOGIN_ERROR = -300;
-    public static final int NOT_LOGGED_IN = 301;
-
-    public static final int UNSUPPORTED_CIR_CHANNEL = -400;
-
-    public static final int ILLEGAL_CONTACT_ADDRESS = -500;
-    public static final int CONTACT_EXISTS_IN_LIST =  -501;
-    public static final int CANT_ADD_BLOCKED_CONTACT = -600;
-
-    public static final int PARSER_ERROR = -700;
-    public static final int SERIALIZER_ERROR = -750;
-
-    public static final int NETWORK_ERROR = -800;
-
-    public static final int ILLEGAL_SERVER_RESPONSE = -900;
-
-    public static final int UNKNOWN_ERROR = -1000;
-
-    private int mCode;
-    private String mDescription;
-
-    /**
-     * Creates a new error with specified code and description.
-     *
-     * @param code the error code.
-     * @param description the description of the error.
-     */
-    public ImErrorInfo(int code, String description) {
-        mCode = code;
-        mDescription = description;
-    }
-
-    public ImErrorInfo(Parcel source) {
-        mCode = source.readInt();
-        mDescription = source.readString();
-    }
-
-    /**
-     * Gets the error code.
-     *
-     * @return the error code.
-     */
-    public int getCode() {
-        return mCode;
-    }
-
-    /**
-     * Gets the description of the error.
-     *
-     * @return the description of the error.
-     */
-    public String getDescription() {
-        return mDescription;
-    }
-
-    @Override
-    public String toString() {
-        return mCode + " - " + mDescription;
-    }
-
-    public void writeToParcel(Parcel dest, int flags) {
-        dest.writeInt(mCode);
-        dest.writeString(mDescription);
-    }
-
-    public int describeContents() {
-        return 0;
-    }
-
-    public static final Parcelable.Creator<ImErrorInfo> CREATOR = new Parcelable.Creator<ImErrorInfo>() {
-        public ImErrorInfo createFromParcel(Parcel source) {
-            return new ImErrorInfo(source);
-        }
-
-        public ImErrorInfo[] newArray(int size) {
-            return new ImErrorInfo[size];
-        }
-    };
-
-}
diff --git a/src/com/android/im/engine/ImException.java b/src/com/android/im/engine/ImException.java
deleted file mode 100644 (file)
index c14f152..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-/**
- * A generic exception that is thrown by the IM engine. If it's caused by an
- * error condition returned by the IM server, an IMError is associated with
- * it.
- */
-public class ImException extends Exception {
-    private ImErrorInfo mError;
-
-    /**
-     * Creates a new ImException with the specified detail message.
-     *
-     * @param message the detail message.
-     */
-    public ImException(String message) {
-        super(message);
-    }
-
-    /**
-     * Creates a new ImException with the IMError which was the cause of the
-     * exception.
-     *
-     * @param error the cause of the exception.
-     */
-    public ImException(ImErrorInfo error) {
-        super(error.getDescription());
-        mError = error;
-    }
-
-    /**
-     * Creates a new ImException with the specified cause.
-     *
-     * @param cause the cause.
-     */
-    public ImException(Throwable cause) {
-        super(cause);
-    }
-
-    /**
-     * Creates a new ImException with the specified detail message and cause.
-     *
-     * @param message the detail message.
-     * @param cause the cause.
-     */
-    public ImException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * Creates a new ImException with specified IM error code and description
-     *
-     * @param imErrorCode
-     * @param string
-     */
-    public ImException(int imErrorCode, String description) {
-        this(new ImErrorInfo(imErrorCode, description));
-    }
-
-    /**
-     * Gets the IMError which caused the exception or <code>null</code> if
-     * there isn't one.
-     *
-     * @return the IMError which caused the exception.
-     */
-    public ImErrorInfo getImError() {
-        return mError;
-    }
-
-    public void printStackTrace() {
-        System.err.println("ImError: " + mError);
-        super.printStackTrace();
-    }
-}
diff --git a/src/com/android/im/engine/Invitation.aidl b/src/com/android/im/engine/Invitation.aidl
deleted file mode 100644 (file)
index 135e5e1..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-parcelable Invitation;
diff --git a/src/com/android/im/engine/Invitation.java b/src/com/android/im/engine/Invitation.java
deleted file mode 100644 (file)
index 2eebb79..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.engine;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-public class Invitation implements Parcelable {
-    private String mId;
-    private Address mGroupAddress;
-    private Address mSender;
-    private String mReason;
-
-    public Invitation(String id, Address groupAddress, Address sender,
-            String resean) {
-        mId = id;
-        mGroupAddress = groupAddress;
-        mSender = sender;
-        mReason = resean;
-    }
-
-    public Invitation(Parcel source) {
-        mId = source.readString();
-        mGroupAddress = AddressParcelHelper.readFromParcel(source);
-        mSender = AddressParcelHelper.readFromParcel(source);
-        mReason = source.readString();
-    }
-
-    public String getInviteID() {
-        return mId;
-    }
-
-    public Address getGroupAddress() {
-        return mGroupAddress;
-    }
-
-    public Address getSender() {
-        return mSender;
-    }
-
-    public String getReason() {
-        return mReason;
-    }
-
-    public void writeToParcel(Parcel dest, int flags) {
-        dest.writeString(mId);
-        AddressParcelHelper.writeToParcel(dest, mGroupAddress);
-        AddressParcelHelper.writeToParcel(dest, mSender);
-        dest.writeString(mReason);
-    }
-
-    public int describeContents() {
-        return 0;
-    }
-
-    public static final Parcelable.Creator<Invitation> CREATOR = new Parcelable.Creator<Invitation>() {
-        public Invitation createFromParcel(Parcel source) {
-            return new Invitation(source);
-        }
-
-        public Invitation[] newArray(int size) {
-            return new Invitation[size];
-        }
-    };
-}
diff --git a/src/com/android/im/engine/InvitationListener.java b/src/com/android/im/engine/InvitationListener.java
deleted file mode 100644 (file)
index 88355ba..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-/**
- * Interface that allows the implementing class to listen to invitation from
- * other users.
- */
-public interface InvitationListener {
-    /**
-     * Calls when an invitation to join a certain group from another user
-     * received. The user should accept or reject the invitation by
-     * {@link ChatGroupManager#acceptInvitationAsync(Invitation) acceptInvitation} or
-     * {@link ChatGroupManager#rejectInvitationAsync(Invitation) rejectInvitation}
-     *
-     * @param invitation the invitation received.
-     */
-    public void onGroupInvitation(Invitation invitation);
-}
diff --git a/src/com/android/im/engine/LoginInfo.java b/src/com/android/im/engine/LoginInfo.java
deleted file mode 100644 (file)
index bf1c641..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-/**
- * A wrapper of the login information.
- */
-public class LoginInfo {
-    private String mUserName;
-    private String mPassword;
-
-    public LoginInfo(String userName, String password) {
-        mUserName = userName;
-        mPassword = password;
-    }
-
-    public String getUserName() {
-        return mUserName;
-    }
-
-    public String getPassword() {
-        return mPassword;
-    }
-}
diff --git a/src/com/android/im/engine/Message.aidl b/src/com/android/im/engine/Message.aidl
deleted file mode 100644 (file)
index d41d569..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-parcelable Message;
diff --git a/src/com/android/im/engine/Message.java b/src/com/android/im/engine/Message.java
deleted file mode 100644 (file)
index 5cc2c78..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import java.util.Date;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * Represents an instant message send between users.
- */
-public class Message implements Parcelable {
-    private String mId;
-    private Address mFrom;
-    private Address mTo;
-    private String mBody;
-    private Date mDate;
-
-    /**
-     *
-     * @param msg
-     * @throws NullPointerException if msg is null.
-     */
-    public Message(String msg) {
-        if (msg == null) {
-            throw new NullPointerException("null msg");
-        }
-        mBody = msg;
-    }
-
-    public Message(Parcel source) {
-        mId = source.readString();
-        mFrom = AddressParcelHelper.readFromParcel(source);
-        mTo = AddressParcelHelper.readFromParcel(source);
-        mBody = source.readString();
-        long time = source.readLong();
-        if(time != -1) {
-            mDate = new Date(time);
-        }
-    }
-
-    /**
-     * Gets an identifier of this message. May be <code>null</code> if the
-     * underlying protocol doesn't support it.
-     *
-     * @return the identifier of this message.
-     */
-    public String getID() {
-        return mId;
-    }
-
-    /**
-     * Gets the body of this message.
-     *
-     * @return the body of this message.
-     */
-    public String getBody() {
-        return mBody;
-    }
-
-    /**
-     * Gets the address where the message is sent from.
-     *
-     * @return the address where the message is sent from.
-     */
-    public Address getFrom() {
-        return mFrom;
-    }
-
-    /**
-     * Gets the address where the message is sent to.
-     *
-     * @return the address where the message is sent to.
-     */
-    public Address getTo() {
-        return mTo;
-    }
-
-    /**
-     * Gets the date time associated with this message. If it's a message sent
-     * from this client, the date time is when the message is sent. If it's a
-     * message received from other users, the date time is either when the
-     * message was received or sent, depending on the underlying protocol.
-     *
-     * @return the date time.
-     */
-    public Date getDateTime() {
-        if (mDate == null) {
-            return null;
-        }
-        return new Date(mDate.getTime());
-    }
-
-    public void setID(String id) {
-        mId = id;
-    }
-
-    public void setBody(String body) {
-        mBody = body;
-    }
-
-    public void setFrom(Address from) {
-        mFrom = from;
-    }
-
-    public void setTo(Address to) {
-        mTo = to;
-    }
-
-    public void setDateTime(Date dateTime) {
-        long time = dateTime.getTime();
-        if (mDate == null) {
-            mDate = new Date(time);
-        } else {
-            mDate.setTime(time);
-        }
-    }
-
-    public String toString() {
-        return "From: " + mFrom.getScreenName() + " To: " + mTo.getScreenName()
-                + " " + mBody;
-    }
-
-    public void writeToParcel(Parcel dest, int flags) {
-        dest.writeString(mId);
-        AddressParcelHelper.writeToParcel(dest, mFrom);
-        AddressParcelHelper.writeToParcel(dest, mTo);
-        dest.writeString(mBody);
-        dest.writeLong(mDate == null ? -1 : mDate.getTime());
-    }
-
-    public int describeContents() {
-        return 0;
-    }
-
-    public static final Parcelable.Creator<Message> CREATOR = new Parcelable.Creator<Message>() {
-        public Message createFromParcel(Parcel source) {
-            return new Message(source);
-        }
-
-        public Message[] newArray(int size) {
-            return new Message[size];
-        }
-    };
-}
diff --git a/src/com/android/im/engine/MessageListener.java b/src/com/android/im/engine/MessageListener.java
deleted file mode 100644 (file)
index 3bdb9e9..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-/**
- * Interface that allows for implementing classes to listen for new message.
- * Listeners are registered with ChatSession objects.
- */
-public interface MessageListener {
-    /**
-     * Calls when a new message has arrived.
-     *
-     * @param ses the ChatSession.
-     * @param msg the incoming message.
-     */
-    public void onIncomingMessage(ChatSession ses, Message msg);
-
-    /**
-     * Calls when an error occurs to send a message.
-     *
-     * @param ses the ChatSession.
-     * @param msg the message which was sent.
-     * @param error the error information.
-     */
-    public void onSendMessageError(ChatSession ses, Message msg, ImErrorInfo error);
-}
diff --git a/src/com/android/im/engine/PrefManager.java b/src/com/android/im/engine/PrefManager.java
deleted file mode 100644 (file)
index b628978..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import java.util.ArrayList;
-
-import com.android.im.imps.ImpsConnectionConfig;
-
-public class PrefManager {
-    private ArrayList<ConnectionConfig> mActiveConnectionPrefs;
-
-    private static PrefManager sInstance;
-
-    private PrefManager() {
-        mActiveConnectionPrefs = new ArrayList<ConnectionConfig>();
-        // TODO: load prefs
-        mActiveConnectionPrefs.add(new ImpsConnectionConfig());
-    }
-
-    public synchronized static PrefManager getInstance() {
-        if (sInstance == null) {
-            sInstance = new PrefManager();
-        }
-        return sInstance;
-    }
-
-    public ArrayList<ConnectionConfig> getActiveConnectionPrefs() {
-        return mActiveConnectionPrefs;
-    }
-}
diff --git a/src/com/android/im/engine/Presence.aidl b/src/com/android/im/engine/Presence.aidl
deleted file mode 100644 (file)
index ba5e487..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-parcelable Presence;
diff --git a/src/com/android/im/engine/Presence.java b/src/com/android/im/engine/Presence.java
deleted file mode 100644 (file)
index c548480..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-import java.util.Collections;
-import java.util.Map;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * A <code>Presence</code> is an abstract presentation of the user's presence
- * information.
- *
- * Note that changes made to the Presence data won't be reflected to the
- * server until <code>ImConnection.updateUserPresence</code> is called.
- * Only the logged in user can update its own presence data via
- * <code>ImConnection.updateUserPresence</code>. Changes to any other
- * contact's presence data won't be saved or sent to the server.
- */
-public final class Presence implements Parcelable {
-    public static final int OFFLINE = 0;
-    public static final int DO_NOT_DISTURB = 1;
-    public static final int AWAY = 2;
-    public static final int IDLE = 3;
-    public static final int AVAILABLE = 4;
-
-    public static final int CLIENT_TYPE_DEFAULT = 0;
-    public static final int CLIENT_TYPE_MOBILE = 1;
-
-    private int mStatus;
-    private String mStatusText;
-    private byte[] mAvatarData;
-    private String mAvatarType;
-    private int mClientType;
-
-    private Map<String, String> mExtendedInfo;
-
-    public Presence() {
-        this(Presence.OFFLINE, null, null, null, CLIENT_TYPE_DEFAULT, null);
-    }
-
-    public Presence(int status, String statusText, byte[] avatarData,
-            String avatarType, int clientType) {
-        this(status, statusText, avatarData, avatarType, clientType, null);
-    }
-
-    public Presence(int status, String statusText, byte[] avatarData,
-            String avatarType, int clientType, Map<String, String> extendedInfo) {
-        setStatus(status);
-        mStatusText = statusText;
-        setAvatar(avatarData, avatarType);
-        mClientType = clientType;
-        mExtendedInfo = extendedInfo;
-    }
-
-    public Presence(Presence p) {
-        this(p.mStatus, p.mStatusText, p.mAvatarData, p.mAvatarType,
-                p.mClientType, p.mExtendedInfo);
-    }
-
-    public Presence(Parcel source) {
-        mStatus = source.readInt();
-        mStatusText = source.readString();
-        mAvatarData = source.createByteArray();
-        mAvatarType = source.readString();
-        mClientType = source.readInt();
-        // TODO - what ClassLoader should be passed to readMap?
-        // TODO - switch to Bundle
-        mExtendedInfo = source.readHashMap(null);
-    }
-
-    /**
-     * Get avatar bitmap.
-     *
-     * @return Avatar bitmap. Note any changes made to the bitmap itself
-     *         won't be saved or sent back to the server. To change avatar
-     *         call <code>setAvatar</code> with a <b>new</b> bitmap instance.
-     * FIXME: Avatar is stored as a byte array and a type string now, it will
-     * be encapsulated with an Object after we change to ContentProvider.
-     */
-    public byte[] getAvatarData() {
-        if(mAvatarData == null){
-            return null;
-        } else {
-            byte[] data = new byte[mAvatarData.length];
-            System.arraycopy(mAvatarData, 0, data, 0, mAvatarData.length);
-            return data;
-        }
-    }
-
-    /**
-     * Get the MIME type of avatar.
-     *
-     * @return the MIME type of avatar.
-     */
-    public String getAvatarType() {
-        return mAvatarType;
-    }
-
-    public int getClientType() {
-        return mClientType;
-    }
-
-    public Map<String, String> getExtendedInfo() {
-        return mExtendedInfo == null ? null : Collections.unmodifiableMap(mExtendedInfo);
-    }
-
-    public boolean isOnline() {
-        return mStatus != OFFLINE;
-    }
-
-    public int getStatus() {
-        return mStatus;
-    }
-
-    public void setStatus(int status) {
-        if (status < OFFLINE || status > AVAILABLE ) {
-            throw new IllegalArgumentException("invalid presence status value");
-        }
-        mStatus = status;
-    }
-
-    public String getStatusText() {
-        return mStatusText;
-    }
-
-    public void setAvatar(byte[] data, String type) {
-        if(data != null) {
-            mAvatarData = new byte[data.length];
-            System.arraycopy(data, 0, mAvatarData, 0, data.length);
-        } else {
-            mAvatarData = null;
-        }
-        mAvatarType = type;
-    }
-
-    public void setStatusText(String statusText) {
-        mStatusText = statusText;
-    }
-
-    public void setClientType(int clientType) {
-        mClientType = clientType;
-    }
-
-    public void writeToParcel(Parcel dest, int flags) {
-        dest.writeInt(mStatus);
-        dest.writeString(mStatusText);
-        dest.writeByteArray(mAvatarData);
-        dest.writeString(mAvatarType);
-        dest.writeInt(mClientType);
-        dest.writeMap(mExtendedInfo);
-    }
-
-    public int describeContents() {
-        return 0;
-    }
-
-    public static final Parcelable.Creator<Presence> CREATOR = new Parcelable.Creator<Presence>() {
-        public Presence createFromParcel(Parcel source) {
-            return new Presence(source);
-        }
-
-        public Presence[] newArray(int size) {
-            return new Presence[size];
-        }
-    };
-}
diff --git a/src/com/android/im/engine/SmsService.java b/src/com/android/im/engine/SmsService.java
deleted file mode 100644 (file)
index 5ba170b..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.engine;
-
-/**
- * An abstract interface to access system SMS service.
- */
-public interface SmsService {
-    /**
-     * The listener which will be notified when an incoming SMS is received.
-     *
-     */
-    public interface SmsListener {
-        /**
-         * Called on new SMS received.
-         *
-         * @param data
-         */
-        public void onIncomingSms(byte[] data);
-    }
-
-    /**
-     * Callback on send SMS failure.
-     *
-     */
-    public interface SmsSendFailureCallback {
-        /** Generic failure case.*/
-        int ERROR_GENERIC_FAILURE = 1;
-        /** Failed because radio was explicitly turned off.*/
-        int ERROR_RADIO_OFF = 2;
-
-        /**
-         * Called when send an SMS failed.
-         *
-         * @param errorCode the error code; will be one of
-         *            {@link #ERROR_GENERIC_FAILURE},
-         *            {@link #ERROR_RADIO_OFF}
-         */
-        public void onFailure(int errorCode);
-    }
-
-    /**
-     * The max number of bytes an SMS can take.
-     *
-     * @return the max number of bytes an SMS can take.
-     */
-    public int getMaxSmsLength();
-
-    /**
-     * Sends a data SMS to the destination.
-     *
-     * @param dest
-     *            The address to send the message to.
-     * @param port
-     *            The port to deliver the message to.
-     * @param data
-     *            The body of the message to send.
-     */
-    public void sendSms(String dest, int port, byte[] data);
-
-    /**
-     * Sends a data SMS to the destination.
-     *
-     * @param dest
-     *            The address to send the message to.
-     * @param port
-     *            The port to deliver the message to.
-     * @param data
-     *            The body of the message to send.
-     * @param callback
-     *            If not null, it will be notified if the message could not be
-     *            sent.
-     */
-    public void sendSms(String dest, int port, byte[] data,
-            SmsSendFailureCallback callback);
-
-    /**
-     * Add a SmsListener so that it can be notified when new SMS from specific
-     * address and application port has been received.
-     *
-     * @param from
-     *            The address of the sender.
-     * @param port
-     *            The application port.
-     * @param listener
-     *            The listener which will be notified when SMS received.
-     */
-    public void addSmsListener(String from, int port, SmsListener listener);
-
-    /**
-     * Remove a SmsListener from the service so that it won't be notified
-     * anymore.
-     *
-     * @param listener
-     *            The listener to be removed.
-     */
-    public void removeSmsListener(SmsListener listener);
-}
diff --git a/src/com/android/im/engine/SubscriptionRequestListener.java b/src/com/android/im/engine/SubscriptionRequestListener.java
deleted file mode 100644 (file)
index 086ee23..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.engine;
-
-/**
- * Interface that allows the implementing class to listen to subscription
- * request from other users.
- */
-public interface SubscriptionRequestListener {
-    /**
-     * Called when a subscription request from another user is received.
-     *
-     * @param from
-     */
-    void onSubScriptionRequest(Contact from);
-
-    /**
-     * Called when a subscription request is approved.
-     *
-     * @param contact
-     */
-    void onSubscriptionApproved(String contact);
-
-    /**
-     * Called when a subscription request is declined.
-     *
-     * @param contact
-     */
-    void onSubscriptionDeclined(String contact);
-
-    /**
-     * Called when an error occurs during approving a subscription request.
-     *
-     * @param contact
-     * @param error
-     */
-    void onApproveSubScriptionError(String contact, ImErrorInfo error);
-
-    /**
-     * Called when an error occurs during declining a subscription request.
-     * @param contact
-     * @param error
-     */
-    void onDeclineSubScriptionError(String contact, ImErrorInfo error);
-}
diff --git a/src/com/android/im/engine/SystemService.java b/src/com/android/im/engine/SystemService.java
deleted file mode 100644 (file)
index 26edc2a..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.engine;
-
-import com.android.im.service.AndroidSystemService;
-
-/**
- * The interface to access system service objects.
- * 
- */
-public abstract class SystemService {
-    /**
-     * Gets the default instance of the system service.
-     * 
-     * @return the default instance of the system service.
-     */
-    public static SystemService getDefault() {
-        return AndroidSystemService.getInstance();
-    }
-
-    /**
-     * Gets the system HeartbeatService.
-     * 
-     * @return the instance of the HeartbeatService.
-     */
-    public abstract HeartbeatService getHeartbeatService();
-
-    /**
-     * Gets the system SmsService.
-     * 
-     * @return the instance of the SmsService.
-     */
-    public abstract SmsService getSmsService();
-}
diff --git a/src/com/android/im/imps/AsyncCompletion.java b/src/com/android/im/imps/AsyncCompletion.java
deleted file mode 100644 (file)
index 034a343..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import com.android.im.engine.ImErrorInfo;
-
-public interface AsyncCompletion {
-
-    void onComplete();
-
-    void onError(ImErrorInfo error);
-
-}
diff --git a/src/com/android/im/imps/AsyncTransaction.java b/src/com/android/im/imps/AsyncTransaction.java
deleted file mode 100644 (file)
index 17ae93e..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import com.android.im.engine.ImErrorInfo;
-
-abstract class AsyncTransaction extends ImpsTransaction {
-
-    private final AsyncCompletion mCompletionCallback;
-    private boolean mCompletionNotified;
-    protected final ImpsTransactionManager mTransManager;
-
-    AsyncTransaction(ImpsTransactionManager manager) {
-        this(manager, null);
-    }
-
-    AsyncTransaction(ImpsTransactionManager manager, AsyncCompletion completion) {
-        mTransManager = manager;
-        mCompletionCallback = completion;
-        manager.beginClientTransaction(this);
-    }
-
-    /**
-     * Sends a request within this transaction.
-     *
-     * @param request the request to send.
-     */
-    public void sendRequest(Primitive request) {
-        sendPrimitive(request);
-    }
-
-    /**
-     * Notify that an error occurs in the transaction.
-     *
-     * @param error the error
-     */
-    final void notifyError(ImErrorInfo error) {
-        notifyErrorResponse(new ImpsErrorInfo(error.getCode(), error.getDescription(), null));
-    }
-
-    /**
-     * Notify that a response from the server has arrived.
-     *
-     * @param response the response.
-     */
-    final void notifyResponse(Primitive response) {
-        response.setTransaction(this);
-        ImpsErrorInfo error = ImpsUtils.checkResultError(response);
-        if (error != null) {
-            notifyErrorResponse(error);
-        } else {
-            notifySuccessResponse(response);
-        }
-    }
-
-    protected void notifyErrorResponse(ImpsErrorInfo error) {
-        onResponseError(error);
-        mTransManager.endClientTransaction(this);
-        notifyAsyncCompletionError(error);
-    }
-
-    protected void notifySuccessResponse(Primitive response) {
-        onResponseOk(response);
-        mTransManager.endClientTransaction(this);
-        notifyAsyncCompletionSuccess();
-    }
-
-    public abstract void onResponseError(ImpsErrorInfo error);
-    public abstract void onResponseOk(Primitive response);
-
-    protected void notifyAsyncCompletionError(ImErrorInfo error) {
-        if (!mCompletionNotified) {
-            mCompletionNotified = true;
-            if (mCompletionCallback != null)
-                mCompletionCallback.onError(error);
-        }
-    }
-
-    protected void notifyAsyncCompletionSuccess() {
-        if (!mCompletionNotified) {
-            mCompletionNotified = true;
-            if (mCompletionCallback != null)
-                mCompletionCallback.onComplete();
-        }
-    }
-}
diff --git a/src/com/android/im/imps/CirChannel.java b/src/com/android/im/imps/CirChannel.java
deleted file mode 100644 (file)
index f147d00..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import com.android.im.engine.ImException;
-
-/**
- * The protocol binding in data channel might be WSP, HTTP and HTTPS which are
- * asymmetric. In this case when the server needs to start transaction, it has
- * to send a communication initiation request message through the CIR channel to
- * the client in order to request an immediate PollingRequest message from the
- * client to the server on the data channel.
- */
-abstract class CirChannel {
-    protected ImpsConnection mConnection;
-
-    protected CirChannel(ImpsConnection connection) {
-        mConnection = connection;
-    }
-
-    /**
-     * Establishes the connection to the server if the protocol is connection
-     * oriented (e.g. as TCP)and starts to listen to CIR requests from the
-     * server.
-     * @throws Exception
-     */
-    public abstract void connect() throws ImException;
-
-    public void reconnect(){
-    }
-
-    /**
-     * Shutdown the CIR channel, stops to listen to CIR requests from the server.
-     *
-     */
-    public abstract void shutdown();
-}
diff --git a/src/com/android/im/imps/CustomPasswordDigest.java b/src/com/android/im/imps/CustomPasswordDigest.java
deleted file mode 100644 (file)
index 5ce1f5a..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.imps;
-
-import com.android.im.engine.ImException;
-import com.android.im.plugin.IPasswordDigest;
-
-import android.os.RemoteException;
-
-import dalvik.system.PathClassLoader;
-
-public class CustomPasswordDigest implements PasswordDigest {
-
-    private IPasswordDigest mPasswordDigest;
-    public CustomPasswordDigest(String pluginPath, String implClass) throws ImException {
-        PathClassLoader classLoader = new PathClassLoader(pluginPath,
-                getClass().getClassLoader());
-        try {
-            Class cls = classLoader.loadClass(implClass);
-            mPasswordDigest = (IPasswordDigest)cls.newInstance();
-        } catch (ClassNotFoundException e) {
-            throw new ImException(e);
-        } catch (IllegalAccessException e) {
-            throw new ImException(e);
-        } catch (InstantiationException e) {
-            throw new ImException(e);
-        }
-    }
-    public String digest(String schema, String nonce, String password) throws ImException {
-        try {
-            return mPasswordDigest.digest(schema, nonce, password);
-        } catch (RemoteException e) {
-            throw new ImException(e);
-        }
-    }
-
-    public String[] getSupportedDigestSchema() {
-        try {
-            return mPasswordDigest.getSupportedDigestSchema();
-        } catch (RemoteException e) {
-            return new String[0];
-        }
-    }
-
-}
diff --git a/src/com/android/im/imps/CustomPresenceMapping.java b/src/com/android/im/imps/CustomPresenceMapping.java
deleted file mode 100644 (file)
index 9f7270e..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.imps;
-
-import com.android.im.engine.ImException;
-import com.android.im.plugin.IPresenceMapping;
-import com.android.im.plugin.ImPluginConstants;
-
-import dalvik.system.PathClassLoader;
-
-import android.os.RemoteException;
-
-import java.util.Map;
-
-public class CustomPresenceMapping implements PresenceMapping {
-    private IPresenceMapping mPresenceMapping;
-
-    public CustomPresenceMapping(String pluginPath, String implClass) throws ImException {
-        PathClassLoader classLoader = new PathClassLoader(pluginPath,
-                getClass().getClassLoader());
-        try {
-            Class cls = classLoader.loadClass(implClass);
-            mPresenceMapping = (IPresenceMapping)cls.newInstance();
-        } catch (ClassNotFoundException e) {
-            throw new ImException(e);
-        } catch (IllegalAccessException e) {
-            throw new ImException(e);
-        } catch (InstantiationException e) {
-            throw new ImException(e);
-        }
-    }
-
-    public Map<String, Object> getExtra(int status) {
-        try {
-            return mPresenceMapping.getExtra(status);
-        } catch (RemoteException e) {
-            return null;
-        }
-    }
-
-    public boolean getOnlineStatus(int status) {
-        try {
-            return mPresenceMapping.getOnlineStatus(status);
-        } catch (RemoteException e) {
-            return false;
-        }
-    }
-
-    public int getPresenceStatus(boolean onlineStatus, String userAvailability,
-            Map<String, Object> allValues) {
-        try {
-            return mPresenceMapping.getPresenceStatus(onlineStatus, userAvailability, allValues);
-        } catch (RemoteException e) {
-            return ImPluginConstants.PRESENCE_OFFLINE;
-        }
-    }
-
-    public int[] getSupportedPresenceStatus() {
-        try {
-            return mPresenceMapping.getSupportedPresenceStatus();
-        } catch (RemoteException e) {
-            return new int[0];
-        }
-    }
-
-    public String getUserAvaibility(int status) {
-        try {
-            return mPresenceMapping.getUserAvaibility(status);
-        } catch (RemoteException e) {
-            return ImPluginConstants.PA_NOT_AVAILABLE;
-        }
-    }
-
-    public boolean requireAllPresenceValues() {
-        try {
-            return mPresenceMapping.requireAllPresenceValues();
-        } catch (RemoteException e) {
-            return false;
-        }
-    }
-
-}
diff --git a/src/com/android/im/imps/DataChannel.java b/src/com/android/im/imps/DataChannel.java
deleted file mode 100644 (file)
index a244677..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import com.android.im.engine.ImException;
-
-/**
- * The IMPS transport binding is divided into two channels: a mandatory data
- * channel and a conditional CIR channel. All the exchange of CSP primitives is
- * done in the data channel.
- */
-abstract class DataChannel {
-    protected ImpsConnection mConnection;
-    protected PrimitiveParser mParser;
-    protected PrimitiveSerializer mSerializer;
-    protected long mMinPollMillis;
-
-    protected DataChannel(ImpsConnection connection) throws ImException {
-        mConnection = connection;
-    }
-
-    /**
-     * Establishes a data channel with the IMPS server.
-     *
-     * @throws ImException if an error occur during establishing the data
-     *             channel.
-     */
-    public abstract void connect() throws ImException;
-
-    /**
-     * Suspend the data channel. No data will be sent through the data channel
-     * after suspended. It can be recovered from {@link #resume()}.
-     */
-    public abstract void suspend();
-
-    /**
-     * Resume the suspended data channel.
-     *
-     * @return <code>true</code> if the channel is resumed successfully;
-     *         <code>false</code> if the channel is timeout and a new one must
-     *         be established.
-     */
-    public abstract boolean resume();
-
-    /**
-     * Shutdown the data channel.
-     */
-    public abstract void shutdown();
-
-    /**
-     * Sends a CSP primitive to the IMPS server through this data channel.
-     *
-     * @param p the primitive to send.
-     */
-    public abstract void sendPrimitive(Primitive p);
-
-    /**
-     * Receives a primitive from this data channel, waiting until a primitive
-     * from the server arrived or being interrupted.
-     *
-     * @return the received primitive
-     * @throws InterruptedException
-     */
-    public abstract Primitive receivePrimitive() throws InterruptedException;
-
-    /**
-     * Gets the time when the last primitive was sent to the server through the
-     * data channel.
-     *
-     * @return the time last primitive was sent.
-     */
-    public abstract long getLastActiveTime();
-
-    /**
-     * Tells if there is any primitive waiting to send.
-     *
-     * @return <code>true</code> if there is one or more primitives waiting to send.
-     */
-    public abstract boolean isSendingQueueEmpty();
-
-    /**
-     * Starts the keep alive task. KeepAliveRequest will be sent to the server
-     * if no other transaction has occurred during the KeepAliveTime interval.
-     */
-    public abstract void startKeepAlive(long interval);
-
-    /**
-     * Set the ServerMinPoll value (in seconds) after capability negotiation.
-     * The DataChannel <b>MUST NOT</b> send more than 1 PollingRequest within
-     * this interval.
-     */
-    public void setServerMinPoll(long interval)
-    {
-        mMinPollMillis = interval * 1000;
-    }
-}
diff --git a/src/com/android/im/imps/DefaultPresenceMapping.java b/src/com/android/im/imps/DefaultPresenceMapping.java
deleted file mode 100644 (file)
index fa5f954..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.imps;
-
-import com.android.im.plugin.ImPluginConstants;
-
-import java.util.Map;
-
-public class DefaultPresenceMapping implements PresenceMapping {
-
-    public Map<String, Object> getExtra(int status) {
-        return null;
-    }
-
-    public boolean getOnlineStatus(int status) {
-        return status != ImPluginConstants.PRESENCE_OFFLINE;
-    }
-
-    public int getPresenceStatus(boolean onlineStatus, String userAvailability,
-            Map<String, Object> allValues) {
-        if (!onlineStatus) {
-            return ImPluginConstants.PRESENCE_OFFLINE;
-        }
-        if (ImPluginConstants.PA_NOT_AVAILABLE.equals(userAvailability)) {
-            return ImPluginConstants.PRESENCE_AWAY;
-        } else if (ImPluginConstants.PA_DISCREET.equals(userAvailability)) {
-            return ImPluginConstants.PRESENCE_DO_NOT_DISTURB;
-        } else {
-            return ImPluginConstants.PRESENCE_AVAILABLE;
-        }
-    }
-
-    public int[] getSupportedPresenceStatus() {
-        return new int[] {
-                ImPluginConstants.PRESENCE_AVAILABLE,
-                ImPluginConstants.PRESENCE_DO_NOT_DISTURB,
-                ImPluginConstants.PRESENCE_AWAY
-        };
-    }
-
-    public String getUserAvaibility(int status) {
-        switch (status) {
-            case ImPluginConstants.PRESENCE_AVAILABLE:
-                return ImPluginConstants.PA_AVAILABLE;
-
-            case ImPluginConstants.PRESENCE_AWAY:
-                return ImPluginConstants.PA_NOT_AVAILABLE;
-
-            case ImPluginConstants.PRESENCE_DO_NOT_DISTURB:
-                return ImPluginConstants.PA_DISCREET;
-
-            default:
-                return null;
-        }
-    }
-
-    public boolean requireAllPresenceValues() {
-        return false;
-    }
-
-}
diff --git a/src/com/android/im/imps/HttpCirChannel.java b/src/com/android/im/imps/HttpCirChannel.java
deleted file mode 100644 (file)
index 1cca355..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import android.os.SystemClock;
-
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-/**
- * An implementation of CIR channel with standalone HTTP binding.
- */
-class HttpCirChannel extends CirChannel implements Runnable {
-    private static final int HTTP_CIR_PING_INTERVAL = 10000;
-
-    private DataChannel mDataChannel;
-
-    private boolean mStopped;
-    private Thread mPollingTask;
-
-    private URL mCirUrl;
-
-    private long mServerPollMin;
-
-    public HttpCirChannel(ImpsConnection connection, DataChannel dataChannel) {
-        super(connection);
-        this.mDataChannel = dataChannel;
-    }
-
-    @Override
-    public void connect() {
-        ImpsSession session = mConnection.getSession();
-        try {
-            if (session.getCirHttpAddress() != null) {
-                mCirUrl = new URL(session.getCirHttpAddress());
-            }
-        } catch (MalformedURLException e) {
-            // Ignore
-        }
-        mServerPollMin = session.getServerPollMin() * 1000;
-
-        mPollingTask = new Thread(this, "HTTPCIRChannel");
-        mPollingTask.setDaemon(true);
-        mPollingTask.start();
-    }
-
-    @Override
-    public void shutdown() {
-        mStopped = true;
-    }
-
-    public void run() {
-        while (!mStopped) {
-            long lastActive = mDataChannel.getLastActiveTime();
-
-            if (mCirUrl != null) {
-                if (SystemClock.elapsedRealtime() - lastActive >= HTTP_CIR_PING_INTERVAL) {
-                    HttpURLConnection urlConnection;
-                    try {
-                        urlConnection = (HttpURLConnection) mCirUrl
-                                .openConnection();
-
-                        if (urlConnection.getResponseCode() == HttpURLConnection.HTTP_OK) {
-                            mConnection.sendPollingRequest();
-                        }
-                    } catch (IOException e) {
-                        mStopped = true;
-                    }
-                }
-
-                try {
-                    Thread.sleep(HTTP_CIR_PING_INTERVAL);
-                } catch (InterruptedException e) {
-                    // Ignore.
-                }
-            } else {
-                // The server didn't provide a URL for CIR poll in the
-                // capability negotiation, just send PollingRequest.
-                if (SystemClock.elapsedRealtime() - lastActive >= mServerPollMin
-                        && mDataChannel.isSendingQueueEmpty()) {
-                    mConnection.sendPollingRequest();
-                }
-
-                try {
-                    Thread.sleep(mServerPollMin);
-                } catch (InterruptedException e) {
-                    // Ignore.
-                }
-            }
-        }
-    }
-}
diff --git a/src/com/android/im/imps/HttpDataChannel.java b/src/com/android/im/imps/HttpDataChannel.java
deleted file mode 100644 (file)
index 8f49751..0000000
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.http.Header;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.StatusLine;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.ByteArrayEntity;
-import org.apache.http.message.BasicHeader;
-import org.apache.http.params.HttpConnectionParams;
-import org.apache.http.params.HttpParams;
-
-import android.net.http.AndroidHttpClient;
-import android.os.SystemClock;
-import android.util.Log;
-
-import com.android.im.engine.HeartbeatService;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.ImException;
-import com.android.im.engine.SystemService;
-import com.android.im.imps.Primitive.TransactionMode;
-
-/**
- * The <code>HttpDataChannel</code> is an implementation of IMPS data channel
- * in which the protocol binding is HTTP.
- */
-class HttpDataChannel extends DataChannel implements Runnable, HeartbeatService.Callback {
-
-    private static final int MAX_RETRY_COUNT = 10;
-    private static final int INIT_RETRY_DELAY_MS = 5000;
-    private static final int MAX_RETRY_DELAY_MS = 300 * 1000;
-
-    private Thread mSendThread;
-    private boolean mStopped;
-    private boolean mSuspended;
-    private boolean mConnected;
-    private boolean mStopRetry;
-    private Object mRetryLock = new Object();
-    private LinkedBlockingQueue<Primitive> mSendQueue;
-    private LinkedBlockingQueue<Primitive> mReceiveQueue;
-
-    private long mLastActive;
-    private long mKeepAliveMillis;
-    private Primitive mKeepAlivePrimitive;
-
-    private AtomicBoolean mHasPendingPolling = new AtomicBoolean(false);
-
-    private final AndroidHttpClient mHttpClient;
-    private final Header mContentTypeHeader;
-    private final Header mMsisdnHeader;
-    private URI mPostUri;
-
-    private ImpsTransactionManager mTxManager;
-
-    /**
-     * Constructs a new HttpDataChannel for a connection.
-     *
-     * @param connection the connection which uses the data channel.
-     */
-    public HttpDataChannel(ImpsConnection connection) throws ImException {
-        super(connection);
-        mTxManager = connection.getTransactionManager();
-        ImpsConnectionConfig cfg = connection.getConfig();
-        try {
-            String host = cfg.getHost();
-            if (host == null || host.length() == 0) {
-                throw new ImException(ImErrorInfo.INVALID_HOST_NAME,
-                       "Empty host name.");
-            }
-            mPostUri = new URI(cfg.getHost());
-            if (mPostUri.getPath() == null || "".equals(mPostUri.getPath())) {
-                mPostUri = new URI(cfg.getHost() + "/");
-            }
-            if (!"http".equalsIgnoreCase(mPostUri.getScheme())
-                    && !"https".equalsIgnoreCase(mPostUri.getScheme())) {
-                throw new ImException(ImErrorInfo.INVALID_HOST_NAME,
-                        "Non HTTP/HTTPS host name.");
-            }
-
-            mHttpClient = AndroidHttpClient.newInstance("Android-Imps/0.1");
-
-            HttpParams params = mHttpClient.getParams();
-            HttpConnectionParams.setConnectionTimeout(params, cfg.getReplyTimeout());
-            HttpConnectionParams.setSoTimeout(params, cfg.getReplyTimeout());
-        } catch (URISyntaxException e) {
-            throw new ImException(ImErrorInfo.INVALID_HOST_NAME,
-                    e.getLocalizedMessage());
-        }
-
-        mContentTypeHeader = new BasicHeader("Content-Type", cfg.getTransportContentType());
-        String msisdn = cfg.getMsisdn();
-        mMsisdnHeader = (msisdn != null) ? new BasicHeader("MSISDN", msisdn) : null;
-
-        mParser = cfg.createPrimitiveParser();
-        mSerializer = cfg.createPrimitiveSerializer();
-    }
-
-    @Override
-    public void connect() throws ImException {
-        if (mConnected) {
-            throw new ImException("Already connected");
-        }
-        mStopped = false;
-        mStopRetry = false;
-
-        mSendQueue = new LinkedBlockingQueue<Primitive>();
-        mReceiveQueue = new LinkedBlockingQueue<Primitive>();
-
-        mSendThread = new Thread(this, "HttpDataChannel");
-        mSendThread.setDaemon(true);
-        mSendThread.start();
-
-        mConnected = true;
-    }
-
-    @Override
-    public void suspend() {
-        mSuspended = true;
-    }
-
-    @Override
-    public boolean resume() {
-        long now = SystemClock.elapsedRealtime();
-        if (now - mLastActive > mKeepAliveMillis) {
-            shutdown();
-            return false;
-        } else {
-            mSuspended = false;
-
-            // Send a polling request after resume in case we missed some
-            // updates while we are suspended.
-            Primitive polling = new Primitive(ImpsTags.Polling_Request);
-            polling.setSession(mConnection.getSession().getID());
-            sendPrimitive(polling);
-            startHeartbeat();
-
-            return true;
-        }
-    }
-
-    @Override
-    public void shutdown() {
-        HeartbeatService heartbeatService
-            = SystemService.getDefault().getHeartbeatService();
-        if (heartbeatService != null) {
-            heartbeatService.stopHeartbeat(this);
-        }
-        // Stop the sending thread
-        mStopped = true;
-        mSendThread.interrupt();
-        mConnected = false;
-    }
-
-    @Override
-    public void sendPrimitive(Primitive p) {
-        if (!mConnected || mStopped) {
-            ImpsLog.log("DataChannel not connected, ignore primitive " + p.getType());
-            return;
-        }
-
-        if (ImpsTags.Polling_Request.equals(p.getType())) {
-            if (!mHasPendingPolling.compareAndSet(false, true)) {
-                ImpsLog.log("HttpDataChannel: Ignoring Polling-Request");
-                return;
-            }
-        } else if (ImpsTags.Logout_Request.equals(p.getType())) {
-            mStopRetry = true;
-            synchronized (mRetryLock) {
-                mRetryLock.notify();
-            }
-        }
-        if (!mSendQueue.offer(p)) {
-            // This is almost impossible for a LinkedBlockingQueue. We don't
-            // even bother to assign an error code for this. ;)
-            mTxManager.notifyErrorResponse(p.getTransactionID(),
-                    ImErrorInfo.UNKNOWN_ERROR, "sending queue full");
-        }
-    }
-
-    @Override
-    public Primitive receivePrimitive() throws InterruptedException {
-        if (!mConnected || mStopped) {
-            throw new IllegalStateException();
-        }
-
-        return mReceiveQueue.take();
-    }
-
-    @Override
-    public void startKeepAlive(long interval) {
-        if (!mConnected || mStopped) {
-            throw new IllegalStateException();
-        }
-
-        if (interval <= 0) {
-            interval = mConnection.getConfig().getDefaultKeepAliveInterval();
-        }
-
-        mKeepAliveMillis = interval * 1000;
-        if (mKeepAliveMillis < 0) {
-            ImpsLog.log("Negative keep alive time. Won't send keep-alive");
-        }
-        mKeepAlivePrimitive = new Primitive(ImpsTags.KeepAlive_Request);
-        startHeartbeat();
-    }
-
-    private void startHeartbeat() {
-        HeartbeatService heartbeatService
-            = SystemService.getDefault().getHeartbeatService();
-        if (heartbeatService != null) {
-            heartbeatService.startHeartbeat(this, mKeepAliveMillis);
-        }
-    }
-
-    public long sendHeartbeat() {
-        if (mSuspended) {
-            return 0;
-        }
-
-        long inactiveTime = SystemClock.elapsedRealtime() - mLastActive;
-        if (needSendKeepAlive(inactiveTime)) {
-            sendKeepAlive();
-            return mKeepAliveMillis;
-        } else {
-            return mKeepAliveMillis - inactiveTime;
-        }
-    }
-
-    private boolean needSendKeepAlive(long inactiveTime) {
-        return mKeepAliveMillis - inactiveTime <= 500;
-    }
-
-    @Override
-    public long getLastActiveTime() {
-        return mLastActive;
-    }
-
-    @Override
-    public boolean isSendingQueueEmpty() {
-        if (!mConnected || mStopped) {
-            throw new IllegalStateException();
-        }
-        return mSendQueue.isEmpty();
-    }
-
-    public void run() {
-        while (!mStopped) {
-            try {
-                Primitive primitive = mSendQueue.take();
-                if (primitive.getType().equals(ImpsTags.Polling_Request)) {
-                    mHasPendingPolling.set(false);
-                }
-                doSendPrimitive(primitive);
-            } catch (InterruptedException e) {
-            }
-        }
-        mHttpClient.close();
-    }
-
-    private void sendKeepAlive() {
-        ImpsTransactionManager tm = mConnection.getTransactionManager();
-        AsyncTransaction tx = new AsyncTransaction(tm) {
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                // Since we never request a new timeout value, the response
-                // can be ignored
-            }
-        };
-        tx.sendRequest(mKeepAlivePrimitive);
-    }
-
-    /**
-     * Sends a primitive to the IMPS server through HTTP.
-     *
-     * @param p The primitive to send.
-     */
-    private void doSendPrimitive(Primitive p) {
-        String errorInfo = null;
-        int retryCount = 0;
-        long retryDelay = INIT_RETRY_DELAY_MS;
-        while (retryCount < MAX_RETRY_COUNT) {
-            try {
-                trySend(p);
-                return;
-            } catch (IOException e) {
-                errorInfo = e.getLocalizedMessage();
-                String type = p.getType();
-                if (ImpsTags.Login_Request.equals(type)
-                        || ImpsTags.Logout_Request.equals(type)) {
-                    // we don't retry to send login/logout request. The request
-                    // might be sent to the server successfully but we failed to
-                    // get the response from the server. Retry in this case might
-                    // cause multiple login which is not allowed by some server.
-                    break;
-                }
-                if (p.getTransactionMode() == TransactionMode.Response) {
-                    // Ignore the failure of sending response to the server since
-                    // it's only an acknowledgment. When we get here, the
-                    // primitive might have been sent successfully but failed to
-                    // get the http response. The server might or might not send
-                    // the request again if it does not receive the acknowledgment,
-                    // the client is ok to either case.
-                    return;
-                }
-                retryCount++;
-                // sleep for a while and retry to send the primitive in a new
-                // transaction if we havn't met the max retry count.
-                if (retryCount < MAX_RETRY_COUNT) {
-                   mTxManager.reassignTransactionId(p);
-                    Log.w(ImpsLog.TAG, "Send primitive failed, retry after " + retryDelay + "ms");
-                    synchronized (mRetryLock) {
-                        try {
-                            mRetryLock.wait(retryDelay);
-                        } catch (InterruptedException ignore) {
-                        }
-                        if (mStopRetry) {
-                            break;
-                        }
-                    }
-                    retryDelay = retryDelay * 2;
-                    if (retryDelay > MAX_RETRY_DELAY_MS) {
-                        retryDelay = MAX_RETRY_DELAY_MS;
-                    }
-                }
-            }
-        }
-        Log.w(ImpsLog.TAG, "Failed to send primitive after " + MAX_RETRY_COUNT + " retries");
-        mTxManager.notifyErrorResponse(p.getTransactionID(),
-                ImErrorInfo.NETWORK_ERROR, errorInfo);
-    }
-
-    private void trySend(Primitive p) throws IOException {
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        try {
-            mSerializer.serialize(p, out);
-        } catch (SerializerException e) {
-            mTxManager.notifyErrorResponse(p.getTransactionID(),
-                    ImErrorInfo.SERIALIZER_ERROR,
-                    "Internal serializer error, primitive: " + p.getType());
-            out.close();
-            return;
-        }
-
-        HttpPost req = new HttpPost(mPostUri);
-        req.addHeader(mContentTypeHeader);
-        if (mMsisdnHeader != null) {
-            req.addHeader(mMsisdnHeader);
-        }
-        ByteArrayEntity entity = new ByteArrayEntity(out.toByteArray());
-        req.setEntity(entity);
-
-        mLastActive = SystemClock.elapsedRealtime();
-        if (Log.isLoggable(ImpsLog.TAG, Log.DEBUG)) {
-            long sendBytes = entity.getContentLength() + 176 /* approx. header length */;
-            ImpsLog.log(mConnection.getLoginUserName() + " >> " + p.getType() + " HTTP payload approx. " + sendBytes + " bytes");
-        }
-        if (Log.isLoggable(ImpsLog.PACKET_TAG, Log.DEBUG)) {
-            ImpsLog.dumpRawPacket(out.toByteArray());
-            ImpsLog.dumpPrimitive(p);
-        }
-
-        HttpResponse res = mHttpClient.execute(req);
-        StatusLine statusLine = res.getStatusLine();
-        HttpEntity resEntity = res.getEntity();
-
-        InputStream in = resEntity.getContent();
-
-        if (Log.isLoggable(ImpsLog.PACKET_TAG, Log.DEBUG)) {
-            Log.d(ImpsLog.PACKET_TAG, statusLine.toString());
-            Header[] headers = res.getAllHeaders();
-            for (Header h : headers) {
-                Log.d(ImpsLog.PACKET_TAG, h.toString());
-            }
-            int len = (int) resEntity.getContentLength();
-            if (len > 0) {
-                byte[] content = new byte[len];
-                int offset = 0;
-                int bytesRead = 0;
-                do {
-                    bytesRead = in.read(content, offset, len);
-                    offset += bytesRead;
-                    len -= bytesRead;
-                } while (bytesRead > 0);
-                in.close();
-                ImpsLog.dumpRawPacket(content);
-                in = new ByteArrayInputStream(content);
-            }
-        }
-
-        try {
-            if (statusLine.getStatusCode() != HttpURLConnection.HTTP_OK) {
-                mTxManager.notifyErrorResponse(p.getTransactionID(), statusLine.getStatusCode(),
-                        statusLine.getReasonPhrase());
-                return;
-            }
-            if (resEntity.getContentLength() == 0) {
-                // empty responses are only valid for Polling-Request or
-                // server initiated transactions
-                if ((p.getTransactionMode() != TransactionMode.Response)
-                        && !p.getType().equals(ImpsTags.Polling_Request)) {
-                    mTxManager.notifyErrorResponse(p.getTransactionID(),
-                            ImErrorInfo.ILLEGAL_SERVER_RESPONSE,
-                            "bad response from server");
-                }
-                return;
-            }
-
-            Primitive response = mParser.parse(in);
-
-            if (Log.isLoggable(ImpsLog.PACKET_TAG, Log.DEBUG)) {
-                ImpsLog.dumpPrimitive(response);
-            }
-
-            if (Log.isLoggable(ImpsLog.TAG, Log.DEBUG)) {
-                long len = 2 + resEntity.getContentLength() + statusLine.toString().length() + 2;
-                Header[] headers = res.getAllHeaders();
-                for (Header header : headers) {
-                    len += header.getName().length() + header.getValue().length() + 4;
-                }
-                ImpsLog.log(mConnection.getLoginUserName() + " << "
-                        + response.getType() + " HTTP payload approx. " + len + "bytes");
-            }
-
-            if (!mReceiveQueue.offer(response)) {
-                // This is almost impossible for a LinkedBlockingQueue.
-                // We don't even bother to assign an error code for it.
-                mTxManager.notifyErrorResponse(p.getTransactionID(),
-                        ImErrorInfo.UNKNOWN_ERROR, "receiving queue full");
-            }
-        } catch (ParserException e) {
-            ImpsLog.logError(e);
-            mTxManager.notifyErrorResponse(p.getTransactionID(),
-                    ImErrorInfo.PARSER_ERROR,
-                    "Parser error, received a bad response from server");
-        } finally {
-            //consume all the content so that the connection can be re-used.
-            resEntity.consumeContent();
-        }
-    }
-
-}
diff --git a/src/com/android/im/imps/ImpsAddress.java b/src/com/android/im/imps/ImpsAddress.java
deleted file mode 100644 (file)
index e11bb7f..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import android.os.Parcel;
-
-import com.android.im.engine.Address;
-import com.android.im.engine.ImEntity;
-
-/**
- * The abstract representation of an IMPS address.
- */
-public abstract class ImpsAddress extends Address {
-    private static final char[] SPECIALS = {'/', '@', '+'};
-
-    protected String mUser;
-    protected String mResource;
-    protected String mDomain;
-
-    private String mFullAddress;
-
-    protected ImpsAddress() {
-    }
-
-    protected ImpsAddress(String user, String resource, String domain) {
-        // build the full address and unify the fields to lower case since imps
-        // address is case insensitive.
-        StringBuilder buf = new StringBuilder(ImpsConstants.ADDRESS_PREFIX);
-        if(user != null) {
-            buf.append(user.toLowerCase());
-        }
-        if(resource != null) {
-            buf.append('/').append(resource.toLowerCase());
-        }
-        if(domain != null) {
-            buf.append('@').append(domain.toLowerCase());
-        }
-        mFullAddress = buf.toString();
-        mUser = user;
-        mResource = resource;
-        mDomain = domain;
-        verifyAddress();
-    }
-
-    protected ImpsAddress(String full){
-        this(full, true);
-    }
-
-    protected ImpsAddress(String full, boolean verify) {
-        if (full == null || full.length() == 0) {
-            throw new IllegalArgumentException();
-        }
-
-        //TODO: escape reserved characters.
-        if(!full.startsWith(ImpsConstants.ADDRESS_PREFIX)) {
-            full = ImpsConstants.ADDRESS_PREFIX + full;
-        }
-
-        parse(full);
-        mFullAddress = full;
-
-        if (verify) {
-            verifyAddress();
-        }
-    }
-
-    private void parse(String full) {
-        mUser = parseUser(full);
-        mResource = parseResource(full);
-        mDomain = parseDomain(full);
-    }
-
-    private void verifyAddress() throws IllegalArgumentException {
-        ImpsLog.log("verifyAddress:" + mUser + ", " + mResource + ",  " + mDomain);
-        if(mUser == null && mResource == null) {
-            throw new IllegalArgumentException();
-        }
-
-        if(mUser != null) {
-            if(mUser.length() == 0) {
-                throw new IllegalArgumentException("Invalid user");
-            }
-            if(mUser.charAt(0) == '+') {//mobile number
-                for(int i = 1; i < mUser.length(); i++) {
-                    if(!Character.isDigit(mUser.charAt(i))) {
-                        throw new IllegalArgumentException("Invalid user");
-                    }
-                }
-            } else if(!isAlphaSequence(mUser)) {
-                throw new IllegalArgumentException("Invalid user");
-            }
-        }
-
-        if(mResource != null && !isAlphaSequence(mResource)) {
-            throw new IllegalArgumentException("Invalid resource");
-        }
-        if(mDomain != null && !isAlphaSequence(mDomain)) {
-            throw new IllegalArgumentException("Invalid domain");
-        }
-    }
-
-    /**
-     * Gets the User-part of the address which refers to the identification of
-     * the IMPS user.
-     *
-     * @return the User-part of the address.
-     */
-    public String getUser() {
-        return mUser;
-    }
-
-    /**
-     * Gets the Resource-part of the address which identifies the referred
-     * public or private resource.
-     *
-     * @return the Resource-part of the address.
-     */
-    public String getResource() {
-        return mResource;
-    }
-
-    /**
-     * Gets the Domain-part of the address which identifies the IMPS server
-     * domain.
-     *
-     * @return the Domain-part of the address.
-     */
-    public String getDomain() {
-        return mDomain;
-    }
-
-    /**
-     * Gets the full string representation of the address.
-     */
-    @Override
-    public String getFullName() {
-        return mFullAddress;
-    }
-
-    @Override
-    public void writeToParcel(Parcel dest) {
-        dest.writeString(mFullAddress);
-    }
-
-    @Override
-    public void readFromParcel(Parcel source) {
-        mFullAddress = source.readString();
-        parse(mFullAddress);
-    }
-
-    @Override
-    public boolean equals(Object other) {
-        return other instanceof ImpsAddress
-                && mFullAddress.equalsIgnoreCase(((ImpsAddress)other).mFullAddress);
-    }
-
-    @Override
-    public int hashCode() {
-        return mFullAddress.toLowerCase().hashCode();
-    }
-
-    /**
-     * Formats the address to a PrimitiveElement which can be used as the
-     * content of Sender or Recipient.
-     *
-     * @return a PrimitiveElement.
-     */
-    public abstract PrimitiveElement toPrimitiveElement();
-
-    /**
-     * Gets the entity this address object refers to.
-     *
-     * @param connection
-     * @return the entity this address refers to or <code>null</code> if the
-     *         entity not found.
-     */
-    abstract ImEntity getEntity(ImpsConnection connection);
-
-    /**
-     * Constructs an ImpsAddress from the Sender or Recipient element in a
-     * primitive.
-     *
-     * @param elem the Sender of Recipient element.
-     * @return the ImpsAddress object or <code>null</code> if it's not a valid
-     *         element.
-     */
-    public static ImpsAddress fromPrimitiveElement(PrimitiveElement elem) {
-        String type = elem.getTagName();
-        if(ImpsTags.User.equals(type)) {
-            return new ImpsUserAddress(elem.getChildContents(ImpsTags.UserID), false);
-        } else if(ImpsTags.Group.equals(type)) {
-            PrimitiveElement child = elem.getFirstChild();
-            if(child == null) {
-                throw new IllegalArgumentException();
-            }
-            if(ImpsTags.GroupID.equals(child.getTagName())){
-                return new ImpsGroupAddress(child.getContents());
-            } else {
-                String screeName = child.getChildContents(ImpsTags.SName);
-                String groupId = child.getChildContents(ImpsTags.GroupID);
-                return new ImpsGroupAddress(groupId, screeName);
-            }
-        } else if(ImpsTags.ContactList.equals(type)) {
-            return new ImpsContactListAddress(elem.getContents(), false);
-        } else {
-            throw new IllegalArgumentException();
-        }
-    }
-
-    private String parseUser(String full) {
-        int index = full.indexOf('/');
-        if(index == 3) {
-            return null;
-        }
-        if (index == -1) {
-            index = full.lastIndexOf('@');
-        }
-        if (index == -1) {
-            index = full.length();
-        }
-        return full.substring(3, index);
-    }
-
-    private String parseResource(String full) {
-        int beginIndex = full.indexOf('/');
-        if (beginIndex == -1) {
-            return null;
-        }
-        int endIndex = full.lastIndexOf('@');
-        if (endIndex == -1 || endIndex < beginIndex) {
-            endIndex = full.length();
-        }
-        return full.substring(beginIndex + 1, endIndex);
-    }
-
-    private String parseDomain(String full) {
-        int beginIndex = full.lastIndexOf('@');
-        return beginIndex == -1 ? null : full.substring(beginIndex + 1);
-    }
-
-    private boolean isAlphaSequence(String str) {
-        for(int i = 0; i < str.length(); i++) {
-            char ch = str.charAt(i);
-            if(ch < 32 || ch > 126 || isSpecial(ch)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    private boolean isSpecial(char ch) {
-        for (char element : SPECIALS) {
-            if(ch == element) {
-                return true;
-            }
-        }
-        return false;
-    }
-}
diff --git a/src/com/android/im/imps/ImpsChatGroupManager.java b/src/com/android/im/imps/ImpsChatGroupManager.java
deleted file mode 100644 (file)
index 4846d9e..0000000
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.util.ArrayList;
-
-import com.android.im.engine.Address;
-import com.android.im.engine.ChatGroup;
-import com.android.im.engine.ChatGroupManager;
-import com.android.im.engine.Contact;
-import com.android.im.engine.GroupListener;
-import com.android.im.engine.GroupMemberListener;
-import com.android.im.engine.Invitation;
-
-/**
- * The implementation of ChatGroupManager with IMPS protocol.
- */
-public class ImpsChatGroupManager extends ChatGroupManager implements
-        ServerTransactionListener {
-    private ImpsConnection mConnection;
-    private ImpsTransactionManager mTransactionManager;
-
-    ImpsChatGroupManager(ImpsConnection connection) {
-        mConnection = connection;
-
-        mTransactionManager = connection.getTransactionManager();
-        mTransactionManager.setTransactionListener(ImpsTags.GroupChangeNotice, this);
-        mTransactionManager.setTransactionListener(ImpsTags.LeaveGroup_Response, this);
-        mTransactionManager.setTransactionListener(ImpsTags.InviteUser_Request, this);
-        mTransactionManager.setTransactionListener(ImpsTags.Invite_Response, this);
-    }
-
-    @Override
-    protected void addGroupMemberAsync(final ChatGroup group, final Contact contact){
-        Primitive request = buildAddGroupMemberRequest(group, contact);
-
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                notifyGroupMemberError(group, error);
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                notifyMemberJoined(group, contact);
-            }
-        };
-        tx.sendRequest(request);
-    }
-
-    @Override
-    public void createChatGroupAsync(final String name) {
-        final ImpsAddress loginUserAddress = mConnection.getSession()
-                .getLoginUserAddress();
-        final ImpsAddress groupAddress = new ImpsGroupAddress(loginUserAddress, name);
-
-        Primitive primitive = buildCreateGroupRequest(name, groupAddress);
-
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                notifyGroupError(GroupListener.ERROR_CREATING_GROUP, name, error);
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                // The current user is joined into the group automatically.
-                ArrayList<Contact> members = new ArrayList<Contact>();
-                members.add(new Contact(loginUserAddress, loginUserAddress
-                        .getUser()));
-
-                ChatGroup group = new ChatGroup(groupAddress, name, members,
-                        ImpsChatGroupManager.this);
-                notifyGroupCreated(group);
-            }
-        };
-        tx.sendRequest(primitive);
-    }
-
-    @Override
-    public void deleteChatGroupAsync(final ChatGroup group) {
-        Primitive request = new Primitive(ImpsTags.DeleteGroup_Request);
-        request.addElement(ImpsTags.GroupID, group.getAddress().getFullName());
-
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                notifyGroupError(GroupListener.ERROR_DELETING_GROUP,
-                    group.getName(), error);
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                notifyGroupDeleted(group);
-            }
-        };
-        tx.sendRequest(request);
-    }
-
-    @Override
-    public void inviteUserAsync(final ChatGroup group, Contact contact) {
-        Primitive request = buildInviteUserRequest(group, contact);
-
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager){
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                notifyGroupMemberError(group, error);
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                //Do nothing
-            }
-        };
-        tx.sendRequest(request);
-    }
-
-    @Override
-    public void acceptInvitationAsync(Invitation invitation){
-        joinChatGroupAsync(invitation.getGroupAddress());
-        sendInvitationResposne(invitation, true);
-    }
-
-    @Override
-    public void rejectInvitationAsync(Invitation invitation) {
-        sendInvitationResposne(invitation, false);
-    }
-
-    private void sendInvitationResposne(Invitation invitation, boolean accept) {
-        Primitive response = new Primitive(ImpsTags.InviteUser_Response);
-        response.addElement(ImpsTags.InviteID, invitation.getInviteID());
-        response.addElement(ImpsTags.Acceptance, ImpsUtils.toImpsBool(accept));
-        ImpsAddress sender = (ImpsAddress) invitation.getSender();
-        response.addElement(sender.toPrimitiveElement());
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager){
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                // Ignore
-            }
-            @Override
-            public void onResponseOk(Primitive res) {
-                // Ignore
-            }
-        };
-        tx.sendRequest(response);
-    }
-
-    @Override
-    public void joinChatGroupAsync(final Address address) {
-        Primitive request = buildJoinGroupRequest(address);
-
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                notifyGroupError(GroupListener.ERROR_JOINING_IN_GROUP,
-                    address.getScreenName(), error);
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                ArrayList<Contact> members = new ArrayList<Contact>();
-                // FIXME: UserMapList is a child of Joined in version 1.3
-                PrimitiveElement userMapping = response
-                        .getElement(ImpsTags.UserMapList);
-                extractUserMapList(userMapping, members);
-
-                ChatGroup group = new ChatGroup(address, address
-                        .getScreenName(), members, ImpsChatGroupManager.this);
-                notifyJoinedGroup(group);
-            }
-        };
-        tx.sendRequest(request);
-    }
-
-    @Override
-    public void leaveChatGroupAsync(final ChatGroup group) {
-        Primitive leaveRequest = buildLeaveGroupRequest(group);
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                notifyGroupError(GroupListener.ERROR_LEAVING_GROUP,
-                    group.getName(), error);
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                notifyLeftGroup(group);
-            }
-        };
-        tx.sendRequest(leaveRequest);
-    }
-
-    @Override
-    protected void removeGroupMemberAsync(final ChatGroup group, final Contact contact) {
-        Primitive request = buildRemoveGroupMemberRequest(group, contact);
-
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                notifyGroupMemberError(group, error);
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                notifyMemberLeft(group, contact);
-            }
-        };
-        tx.sendRequest(request);
-    }
-
-    /**
-     * Loads the members of a ChatGroup asynchronously. This method will create
-     * a ChatGroup and return immediately. After the members are fetched from
-     * the server,
-     * {@link GroupMemberListener#onMemberJoined(ChatGroup, Contact)}} will be
-     * called.
-     *
-     * @param address
-     */
-    ChatGroup loadGroupMembersAsync(ImpsGroupAddress address) {
-        //FIXME: NowIMP Server doesn't support this primitive.
-//        Primitive request = new Primitive(ImpsTags.GetJoinedUsers_Request);
-//        request.addElement(ImpsTags.GroupID, address.getFullName());
-//        Primitive response = mConnection.sendRequest(request);
-//        ImpsUtils.checkResult(response);
-//
-//        ChatGroup group = new ChatGroup(address, address.getScreenName(), this);
-        throw new RuntimeException("Not implemented yet");
-    }
-
-    public void notifyServerTransaction(ServerTransaction tx) {
-        final Primitive primitive = tx.getRequest();
-        String type = primitive.getType();
-        if (ImpsTags.GroupChangeNotice.equals(type)) {
-            tx.sendStatusResponse(ImpsConstants.SUCCESS_CODE);
-            handleGroupChange(primitive);
-        } else if (ImpsTags.InviteUser_Request.equals(type)) {
-            tx.sendStatusResponse(ImpsConstants.SUCCESS_CODE);
-
-            String inviteType = primitive.getElementContents(ImpsTags.InviteType);
-            // We only handle Group invitation right now.
-            if (ImpsConstants.GROUP_INVITATION.equals(inviteType)) {
-                handleInvitation(primitive);
-            }
-        } else if (ImpsTags.LeaveGroup_Response.equals(type)) {
-            tx.sendStatusResponse(ImpsConstants.SUCCESS_CODE);
-            String groupId = primitive.getElementContents(ImpsTags.GroupID);
-            ChatGroup group = mGroups.get(new ImpsGroupAddress(groupId));
-            if(group != null) {
-                notifyLeftGroup(group);
-            } else {
-                ImpsLog.log("Leave unknown group:" + groupId);
-            }
-        } else if (ImpsTags.Invite_Response.equals(type)) {
-            tx.sendStatusResponse(ImpsConstants.SUCCESS_CODE);
-            //TODO: notify the user?
-        }
-    }
-
-    void handleGroupChange(final Primitive primitive) {
-        String groupId = primitive.getElementContents(ImpsTags.GroupID);
-        ImpsGroupAddress address = new ImpsGroupAddress(groupId);
-
-        ArrayList<Contact> joined = new ArrayList<Contact>();
-        PrimitiveElement joinedElem = primitive.getElement(ImpsTags.Joined);
-        if (joinedElem != null) {
-            extractUserMapList(joinedElem.getFirstChild(), joined);
-        }
-        ArrayList<Contact> left = new ArrayList<Contact>();
-        PrimitiveElement leftElem = primitive.getElement(ImpsTags.Left);
-        if (leftElem != null) {
-            extractUserMapList(leftElem.getFirstChild(), left);
-        }
-
-        notifyGroupChanged(address, joined, left);
-    }
-
-    void handleInvitation(final Primitive primitive) {
-        String inviteId = primitive.getElementContents(ImpsTags.InviteID);
-        PrimitiveElement sender = primitive.getElement(ImpsTags.Sender);
-        ImpsAddress senderAddress = ImpsAddress.fromPrimitiveElement(sender
-                .getFirstChild());
-        String groupId = primitive.getElementContents(ImpsTags.GroupID);
-        Address groupAddress = new ImpsGroupAddress(groupId);
-        String inviteNote = primitive.getElementContents(ImpsTags.InviteNote);
-
-        Invitation invitation = new Invitation(inviteId, groupAddress,
-                senderAddress, inviteNote);
-        notifyGroupInvitation(invitation);
-    }
-
-    private Primitive buildAddGroupMemberRequest(final ChatGroup group, final Contact contact) {
-        Primitive request = new Primitive(ImpsTags.AddGroupMembers_Request);
-        request.addElement(ImpsTags.GroupID, group.getAddress().getFullName());
-
-        // FIXME: It's UserIDList in 1.3
-        PrimitiveElement userList = request.addElement(ImpsTags.UserList);
-        PrimitiveElement user = userList.addChild(ImpsTags.User);
-        user.addChild(ImpsTags.UserID, contact.getAddress().getFullName());
-        return request;
-    }
-
-    private Primitive buildCreateGroupRequest(String name, ImpsAddress groupAddress) {
-        Primitive primitive = new Primitive(ImpsTags.CreateGroup_Request);
-        primitive.addElement(ImpsTags.GroupID, groupAddress.getFullName());
-        PrimitiveElement propertiesElem = primitive.addElement(ImpsTags.GroupProperties);
-        propertiesElem.addPropertyChild(ImpsTags.Name, name);
-        propertiesElem.addPropertyChild(ImpsTags.Accesstype, ImpsConstants.Open);
-        propertiesElem.addPropertyChild(ImpsTags.PrivateMessaging, false);
-        propertiesElem.addPropertyChild(ImpsTags.Searchable, false);
-        propertiesElem.addPropertyChild(ImpsTags.AutoDelete, true);
-
-        // TODO: welcome note?
-        primitive.addElement(ImpsTags.JoinGroup, true);
-
-        PrimitiveElement screenName = primitive.addElement(ImpsTags.ScreenName);
-        screenName.addChild(ImpsTags.SName, mConnection.getLoginUserName());
-        screenName.addChild(ImpsTags.GroupID, groupAddress.getFullName());
-
-        primitive.addElement(ImpsTags.SubscribeNotification, true);
-
-        return primitive;
-    }
-
-    private Primitive buildInviteUserRequest(ChatGroup group, Contact contact) {
-        String inviteId = nextInviteID();
-        Primitive request = new Primitive(ImpsTags.Invite_Request);
-        request.addElement(ImpsTags.InviteID, inviteId);
-        request.addElement(ImpsTags.InviteType, ImpsConstants.GROUP_INVITATION);
-
-        // FIXME: <Sender> is only required in IMPS1.3
-        // ImpsGroupAddress groupAddress = (ImpsGroupAddress)group.getAddress();
-        // groupAddress.setScreenName(mConnection.getLoginUser());
-        // request.addElement(ImpsTags.Sender).addChild(groupAddress.toPrimitiveElement());
-
-        request.addElement(ImpsTags.Recipient).addChild(
-                ((ImpsAddress)contact.getAddress()).toPrimitiveElement());
-        request.addElement(ImpsTags.GroupID, group.getAddress().getFullName());
-
-        // FIXME: <ScreenName> is only needed in IMPS1.2
-        PrimitiveElement screenName = request.addElement(ImpsTags.ScreenName);
-        screenName.addChild(ImpsTags.SName, mConnection.getLoginUserName());
-        screenName.addChild(ImpsTags.GroupID, group.getAddress().getFullName());
-        return request;
-    }
-
-    private Primitive buildJoinGroupRequest(Address address) {
-        Primitive request = new Primitive(ImpsTags.JoinGroup_Request);
-        request.addElement(ImpsTags.GroupID, address.getFullName());
-        PrimitiveElement screenName = request.addElement(ImpsTags.ScreenName);
-        screenName.addChild(ImpsTags.SName, mConnection.getLoginUserName());
-        screenName.addChild(ImpsTags.GroupID, address.getFullName());
-
-        request.addElement(ImpsTags.JoinedRequest, true);
-        request.addElement(ImpsTags.SubscribeNotification, true);
-        return request;
-    }
-
-    private Primitive buildLeaveGroupRequest(ChatGroup group) {
-        Primitive leaveRequest = new Primitive(ImpsTags.LeaveGroup_Request);
-        leaveRequest.addElement(ImpsTags.GroupID, group.getAddress().getFullName());
-        return leaveRequest;
-    }
-
-    private Primitive buildRemoveGroupMemberRequest(ChatGroup group, Contact contact) {
-        Primitive request = new Primitive(ImpsTags.RemoveGroupMembers_Request);
-        request.addElement(ImpsTags.GroupID, group.getAddress().getFullName());
-
-        // FIXME: It's UserIDList in 1.3
-        PrimitiveElement userList = request.addElement(ImpsTags.UserList);
-        PrimitiveElement user = userList.addChild(ImpsTags.User);
-        user.addChild(ImpsTags.UserID, contact.getAddress().getFullName());
-        return request;
-    }
-
-    private void extractUserMapList(PrimitiveElement userMapList,
-            ArrayList<Contact> list) {
-        // FIXME: UserMapping is the child of UserMapList in version 1.3
-        PrimitiveElement userMapping = userMapList;
-
-        if (userMapping != null) {
-            for (PrimitiveElement mapping : userMapping.getChildren()) {
-                String name = mapping.getChildContents(ImpsTags.SName);
-                String id = mapping.getChildContents(ImpsTags.UserID);
-                if (id == null) {
-                    id = name;
-                }
-                list.add((Contact)(new ImpsUserAddress(id)).getEntity(mConnection));
-            }
-        }
-    }
-    private static int sInviteID = 0;
-
-    private synchronized String nextInviteID() {
-        return "invite" + System.currentTimeMillis() + (sInviteID++);
-    }
-}
diff --git a/src/com/android/im/imps/ImpsChatSessionManager.java b/src/com/android/im/imps/ImpsChatSessionManager.java
deleted file mode 100644 (file)
index b2c49db..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.util.ArrayList;
-import java.util.Date;
-
-import android.text.format.Time;
-import android.util.TimeFormatException;
-
-import com.android.im.engine.Address;
-import com.android.im.engine.ChatSession;
-import com.android.im.engine.ChatSessionManager;
-import com.android.im.engine.ImEntity;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.Message;
-
-/**
- * The implementation of ChatSessionManager with Wireless Village IMPS protocol.
- */
-public class ImpsChatSessionManager extends ChatSessionManager
-            implements ServerTransactionListener {
-    private ImpsConnection mConnection;
-    private ImpsTransactionManager mTransactionManager;
-    private ArrayList<Message> mMessageQueue;
-    private boolean mStartNotifying;
-
-    ImpsChatSessionManager(ImpsConnection connection) {
-        mConnection = connection;
-        mMessageQueue = new ArrayList<Message>();
-
-        mTransactionManager = connection.getTransactionManager();
-        mTransactionManager.setTransactionListener(ImpsTags.NewMessage, this);
-        mTransactionManager.setTransactionListener(ImpsTags.DeliveryReport_Request, this);
-    }
-
-    @Override
-    protected void sendMessageAsync(final ChatSession ses, final Message message) {
-        // force to send from the currently logged user.
-        message.setFrom(mConnection.getSession().getLoginUserAddress());
-
-        if(message.getDateTime() == null) {
-            message.setDateTime(new Date());
-        }
-        Primitive primitive = createSendMessagePrimitive(message);
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-
-            @Override
-            public void onResponseOk(Primitive response) { }
-
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                ses.onSendMessageError(message, error);
-            }
-        };
-
-        tx.sendRequest(primitive);
-    }
-
-    public void notifyServerTransaction(ServerTransaction tx) {
-        Primitive primitive = tx.getRequest();
-
-        if (ImpsTags.NewMessage.equals(primitive.getType())) {
-            Message msg = extractMessage(primitive);
-
-            // send response to the server.
-            Primitive response = new Primitive(ImpsTags.MessageDelivered);
-            response.addElement(ImpsTags.MessageID, msg.getID());
-            tx.sendResponse(response);
-
-            synchronized(mMessageQueue) {
-                if(mStartNotifying){
-                    processMessage(msg);
-                } else {
-                    mMessageQueue.add(msg);
-                }
-            }
-        } else if(ImpsTags.DeliveryReport_Request.equals(primitive.getType())) {
-            tx.sendStatusResponse(ImpsConstants.SUCCESS_CODE);
-
-            // We only notify the user when an error occurs.
-            ImErrorInfo error = ImpsUtils.checkResultError(primitive);
-            if(error != null) {
-                PrimitiveElement msgInfo = primitive.getElement(ImpsTags.MessageInfo);
-                String msgId = msgInfo.getChildContents(ImpsTags.MessageID);
-                PrimitiveElement recipent = msgInfo.getChild(ImpsTags.Recipient);
-                ImpsAddress recipentAddress = ImpsAddress.fromPrimitiveElement(
-                        recipent.getFirstChild());
-                ChatSession session = findSession(recipentAddress);
-                if(session != null) {
-                    session.onSendMessageError(msgId, error);
-                } else {
-                    ImpsLog.log("Session has closed when received delivery error: "
-                            + error);
-                }
-            }
-        }
-    }
-
-    public void start() {
-        synchronized (mMessageQueue) {
-            mStartNotifying = true;
-            for (Message message : mMessageQueue) {
-                processMessage(message);
-            }
-            mMessageQueue.clear();
-        }
-    }
-
-    /**
-     * Extracts a message from a NewMessage primitive.
-     *
-     * @param primitive
-     *            the NewMessage primitive.
-     * @return an instance of message.
-     */
-    private Message extractMessage(Primitive primitive) {
-        String msgBody = primitive.getElementContents(ImpsTags.ContentData);
-        if (msgBody == null) {
-            msgBody = "";
-        }
-        Message msg = new Message(msgBody);
-
-        PrimitiveElement msgInfo = primitive.getElement(ImpsTags.MessageInfo);
-
-        String id = msgInfo.getChildContents(ImpsTags.MessageID);
-        msg.setID(id);
-
-        PrimitiveElement sender = msgInfo.getChild(ImpsTags.Sender);
-        msg.setFrom(ImpsAddress.fromPrimitiveElement(sender.getFirstChild()));
-
-        PrimitiveElement recipent = msgInfo.getChild(ImpsTags.Recipient);
-        if (recipent != null && recipent.getFirstChild() != null) {
-            msg.setTo(ImpsAddress.fromPrimitiveElement(recipent.getFirstChild()));
-        } else {
-            msg.setTo(mConnection.getLoginUser().getAddress());
-        }
-
-        String dateTime = msgInfo.getChildContents(ImpsTags.DateTime);
-        if (dateTime != null) {
-            try {
-                Time t = new Time();
-                t.parse(dateTime);
-                msg.setDateTime(new Date(t.toMillis(false /* use isDst */)));
-            } catch (TimeFormatException e) {
-                msg.setDateTime(new Date());
-            }
-        } else {
-            msg.setDateTime(new Date());
-        }
-        return msg;
-    }
-
-    /**
-     * Creates a SendMessage-Request primitive to send message.
-     *
-     * @param message the message to send.
-     * @return the SendMessage-Request primitive.
-     */
-    private Primitive createSendMessagePrimitive(Message message) {
-        Primitive primitive = new Primitive(ImpsTags.SendMessage_Request);
-
-        primitive.addElement(ImpsTags.DeliveryReport,
-                mConnection.getConfig().needDeliveryReport());
-
-        PrimitiveElement msgInfo = primitive.addElement(ImpsTags.MessageInfo);
-        PrimitiveElement recipient = msgInfo.addChild(ImpsTags.Recipient);
-        recipient.addChild(((ImpsAddress)message.getTo()).toPrimitiveElement());
-        PrimitiveElement sender = msgInfo.addChild(ImpsTags.Sender);
-        sender.addChild(((ImpsAddress)message.getFrom()).toPrimitiveElement());
-
-        // XXX: ContentType is optional and by default is "text/plain".
-        // However without this the OZ IMPS server wouldn't reply to our
-        // SendMessage requests and just let the HTTP connection times out.
-        msgInfo.addChild(ImpsTags.ContentType, "text/plain");
-
-        // optional
-//        Calendar calendar = Calendar.getInstance();
-//        calendar.setTime(message.getDateTime());
-//        msgInfo.addChild(ImpsTags.DateTime, DateUtils.writeDateTime(calendar));
-
-        String msgBody = message.getBody();
-        msgInfo.addChild(ImpsTags.ContentSize, Integer.toString(msgBody.length()));
-        primitive.addElement(ImpsTags.ContentData, msgBody);
-
-        return primitive;
-    }
-
-    /**
-     * Processes an incoming message. Called by the sub protocol implementation
-     * when an incoming message arrived.
-     *
-     * @param msg the incoming message.
-     */
-    void processMessage(Message msg) {
-        ImpsAddress from = (ImpsAddress) msg.getFrom();
-        ImpsAddress to = (ImpsAddress) msg.getTo();
-
-        ImpsAddress address = (to instanceof ImpsGroupAddress) ? to : from;
-
-        synchronized (this) {
-            ChatSession ses = findSession(address);
-            if (ses == null) {
-                ImEntity participant = address.getEntity(mConnection);
-                if (participant != null) {
-                    ses = createChatSession(address.getEntity(mConnection));
-                } else {
-                    ImpsLog.log("Message from unknown sender");
-                    return;
-                }
-            }
-            ses.onReceiveMessage(msg);
-        }
-    }
-
-    /**
-     * Finds the ChatSession which the message belongs to.
-     *
-     * @param msg the message.
-     * @return the ChatSession or <code>null</code> if the session not exists.
-     */
-    private ChatSession findSession(Address address) {
-        for(ChatSession session : mSessions) {
-            ImEntity participant = session.getParticipant();
-            if(participant.getAddress().equals(address)) {
-                return session;
-            }
-        }
-        return null;
-    }
-}
diff --git a/src/com/android/im/imps/ImpsClientCapability.java b/src/com/android/im/imps/ImpsClientCapability.java
deleted file mode 100644 (file)
index f075846..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import com.android.im.imps.ImpsConnectionConfig.CirMethod;
-import com.android.im.imps.ImpsConnectionConfig.TransportType;
-
-/**
- * The configuration of the capabilities of the client.
- */
-final class ImpsClientCapability {
-
-    private ImpsClientCapability() {
-    }
-
-    /**
-     * Gets the type of the client.
-     *
-     * @return the type of the client.
-     */
-    public static String getClientType() {
-        return "MOBILE_PHONE";
-    }
-
-    /**
-     * Get the maximum number of bytes of XML (WBXML, SMS - depending on the
-     * actual encoding) primitive that the client-side parser can handle.
-     *
-     * @return the maximum number of bytes that the parser can handle.
-     */
-    public static int getParserSize() {
-        // TODO: we do not really have a limit for this for now. Just return
-        // a number big enough.
-        return 256 * 1024;
-    }
-
-    /**
-     * Get the maximum number of bytes of the message content that the client
-     * can handle.
-     *
-     * @return the maximum number of bytes of the message content that the
-     * client can handle.
-     */
-    public static int getAcceptedContentLength() {
-        return 256 * 1024;
-    }
-
-    /**
-     * Gets the maximum number of open transactions from both client and
-     * server side at any given time.
-     *
-     * @return the maximum number of open transactions.
-     */
-    public static int getMultiTrans() {
-        return 1;
-    }
-
-    /**
-     * Gets the maximum number of primitives that the client can handle within
-     * the same transport message at any given time.
-     *
-     * @return the maximum number of primitives within the same transport
-     *         message.
-     */
-    public static int getMultiTransPerMessage() {
-        return 1;
-    }
-
-    /**
-     * Gets the initial IM delivery method that the recipient client prefers in
-     * the set of "PUSH" and "Notify/Get".
-     *
-     * @return "P" if prefers "PUSH", or "N" if prefers "Notify/Get".
-     */
-    public static String getInitialDeliveryMethod() {
-        return "P";
-    }
-
-    /**
-     * Get supported CIR methods in preferred order.
-     *
-     * @return a array of supported CIR methods.
-     */
-    public static CirMethod[] getSupportedCirMethods() {
-        return new CirMethod[] {
-                CirMethod.STCP,
-                CirMethod.SSMS,
-                CirMethod.SHTTP,
-        };
-    }
-
-    /**
-     * Get supported bearers (HTTP(S), WSP, SMS).
-     *
-     * @return the array of supported bearers.
-     */
-    public static TransportType[] getSupportedBearers() {
-        return new TransportType[] {
-                TransportType.HTTP
-        };
-    }
-
-    /**
-     * Get supported Presence attributes
-     *
-     * @return the array of supported Presence attributes
-     */
-    public static String[] getSupportedPresenceAttribs() {
-        return new String[] {
-                ImpsTags.OnlineStatus,
-                ImpsTags.ClientInfo,
-                ImpsTags.UserAvailability,
-                ImpsTags.StatusText,
-                ImpsTags.StatusContent,
-        };
-    };
-
-    /**
-     * Gets the basic presence attributes.
-     *
-     * @return an array of the basic Presence attributes.
-     */
-    public static String[] getBasicPresenceAttributes() {
-        return new String[] {
-                ImpsTags.OnlineStatus,
-                ImpsTags.ClientInfo,
-                ImpsTags.UserAvailability,
-        };
-    }
-
-}
diff --git a/src/com/android/im/imps/ImpsConnection.java b/src/com/android/im/imps/ImpsConnection.java
deleted file mode 100644 (file)
index 8f84cdb..0000000
+++ /dev/null
@@ -1,772 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-import com.android.im.engine.ChatGroupManager;
-import com.android.im.engine.ChatSessionManager;
-import com.android.im.engine.Contact;
-import com.android.im.engine.ContactListManager;
-import com.android.im.engine.ImConnection;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.ImException;
-import com.android.im.engine.LoginInfo;
-import com.android.im.engine.Presence;
-import com.android.im.imps.ImpsConnectionConfig.CirMethod;
-import com.android.im.imps.ImpsConnectionConfig.TransportType;
-import com.android.im.imps.Primitive.TransactionMode;
-
-/**
- * An implementation of ImConnection of Wireless Village IMPS protocol.
- */
-public class ImpsConnection extends ImConnection {
-    ImpsConnectionConfig mConfig;
-
-    DataChannel mDataChannel;
-    private CirChannel mCirChannel;
-    private PrimitiveDispatcherThread mDispatcherThread;
-
-    ImpsSession mSession;
-    ImpsTransactionManager mTransactionManager;
-    private ImpsChatSessionManager mChatSessionManager;
-    private ImpsContactListManager mContactListManager;
-    private ImpsChatGroupManager   mChatGroupManager;
-    private boolean mReestablishing;
-
-    /**
-     * Constructs a new WVConnection with a WVConnectionConfig object.
-     *
-     * @param config the configuration.
-     * @throws ImException if there's an error in the configuration.
-     */
-    public ImpsConnection(ImpsConnectionConfig config) {
-        super();
-
-        mConfig = config;
-
-        mTransactionManager = new ImpsTransactionManager(this);
-        mChatSessionManager = new ImpsChatSessionManager(this);
-        mContactListManager = new ImpsContactListManager(this);
-        mChatGroupManager   = new ImpsChatGroupManager(this);
-    }
-
-    /**
-     * Gets the configuration of this connection.
-     *
-     * @return the configuration.
-     */
-    ImpsConnectionConfig getConfig() {
-        return mConfig;
-    }
-
-    synchronized void shutdownOnError(ImErrorInfo error) {
-        if(mState == DISCONNECTED) {
-            return;
-        }
-
-        if (mCirChannel != null) {
-            mCirChannel.shutdown();
-        }
-        if (mDispatcherThread != null) {
-            mDispatcherThread.shutdown();
-        }
-        if (mDataChannel != null) {
-            mDataChannel.shutdown();
-        }
-        if (mContactListManager != null && !mReestablishing) {
-            mContactListManager.reset();
-        }
-        setState(mReestablishing ? SUSPENDED: DISCONNECTED, error);
-        mReestablishing = false;
-    }
-
-    void shutdown(){
-        shutdownOnError(null);
-    }
-
-    @Override
-    public int getCapability() {
-        return CAPABILITY_GROUP_CHAT | CAPABILITY_SESSION_REESTABLISHMENT;
-    }
-
-    @Override
-    public void loginAsync(LoginInfo loginInfo) {
-        if (!checkAndSetState(DISCONNECTED)) {
-            return;
-        }
-        try {
-            mSession = new ImpsSession(this, loginInfo);
-        } catch (ImException e) {
-            setState(DISCONNECTED, e.getImError());
-            return;
-        }
-        doLogin();
-    }
-
-    @Override
-    public void reestablishSessionAsync(
-            HashMap<String, String> cookie) {
-        if (!checkAndSetState(SUSPENDED)) {
-            return;
-        }
-        // If we can resume from the data channel, which means the
-        // session is still valid, we can just re-use the existing
-        // session and don't need to re-establish it.
-        if (mDataChannel.resume()) {
-            try {
-                setupCIRChannel();
-            } catch(ImException e) {}
-            setState(LOGGED_IN, null);
-        } else {
-            // Failed to resume the data channel which means the
-            // session might have expired, we need to re-establish
-            // the session by signing in again.
-            mReestablishing = true;
-            try {
-                mSession = new ImpsSession(this, cookie);
-            } catch (ImException e) {
-                setState(DISCONNECTED, e.getImError());
-                return;
-            }
-            doLogin();
-        }
-    }
-
-    @Override
-    public void networkTypeChanged() {
-        if (mCirChannel != null) {
-            mCirChannel.reconnect();
-        }
-    }
-
-    private synchronized boolean checkAndSetState(int state) {
-        if(mState != state){
-            return false;
-        }
-        setState(LOGGING_IN, null);
-        return true;
-    }
-
-    private void doLogin() {
-        try {
-            if (mConfig.useSmsAuth()) {
-                mDataChannel = new SmsDataChannel(this);
-            } else {
-                mDataChannel = createDataChannel();
-            }
-            mDataChannel.connect();
-        } catch (ImException e) {
-            ImErrorInfo error = e.getImError();
-            if(error == null){
-                error = new ImErrorInfo(ImErrorInfo.UNKNOWN_LOGIN_ERROR,
-                        e.getMessage());
-            }
-            shutdownOnError(error);
-            return;
-        }
-
-        mDispatcherThread = new PrimitiveDispatcherThread(mDataChannel);
-        mDispatcherThread.start();
-
-        LoginTransaction login = new LoginTransaction();
-        login.startAuthenticate();
-    }
-
-    @Override
-    public HashMap<String, String> getSessionContext() {
-        if(mState != LOGGED_IN) {
-            return null;
-        } else {
-            return mSession.getContext();
-        }
-    }
-
-    class LoginTransaction extends MultiPhaseTransaction {
-
-        LoginTransaction() {
-            // We're not passing completion to ImpsAsyncTransaction. Instead
-            // we'll handle the notification in LoginTransaction.
-            super(mTransactionManager);
-        }
-
-        public void startAuthenticate() {
-            Primitive login = buildBasicLoginReq();
-            if (mConfig.use4wayLogin()) {
-                // first login request of 4 way login
-                String[] supportedDigestSchema = mConfig.getPasswordDigest().getSupportedDigestSchema();
-                for (String element : supportedDigestSchema) {
-                    login.addElement(ImpsTags.DigestSchema, element);
-                }
-            } else {
-                // 2 way login
-                login.addElement(ImpsTags.Password, mSession.getPassword());
-            }
-            sendRequest(login);
-        }
-
-        @Override
-        public TransactionStatus processResponse(Primitive response) {
-            if (response.getElement(ImpsTags.SessionID) != null) {
-                // If server chooses authentication based on network, we might
-                // got the final Login-Response before the 2nd Login-Request.
-                String sessionId = response.getElementContents(ImpsTags.SessionID);
-                String keepAliveTime = response.getElementContents(ImpsTags.KeepAliveTime);
-                String capablityReqeust = response.getElementContents(ImpsTags.CapabilityRequest);
-
-                long keepAlive = ImpsUtils.parseLong(keepAliveTime,
-                        mConfig.getDefaultKeepAliveInterval());
-                // make sure we always have time to send keep-alive requests.
-                // see buildBasicLoginReq().
-                keepAlive -= 5;
-                mSession.setId(sessionId);
-                mSession.setKeepAliveTime(keepAlive);
-                mSession.setCapablityRequestRequired(ImpsUtils.isTrue(capablityReqeust));
-
-                onAuthenticated();
-                return TransactionStatus.TRANSACTION_COMPLETED;
-            } else {
-                return sendSecondLogin(response);
-            }
-        }
-
-        @Override
-        public TransactionStatus processResponseError(ImpsErrorInfo error) {
-            if (error.getCode() == ImpsConstants.STATUS_UNAUTHORIZED
-                    && error.getPrimitive() != null) {
-                if (mConfig.use4wayLogin()) {
-                    // Not really an error. Send the 2nd Login-Request.
-                    return sendSecondLogin(error.getPrimitive());
-                } else {
-                    // We have already sent password in 2way login, while OZ's
-                    // yahoo gateway server returns "401 - Further authorization
-                    // required" instead of "409 - Invalid password" if the
-                    // password only contains spaces.
-                    shutdownOnError(new ImErrorInfo(409, "Invalid password"));
-                    return TransactionStatus.TRANSACTION_COMPLETED;
-                }
-            } else if(error.getCode() == ImpsConstants.STATUS_COULD_NOT_RECOVER_SESSION) {
-                // The server could not recover the session, create a new
-                // session and try to login again.
-                LoginInfo loginInfo = mSession.getLoginInfo();
-                try {
-                    mSession = new ImpsSession(ImpsConnection.this, loginInfo);
-                } catch (ImException ignore) {
-                    // This shouldn't happen since we have tried to login with
-                    // the loginInfo
-                }
-                startAuthenticate();
-                return TransactionStatus.TRANSACTION_COMPLETED;
-            } else {
-                shutdownOnError(error);
-                return TransactionStatus.TRANSACTION_COMPLETED;
-            }
-        }
-
-        private TransactionStatus sendSecondLogin(Primitive res) {
-            try {
-                Primitive secondLogin = buildBasicLoginReq();
-
-                String nonce = res.getElementContents(ImpsTags.Nonce);
-                String digestSchema = res.getElementContents(ImpsTags.DigestSchema);
-                String digestBytes = mConfig.getPasswordDigest().digest(digestSchema, nonce,
-                        mSession.getPassword());
-
-                secondLogin.addElement(ImpsTags.DigestBytes, digestBytes);
-
-                sendRequest(secondLogin);
-                return TransactionStatus.TRANSACTION_CONTINUE;
-            } catch (ImException e) {
-                ImpsLog.logError(e);
-                shutdownOnError(new ImErrorInfo(ImErrorInfo.UNKNOWN_ERROR, e.toString()));
-                return TransactionStatus.TRANSACTION_COMPLETED;
-            }
-        }
-
-        private void onAuthenticated() {
-            // The user has chosen logout before the session established, just
-            // send the Logout-Request in this case.
-            if (mState == LOGGING_OUT) {
-                sendLogoutRequest();
-                return;
-            }
-
-            if (mConfig.useSmsAuth()
-                    && mConfig.getDataChannelBinding() != TransportType.SMS) {
-                // SMS data channel was used if it's set to send authentication
-                // over SMS. Switch to the config data channel after authentication
-                // completed.
-                try {
-                    DataChannel dataChannel = createDataChannel();
-                    dataChannel.connect();
-
-                    mDataChannel.shutdown();
-                    mDataChannel = dataChannel;
-                    mDispatcherThread.changeDataChannel(dataChannel);
-                } catch (ImException e) {
-                    // This should not happen since only http data channel which
-                    // does not do the real network connection in connect() is
-                    // valid here now.
-                    logoutAsync();
-                    return;
-                }
-            }
-
-            if(mSession.isCapablityRequestRequired()) {
-                mSession.negotiateCapabilityAsync(new AsyncCompletion(){
-                    public void onComplete() {
-                        onCapabilityNegotiated();
-                    }
-
-                    public void onError(ImErrorInfo error) {
-                        shutdownOnError(error);
-                    }
-                });
-            } else {
-                onCapabilityNegotiated();
-            }
-        }
-
-        void onCapabilityNegotiated() {
-            mDataChannel.setServerMinPoll(mSession.getServerPollMin());
-            if(getConfig().getCirChannelBinding() != CirMethod.NONE) {
-                try {
-                    setupCIRChannel();
-                } catch (ImException e) {
-                    shutdownOnError(new ImErrorInfo(
-                            ImErrorInfo.UNSUPPORTED_CIR_CHANNEL, e.toString()));
-                    return;
-                }
-            }
-
-            mSession.negotiateServiceAsync(new AsyncCompletion(){
-                public void onComplete() {
-                    onServiceNegotiated();
-                }
-
-                public void onError(ImErrorInfo error) {
-                    shutdownOnError(error);
-                }
-            });
-        }
-
-        void onServiceNegotiated() {
-            mDataChannel.startKeepAlive(mSession.getKeepAliveTime());
-
-            retrieveUserPresenceAsync(new AsyncCompletion() {
-                public void onComplete() {
-                    setState(LOGGED_IN, null);
-                    if (mReestablishing) {
-                        ImpsContactListManager listMgr=  (ImpsContactListManager) getContactListManager();
-                        listMgr.subscribeToAllListAsync();
-                        mReestablishing = false;
-                    }
-                }
-
-                public void onError(ImErrorInfo error) {
-                    // Just continue. initUserPresenceAsync already made a
-                    // default mUserPresence for us.
-                    onComplete();
-                }
-            });
-        }
-    }
-
-    @Override
-    public void logoutAsync() {
-        setState(LOGGING_OUT, null);
-        // Shutdown the CIR channel first.
-        if(mCirChannel != null) {
-            mCirChannel.shutdown();
-            mCirChannel = null;
-        }
-
-        // Only send the Logout-Request if the session has been established.
-        if (mSession.getID() != null) {
-            sendLogoutRequest();
-        }
-    }
-
-    void sendLogoutRequest() {
-        // We cannot shut down our connections in ImpsAsyncTransaction.onResponse()
-        // because at that time the logout transaction itself hasn't ended yet. So
-        // we have to do this in this completion object.
-        AsyncCompletion completion = new AsyncCompletion() {
-            public void onComplete() {
-                shutdown();
-            }
-
-            public void onError(ImErrorInfo error) {
-                // We simply ignore all errors when logging out.
-                // NowIMP responds a <Disconnect> instead of <Status> on logout request.
-                shutdown();
-            }
-        };
-        AsyncTransaction tx = new SimpleAsyncTransaction(mTransactionManager,
-                completion);
-        Primitive logoutPrimitive = new Primitive(ImpsTags.Logout_Request);
-        tx.sendRequest(logoutPrimitive);
-    }
-
-    public ImpsSession getSession() {
-        return mSession;
-    }
-
-    @Override
-    public Contact getLoginUser() {
-        if(mSession == null){
-            return null;
-        }
-        Contact loginUser = mSession.getLoginUser();
-        loginUser.setPresence(getUserPresence());
-        return loginUser;
-    }
-
-    @Override
-    public int[] getSupportedPresenceStatus() {
-        return mConfig.getPresenceMapping().getSupportedPresenceStatus();
-    }
-
-    public ImpsTransactionManager getTransactionManager() {
-        return mTransactionManager;
-    }
-
-    @Override
-    public ChatSessionManager getChatSessionManager() {
-        return mChatSessionManager;
-    }
-
-    @Override
-    public ContactListManager getContactListManager() {
-        return mContactListManager;
-    }
-
-    @Override
-    public ChatGroupManager getChatGroupManager() {
-        return mChatGroupManager;
-    }
-
-    /**
-     * Sends a specific primitive to the server. It will return immediately
-     * after the primitive has been put to the sending queue.
-     *
-     * @param primitive the packet to send.
-     */
-    void sendPrimitive(Primitive primitive) {
-        mDataChannel.sendPrimitive(primitive);
-    }
-
-    /**
-     * Sends a PollingRequest to the server.
-     */
-    void sendPollingRequest() {
-        Primitive pollingRequest = new Primitive(ImpsTags.Polling_Request);
-        pollingRequest.setSession(getSession().getID());
-        mDataChannel.sendPrimitive(pollingRequest);
-    }
-
-    private DataChannel createDataChannel() throws ImException {
-        TransportType dataChannelBinding = mConfig.getDataChannelBinding();
-        if (dataChannelBinding == TransportType.HTTP) {
-            return new HttpDataChannel(this);
-        } else if (dataChannelBinding == TransportType.SMS) {
-            return new SmsDataChannel(this);
-        } else {
-            throw new ImException("Unsupported data channel binding");
-        }
-    }
-
-    void setupCIRChannel() throws ImException {
-        if(mConfig.getDataChannelBinding() == TransportType.SMS) {
-            // No CIR channel is needed, do nothing.
-            return;
-        }
-        CirMethod cirMethod = mSession.getCurrentCirMethod();
-        if (cirMethod == null) {
-            cirMethod = mConfig.getCirChannelBinding();
-
-            if (!mSession.getSupportedCirMethods().contains(cirMethod)) {
-                // Sever don't support the CIR method
-                cirMethod = CirMethod.SHTTP;
-            }
-            mSession.setCurrentCirMethod(cirMethod);
-        }
-
-        if (cirMethod == CirMethod.SHTTP) {
-            mCirChannel = new HttpCirChannel(this, mDataChannel);
-        } else if (cirMethod == CirMethod.STCP) {
-            mCirChannel = new TcpCirChannel(this);
-        } else if (cirMethod == CirMethod.SSMS) {
-            mCirChannel = new SmsCirChannel(this);
-        } else if (cirMethod == CirMethod.NONE) {
-            //Do nothing
-        } else {
-            throw new ImException(ImErrorInfo.UNSUPPORTED_CIR_CHANNEL,
-                    "Unsupported CIR channel binding");
-        }
-
-        if(mCirChannel != null) {
-            mCirChannel.connect();
-        }
-    }
-
-    private class PrimitiveDispatcherThread extends Thread {
-        private boolean stopped;
-        private DataChannel mChannel;
-
-        public PrimitiveDispatcherThread(DataChannel channel)
-        {
-            super("ImpsPrimitiveDispatcher");
-            mChannel = channel;
-        }
-
-        public void changeDataChannel(DataChannel channel) {
-            mChannel = channel;
-            interrupt();
-        }
-
-        @Override
-        public void run() {
-            Primitive primitive = null;
-            while (!stopped) {
-                try {
-                    primitive = mChannel.receivePrimitive();
-                } catch (InterruptedException e) {
-                    if (stopped) {
-                        break;
-                    }
-                    primitive = null;
-                }
-
-                if (primitive != null) {
-                    try {
-                        processIncomingPrimitive(primitive);
-                    } catch (Throwable t) {
-                        // We don't know what is going to happen in the various
-                        // listeners.
-                        ImpsLog.logError("ImpsDispatcher: uncaught Throwable", t);
-                    }
-                }
-            }
-        }
-
-        void shutdown() {
-            stopped = true;
-            interrupt();
-        }
-    }
-
-    /**
-     * Handles the primitive received from the server.
-     *
-     * @param primitive the received primitive.
-     */
-    void processIncomingPrimitive(Primitive primitive) {
-        // if CIR is 'F', the CIR channel is not available. Re-establish it.
-        if (primitive.getCir() != null && ImpsUtils.isFalse(primitive.getCir())) {
-            if(mCirChannel != null) {
-                mCirChannel.shutdown();
-            }
-            try {
-                setupCIRChannel();
-            } catch (ImException e) {
-                e.printStackTrace();
-            }
-        }
-
-        if (primitive.getPoll() != null && ImpsUtils.isTrue(primitive.getPoll())) {
-            sendPollingRequest();
-        }
-
-        if (primitive.getType().equals(ImpsTags.Disconnect)) {
-            if (mState != LOGGING_OUT) {
-                ImErrorInfo error = ImpsUtils.checkResultError(primitive);
-                shutdownOnError(error);
-                return;
-            }
-        }
-
-        if (primitive.getTransactionMode() == TransactionMode.Response) {
-            ImpsErrorInfo error = ImpsUtils.checkResultError(primitive);
-            if (error != null) {
-                int code = error.getCode();
-                if (code == ImpsErrorInfo.SESSION_EXPIRED
-                        || code == ImpsErrorInfo.FORCED_LOGOUT
-                        || code == ImpsErrorInfo.INVALID_SESSION) {
-                    shutdownOnError(error);
-                    return;
-                }
-            }
-        }
-
-        // According to the IMPS spec, only VersionDiscoveryResponse which
-        // are not supported now doesn't have a transaction ID.
-        if (primitive.getTransactionID() != null) {
-            mTransactionManager.notifyIncomingPrimitive(primitive);
-        }
-    }
-
-    @Override
-    protected void doUpdateUserPresenceAsync(Presence presence) {
-        ArrayList<PrimitiveElement> presenceSubList = ImpsPresenceUtils.buildUpdatePresenceElems(
-                mUserPresence, presence, mConfig.getPresenceMapping());
-        Primitive request = buildUpdatePresenceReq(presenceSubList);
-        // Need to make a copy because the presence passed in may change
-        // before the transaction finishes.
-        final Presence newPresence = new Presence(presence);
-
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                savePresenceChange(newPresence);
-                notifyUserPresenceUpdated();
-            }
-
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                notifyUpdateUserPresenceError(error);
-            }
-        };
-        tx.sendRequest(request);
-    }
-
-    void savePresenceChange(Presence newPresence) {
-        mUserPresence.setStatusText(newPresence.getStatusText());
-        mUserPresence.setStatus(newPresence.getStatus());
-        mUserPresence.setAvatar(newPresence.getAvatarData(), newPresence.getAvatarType());
-        // no need to update extended info because it's always read only.
-    }
-
-    void retrieveUserPresenceAsync(final AsyncCompletion completion) {
-        Primitive request = new Primitive(ImpsTags.GetPresence_Request);
-
-        request.addElement(this.getSession().getLoginUserAddress().toPrimitiveElement());
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager){
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                PrimitiveElement presence = response.getElement(ImpsTags.Presence);
-                PrimitiveElement presenceSubList = presence.getChild(ImpsTags.PresenceSubList);
-                mUserPresence = ImpsPresenceUtils.extractPresence(presenceSubList,
-                        mConfig.getPresenceMapping());
-                // XXX: workaround for the OZ IMPS GTalk server that
-                // returns an initial 'F' OnlineStatus. Set the online
-                // status to available in this case.
-                if(mUserPresence.getStatus() == Presence.OFFLINE) {
-                    mUserPresence.setStatus(Presence.AVAILABLE);
-                }
-                compareAndUpdateClientInfo();
-            }
-
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                mUserPresence = new Presence(Presence.AVAILABLE, "", null,
-                        null, Presence.CLIENT_TYPE_MOBILE, ImpsUtils.getClientInfo());
-                completion.onError(error);
-            }
-
-            private void compareAndUpdateClientInfo() {
-                if (!ImpsUtils.getClientInfo().equals(mUserPresence.getExtendedInfo())) {
-                    updateClientInfoAsync(completion);
-                    return;
-                }
-                // no need to update our client info to the server again
-                completion.onComplete();
-            }
-        };
-
-        tx.sendRequest(request);
-    }
-
-    void updateClientInfoAsync(AsyncCompletion completion) {
-        Primitive updatePresenceRequest = buildUpdatePresenceReq(buildClientInfoElem());
-
-        AsyncTransaction tx = new SimpleAsyncTransaction(mTransactionManager,
-                completion);
-        tx.sendRequest(updatePresenceRequest);
-    }
-
-    private Primitive buildUpdatePresenceReq(PrimitiveElement presence) {
-        ArrayList<PrimitiveElement> presences = new ArrayList<PrimitiveElement>();
-
-        presences.add(presence);
-
-        return buildUpdatePresenceReq(presences);
-    }
-
-    private Primitive buildUpdatePresenceReq(ArrayList<PrimitiveElement> presences) {
-        Primitive updatePresenceRequest = new Primitive(ImpsTags.UpdatePresence_Request);
-
-        PrimitiveElement presenceSubList = updatePresenceRequest
-                .addElement(ImpsTags.PresenceSubList);
-        presenceSubList.setAttribute(ImpsTags.XMLNS, mConfig.getPresenceNs());
-
-        for (PrimitiveElement presence : presences) {
-            presenceSubList.addChild(presence);
-        }
-
-        return updatePresenceRequest;
-    }
-
-    private PrimitiveElement buildClientInfoElem() {
-        PrimitiveElement clientInfo = new PrimitiveElement(ImpsTags.ClientInfo);
-        clientInfo.addChild(ImpsTags.Qualifier, true);
-
-        Map<String, String> map = ImpsUtils.getClientInfo();
-        for (Map.Entry<String, String> item : map.entrySet()) {
-            clientInfo.addChild(item.getKey(), item.getValue());
-        }
-
-        return clientInfo;
-    }
-
-    Primitive buildBasicLoginReq() {
-        Primitive login = new Primitive(ImpsTags.Login_Request);
-        login.addElement(ImpsTags.UserID, mSession.getUserName());
-        PrimitiveElement clientId = login.addElement(ImpsTags.ClientID);
-        clientId.addChild(ImpsTags.URL, mConfig.getClientId());
-        if (mConfig.getMsisdn() != null) {
-            clientId.addChild(ImpsTags.MSISDN, mConfig.getMsisdn());
-        }
-        // we request for a bigger TimeToLive value than our default keep
-        // alive interval to make sure we always have time to send the keep
-        // alive requests.
-        login.addElement(ImpsTags.TimeToLive,
-                Integer.toString(mConfig.getDefaultKeepAliveInterval() + 5));
-        login.addElement(ImpsTags.SessionCookie, mSession.getCookie());
-        return login;
-    }
-
-    @Override
-    synchronized public void suspend() {
-        setState(SUSPENDING, null);
-
-        if (mCirChannel != null) {
-            mCirChannel.shutdown();
-        }
-
-        if (mDataChannel != null) {
-            mDataChannel.suspend();
-        }
-
-        setState(SUSPENDED, null);
-    }
-}
diff --git a/src/com/android/im/imps/ImpsConnectionConfig.java b/src/com/android/im/imps/ImpsConnectionConfig.java
deleted file mode 100644 (file)
index 0986dbc..0000000
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.util.Map;
-
-import com.android.im.engine.ConnectionConfig;
-import com.android.im.engine.ImException;
-import com.android.im.imps.ImpsConstants.ImpsVersion;
-import com.android.im.plugin.ImpsConfigNames;
-
-/**
- * The configuration for IMPS connection.
- */
-public class ImpsConnectionConfig extends ConnectionConfig {
-    private static final int DEFAULT_KEEPALIVE_SECONDS  = 2 * 60 * 60; // 2 hour
-    private static final int DEFAULT_MIN_SERVER_POLL    = 30;    // seconds
-
-    private static final int DEFAULT_SMS_PORT = 3590;
-    private static final int DEFAULT_SMS_CIR_PORT = 3716;
-    private static final long DEFAULT_PRESENCE_POLL_INTERVAL = 60 * 1000; // 1 minute
-
-    // DeliveryReport is good for acknowledgment but consumes 2 extra
-    // transactions + 1 possible CIR notification per message. Should not
-    // be enabled on limited/slow connections.
-    private static final boolean NEED_DELIVERY_REPORT   = false;
-
-    private ImpsVersion mImpsVersion = ImpsVersion.IMPS_VERSION_12;
-
-    private TransportType mDataChannelBinding = TransportType.HTTP;
-    private CirMethod mCirChannelBinding = CirMethod.STCP;
-    private EncodingType mDataEncoding = EncodingType.WBXML;
-    private boolean mSecureLogin = true;    // default to use 4-way login
-    private boolean mBasicPresenceOnly = false;
-    private String mHost         = "";
-    private String mClientId     = "JiMMY";
-    private String mMsisdn;
-
-    private int mUdpPort = 3717;
-    private int mReplyTimeout = 45 * 1000;
-
-    private String mContentType;
-    private String mVersionNs;
-    private String mTransactionNs;
-    private String mPresenceNs;
-
-    private PresenceMapping mPresenceMapping;
-    private PasswordDigest mPasswordDigest;
-
-    private String mDefaultDomain;
-
-    private String mCustomPasswordDigest;
-    private String mCustomPresenceMapping;
-
-    private String mPluginPath;
-
-    private Map<String, String> mOthers;
-
-    public ImpsConnectionConfig() {
-        setupVersionStrings();
-    }
-
-    public ImpsConnectionConfig(Map<String, String> map) {
-        String dataChannel = map.get(ImpsConfigNames.DATA_CHANNEL);
-        try {
-            mDataChannelBinding = TransportType.valueOf(dataChannel);
-        } catch (IllegalArgumentException e) {
-            ImpsLog.log("Unknown DataChannel: " + dataChannel +", using HTTP");
-            mDataChannelBinding = TransportType.HTTP;
-        }
-
-        String dataEncoding = map.get(ImpsConfigNames.DATA_ENCODING);
-        try {
-            mDataEncoding = EncodingType.valueOf(dataEncoding);
-        } catch (IllegalArgumentException e) {
-            ImpsLog.log("Unknown DataEncoding: " + dataEncoding +", using WBXML");
-            mDataEncoding = EncodingType.WBXML;
-        }
-
-        String cirChannel = map.get(ImpsConfigNames.CIR_CHANNEL);
-        try {
-            mCirChannelBinding = CirMethod.valueOf(cirChannel);
-        } catch (IllegalArgumentException e) {
-            ImpsLog.log("Unknown CirChannel: " + cirChannel +", using TCP");
-            mCirChannelBinding = CirMethod.STCP;
-        }
-
-        mHost = map.get(ImpsConfigNames.HOST);
-
-        if (map.get(ImpsConfigNames.CLIENT_ID) != null) {
-            mClientId = map.get(ImpsConfigNames.CLIENT_ID);
-        }
-
-        if (map.get(ImpsConfigNames.MSISDN) != null) {
-            mMsisdn = map.get(ImpsConfigNames.MSISDN);
-        }
-        if (map.get(ImpsConfigNames.SECURE_LOGIN) != null) {
-            mSecureLogin = isTrue(map.get(ImpsConfigNames.SECURE_LOGIN));
-        }
-        if (map.get(ImpsConfigNames.BASIC_PA_ONLY) != null) {
-            mBasicPresenceOnly = isTrue(map.get(ImpsConfigNames.BASIC_PA_ONLY));
-        }
-        if (map.containsKey(ImpsConfigNames.VERSION)) {
-            mImpsVersion = ImpsVersion.fromString(
-                    map.get(ImpsConfigNames.VERSION));
-        }
-        setupVersionStrings();
-
-        mDefaultDomain = map.get(ImpsConfigNames.DEFAULT_DOMAIN);
-
-        mPluginPath = map.get(ImpsConfigNames.PLUGIN_PATH);
-        mCustomPasswordDigest = map.get(ImpsConfigNames.CUSTOM_PASSWORD_DIGEST);
-        mCustomPresenceMapping = map.get(ImpsConfigNames.CUSTOM_PRESENCE_MAPPING);
-
-        mOthers = map;
-    }
-
-    @Override
-    public String getProtocolName() {
-        return "IMPS";
-    }
-
-    private void setupVersionStrings() {
-        if (mImpsVersion == ImpsVersion.IMPS_VERSION_11) {
-            if (mDataEncoding == EncodingType.XML) {
-                mContentType = "application/vnd.wv.csp.xml";
-            } else if (mDataEncoding == EncodingType.WBXML) {
-                mContentType = "application/vnd.wv.csp.wbxml";
-            } else if (mDataEncoding == EncodingType.SMS) {
-                mContentType = "application/vnd.wv.csp.sms";
-            }
-            mVersionNs = ImpsConstants.VERSION_11_NS;
-            mTransactionNs = ImpsConstants.TRANSACTION_11_NS;
-            mPresenceNs = ImpsConstants.PRESENCE_11_NS;
-        } else if (mImpsVersion == ImpsVersion.IMPS_VERSION_12) {
-            if (mDataEncoding == EncodingType.XML) {
-                mContentType = "application/vnd.wv.csp.xml";
-            } else if (mDataEncoding == EncodingType.WBXML) {
-                mContentType = "application/vnd.wv.csp.wbxml";
-            } else if (mDataEncoding == EncodingType.SMS) {
-                mContentType = "application/vnd.wv.csp.sms";
-            }
-
-            mVersionNs = ImpsConstants.VERSION_12_NS;
-            mTransactionNs = ImpsConstants.TRANSACTION_12_NS;
-            mPresenceNs = ImpsConstants.PRESENCE_12_NS;
-        } else if (mImpsVersion == ImpsVersion.IMPS_VERSION_13){
-            if (mDataEncoding == EncodingType.XML) {
-                mContentType = "application/vnd.wv.csp+xml";
-            } else if (mDataEncoding == EncodingType.WBXML) {
-                mContentType = "application/vnd.wv.csp+wbxml";
-            } else if (mDataEncoding == EncodingType.SMS) {
-                mContentType = "application/vnd.wv.csp.sms";
-            }
-
-            mVersionNs = ImpsConstants.VERSION_13_NS;
-            mTransactionNs = ImpsConstants.TRANSACTION_13_NS;
-            mPresenceNs = ImpsConstants.PRESENCE_13_NS;
-        }
-    }
-
-    public String getClientId() {
-        return mClientId;
-    }
-
-    public String getMsisdn() {
-        return mMsisdn;
-    }
-
-    public boolean use4wayLogin() {
-        return mSecureLogin;
-    }
-
-    public boolean useSmsAuth() {
-        return isTrue(mOthers.get(ImpsConfigNames.SMS_AUTH));
-    }
-
-    public boolean needDeliveryReport() {
-        return NEED_DELIVERY_REPORT;
-    }
-
-    /**
-     * Gets the type of protocol binding for data channel.
-     *
-     * @return the type of protocol binding for data channel.
-     */
-    public TransportType getDataChannelBinding() {
-        return mDataChannelBinding;
-    }
-
-    /**
-     * Gets the type of protocol binding for CIR channel.
-     *
-     * @return the type of protocol binding for CIR channel.
-     */
-    public CirMethod getCirChannelBinding() {
-        return mCirChannelBinding;
-    }
-
-    /**
-     * Gets the host name of the server.
-     *
-     * @return the host name of the server.
-     */
-    public String getHost() {
-        return mHost;
-    }
-
-    /**
-     * Sets the host name of the server.
-     *
-     * @param host the host name.
-     */
-    public void setHost(String host) {
-        mHost = host;
-    }
-
-    /**
-     * Gets the number of milliseconds to wait for a response from the server.
-     * The default value is 45 seconds.
-     *
-     * @return the milliseconds to wait for a response from the server
-     */
-    public int getReplyTimeout() {
-        return mReplyTimeout;
-    }
-
-    /**
-     * XXX: Workaround for the OZ IMPS GTalk server which supports only basic
-     * presence attributes and don't support GetAttributeList.
-     *
-     * @return <code>true</code> if only basic presence attribute is
-     *         supported.
-     */
-    public boolean supportBasicPresenceOnly() {
-        return mBasicPresenceOnly;
-    }
-
-    public String getTransportContentType() {
-        return mContentType;
-    }
-
-    public ImpsVersion getImpsVersion() {
-        return mImpsVersion;
-    }
-
-    // TODO: should remove this and let the serializer to handle all the name
-    // spaces.
-    public String getPresenceNs() {
-        return mPresenceNs;
-    }
-
-    public PrimitiveParser createPrimitiveParser() throws ImException {
-        if(mDataEncoding == EncodingType.WBXML) {
-            return new WbxmlPrimitiveParser();
-        } else if (mDataEncoding == EncodingType.XML) {
-            return new XmlPrimitiveParser();
-        } else if (mDataEncoding == EncodingType.SMS) {
-            return new PtsPrimitiveParser();
-        }
-
-        ImpsLog.log("Unknown DataEncoding: " + mDataEncoding);
-        return null;
-    }
-
-    public PrimitiveSerializer createPrimitiveSerializer() {
-        if(mDataEncoding == EncodingType.WBXML) {
-            return new WbxmlPrimitiveSerializer(mImpsVersion,
-                    mVersionNs, mTransactionNs);
-        } else if (mDataEncoding == EncodingType.XML) {
-            return new XmlPrimitiveSerializer(mVersionNs, mTransactionNs);
-        } else if (mDataEncoding == EncodingType.SMS) {
-            try {
-                return new PtsPrimitiveSerializer(mImpsVersion);
-            } catch (SerializerException e) {
-                ImpsLog.logError(e);
-                return null;
-            }
-        }
-
-        ImpsLog.log("Unknown DataEncoding: " + mDataEncoding);
-        return null;
-    }
-
-    /**
-     * Gets the port number for the standalone UDP/IP CIR method. This is only
-     * useful when UDP CIR method is used. The default port number is 3717.
-     *
-     * @return the port number for the standalone UDP/IP CIR method.
-     */
-    public int getUdpPort() {
-        return mUdpPort;
-    }
-
-    public String getSmsAddr() {
-        return mOthers.get(ImpsConfigNames.SMS_ADDR);
-    }
-
-    public int getSmsPort() {
-        String value = mOthers.get(ImpsConfigNames.SMS_PORT);
-        if (value == null) {
-            return DEFAULT_SMS_PORT;
-        }
-        try {
-            return Integer.parseInt(value);
-        } catch (NumberFormatException e) {
-            return DEFAULT_SMS_PORT;
-        }
-    }
-
-    public String getSmsCirAddr() {
-        return mOthers.get(ImpsConfigNames.SMS_CIR_ADDR);
-    }
-
-    public int getSmsCirPort() {
-        String value = mOthers.get(ImpsConfigNames.SMS_CIR_PORT);
-        if (value == null) {
-            return DEFAULT_SMS_CIR_PORT;
-        }
-        try {
-            return Integer.parseInt(value);
-        } catch (NumberFormatException e) {
-            return DEFAULT_SMS_CIR_PORT;
-        }
-    }
-
-    public boolean usePrensencePolling() {
-        String value = mOthers.get(ImpsConfigNames.POLL_PRESENCE);
-        return isTrue(value);
-    }
-
-    public long getPresencePollInterval() {
-        String value = mOthers.get(ImpsConfigNames.PRESENCE_POLLING_INTERVAL);
-        if (value == null) {
-            return DEFAULT_PRESENCE_POLL_INTERVAL;
-        }
-        try {
-            return Long.parseLong(value);
-        } catch (NumberFormatException e) {
-            return DEFAULT_PRESENCE_POLL_INTERVAL;
-        }
-    }
-
-    public int getDefaultServerPollMin() {
-        return DEFAULT_MIN_SERVER_POLL;
-    }
-
-    public int getDefaultKeepAliveInterval() {
-        return DEFAULT_KEEPALIVE_SECONDS;
-    }
-
-    public PresenceMapping getPresenceMapping() {
-        if (mPresenceMapping != null) {
-            return mPresenceMapping;
-        }
-
-        if (mCustomPresenceMapping != null) {
-            try {
-                mPresenceMapping = new CustomPresenceMapping(mPluginPath,
-                        mCustomPresenceMapping);
-            } catch (ImException e) {
-                ImpsLog.logError("Failed to load custom presence mapping", e);
-            }
-        }
-
-        if (mPresenceMapping == null) {
-            mPresenceMapping = new DefaultPresenceMapping();
-        }
-        return mPresenceMapping;
-    }
-
-    public PasswordDigest getPasswordDigest() {
-        if (mPasswordDigest != null) {
-            return mPasswordDigest;
-        }
-
-        if (mCustomPasswordDigest != null) {
-            try {
-                mPasswordDigest = new CustomPasswordDigest(mPluginPath, mCustomPasswordDigest);
-            } catch (ImException e) {
-                ImpsLog.logError("Can't load custom password digest method", e);
-            }
-        }
-
-        if (mPasswordDigest == null) {
-            mPasswordDigest = new StandardPasswordDigest();
-        }
-        return mPasswordDigest;
-    }
-
-    public String getDefaultDomain() {
-        return mDefaultDomain;
-    }
-
-    private boolean isTrue(String value) {
-        return "true".equalsIgnoreCase(value);
-    }
-
-    /**
-     * Represents the type of protocol binding for data channel.
-     */
-    public static enum TransportType {
-        WAP, HTTP, HTTPS, SMS,
-    }
-
-    /**
-     * Represents the type of the data encoding.
-     */
-    public static enum EncodingType {
-        XML, WBXML, SMS,
-    }
-
-    /**
-     * Represents the type of protocol binding for CIR channel.
-     */
-    public static enum CirMethod {
-        /**
-         * WAP 1.2 or WAP 2.0 push using WSP unit push message and SMS as a
-         * bearer
-         */
-        WAPSMS,
-
-        /**
-         * WAP 1.2 or WAP 2.0 push using WSP unit push message and UDP/IP as a
-         * bearer
-         */
-        WAPUDP,
-
-        /**
-         * Standalone SMS binding
-         */
-        SSMS,
-
-        /**
-         * Standalone UDP/IP binding
-         */
-        SUDP,
-
-        /**
-         * Standalone TCP/IP binding
-         */
-        STCP,
-
-        /**
-         * Standalone HTTP binding
-         */
-        SHTTP,
-
-        /**
-         * No CIR channel
-         */
-        NONE,
-    }
-}
diff --git a/src/com/android/im/imps/ImpsConstants.java b/src/com/android/im/imps/ImpsConstants.java
deleted file mode 100644 (file)
index 0bc8378..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-public class ImpsConstants {
-
-    public static enum ImpsVersion {
-        IMPS_VERSION_11,
-        IMPS_VERSION_12,
-        IMPS_VERSION_13;
-
-        public static ImpsVersion fromString(String value) {
-            if ("1.1".equals(value)) {
-                return IMPS_VERSION_11;
-            } else if ("1.2".equals(value)) {
-                return IMPS_VERSION_12;
-            } else if ("1.3".equals(value)) {
-                return IMPS_VERSION_13;
-            } else {
-                // Unknown version, use 1.2 as default
-                return IMPS_VERSION_12;
-            }
-        }
-    }
-
-    // TODO: move these to some place else?
-    public static final String CLIENT_PRODUCER = "MOKIA";
-    public static final String CLIENT_VERSION = "0.1";
-
-    public static final String VERSION_11_NS
-        = "http://www.wireless-village.org/CSP1.1";
-    public static final String TRANSACTION_11_NS
-        = "http://www.wireless-village.org/TRC1.1";
-    public static final String PRESENCE_11_NS
-        = "http://www.wireless-village.org/PA1.1";
-
-    public static final String VERSION_12_NS
-        = "http://www.openmobilealliance.org/DTD/WV-CSP1.2";
-    public static final String TRANSACTION_12_NS
-        = "http://www.openmobilealliance.org/DTD/WV-TRC1.2";
-    public static final String PRESENCE_12_NS
-        = "http://www.openmobilealliance.org/DTD/WV-PA1.2";
-
-    public static final String VERSION_13_NS
-        = "http://www.openmobilealliance.org/DTD/IMPS-CSP1.3";
-    public static final String TRANSACTION_13_NS
-        = "http://www.openmobilealliance.org/DTD/IMPS-TRC1.3";
-    public static final String PRESENCE_13_NS
-        = "http://www.openmobilealliance.org/DTD/IMPS-PA1.3";
-
-    public static final String ADDRESS_PREFIX = "wv:";
-
-    public static final String TRUE = "T";
-    public static final String FALSE = "F";
-    public static final String SUCCESS_CODE = "200";
-    public static final String Open = "Open";
-    public static final String DisplayName = "DisplayName";
-    public static final String GROUP_INVITATION = "GR";
-    public static final String Default = "Default";
-
-    public static final int STATUS_UNAUTHORIZED  = 401;
-    public static final int STATUS_NOT_IMPLEMENTED = 501;
-    public static final int STATUS_COULD_NOT_RECOVER_SESSION = 502;
-    // status 760 is IMPS 1.2 only
-    public static final int STATUS_AUTO_SUBSCRIPTION_NOT_SUPPORTED = 760;
-
-    /** presence UserAvailability values */
-    public static final String PRESENCE_AVAILABLE = "AVAILABLE";
-    public static final String PRESENCE_NOT_AVAILABLE = "NOT_AVAILABLE";
-    public static final String PRESENCE_DISCREET = "DISCREET";
-
-    /** presence ClientType values */
-    public static final String PRESENCE_MOBILE_PHONE = "MOBILE_PHONE";
-    public static final String PRESENCE_COMPUTER     = "COMPUTER";
-    public static final String PRESENCE_PDA          = "PDA";
-    public static final String PRESENCE_CLI          = "CLI";
-    public static final String PRESENCE_OTHER        = "OTHER";
-
-    public static final String COMMC_CAP_IM      = "IM";
-}
diff --git a/src/com/android/im/imps/ImpsContactListAddress.java b/src/com/android/im/imps/ImpsContactListAddress.java
deleted file mode 100644 (file)
index 775f094..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import com.android.im.engine.ContactList;
-import com.android.im.engine.ContactListManager;
-import com.android.im.engine.ImEntity;
-
-public class ImpsContactListAddress extends ImpsAddress{
-
-    /**
-     * Default Constructor. Required by AddressParcelHelper.
-     */
-    public ImpsContactListAddress() {
-    }
-
-    public ImpsContactListAddress(ImpsAddress userAddress, String name) {
-        super(userAddress.getUser(), name, userAddress.getDomain());
-        if(mResource == null) {
-            throw new IllegalArgumentException("resource can not be null");
-        }
-    }
-
-    public ImpsContactListAddress(String full, boolean verify) {
-        super(full, verify);
-        if(mResource == null) {
-            throw new IllegalArgumentException("resource can not be null");
-        }
-    }
-
-    public ImpsContactListAddress(String full) {
-        this(full, false);
-    }
-
-    @Override
-    public PrimitiveElement toPrimitiveElement() {
-        PrimitiveElement contactList = new PrimitiveElement(ImpsTags.ContactList);
-        contactList.setContents(getFullName());
-        return contactList;
-    }
-
-    @Override
-    public String getScreenName() {
-        return getResource();
-    }
-
-    @Override
-    public ImEntity getEntity(ImpsConnection connection) {
-        ContactListManager manager = connection.getContactListManager();
-        for(ContactList list : manager.getContactLists()) {
-            if(list.getAddress().equals(this)) {
-                return list;
-            }
-        }
-        return null;
-    }
-
-}
diff --git a/src/com/android/im/imps/ImpsContactListManager.java b/src/com/android/im/imps/ImpsContactListManager.java
deleted file mode 100644 (file)
index cc6e369..0000000
+++ /dev/null
@@ -1,1016 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Vector;
-
-import com.android.im.engine.Address;
-import com.android.im.engine.Contact;
-import com.android.im.engine.ContactList;
-import com.android.im.engine.ContactListListener;
-import com.android.im.engine.ContactListManager;
-import com.android.im.engine.ImConnection;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.ImException;
-import com.android.im.engine.Presence;
-import com.android.im.engine.SubscriptionRequestListener;
-import com.android.im.imps.ImpsConstants.ImpsVersion;
-
-/**
- * An implementation of ContactListManager of Wireless Village IMPS protocol.
- */
-public class ImpsContactListManager extends ContactListManager
-        implements ServerTransactionListener {
-    private ImpsConnection mConnection;
-    private String mDefaultDomain;
-    ImpsTransactionManager mTransactionManager;
-    ImpsConnectionConfig mConfig;
-
-    boolean mAllowAutoSubscribe = true;
-
-    ArrayList<Contact> mSubscriptionRequests;
-
-    /**
-     * Constructs the manager with specific connection.
-     *
-     * @param connection the connection related to the manager
-     */
-    ImpsContactListManager(ImpsConnection connection) {
-        mConnection = connection;
-        mConfig = connection.getConfig();
-        mDefaultDomain = mConfig.getDefaultDomain();
-        mTransactionManager = connection.getTransactionManager();
-
-        mTransactionManager.setTransactionListener(
-                ImpsTags.PresenceNotification_Request, this);
-        mTransactionManager.setTransactionListener(
-                ImpsTags.PresenceAuth_Request, this);
-    }
-
-    @Override
-    public Contact createTemporaryContact(String address){
-        ImpsAddress impsAddr = new ImpsUserAddress(normalizeAddress(address));
-        return new Contact(impsAddr, impsAddr.getScreenName());
-    }
-
-    @Override
-    public String normalizeAddress(String address) {
-        String s = address.toLowerCase();
-        if (!s.startsWith(ImpsConstants.ADDRESS_PREFIX)) {
-            s = ImpsConstants.ADDRESS_PREFIX + s;
-        }
-        if (mDefaultDomain != null && s.indexOf('@') == -1) {
-            s = s + "@" + mDefaultDomain;
-        }
-        return s;
-    }
-
-    @Override
-    public synchronized void loadContactListsAsync() {
-        if (getState() != LISTS_NOT_LOADED) {
-            return;
-        }
-
-        setState(LISTS_LOADING);
-
-        // load blocked list first
-        Primitive request = new Primitive(ImpsTags.GetBlockedList_Request);
-
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                // don't notify the 501 not implemented error
-                if (error.getCode() != ImpsConstants.STATUS_NOT_IMPLEMENTED) {
-                    notifyContactError(
-                            ContactListListener.ERROR_LOADING_BLOCK_LIST,
-                            error, null, null);
-                }
-
-                next();
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                extractBlockedContacts(response);
-
-                next();
-            }
-
-            private void next() {
-                setState(BLOCKED_LIST_LOADED);
-                new LoadContactsTransaction().startGetContactLists();
-                //createDefaultAttributeListAsync();
-            }
-        };
-
-        tx.sendRequest(request);
-    }
-
-    Vector<ImpsContactListAddress> extractListAddresses(Primitive response){
-        Vector<ImpsContactListAddress> addresses = new Vector<ImpsContactListAddress>();
-
-        for (PrimitiveElement child : response.getContentElement()
-                .getChildren()) {
-            if (child.getTagName().equals(ImpsTags.ContactList)) {
-                // FIXME: ignore the PEP contact lists for now
-                // PEP: "Presence Enhanced Phonebook and Instant Messaging
-                // Application Category" specification from Nokia and SonyEricsson.
-                //  ~IM_subscriptions
-                //  ~pep1.0_privatelist
-                //  ~pep1.0_blocklist
-                //  ~pep1.0_friendlist
-                //  ~pep1.0_subscriptions-*
-                if (child.getContents().contains("/~pep1.0_")) {
-                    continue;
-                }
-                addresses.add(new ImpsContactListAddress(child.getContents()));
-            }
-        }
-
-        String defaultListAddress = response.getElementContents(ImpsTags.DefaultContactList);
-        if (null != defaultListAddress) {
-            addresses.add(new ImpsContactListAddress(defaultListAddress));
-        }
-
-        return addresses;
-    }
-
-    public void fetchPresence(ImpsAddress[] addresses) {
-        if (addresses == null || addresses.length == 0) {
-            return;
-        }
-
-        Primitive request = new Primitive(ImpsTags.GetPresence_Request);
-        for (ImpsAddress addr : addresses) {
-            request.addElement(addr.toPrimitiveElement());
-        }
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager){
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                ImpsLog.logError("Failed to get presence:" + error.toString());
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                extractAndNotifyPresence(response.getContentElement());
-            }
-        };
-        tx.sendRequest(request);
-    }
-
-    public ImpsAddress[] getAllListAddress() {
-        int count = mContactLists.size();
-        ImpsAddress[] res = new ImpsContactListAddress[count];
-
-        int index = 0;
-        for (ContactList l : mContactLists) {
-            res[index++] = (ImpsContactListAddress) l.getAddress();
-        }
-
-        return res;
-    }
-
-//    void createDefaultAttributeListAsync() {
-//        Primitive request = new Primitive(ImpsTags.CreateAttributeList_Request);
-//
-//        PrimitiveElement presenceList = request.addElement(ImpsTags.PresenceSubList);
-//        presenceList.setAttribute(ImpsTags.XMLNS, mConnection.getConfig().getPresenceNs());
-//
-//        for (String tagName : ImpsClientCapability.getSupportedPresenceAttribs()) {
-//            presenceList.addChild(tagName);
-//        }
-//
-//        request.addElement(ImpsTags.DefaultList, true);
-//
-//        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-//            @Override
-//            public void onResponseError(ImpsErrorInfo error) {
-//                // don't notify the 501 not implemented error
-//                if(error.getCode() != ImpsConstants.STATUS_NOT_IMPLEMENTED) {
-//                    // TODO: not ERROR_RETRIEVING_PRESENCE exactly here...
-//                    notifyContactError(
-//                            ContactListListener.ERROR_RETRIEVING_PRESENCE,
-//                            error, null, null);
-//                }
-//            }
-//
-//            @Override
-//            public void onResponseOk(Primitive response) {}
-//        };
-//
-//        tx.sendRequest(request);
-//    }
-
-    @Override
-    public void approveSubscriptionRequest(String contact) {
-        handleSubscriptionRequest(contact, true);
-    }
-
-    @Override
-    public void declineSubscriptionRequest(String contact) {
-        handleSubscriptionRequest(contact, false);
-    }
-
-    private void handleSubscriptionRequest(final String contact, final boolean accept) {
-
-        Primitive request = new Primitive(ImpsTags.PresenceAuthUser);
-        request.addElement(ImpsTags.UserID, contact);
-        request.addElement(ImpsTags.Acceptance, accept);
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager){
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                SubscriptionRequestListener listener = getSubscriptionRequestListener();
-                if (listener != null) {
-                    if (accept) {
-                        listener.onApproveSubScriptionError(contact, error);
-                    } else {
-                        listener.onDeclineSubScriptionError(contact, error);
-                    }
-                }
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                SubscriptionRequestListener listener = getSubscriptionRequestListener();
-                if (listener != null) {
-                    if (accept) {
-                        listener.onSubscriptionApproved(contact);
-                    } else {
-                        listener.onSubscriptionDeclined(contact);
-                    }
-                }
-            }
-        };
-        tx.sendRequest(request);
-    }
-
-    void subscribeToAllListAsync() {
-        AsyncCompletion completion = new AsyncCompletion(){
-            public void onComplete() {
-                // do nothing
-            }
-            public void onError(ImErrorInfo error) {
-                notifyContactError(ContactListListener.ERROR_RETRIEVING_PRESENCE,
-                        error, null, null);
-            }
-        };
-        subscribeToListsAsync(mContactLists,completion);
-    }
-
-    void subscribeToListAsync(final ContactList list, final AsyncCompletion completion) {
-        Vector<ContactList> lists = new Vector<ContactList>();
-
-        lists.add(list);
-
-        subscribeToListsAsync(lists, completion);
-    }
-
-    void subscribeToListsAsync(final Vector<ContactList> contactLists,
-            final AsyncCompletion completion) {
-        if (contactLists.isEmpty()) {
-            return;
-        }
-
-        Primitive request = buildSubscribeToListsRequest(contactLists);
-
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                if (error.getCode()
-                        == ImpsConstants.STATUS_AUTO_SUBSCRIPTION_NOT_SUPPORTED) {
-                    mAllowAutoSubscribe = false;
-                    ArrayList<Contact> contacts = new ArrayList<Contact>();
-                    for (ContactList list : contactLists) {
-                        contacts.addAll(list.getContacts());
-                    }
-
-                    subscribeToContactsAsync(contacts, completion);
-                } else {
-                    if (completion != null) {
-                        completion.onError(error);
-                    }
-                }
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                if (completion != null) {
-                    completion.onComplete();
-                }
-            }
-
-        };
-
-        tx.sendRequest(request);
-    }
-
-    void subscribeToContactsAsync(ArrayList<Contact> contacts, AsyncCompletion completion) {
-        Primitive request = buildSubscribeToContactsRequest(contacts);
-
-        SimpleAsyncTransaction tx = new SimpleAsyncTransaction(mTransactionManager, completion);
-
-        tx.sendRequest(request);
-    }
-
-    void unsubscribeToListAsync(ContactList list, AsyncCompletion completion) {
-        Primitive request = new Primitive(ImpsTags.UnsubscribePresence_Request);
-        request.addElement(ImpsTags.ContactList, list.getAddress().getFullName());
-
-        SimpleAsyncTransaction tx = new SimpleAsyncTransaction(
-                mTransactionManager, completion);
-
-        tx.sendRequest(request);
-    }
-
-    void unsubscribeToContactAsync(Contact contact, AsyncCompletion completion) {
-        Primitive request = new Primitive(ImpsTags.UnsubscribePresence_Request);
-        request.addElement(ImpsTags.User).addPropertyChild(ImpsTags.UserID,
-                contact.getAddress().getFullName());
-
-        SimpleAsyncTransaction tx = new SimpleAsyncTransaction(
-                mTransactionManager, completion);
-
-        tx.sendRequest(request);
-    }
-
-    private Primitive buildSubscribeToContactsRequest(ArrayList<Contact> contacts) {
-        ArrayList<ImpsAddress> addresses = new ArrayList<ImpsAddress>();
-
-        for (Contact contact : contacts) {
-            addresses.add((ImpsAddress)contact.getAddress());
-        }
-
-        Primitive request = buildSubscribePresenceRequest(addresses);
-        return request;
-    }
-
-    @Override
-    protected void doCreateContactListAsync(final String name,
-            Collection<Contact> contacts,
-            final boolean isDefault) {
-        ImpsAddress selfAddress = mConnection.getSession().getLoginUserAddress();
-        ImpsAddress listAddress = new ImpsContactListAddress(selfAddress, name);
-
-        final ContactList list = new ContactList(listAddress, name,
-                isDefault, contacts, this);
-
-        Primitive createListRequest = buildCreateListReq(name, contacts,
-                isDefault, listAddress);
-
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                notifyContactError(ContactListListener.ERROR_CREATING_LIST,
-                        error, name, null);
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                notifyContactListCreated(list);
-
-                if (mConfig.usePrensencePolling()) {
-                    getPresencePollingManager().resetPollingContacts();
-                } else {
-                    subscribeToListAsync(list, null);
-                }
-            }
-        };
-
-        tx.sendRequest(createListRequest);
-    }
-
-    private Primitive buildCreateListReq(String name,
-            Collection<Contact> contacts, boolean isDefault,
-            ImpsAddress listAddress) {
-        Primitive createListRequest = new Primitive(ImpsTags.CreateList_Request);
-        createListRequest.addElement(listAddress.toPrimitiveElement());
-
-        // add initial contacts, if any
-        if (null != contacts && !contacts.isEmpty()) {
-            PrimitiveElement nickList = createListRequest.addElement(ImpsTags.NickList);
-
-            for (Contact contact : contacts) {
-                nickList.addChild(buildNickNameElem(contact));
-            }
-        }
-
-        PrimitiveElement contactListProp = createListRequest.addElement(
-                ImpsTags.ContactListProperties);
-
-        contactListProp.addPropertyChild(ImpsConstants.DisplayName, name);
-        contactListProp.addPropertyChild(ImpsConstants.Default,
-                ImpsUtils.toImpsBool(isDefault));
-
-        return createListRequest;
-    }
-
-    /**
-     * Delete a specified contact list asyncLoginWrapper.
-     *
-     * @param list the contact list to be deleted
-     */
-    @Override
-    public void doDeleteContactListAsync(final ContactList list) {
-        Primitive delListRequest = buildDelListReq(list);
-
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                notifyContactError(ContactListListener.ERROR_DELETING_LIST,
-                        error, list.getName(), null);
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                notifyContactListDeleted(list);
-                if (mConfig.usePrensencePolling()) {
-                    getPresencePollingManager().resetPollingContacts();
-                } else if (!mAllowAutoSubscribe) {
-                    unsubscribeToListAsync(list, new AsyncCompletion(){
-                        public void onComplete() {}
-
-                        public void onError(ImErrorInfo error) {
-                            // don't bother to alert this error since the
-                            // list has already been removed.
-                            ImpsLog.log("Warning: unsubscribing list presence failed");
-                        }
-                    });
-                }
-            }
-        };
-
-        tx.sendRequest(delListRequest);
-    }
-
-    private Primitive buildDelListReq(final ContactList list) {
-        Primitive delListRequest = new Primitive(ImpsTags.DeleteList_Request);
-        delListRequest.addElement(((ImpsAddress)list.getAddress())
-                .toPrimitiveElement());
-        return delListRequest;
-    }
-
-    private Primitive buildListManageRequest(ContactList list, Collection<Contact> contactsToAdd,
-            Collection<Contact> contactsToRemove, String listName) {
-        // Create ListManage request
-        Primitive req = new Primitive(ImpsTags.ListManage_Request);
-        req.addElement(((ImpsAddress)list.getAddress()).toPrimitiveElement());
-        req.addElement(ImpsTags.ReceiveList, false);
-
-        // If there are any pending added contacts, add them to the addNickList
-        if (contactsToAdd != null && !contactsToAdd.isEmpty()) {
-            PrimitiveElement addList = req.addElement(ImpsTags.AddNickList);
-
-            for (Contact c : contactsToAdd) {
-                PrimitiveElement nickNameElem = addList.addChild(ImpsTags.NickName);
-                nickNameElem.addChild(ImpsTags.Name, c.getName());
-                nickNameElem.addChild(ImpsTags.UserID, c.getAddress().getFullName());
-            }
-        }
-
-        // If there are any pending removed contacts, add them to the removeNickList
-        if (contactsToRemove != null && !contactsToRemove.isEmpty()) {
-            PrimitiveElement removeList = req.addElement(ImpsTags.RemoveNickList);
-
-            for (Contact c : contactsToRemove) {
-                removeList.addChild(ImpsTags.UserID, c.getAddress().getFullName());
-            }
-        }
-
-        // Add the list properties
-        if (listName != null) {
-            PrimitiveElement requestProps = req.addElement(ImpsTags.ContactListProperties);
-            requestProps.addPropertyChild(ImpsConstants.DisplayName, listName);
-        }
-
-        return req;
-    }
-
-    private Primitive buildSubscribeToListsRequest(Collection<ContactList> lists) {
-        ArrayList<ImpsAddress> addresses = new ArrayList<ImpsAddress>();
-
-        for (ContactList list : lists) {
-            addresses.add((ImpsAddress)list.getAddress());
-        }
-
-        Primitive subscribePresenceRequest = buildSubscribePresenceRequest(addresses);
-
-        subscribePresenceRequest.addElement(ImpsTags.AutoSubscribe, true);
-
-        return subscribePresenceRequest;
-    }
-
-    private Primitive buildSubscribePresenceRequest(ArrayList<ImpsAddress> addresses) {
-        Primitive request = new Primitive(ImpsTags.SubscribePresence_Request);
-
-        // XXX: Workaround on OZ IMPS GTalk server which only supports a few
-        // basic presence attributes. The PresenceSubList is optional and an
-        // empty List or missing list indicates all available presence
-        // attributes are desired but the OZ server doens't quite follow the
-        // spec here. It won't send any PresenceNotification either when we
-        // don't send PresenceSubList or we request more PA than it supports.
-        if(mConfig.supportBasicPresenceOnly()){
-            PrimitiveElement presenceList = request.addElement(ImpsTags.PresenceSubList);
-            presenceList.setAttribute(ImpsTags.XMLNS, mConfig.getPresenceNs());
-            for(String pa : ImpsClientCapability.getBasicPresenceAttributes()) {
-                presenceList.addChild(pa);
-            }
-        }
-
-        for (ImpsAddress address : addresses) {
-            request.addElement(address.toPrimitiveElement());
-        }
-
-        return request;
-    }
-
-    public void notifyServerTransaction(ServerTransaction tx) {
-        Primitive request = tx.getRequest();
-        String type = request.getType();
-        if (ImpsTags.PresenceNotification_Request.equals(type)) {
-            tx.sendStatusResponse(ImpsConstants.SUCCESS_CODE);
-
-            PrimitiveElement content = request.getContentElement();
-            extractAndNotifyPresence(content);
-        } else if (ImpsTags.PresenceAuth_Request.equals(type)) {
-            tx.sendStatusResponse(ImpsConstants.SUCCESS_CODE);
-
-            String userId = request.getElementContents(ImpsTags.UserID);
-            Contact contact = getContact(userId);
-            if (contact == null) {
-                ImpsAddress address = new ImpsUserAddress(userId);
-                contact = new Contact(address, address.getScreenName());
-            }
-            if (getState() < LISTS_LOADED) {
-                if (mSubscriptionRequests == null) {
-                    mSubscriptionRequests = new ArrayList<Contact>();
-                }
-                mSubscriptionRequests.add(contact);
-            } else {
-                SubscriptionRequestListener listener = getSubscriptionRequestListener();
-                if (listener != null) {
-                    listener.onSubScriptionRequest(contact);
-                }
-            }
-        }
-    }
-
-    private void extractAndNotifyPresence(PrimitiveElement content) {
-        ArrayList<Contact> updated = new ArrayList<Contact>();
-        PresenceMapping presenceMapping = mConfig.getPresenceMapping();
-
-        ArrayList<PrimitiveElement> presenceList = content.getChildren(ImpsTags.Presence);
-        for (PrimitiveElement presenceElem : presenceList) {
-            String userId = presenceElem.getChildContents(ImpsTags.UserID);
-            if (userId == null) {
-                continue;
-            }
-            PrimitiveElement presenceSubList = presenceElem.getChild(ImpsTags.PresenceSubList);
-            Presence presence = ImpsPresenceUtils.extractPresence(presenceSubList, presenceMapping);
-            // Find out the contact in all lists and update their presence
-            for(ContactList list : mContactLists) {
-                Contact contact = list.getContact(userId);
-                if (contact != null) {
-                    contact.setPresence(presence);
-                    updated.add(contact);
-                }
-            }
-        }
-        if (!updated.isEmpty()) {
-            notifyContactsPresenceUpdated(updated.toArray(new Contact[updated.size()]));
-        }
-    }
-
-    void loadContactsOfListAsync(final ImpsAddress address, final
-            AsyncCompletion completion) {
-        Primitive listManageRequest = new Primitive(ImpsTags.ListManage_Request);
-
-        listManageRequest.addElement(address.toPrimitiveElement());
-        listManageRequest.addElement(ImpsTags.ReceiveList, true);
-
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                completion.onError(error);
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                final ContactList list = extractContactList(response, address);
-
-                mContactLists.add(list);
-                if (list.isDefault()) {
-                    mDefaultContactList = list;
-                }
-
-                if (mConfig.usePrensencePolling()) {
-                    completion.onComplete();
-                } else {
-                    subscribeToListAsync(list, completion);
-                }
-            }
-        };
-
-        tx.sendRequest(listManageRequest);
-    }
-
-    private Primitive buildBlockContactReq(String address, boolean block) {
-        Primitive request = new Primitive(ImpsTags.BlockEntity_Request);
-        ImpsVersion version = mConfig.getImpsVersion();
-
-        if (version == ImpsVersion.IMPS_VERSION_13) {
-            request.addElement(ImpsTags.BlockListInUse, true);
-            request.addElement(ImpsTags.GrantListInUse, false);
-        }
-
-        PrimitiveElement blockList = request.addElement(ImpsTags.BlockList);
-        if (version != ImpsVersion.IMPS_VERSION_13) {
-            blockList.addChild(ImpsTags.InUse, true);
-        }
-        PrimitiveElement entityList = blockList.addChild(block ?
-                ImpsTags.AddList : ImpsTags.RemoveList);
-        entityList.addChild(ImpsTags.UserID, address);
-        return request;
-    }
-
-    @Override
-    protected void doBlockContactAsync(String address, final boolean block) {
-        Primitive request = buildBlockContactReq(address, block);
-        final Address contactAddress = new ImpsUserAddress(address);
-        AsyncTransaction tx = new AsyncTransaction(mTransactionManager) {
-
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-                Contact c = getContact(contactAddress);
-                if(c == null) {
-                    c = new Contact(contactAddress, contactAddress.getScreenName());
-                }
-                notifyContactError(
-                        block ? ContactListListener.ERROR_BLOCKING_CONTACT
-                                : ContactListListener.ERROR_UNBLOCKING_CONTACT,
-                        error, null, c);
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                Contact c = getContact(contactAddress);
-                if(c == null) {
-                    c = new Contact(contactAddress, contactAddress.getScreenName());
-                }
-                notifyBlockContact(c, block);
-            }
-        };
-        tx.sendRequest(request);
-    }
-
-    void extractBlockedContacts(Primitive response) {
-        mBlockedList.clear();
-        PrimitiveElement blockList = response.getElement(ImpsTags.BlockList);
-        if(blockList == null) {
-            return;
-        }
-        PrimitiveElement entityList = blockList.getChild(ImpsTags.EntityList);
-        if(entityList == null) {
-            return;
-        }
-        for (PrimitiveElement entity : entityList.getChildren()) {
-            if (entity.getTagName().equals(ImpsTags.UserID)) {
-                ImpsAddress userAddress = new ImpsUserAddress(entity.getContents());
-                notifyBlockContact(new Contact(userAddress, userAddress.getScreenName()),
-                        true);
-            }
-        }
-    }
-
-    /**
-     * Generate NickName element for a specific contact.
-     *
-     * @param contact the contact which provides the info of the NickName elem
-     * @return
-     */
-    private PrimitiveElement buildNickNameElem(Contact contact) {
-        PrimitiveElement nickName = new PrimitiveElement(ImpsTags.NickName);
-
-        nickName.addChild(ImpsTags.Name, contact.getName());
-        nickName.addChild(((ImpsAddress)contact.getAddress()).toPrimitiveElement());
-
-        return nickName;
-    }
-
-    ContactList extractContactList(Primitive response, final ImpsAddress address) {
-        String screenName = address.getScreenName();
-        boolean isDefault = false;
-        PrimitiveElement propertyElem = response.getElement(ImpsTags.ContactListProperties);
-        if (null != propertyElem) {
-            for (PrimitiveElement elem : propertyElem.getChildren()) {
-                if (elem.getTagName().equals(ImpsTags.Property)) {
-                    String name = elem.getChildContents(ImpsTags.Name);
-                    String value = elem.getChildContents(ImpsTags.Value);
-
-                    if (name.equals(ImpsConstants.DisplayName)) {
-                        screenName = value;
-                    } else if (name.equals(ImpsTags.Default)) {
-                        isDefault = ImpsUtils.isTrue(value);
-                    }
-                }
-            }
-        }
-
-        PrimitiveElement nickListElem = response.getElement(ImpsTags.NickList);
-        if (null == nickListElem) {
-            return new ContactList(address, screenName, isDefault, null, this);
-        }
-
-        Vector<Contact> contacts = new Vector<Contact>();
-        for (PrimitiveElement elem : nickListElem.getChildren()) {
-            String id = null;
-            String name = null;
-
-            String tag = elem.getTagName();
-            if (tag.equals(ImpsTags.NickName)) {
-                id = elem.getChild(ImpsTags.UserID).getContents();
-                name = elem.getChild(ImpsTags.Name).getContents();
-            } else if (tag.equals(ImpsTags.UserID)){
-                id = elem.getContents();
-            }
-
-            if (id != null) {
-                Address contactAddress = new ImpsUserAddress(id);
-                Contact c = getContact(contactAddress);
-                if (c == null) {
-                    if (name == null) {
-                        name = contactAddress.getScreenName();
-                    }
-                    c = new Contact(contactAddress, name);
-                }
-                contacts.add(c);
-            }
-        }
-        return new ContactList(address, screenName, isDefault, contacts, this);
-    }
-
-    private class LoadContactsTransaction extends AsyncTransaction {
-        Vector<ImpsContactListAddress> mListAddresses;
-
-        LoadContactsTransaction() {
-            super(mTransactionManager);
-
-            mListAddresses = new Vector<ImpsContactListAddress>();
-        }
-
-        @Override
-        public void onResponseError(ImpsErrorInfo error) {
-            notifyContactError(ContactListListener.ERROR_LOADING_LIST,
-                    error, null, null);
-        }
-
-        @Override
-        public void onResponseOk(Primitive response) {
-            mContactLists.clear();
-
-            mListAddresses = extractListAddresses(response);
-
-            if (!mListAddresses.isEmpty()) {
-                fetchContacts();
-            } else {
-                onContactListsLoaded();
-            }
-        }
-
-        void startGetContactLists() {
-            Primitive getListRequest = new Primitive(ImpsTags.GetList_Request);
-
-            sendRequest(getListRequest);
-        }
-
-        private void fetchContacts() {
-            ImpsContactListAddress fisrtListAddress = mListAddresses.firstElement();
-
-            loadContactsOfListAsync(fisrtListAddress, new LoadListCompletion());
-        }
-
-        private final class LoadListCompletion implements AsyncCompletion {
-            private int mListIndex;
-            LoadListCompletion() {
-                mListIndex = 0;
-            }
-
-            public void onComplete() {
-                processResult(null);
-            }
-
-            public void onError(ImErrorInfo error) {
-                processResult(error);
-            }
-
-            private void processResult(ImErrorInfo error) {
-                ImpsAddress addr = mListAddresses.get(mListIndex);
-
-                if (error == null) {
-                    notifyContactListLoaded(getContactList(addr));
-                } else {
-                    notifyContactError(ContactListListener.ERROR_LOADING_LIST,
-                            error, addr.getScreenName(), null);
-                }
-
-                mListIndex++;
-                if (mListIndex < mListAddresses.size()) {
-                    loadContactsOfListAsync(mListAddresses.get(mListIndex), this);
-                } else {
-                    onContactListsLoaded();
-                }
-            }
-        }
-    }
-
-    void onContactListsLoaded() {
-        notifyContactListsLoaded();
-
-        if (mConfig.usePrensencePolling()) {
-            fetchPresence(getAllListAddress());
-        }
-
-        // notify the pending subscription requests received before contact
-        // lists has been loaded.
-        SubscriptionRequestListener listener = getSubscriptionRequestListener();
-        if (mSubscriptionRequests != null && listener != null) {
-            for (Contact c : mSubscriptionRequests) {
-                listener.onSubScriptionRequest(c);
-            }
-        }
-        ((ImpsChatSessionManager) mConnection.getChatSessionManager()).start();
-    }
-
-    @Override
-    protected void doAddContactToListAsync(String addressStr, ContactList list)
-        throws ImException {
-        ImpsUserAddress address = new ImpsUserAddress(addressStr);
-
-        Contact contact;
-        if (getContact(address) != null) {
-            contact = getContact(address);
-        } else {
-            contact = new Contact(address, address.getScreenName());
-        }
-
-        if (isBlocked(contact)) {
-            throw new ImException(ImErrorInfo.CANT_ADD_BLOCKED_CONTACT,
-            "Contact has been blocked");
-        }
-
-        addContactToListAsync(contact, list);
-    }
-
-    private void addContactToListAsync(final Contact contact,
-            final ContactList list) {
-        final ArrayList<Contact> contacts = new ArrayList<Contact>();
-
-        contacts.add(contact);
-        updateContactListAsync(list, contacts, null, null, new AsyncCompletion(){
-            public void onComplete() {
-                notifyContactListUpdated(list,
-                        ContactListListener.LIST_CONTACT_ADDED, contact);
-
-                if (mConfig.usePrensencePolling()) {
-                    fetchPresence(new ImpsAddress[]{
-                            (ImpsAddress) contact.getAddress()});
-                } else {
-                    AsyncCompletion subscribeCompletion =  new AsyncCompletion(){
-                        public void onComplete() {}
-
-                        public void onError(ImErrorInfo error) {
-                            notifyContactError(
-                                    ContactListListener.ERROR_RETRIEVING_PRESENCE,
-                                    error, list.getName(), contact);
-                        }
-                    };
-
-                    if (mAllowAutoSubscribe) {
-                        // XXX Send subscription again after add contact to make sure we
-                        // can get the presence notification. Although the we set
-                        // AutoSubscribe True when subscribe presence after load contacts,
-                        // the server might not send presence notification.
-                        subscribeToListAsync(list, subscribeCompletion);
-                    } else {
-                        subscribeToContactsAsync(contacts, subscribeCompletion);
-                    }
-                }
-            }
-
-            public void onError(ImErrorInfo error) {
-                // XXX Workaround to convert 402 error to 531. Some
-                // servers might return 402 - Bad parameter instead of
-                // 531 - Unknown user if the user input an invalid user ID.
-                if (error.getCode() == ImpsErrorInfo.BAD_PARAMETER) {
-                    error = new ImErrorInfo(ImpsErrorInfo.UNKNOWN_USER,
-                            error.getDescription());
-                }
-                notifyContactError(ContactListListener.ERROR_ADDING_CONTACT,
-                        error, list.getName(), contact);
-            }
-        });
-    }
-
-    @Override
-    protected void doRemoveContactFromListAsync(final Contact contact, final ContactList list) {
-        ArrayList<Contact> contacts = new ArrayList<Contact>();
-
-        contacts.add(contact);
-        updateContactListAsync(list, null, contacts, null, new AsyncCompletion(){
-            public void onComplete() {
-                ImpsLog.log("removed contact");
-                notifyContactListUpdated(list,
-                        ContactListListener.LIST_CONTACT_REMOVED, contact);
-
-                if (!mAllowAutoSubscribe) {
-                    unsubscribeToContactAsync(contact, new AsyncCompletion(){
-                        public void onComplete() {}
-
-                        public void onError(ImErrorInfo error) {
-                            // don't bother to alert this error since the
-                            // contact has already been removed.
-                            ImpsLog.log("Warning: unsubscribing contact presence failed");
-                        }
-                    });
-                }
-            }
-
-            public void onError(ImErrorInfo error) {
-                ImpsLog.log("remove contact error:" + error);
-                notifyContactError(ContactListListener.ERROR_REMOVING_CONTACT,
-                        error, list.getName(), contact);
-            }
-        });
-    }
-
-    @Override
-    protected void setListNameAsync(final String name, final ContactList list) {
-        updateContactListAsync(list, null, null, name, new AsyncCompletion(){
-            public void onComplete() {
-                notifyContactListNameUpdated(list, name);
-            }
-
-            public void onError(ImErrorInfo error) {
-                notifyContactError(ContactListListener.ERROR_RENAMING_LIST,
-                        error, list.getName(), null);
-            }
-        });
-    }
-
-    private void updateContactListAsync(final ContactList list, final ArrayList<Contact>
-            contactsToAdd, final ArrayList<Contact> contactsToRemove,
-            final String listName, AsyncCompletion completion) {
-        Primitive request = buildListManageRequest(list, contactsToAdd,
-                contactsToRemove, listName);
-
-        SimpleAsyncTransaction tx = new SimpleAsyncTransaction(mTransactionManager, completion);
-        tx.sendRequest(request);
-    }
-
-    String getPropertyValue(String propertyName, PrimitiveElement properties) {
-        for (PrimitiveElement property : properties.getChildren(ImpsTags.Property)) {
-            if (propertyName.equals(property.getChildContents(ImpsTags.Name))) {
-                return property.getChildContents(ImpsTags.Value);
-            }
-        }
-
-        return null;
-    }
-
-    void reset() {
-        setState(LISTS_NOT_LOADED);
-    }
-
-    @Override
-    protected ImConnection getConnection() {
-        return mConnection;
-    }
-
-    private PresencePollingManager mPollingMgr;
-    /*package*/PresencePollingManager getPresencePollingManager() {
-        if (mPollingMgr == null) {
-            mPollingMgr = new PresencePollingManager(this,
-                    mConfig.getPresencePollInterval());
-        }
-        return mPollingMgr;
-    }
-
-}
diff --git a/src/com/android/im/imps/ImpsErrorInfo.java b/src/com/android/im/imps/ImpsErrorInfo.java
deleted file mode 100644 (file)
index b73f00b..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import com.android.im.engine.ImErrorInfo;
-
-public class ImpsErrorInfo extends ImErrorInfo {
-
-    /** The client error definition* */
-    public static final int UNAUTHORIZED = 401;
-    public static final int BAD_PARAMETER = 402;
-    public static final int FORBIDDEN = 403;
-    public static final int NOT_FOUND = 404;
-    public static final int SERVICE_NOT_SUPPORTED = 405;
-    public static final int REQUEST_TIMEOUT = 408;
-    public static final int INVALID_PASSWORD = 409;
-    public static final int UNABLE_TO_DELIVER = 410;
-    public static final int UNSUPPORTED_MEDIA_TYPE = 415;
-    public static final int INVALID_TRANSACTION_ID = 420;
-    public static final int USERID_AND_CLIENTID_NOT_MACTH = 422;
-    public static final int INVALID_INVITATIO_ID = 423;
-    public static final int INVALID_SEARCH_ID = 424;
-    public static final int INVALID_SEARCH_INDEX = 425;
-    public static final int INVALID_MESSAGE_ID = 426;
-    public static final int UNAUTHORIZED_GROUP_MEMBERSHIP = 431;
-    public static final int RESPONSE_TOO_LARGE = 432;
-
-    /** The server error definition* */
-    public static final int INTERNAL_SERVER_OR_NETWORK_ERROR = 500;
-    public static final int NOT_IMPLMENTED = 501;
-    public static final int SERVER_UNAVAILABLE = 503;
-    public static final int TIMEOUT = 504;
-    public static final int VERSION_NOT_SUPPORTED = 505;
-    public static final int SERVICE_NOT_AGREED = 506;
-    public static final int MESSAGE_QUEUE_FULL = 507;
-    public static final int DOMAIN_NOT_SUPPORTED = 516;
-    public static final int UNRESPONDED_PRESENCE_REQUEST = 521;
-    public static final int UNRESPONDED_GROUP_REQUEST = 522;
-    public static final int UNKNOWN_USER = 531;
-    public static final int RECIPIENT_BLOCKED_SENDER = 532;
-    public static final int MESSAGE_RECIPIENT_NOT_LOGGED = 533;
-    public static final int MESSAGE_RECIPIENT_UNAUTHORIZED = 534;
-    public static final int SEARCH_TIMEOUT = 535;
-    public static final int TOO_MANY_HITS = 536;
-    public static final int TOO_BROAD_SEARCH_CRITERIA = 537;
-    public static final int MESSAGE_REJECTED = 538;
-    public static final int HEADER_ENCODING_NOT_SUPPORTED = 540;
-    public static final int MESSAGE_FORWARDED = 541;
-    public static final int MESSAGE_EXPIRED = 542;
-    public static final int NO_MATCHING_DIGEST_SCHEME_SUPPORTED = 543;
-
-    /** The session error definition* */
-    public static final int SESSION_EXPIRED = 600;
-    public static final int FORCED_LOGOUT = 601;
-    public static final int ALREADY_LOGGED = 603;
-    public static final int INVALID_SESSION = 604;
-    public static final int NEW_VALUE_NOT_ACCEPTED = 605;
-
-    /** The presence and contact list error definition* */
-    public static final int CONTACT_LIST_NOT_EXIST = 700;
-    public static final int CONTACT_LIST_ALREADY_EXISTS = 701;
-    public static final int INVALID_OR_UNSUPPORTED_USER_PROPERTIES = 702;
-    public static final int INVALID_OR_UNSUPPORTED_PRESENCE_ATTRIBUTE = 750;
-    public static final int INVALID_OR_UNSUPPORTED_RRESENCE_VALUE = 751;
-    public static final int INVALID_OR_UNSUPPORTED_CONTACT_LIST_PROPERTY = 752;
-    public static final int MAX_NUMBER_OF_CONTACT_LIST_REACHED = 753;
-    public static final int MAX_NUMBER_OF_CONTACTS_REACHED = 754;
-    public static final int MAX_NUMBER_OF_ATTRIBUTE_LISTS_REACHED = 755;
-    public static final int AUTOMATIC_SUBSCRIPTION_NOT_SUPPORTED = 760;
-
-    /** The general error definition* */
-    public static final int MULTIPLE_ERRORS = 900;
-    public static final int GENERAL_ADDRESS_ERROR = 901;
-    public static final int NOT_ENOUGH_CREDIT_TO_COMPLETE_REQUESTED_OPERATION = 902;
-    public static final int OPERATION_REQUIRES_HIGHER_CLASS_SERVICE = 903;
-
-    public static final int MSISDN_ERROR = 920;    
-
-    private final Primitive mPrimitive;
-
-    ImpsErrorInfo(int code, String description, Primitive primitive) {
-        super(code, description);
-        mPrimitive = primitive;
-    }
-
-    Primitive getPrimitive() {
-        return mPrimitive;
-    }
-
-}
diff --git a/src/com/android/im/imps/ImpsGroupAddress.java b/src/com/android/im/imps/ImpsGroupAddress.java
deleted file mode 100644 (file)
index 1d2cd2c..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import android.os.Parcel;
-
-import com.android.im.engine.ChatGroup;
-import com.android.im.engine.ImEntity;
-
-public class ImpsGroupAddress extends ImpsAddress{
-    private String mScreenName;
-
-    /**
-     * Default constructor. Required by AddressParcelHelper.
-     */
-    public ImpsGroupAddress() {
-    }
-
-    public ImpsGroupAddress(String groupId) {
-        this(groupId, null);
-    }
-
-    public ImpsGroupAddress(ImpsAddress userAddress, String groupName) {
-        super(userAddress.getUser(), groupName, userAddress.getDomain());
-        if(mResource == null) {
-            throw new IllegalArgumentException();
-        }
-    }
-
-    public ImpsGroupAddress(String groupId, String screenName) {
-        super(groupId);
-        if(mResource == null) {
-            throw new IllegalArgumentException();
-        }
-        mScreenName = screenName;
-    }
-
-    @Override
-    public String getScreenName() {
-        return mScreenName == null ? getResource() : mScreenName;
-    }
-
-    @Override
-    public void writeToParcel(Parcel dest) {
-        super.writeToParcel(dest);
-        dest.writeString(mScreenName);
-    }
-
-    @Override
-    public void readFromParcel(Parcel source) {
-        super.readFromParcel(source);
-        mScreenName = source.readString();
-    }
-
-    @Override
-    public PrimitiveElement toPrimitiveElement() {
-        PrimitiveElement group = new PrimitiveElement(ImpsTags.Group);
-        group.addChild(ImpsTags.GroupID, getFullName());
-        return group;
-    }
-
-    @Override
-    ImEntity getEntity(ImpsConnection connection) {
-        ImpsChatGroupManager manager =
-            (ImpsChatGroupManager) connection.getChatGroupManager();
-        ChatGroup group = manager.getChatGroup(this);
-        if(group == null) {
-            group = manager.loadGroupMembersAsync(this);
-        }
-        return group;
-    }
-}
diff --git a/src/com/android/im/imps/ImpsLog.java b/src/com/android/im/imps/ImpsLog.java
deleted file mode 100644 (file)
index ffa6ebb..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import com.android.internal.util.HexDump;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import android.util.Log;
-
-public class ImpsLog {
-    public static final String TAG = "IMPS";
-
-    public static final String PACKET_TAG = "IMPS/Packet";
-
-    public static final boolean DEBUG = true;
-
-    private static PrimitiveSerializer mSerialzier;
-
-    private ImpsLog() {
-    }
-
-    static {
-        // we don't really care about the namespace values in the log
-        mSerialzier = new XmlPrimitiveSerializer("", "");
-    }
-
-    public static void dumpRawPacket(byte[] bytes) {
-        Log.d(PACKET_TAG, HexDump.dumpHexString(bytes));
-    }
-
-    public static void dumpPrimitive(Primitive p) {
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        try {
-            mSerialzier.serialize(p, out);
-        } catch (IOException e) {
-            Log.e(PACKET_TAG, "Bad Primitive");
-        } catch (SerializerException e) {
-            Log.e(PACKET_TAG, "Bad Primitive");
-        }
-        Log.d(PACKET_TAG, out.toString());
-    }
-
-    public static void log(Primitive primitive) {
-        if(DEBUG) {
-            ByteArrayOutputStream out = new ByteArrayOutputStream();
-            try {
-                mSerialzier.serialize(primitive, out);
-            } catch (IOException e) {
-                Log.e(TAG, e.getMessage(), e);
-            } catch (SerializerException e) {
-                Log.e(TAG, e.getMessage(), e);
-            }
-            Log.i(TAG, out.toString());
-        }
-    }
-
-    public static void log(String info) {
-        if(DEBUG) {
-            Log.d(TAG, /* DateFormat.format("kk:mm:ss ", new Date()) + */ info);
-        }
-    }
-
-    public static void logError(Throwable t) {
-        Log.e(TAG, /* DateFormat.format("kk:mm:ss", new Date()).toString() */ "", t);
-    }
-
-    public static void logError(String info, Throwable t) {
-        Log.e(TAG, /* DateFormat.format("kk:mm:ss ", new Date()) + */ info, t);
-    }
-
-    public static void logError(String info) {
-        Log.e(TAG, /* DateFormat.format("kk:mm:ss ", new Date()) + */ info);
-    }
-}
diff --git a/src/com/android/im/imps/ImpsPresenceUtils.java b/src/com/android/im/imps/ImpsPresenceUtils.java
deleted file mode 100644 (file)
index ec1403f..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import com.android.im.engine.Presence;
-import org.apache.commons.codec.binary.Base64;
-
-import android.os.Base64Utils;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A helper class used to extract presence values from the primitive received
- * from the server and create the primitive for updating the presence.
- */
-public class ImpsPresenceUtils {
-
-    private ImpsPresenceUtils() {
-    }
-
-    /**
-     * Extract the <code>Presence</code> from the <code>PrimitiveElement</code>
-     * which contains the <code>PresenceSubList</code>.
-     *
-     * @param presenceListElem the <code>PrimitiveElement</code>
-     * @return A new <code>Presence</code> containing the info extracted from the
-     *          <code>PrimitiveElement</code>
-     */
-    public static Presence extractPresence(PrimitiveElement presenceListElem,
-            PresenceMapping mapping){
-        int status = extractPresenceStatus(presenceListElem, mapping);
-        String statusText = extractStatusText(presenceListElem);
-        byte[] avatarData = extractAvatarBytes(presenceListElem);
-        String avatarType = extractAvatarType(presenceListElem);
-
-        int clientType = Presence.CLIENT_TYPE_DEFAULT;
-        HashMap<String, String> clientInfo = extractClientInfo(presenceListElem);
-        if (ImpsConstants.PRESENCE_MOBILE_PHONE.equals(clientInfo.get(ImpsTags.ClientType))) {
-            clientType = Presence.CLIENT_TYPE_MOBILE;
-        }
-        return new Presence(status, statusText, avatarData, avatarType, clientType);
-    }
-
-    /**
-     * Builds a list of PrimitiveElement need be sent to the server to update
-     * the user's presence.
-     *
-     * @param oldPresence
-     * @param newPresence
-     * @return
-     */
-    public static ArrayList<PrimitiveElement> buildUpdatePresenceElems(
-            Presence oldPresence, Presence newPresence, PresenceMapping mapping) {
-        int status = newPresence.getStatus();
-        ArrayList<PrimitiveElement> elems = new ArrayList<PrimitiveElement>();
-
-        boolean newOnlineStatus = mapping.getOnlineStatus(status);
-        PrimitiveElement onlineElem = new PrimitiveElement(ImpsTags.OnlineStatus);
-        onlineElem.addChild(ImpsTags.Qualifier, true);
-        onlineElem.addChild(ImpsTags.PresenceValue, newOnlineStatus);
-        elems.add(onlineElem);
-
-        String newUserAvailablity = mapping.getUserAvaibility(status);
-        PrimitiveElement availElem = new PrimitiveElement(ImpsTags.UserAvailability);
-        availElem.addChild(ImpsTags.Qualifier, true);
-        availElem.addChild(ImpsTags.PresenceValue, newUserAvailablity);
-        elems.add(availElem);
-        Map<String, Object> extra = mapping.getExtra(status);
-        if (extra != null) {
-            mapToPrimitives(extra, elems);
-        }
-        String statusText = newPresence.getStatusText();
-        if (statusText == null) {
-            statusText = "";
-        }
-        if (!statusText.equals(oldPresence.getStatusText())) {
-            PrimitiveElement statusElem = new PrimitiveElement(ImpsTags.StatusText);
-            statusElem.addChild(ImpsTags.Qualifier, true);
-            statusElem.addChild(ImpsTags.PresenceValue, statusText);
-            elems.add(statusElem);
-        }
-
-        byte[] avatar = newPresence.getAvatarData();
-        if (avatar != null && !Arrays.equals(avatar, oldPresence.getAvatarData())) {
-            String base64Avatar = new String(Base64.encodeBase64(avatar));
-            PrimitiveElement statusContent = new PrimitiveElement(ImpsTags.StatusContent);
-            statusContent.addChild(ImpsTags.Qualifier, true);
-            statusContent.addChild(ImpsTags.DirectContent, base64Avatar);
-            statusContent.addChild(ImpsTags.ContentType, newPresence.getAvatarType());
-            elems.add(statusContent);
-        }
-
-        return elems;
-    }
-
-    private static int extractPresenceStatus(PrimitiveElement presenceListElem,
-            PresenceMapping mapping) {
-        PrimitiveElement onlineStatusElem = presenceListElem.getChild(ImpsTags.OnlineStatus);
-        boolean onlineStatus = ImpsUtils.isQualifiedPresence(onlineStatusElem)
-            && ImpsUtils.isTrue(onlineStatusElem.getChildContents(ImpsTags.PresenceValue));
-
-        PrimitiveElement availabilityElem = presenceListElem.getChild(ImpsTags.UserAvailability);
-        String userAvailability = ImpsUtils.isQualifiedPresence(availabilityElem) ?
-                availabilityElem.getChildContents(ImpsTags.PresenceValue) : null;
-
-        HashMap<String, Object> all = null;
-        if (mapping.requireAllPresenceValues()) {
-            all = new HashMap<String, Object>();
-            primitivetoMap(presenceListElem, all);
-        }
-        return mapping.getPresenceStatus(onlineStatus, userAvailability, all);
-    }
-
-    private static void primitivetoMap(PrimitiveElement elem, HashMap<String, Object> map) {
-        String key = elem.getTagName();
-        int childrenCount = elem.getChildCount();
-        if (childrenCount > 0) {
-            HashMap<String, Object> childrenMap = new HashMap<String, Object>();
-            for (PrimitiveElement child : elem.getChildren()) {
-                primitivetoMap(child, childrenMap);
-            }
-            map.put(key, childrenMap);
-        } else {
-            map.put(key, elem.getContents());
-        }
-    }
-
-    private static void mapToPrimitives(Map<String, Object> map, ArrayList<PrimitiveElement> elems) {
-        for (Map.Entry<String, Object> entry : map.entrySet()) {
-            String tag = entry.getKey();
-            Object value = entry.getValue();
-            PrimitiveElement elem = new PrimitiveElement(tag);
-            if (value instanceof String) {
-                elem.setContents((String)value);
-            } else if (value instanceof Map) {
-                mapToPrimitives((Map)value, elem.getChildren());
-            }
-            elems.add(elem);
-        }
-    }
-
-    private static HashMap<String, String> extractClientInfo(PrimitiveElement presenceListElem) {
-        HashMap<String, String> clientInfo = new HashMap<String, String>();
-        PrimitiveElement clientInfoElem = presenceListElem.getChild(ImpsTags.ClientInfo);
-        if (ImpsUtils.isQualifiedPresence(clientInfoElem)) {
-            String clientType = clientInfoElem.getChildContents(ImpsTags.ClientType);
-            if (clientType != null) {
-                clientInfo.put(ImpsTags.ClientType, clientType);
-            }
-
-            String clientProducer = clientInfoElem.getChildContents(ImpsTags.ClientProducer);
-            if (clientProducer != null) {
-                clientInfo.put(ImpsTags.ClientProducer, clientProducer);
-            }
-
-            String clientVersion = clientInfoElem.getChildContents(ImpsTags.ClientVersion);
-            if (clientVersion != null) {
-                clientInfo.put(ImpsTags.ClientVersion, clientVersion);
-            }
-        }
-        return clientInfo;
-    }
-
-    private static String extractStatusText(PrimitiveElement presenceListElem) {
-        String statusText = null;
-        PrimitiveElement statusTextElem = presenceListElem.getChild(ImpsTags.StatusText);
-        if (ImpsUtils.isQualifiedPresence(statusTextElem)) {
-            statusText = statusTextElem.getChildContents(ImpsTags.PresenceValue);
-        }
-        return statusText;
-    }
-
-    private static byte[] extractAvatarBytes(PrimitiveElement presenceListElem) {
-        PrimitiveElement statusContentElem = presenceListElem.getChild(ImpsTags.StatusContent);
-        if(ImpsUtils.isQualifiedPresence(statusContentElem)) {
-            String avatarStr = statusContentElem.getChildContents(ImpsTags.DirectContent);
-            if(avatarStr != null){
-                return Base64Utils.decodeBase64(avatarStr);
-            }
-        }
-        return null;
-    }
-
-    private static String extractAvatarType(PrimitiveElement presenceListElem) {
-        PrimitiveElement statusContentElem = presenceListElem.getChild(ImpsTags.StatusContent);
-        if(ImpsUtils.isQualifiedPresence(statusContentElem)) {
-            return statusContentElem.getChildContents(ImpsTags.ContentType);
-        }
-        return null;
-    }
-}
diff --git a/src/com/android/im/imps/ImpsSession.java b/src/com/android/im/imps/ImpsSession.java
deleted file mode 100644 (file)
index 5118da8..0000000
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import com.android.im.engine.Contact;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.ImException;
-import com.android.im.engine.LoginInfo;
-import com.android.im.imps.ImpsConnectionConfig.CirMethod;
-import com.android.im.imps.ImpsConnectionConfig.TransportType;
-
-/**
- * Represents the context of an IMPS session. The IMPS session is a framework in
- * which the IMPS services are provided to the IMPS client. It's established
- * when the client logs in and terminated when either the client logs out or the
- * SAP decides to disconnect the session.
- */
-public class ImpsSession {
-    private static final String KEY_CIR_HTTP_ADDRESS = "cirHttpAddress";
-    private static final String KEY_CIR_TCP_PORT = "cirTcpPort";
-    private static final String KEY_CIR_TCP_ADDRESS = "cirTcpAddress";
-    private static final String KEY_CIR_METHOD = "CirMethod";
-    private static final String KEY_SERVER_POLL_MIN = "serverPollMin";
-    private static final String KEY_PASSWORD = "password";
-    private static final String KEY_USERNAME = "username";
-    private static final String KEY_KEEP_ALIVE_TIME = "keepAliveTime";
-    private static final String KEY_SESSION_COOKIE = "sessionCookie";
-    private static final String KEY_SESSION_ID = "sessionId";
-
-    private static final int DEFAULT_TCP_PORT = 3171;
-
-    private ImpsConnection mConnection;
-    private String mId;
-    private String mCookie;
-    private long mKeepAliveTime;
-    private CirMethod mCurrentCirMethod;
-    private String mCirTcpAddress;
-    private int mCirTcpPort = DEFAULT_TCP_PORT;
-    private long mServerPollMin;
-    private String mCirHttpAddress;
-    private LoginInfo mLoginInfo;
-
-    private boolean mCapablityRequest;
-    private List<CirMethod> mSupportedCirMethod;
-
-    private Contact mLoginUser;
-
-    PrimitiveElement mServiceTree;
-
-    /**
-     * Flag that indicates this is a new created session or not.
-     */
-    private boolean mNew;
-
-    ImpsSession(ImpsConnection connection, LoginInfo info) throws ImException{
-        mConnection = connection;
-        setLoginInfo(info);
-
-        mNew = true;
-        mCookie = ImpsUtils.genSessionCookie();
-
-        mCirTcpPort = DEFAULT_TCP_PORT;
-        mServerPollMin = connection.getConfig().getDefaultServerPollMin();
-    }
-
-    ImpsSession(ImpsConnection connection, HashMap<String, String> values)
-            throws ImException {
-        mConnection = connection;
-        mNew = false;
-        mId = values.get(KEY_SESSION_ID);
-        if (mId == null || mId.length() == 0) {
-            throw new ImException(ImErrorInfo.INVALID_SESSION_CONTEXT,
-                "Missing session id");
-        }
-        mCookie = values.get(KEY_SESSION_COOKIE);
-        if (mCookie == null || mCookie.length() == 0) {
-            throw new ImException(ImErrorInfo.INVALID_SESSION_CONTEXT,
-                "Missing session cookie");
-        }
-        try {
-            mKeepAliveTime = Long.parseLong(values.get(KEY_KEEP_ALIVE_TIME));
-        } catch (NumberFormatException e) {
-            throw new ImException(ImErrorInfo.INVALID_SESSION_CONTEXT,
-                "Invalid keepAliveTime");
-        }
-        try {
-            mServerPollMin = Long.parseLong(values.get(KEY_SERVER_POLL_MIN));
-        } catch (NumberFormatException e) {
-            throw new ImException(ImErrorInfo.INVALID_SESSION_CONTEXT,
-                "Invalid serverPollMin");
-        }
-        String username = values.get(KEY_USERNAME);
-        String password = values.get(KEY_PASSWORD);
-        // Empty password might be valid
-        if (username == null || username.length() == 0 || password == null) {
-            throw new ImException(ImErrorInfo.INVALID_SESSION_CONTEXT,
-                "Invalid username or password");
-        }
-        setLoginInfo(new LoginInfo(username, password));
-
-        mCurrentCirMethod = CirMethod.valueOf(values.get(KEY_CIR_METHOD));
-        if (mCurrentCirMethod == CirMethod.STCP) {
-            mCirTcpAddress = values.get(KEY_CIR_TCP_ADDRESS);
-            if (mCirTcpAddress == null || mCirTcpAddress.length() == 0) {
-                throw new ImException(ImErrorInfo.INVALID_SESSION_CONTEXT,
-                    "Missing CirTcpAddress");
-            }
-            try {
-                mCirTcpPort = Integer.parseInt(values.get(KEY_CIR_TCP_PORT));
-            } catch (NumberFormatException e) {
-                throw new ImException(ImErrorInfo.INVALID_SESSION_CONTEXT,
-                    "Invalid CirTcpPort");
-            }
-        } else if (mCurrentCirMethod == CirMethod.SHTTP) {
-            mCirHttpAddress = values.get(KEY_CIR_HTTP_ADDRESS);
-        }
-    }
-
-    public HashMap<String, String> getContext() {
-        HashMap<String, String> values = new HashMap<String, String>();
-
-        values.put(KEY_SESSION_ID, mId);
-        values.put(KEY_SESSION_COOKIE, mCookie);
-        values.put(KEY_KEEP_ALIVE_TIME, Long.toString(mKeepAliveTime));
-        values.put(KEY_USERNAME, mLoginInfo.getUserName());
-        values.put(KEY_PASSWORD, mLoginInfo.getPassword());
-        values.put(KEY_SERVER_POLL_MIN, Long.toString(mServerPollMin));
-
-        values.put(KEY_CIR_METHOD, mCurrentCirMethod.name());
-        if(mCurrentCirMethod == CirMethod.STCP) {
-            values.put(KEY_CIR_TCP_ADDRESS, mCirTcpAddress);
-            values.put(KEY_CIR_TCP_PORT, Integer.toString(mCirTcpPort));
-        } else if (mCurrentCirMethod == CirMethod.SHTTP) {
-            values.put(KEY_CIR_HTTP_ADDRESS, mCirHttpAddress);
-        }
-        return values;
-    }
-
-    /**
-     * Gets the unique id of the session.
-     *
-     * @return the unique id of the session.
-     */
-    public String getID() {
-        return mId;
-    }
-
-    public void setId(String id) {
-        mId = id;
-    }
-
-    public String getCookie() {
-        return mCookie;
-    }
-
-    public String getUserName() {
-        return mLoginInfo.getUserName();
-    }
-
-    public String getPassword() {
-        return mLoginInfo.getPassword();
-    }
-
-    public LoginInfo getLoginInfo() {
-        return mLoginInfo;
-    }
-    /**
-     * Gets the auto logout timer value.
-     *
-     * @return the auto logout timer value.
-     */
-    public long getKeepAliveTime() {
-        return mKeepAliveTime;
-    }
-
-    public void setKeepAliveTime(long keepAliveTime) {
-        mKeepAliveTime = keepAliveTime;
-    }
-
-    /**
-     * Gets if further capability request is required in the session.
-     *
-     * @return <code>true</code> if further capability request is required.
-     */
-    public boolean isCapablityRequestRequired() {
-        return mCapablityRequest || mNew;
-    }
-
-    public void setCapablityRequestRequired(boolean required) {
-        mCapablityRequest = required;
-    }
-
-    public ImpsUserAddress getLoginUserAddress() {
-        return (ImpsUserAddress) mLoginUser.getAddress();
-    }
-
-    public Contact getLoginUser() {
-        return mLoginUser;
-    }
-
-    /**
-     * Sets the Login information. After login successfully, the login
-     * information should be saved in the session context so that we can auto
-     * login when reconnect to the server.
-     *
-     * @param loginInfo the login information.
-     * @throws ImException
-     */
-    private void setLoginInfo(LoginInfo loginInfo) throws ImException {
-        try {
-            ImpsAddress address = new ImpsUserAddress(loginInfo.getUserName());
-            mLoginUser = new Contact(address, address.getScreenName());
-            mLoginInfo = loginInfo;
-        } catch (IllegalArgumentException e) {
-            throw new ImException(ImErrorInfo.INVALID_USERNAME,
-                    "Invalid username");
-        }
-    }
-
-    /**
-     * Gets a collection of CIR methods that are supported by both the client
-     * and the server.
-     *
-     * @return a collection of supported CIR methods
-     */
-    public List<CirMethod> getSupportedCirMethods() {
-        return mSupportedCirMethod;
-    }
-
-    public CirMethod getCurrentCirMethod() {
-        return mCurrentCirMethod;
-    }
-
-    public void setCurrentCirMethod(CirMethod cirMethod) {
-        mCurrentCirMethod = cirMethod;
-    }
-
-    /**
-     * Gets the IP address for standalone TCP/IP CIR method.
-     *
-     * @return the IP address for standalone TCP/IP CIR method
-     */
-    public String getCirTcpAddress() {
-        return mCirTcpAddress;
-    }
-
-    /**
-     * Gets the port number for the standalone TCP/IP CIR method.
-     *
-     * @return the port number for the standalone TCP/IP CIR method.
-     */
-    public int getCirTcpPort() {
-        return mCirTcpPort;
-    }
-
-    /**
-     * Gets the minimum time interval (in seconds) that MUST pass before two
-     * subsequent PollingRequest transactions.
-     *
-     * @return the minimum time interval in seconds.
-     */
-    public long getServerPollMin() {
-        return mServerPollMin;
-    }
-
-    /**
-     * Gets the URL used for standalone HTTP binding of CIR channel.
-     *
-     * @return the URL.
-     */
-    public String getCirHttpAddress() {
-        return mCirHttpAddress;
-    }
-
-    /**
-     * Gets the service tree of the features and functions that the server
-     * supports.
-     *
-     * @return the service tree.
-     */
-    public PrimitiveElement getServiceTree() {
-        return mServiceTree;
-    }
-
-    /**
-     * Perform client capability negotiation with the server asynchronously.
-     *
-     * @param completion Async completion object.
-     */
-    public void negotiateCapabilityAsync(AsyncCompletion completion) {
-        Primitive capabilityRequest = buildCapabilityRequest();
-
-        AsyncTransaction tx = new AsyncTransaction(
-                mConnection.getTransactionManager(), completion) {
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                extractCapability(response);
-            }
-
-            @Override
-            public void onResponseError(ImpsErrorInfo error) { }
-        };
-
-        tx.sendRequest(capabilityRequest);
-    }
-
-    /**
-     * Perform service negotiation with the server asynchronously.
-     *
-     * @param completion Async completion object.
-     */
-    public void negotiateServiceAsync(AsyncCompletion completion) {
-        Primitive serviceRequest = buildServiceRequest();
-        AsyncTransaction tx = new AsyncTransaction(
-                mConnection.getTransactionManager(), completion) {
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                mServiceTree = response.getElement(ImpsTags.AllFunctions).getFirstChild();
-            }
-
-            @Override
-            public void onResponseError(ImpsErrorInfo error) { }
-        };
-
-        tx.sendRequest(serviceRequest);
-    }
-
-    private Primitive buildCapabilityRequest() {
-        Primitive capabilityRequest = new Primitive(ImpsTags.ClientCapability_Request);
-        PrimitiveElement list = capabilityRequest.addElement(ImpsTags.CapabilityList);
-        list.addChild(ImpsTags.ClientType, ImpsClientCapability.getClientType());
-        list.addChild(ImpsTags.AcceptedContentLength, Integer
-                .toString(ImpsClientCapability.getAcceptedContentLength()));
-        list.addChild(ImpsTags.ParserSize,
-                Integer.toString(ImpsClientCapability.getParserSize()));
-        list.addChild(ImpsTags.MultiTrans,
-                Integer.toString(ImpsClientCapability.getMultiTrans()));
-
-        // TODO: MultiTransPerMessage is IMPS 1.3
-        //list.addChild(ImpsTags.MultiTransPerMessage,
-        //        Integer.toString(ImpsClientCapability.getMultiTransPerMessage()));
-        list.addChild(ImpsTags.InitialDeliveryMethod,
-                ImpsClientCapability.getInitialDeliveryMethod());
-        list.addChild(ImpsTags.ServerPollMin, Long.toString(mServerPollMin));
-
-        for(TransportType supportedBear : ImpsClientCapability.getSupportedBearers()) {
-            list.addChild(ImpsTags.SupportedBearer, supportedBear.toString());
-        }
-
-        for(CirMethod supportedCirMethod : ImpsClientCapability.getSupportedCirMethods()) {
-            list.addChild(ImpsTags.SupportedCIRMethod, supportedCirMethod.toString());
-            if (CirMethod.SUDP.equals(supportedCirMethod)) {
-                list.addChild(ImpsTags.UDPPort,
-                        Integer.toString(mConnection.getConfig().getUdpPort()));
-            }
-        }
-
-        return capabilityRequest;
-    }
-
-    /* keep this method package private instead of private to avoid the
-     * overhead of calling from a inner class.
-     */
-    void extractCapability(Primitive capabilityResponse) {
-        mSupportedCirMethod = new ArrayList<CirMethod>();
-
-        PrimitiveElement agreedList = capabilityResponse.getContentElement()
-                .getFirstChild();
-        for (PrimitiveElement element : agreedList.getChildren()) {
-            String tag = element.getTagName();
-            if (tag.equals(ImpsTags.SupportedCIRMethod)) {
-                try {
-                    mSupportedCirMethod.add(CirMethod.valueOf(element.getContents()));
-                } catch (IllegalArgumentException e) {
-                    ImpsLog.log("Unrecognized CIR method " + element.getContents());
-                }
-            } else if (tag.equals(ImpsTags.TCPAddress)) {
-                mCirTcpAddress = element.getContents();
-            } else if (tag.equals(ImpsTags.TCPPort)) {
-                mCirTcpPort = (int)ImpsUtils.parseLong(element.getContents(),
-                        DEFAULT_TCP_PORT);
-            } else if (tag.equals(ImpsTags.ServerPollMin)) {
-                long defaultPollMin = mConnection.getConfig().getDefaultServerPollMin();
-                mServerPollMin = ImpsUtils.parseLong(element.getContents(),
-                        defaultPollMin);
-                if (mServerPollMin <= 0) {
-                    mServerPollMin = defaultPollMin;
-                }
-            } else if (tag.equals(ImpsTags.CIRHTTPAddress)
-                    || tag.equals(ImpsTags.CIRURL)) {
-                // This tag is CIRHTTPAddress in 1.3 and CIRURL in 1.2
-                mCirHttpAddress = element.getChildContents(ImpsTags.URL);
-            }
-        }
-    }
-
-    private Primitive buildServiceRequest() {
-        Primitive serviceRequest = new Primitive(ImpsTags.Service_Request);
-        PrimitiveElement functions = serviceRequest.addElement(ImpsTags.Functions);
-        PrimitiveElement features = functions.addChild(ImpsTags.WVCSPFeat);
-        features.addChild(ImpsTags.FundamentalFeat);
-        features.addChild(ImpsTags.PresenceFeat);
-        features.addChild(ImpsTags.IMFeat);
-        features.addChild(ImpsTags.GroupFeat);
-        serviceRequest.addElement(ImpsTags.AllFunctionsRequest, true);
-        return serviceRequest;
-    }
-}
diff --git a/src/com/android/im/imps/ImpsTags.java b/src/com/android/im/imps/ImpsTags.java
deleted file mode 100644 (file)
index 35162f3..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-public interface ImpsTags {
-    public static final String WV_CSP_Message = "WV-CSP-Message";
-    public static final String XMLNS = "xmlns";
-    public static final String Session = "Session";
-    public static final String SessionDescriptor = "SessionDescriptor";
-    public static final String SessionType = "SessionType";
-    public static final String SessionID = "SessionID";
-    public static final String Transaction = "Transaction";
-    public static final String TransactionDescriptor = "TransactionDescriptor";
-    public static final String TransactionMode = "TransactionMode";
-    public static final String TransactionID = "TransactionID";
-    public static final String TransactionContent = "TransactionContent";
-    public static final String Poll = "Poll";
-    public static final String CIR = "CIR";
-
-    // Fundamental primitives and transactions
-    public static final String Status = "Status";
-    public static final String Polling_Request = "Polling-Request";
-    public static final String Login_Request = "Login-Request";
-    public static final String Login_Response = "Login-Response";
-    public static final String Logout_Request = "Logout-Request";
-    public static final String Disconnect = "Disconnect";
-    public static final String KeepAlive_Request = "KeepAlive-Request";
-    public static final String KeepAlive_Response = "KeepAlive-Response";
-    public static final String Service_Request = "Service-Request";
-    public static final String Service_Response = "Service-Response";
-    public static final String ClientCapability_Request = "ClientCapability-Request";
-    public static final String ClientCapability_Response = "ClientCapability-Response";
-//    public static final String GetSPInfo_Request = "GetSPInfo-Request";
-//    public static final String GetSPInfo_Response = "GetSPInfo-Response";
-//    public static final String GetSegment_Request = "GetSegment-Request";
-//    public static final String GetSegment_Response = "GetSegment-Response";
-//    public static final String DropSegment_Request = "DropSegment-Request";
-
-    // Common primitives and transactions
-    public static final String SubscribeNotification_Request = "SubscribeNotification-Request";
-    public static final String UnsubscribeNotification_Request = "UnsubscribeNotification-Request";
-    public static final String Invite_Request = "Invite-Request";
-    public static final String Invite_Response = "Invite-Response";
-    public static final String InviteUser_Request = "InviteUser-Request";
-    public static final String InviteUser_Response = "InviteUser-Response";
-    public static final String CancelInvite_Request = "CancelInvite-Request";
-    public static final String CancelInviteUser_Request = "CancelInviteUser-Request";
-//    public static final String SystemMessage_Request = "SystemMessage-Request";
-//    public static final String SystemMessage_User = "SystemMessage-User";
-//    public static final String Notification_Request = "Notification-Request";
-//    public static final String GetPublicProfile_Request = "GetPublicProfile-Request";
-//    public static final String GetPublicProfile_Response = "GetPublicProfile-Response";
-//    public static final String UpdatePublicProfile_Request = "UpdatePublicProfile-Request";
-//    public static final String Search_Request = "Search-Request";
-//    public static final String Search_Response = "Search-Response";
-//    public static final String StopSearch_Request = "StopSearch-Request";
-//    public static final String GetMap_Request = "GetMap-Request";
-//    public static final String GetMap_Response = "GetMap-Response";
-//    public static final String VerifyID_Request = "VerifyID-Request";
-
-    // Presence-related primitives and transactions
-    public static final String GetList_Request = "GetList-Request";
-    public static final String GetList_Response = "GetList-Response";
-    public static final String CreateList_Request = "CreateList-Request";
-    public static final String DeleteList_Request = "DeleteList-Request";
-    public static final String ListManage_Request = "ListManage-Request";
-    public static final String ListManage_Response = "ListManage-Response";
-    public static final String CreateAttributeList_Request = "CreateAttributeList-Request";
-    public static final String DeleteAttributeList_Request = "DeleteAttributeList-Request";
-    public static final String GetAttributeList_Request = "GetAttributeList-Request";
-    public static final String GetAttributeList_Response = "GetAttributeList-Response";
-    public static final String SubscribePresence_Request = "SubscribePresence-Request";
-    public static final String UnsubscribePresence_Request = "UnsubscribePresence-Request";
-    public static final String PresenceNotification_Request = "PresenceNotification-Request";
-    public static final String GetPresence_Request = "GetPresence-Request";
-    public static final String GetPresence_Response = "GetPresence-Response";
-    public static final String UpdatePresence_Request = "UpdatePresence-Request";
-    public static final String GetBlockedList_Request = "GetBlockedList-Request";
-    public static final String GetBlockedList_Response = "GetBlockedList-Response";
-    public static final String BlockEntity_Request = "BlockEntity-Request";
-    public static final String PresenceAuth_Request = "PresenceAuth-Request";
-    public static final String PresenceAuthUser = "PresenceAuth-User";
-    public static final String CancelAuth_Request = "CancelAuth-Request";
-//  public static final String GetWatcherList_Request = "GetWatcherList-Request";
-//  public static final String GetWatcherList_Response = "GetWatcherList-Response";
-
-    // Messaging-related primitives and transactions
-    public static final String SendMessage_Request = "SendMessage-Request";
-    public static final String SendMessage_Response = "SendMessage-Response";
-    public static final String NewMessage = "NewMessage";
-    public static final String MessageDelivered = "MessageDelivered";
-    public static final String MessageNotification = "MessageNotification";
-    public static final String DeliveryReport_Request = "DeliveryReport-Request";
-//    public static final String SetDeliveryMethod_Request = "SetDeliveryMethod-Request";
-//    public static final String GetMessageList_Request = "GetMessageList-Request";
-//    public static final String GetMessageList_Response = "GetMessageList-Response";
-//    public static final String RejectMessage_Request = "RejectMessage-Request";
-//    public static final String GetMessage_Request = "GetMessage-Request";
-//    public static final String GetMessage_Response = "GetMessage-Response";
-//    public static final String ForwardMessage_Request = "ForwardMessage-Request";
-//    public static final String ForwardMessage_Response = "ForwardMessage-Response";
-//    public static final String ExtendConversation_Request = "ExtendConversation-Request";
-//    public static final String ExtendConversation_Response = "ExtendConversation-Response";
-
-    // Group-related primitives and transactions
-    public static final String CreateGroup_Request = "CreateGroup-Request";
-    public static final String DeleteGroup_Request = "DeleteGroup-Request";
-    public static final String JoinGroup_Request = "JoinGroup-Request";
-    public static final String JoinGroup_Response = "JoinGroup-Response";
-    public static final String LeaveGroup_Request = "LeaveGroup-Request";
-    public static final String LeaveGroup_Response = "LeaveGroup-Response";
-    public static final String GetGroupMembers_Request = "GetGroupMembers-Request";
-    public static final String GetGroupMembers_Response = "GetGroupMembers-Response";
-    public static final String GetJoinedUsers_Request = "GetJoinedUsers-Request";
-    public static final String GetJoinedUsers_Response = "GetJoinedUsers-Response";
-    public static final String AddGroupMembers_Request = "AddGroupMembers-Request";
-    public static final String RemoveGroupMembers_Request = "RemoveGroupMembers-Request";
-    public static final String SubscribeGroupNotice_Request = "SubscribeGroupNotice-Request";
-    public static final String SubscribeGroupNotice_Response = "SubscribeGroupNotice-Response";
-    public static final String GroupChangeNotice = "GroupChangeNotice";
-//    public static final String MemberAccess_Request = "MemberAccess-Request";
-//    public static final String GetGroupProps_Request = "GetGroupProps-Request";
-//    public static final String GetGroupProps_Response = "GetGroupProps-Response";
-//    public static final String SetGroupProps_Request = "SetGroupProps-Request";
-//    public static final String RejectList_Request = "RejectList-Request";
-//    public static final String RejectList_Response = "RejectList-Response";
-
-    // Extension-related primitives and transactions
-//    public static final String Extended_Request = "Extended-Request";
-//    public static final String Extended_Response = "Extended-Response";
-
-    public static final String UserID = "UserID";
-    public static final String Password = "Password";
-    public static final String Nonce = "Nonce";
-    public static final String CapabilityRequest = "CapabilityRequest";
-    public static final String KeepAliveTime = "KeepAliveTime";
-    public static final String Code = "Code";
-    public static final String Result = "Result";
-    public static final String SessionCookie = "SessionCookie";
-    public static final String DigestSchema = "DigestSchema";
-    public static final String ClientID = "ClientID";
-    public static final String URL = "URL";
-    public static final String MSISDN = "MSISDN";
-    public static final String TimeToLive = "TimeToLive";
-    public static final String DigestBytes = "DigestBytes";
-    public static final String Description = "Description";
-    public static final String AllFunctionsRequest = "AllFunctionsRequest";
-    public static final String AllFunctions = "AllFunctions";
-    public static final String NotAvailableFunctions= "NotAvailableFunctions";
-
-    // Presence Attribute
-    public static final String PresenceSubList = "PresenceSubList";
-    public static final String DefaultList = "DefaultList";
-    public static final String DefaultAttributeList = "DefaultAttributeList";
-
-    public static final String OnlineStatus = "OnlineStatus";
-    public static final String ClientInfo = "ClientInfo";
-    public static final String UserAvailability = "UserAvailability";
-    public static final String StatusText = "StatusText";
-    public static final String CommCap = "CommCap";
-    public static final String CommC = "CommC";
-    public static final String CAP = "Cap";
-
-    // TODO: clean up these uncategorized tags
-    public static final String DefaultContactList = "DefaultContactList";
-    //public static final String ContactListIDList = "ContactListIDList";   // 1.3
-    public static final String ContactList = "ContactList";
-    public static final String ReceiveList = "ReceiveList";
-    public static final String ContactListProperties = "ContactListProperties";
-    public static final String Property = "Property";
-    public static final String Name = "Name";
-    public static final String Value = "Value";
-    public static final String AcceptedContentType = "AcceptedContentType";
-    public static final String NickList = "NickList";
-    public static final String NickName = "NickName";
-    public static final String CapabilityList = "CapabilityList";
-    public static final String AgreedCapabilityList = "AgreedCapabilityList";
-    public static final String ClientType = "ClientType";
-    public static final String ParserSize = "ParserSize";
-    public static final String MultiTrans = "MultiTrans";
-    public static final String MultiTransPerMessage = "MultiTransPerMessage";
-    public static final String InitialDeliveryMethod = "InitialDeliveryMethod";
-    public static final String ServerPollMin = "ServerPollMin";
-    public static final String MessageInfo = "MessageInfo";
-    public static final String User = "User";
-    public static final String DeliveryReport = "DeliveryReport";
-    public static final String ContentSize = "ContentSize";
-    public static final String Sender = "Sender";
-    public static final String Recipient = "Recipient";
-    public static final String ContentData = "ContentData";
-    public static final String MessageID = "MessageID";
-    public static final String CIRHTTPAddress = "CIRHTTPAddress";
-    public static final String DefaultLanguage = "DefaultLanguage";
-    public static final String TCPPort = "TCPPort";
-    public static final String TCPAddress = "TCPAddress";
-    public static final String UDPPort = "UDPPort";
-    public static final String SupportedCIRMethod = "SupportedCIRMethod";
-    public static final String SupportedBearer = "SupportedBearer";
-    public static final String Default = "Default";
-    public static final String ContentType = "ContentType";
-    public static final String ContentEncoding = "ContentEncoding";
-    public static final String DateTime = "DateTime";
-    public static final String Font = "Font";
-    public static final String Size = "Size";
-    public static final String Style = "Style";
-    public static final String Color = "Color";
-    public static final String Validity = "Validity";
-    public static final String Group = "Group";
-    public static final String GroupID = "GroupID";
-    public static final String AutoDelete = "AutoDelete";
-    public static final String Searchable = "Searchable";
-    public static final String PrivateMessaging = "PrivateMessaging";
-    public static final String Accesstype = "Accesstype";
-    public static final String SubscribeNotification = "SubscribeNotification";
-    public static final String JoinGroup = "JoinGroup";
-    public static final String GroupProperties = "GroupProperties";
-    public static final String SName = "SName";
-    public static final String Admin = "Admin";
-    public static final String Mod = "Mod";
-    public static final String UserList = "UserList";
-    public static final String UserIDList = "UserIDList";
-    public static final String JoinedRequest = "JoinedRequest";
-    public static final String ScreenName = "ScreenName";
-    public static final String InviteID = "InviteID";
-    public static final String InviteType = "InviteType";
-    public static final String Joined = "Joined";
-    public static final String Left = "Left";
-    public static final String UserMapList = "UserMapList";
-    public static final String InviteNote = "InviteNote";
-    public static final String Acceptance = "Acceptance";
-    public static final String AddNickList = "AddNickList";
-    public static final String RemoveNickList = "RemoveNickList";
-    public static final String Presence = "Presence";
-    public static final String Qualifier = "Qualifier";
-    public static final String PresenceValue = "PresenceValue";
-    public static final String BlockList = "BlockList";
-    public static final String InUse = "InUse";
-    public static final String EntityList = "EntityList";
-    public static final String GrantList = "GrantList";
-    public static final String AddList = "AddList";
-    public static final String RemoveList = "RemoveList";
-    public static final String BlockListInUse = "BlockListInUse";
-    public static final String GrantListInUse = "GrantListInUse";
-    public static final String ClientProducer = "ClientProducer";
-    public static final String ClientVersion = "ClientVersion";
-    public static final String AutoSubscribe = "AutoSubscribe";
-    public static final String StatusContent = "StatusContent";
-    public static final String DirectContent = "DirectContent";
-    public static final String ReferredContent = "ReferredContent";
-    public static final String AcceptedContentLength = "AcceptedContentLength";
-    public static final String Functions = "Functions";
-    public static final String WVCSPFeat = "WVCSPFeat";
-    public static final String FundamentalFeat = "FundamentalFeat";
-    public static final String PresenceFeat = "PresenceFeat";
-    public static final String IMFeat = "IMFeat";
-    public static final String GroupFeat = "GroupFeat";
-    public static final String CIRURL = "CIRURL";
-}
diff --git a/src/com/android/im/imps/ImpsTransaction.java b/src/com/android/im/imps/ImpsTransaction.java
deleted file mode 100644 (file)
index 2bafcbe..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-/**
- * Represents an IMPS transaction which is a basic communication mechanism
- * between an IMPS client and an IMPS SAP. A transaction usually consists of a
- * request and a response primitive. The transactions MAY originate from either
- * IMPS client or IMPS SAP.
- */
-class ImpsTransaction {
-    private String mId;
-    private ImpsConnection mConnection;
-
-    /**
-     * Creates a new transaction.
-     *
-     * @param id the id of the transaction.
-     */
-    protected ImpsTransaction() {
-    }
-
-    void setTransactionInfo(String id, ImpsConnection conn) {
-        mId = id;
-        mConnection = conn;
-    }
-
-    /**
-     * Gets the id of this transaction.
-     *
-     * @return the id of this transaction.
-     */
-    public String getId() {
-        return mId;
-    }
-
-    protected void sendPrimitive(Primitive primitive) {
-        ImpsSession session = mConnection.getSession();
-        if (session != null) {
-            primitive.setSession(session.getID());
-        }
-        primitive.setTransaction(this);
-
-        mConnection.sendPrimitive(primitive);
-    }
-
-}
diff --git a/src/com/android/im/imps/ImpsTransactionManager.java b/src/com/android/im/imps/ImpsTransactionManager.java
deleted file mode 100644 (file)
index f01c1e6..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.util.HashMap;
-
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.imps.Primitive.TransactionMode;
-
-public class ImpsTransactionManager {
-    private ImpsConnection mConnection;
-    private int mTransactionId;
-
-    /** Keep track of the client initialized transactions. */
-    private HashMap<String, AsyncTransaction> mClientTransactions;
-
-    private HashMap<String, ServerTransactionListener> mServerTransactionListeners;
-
-    /**
-     * Constructs an instance of transaction manager.
-     */
-    ImpsTransactionManager(ImpsConnection connection) {
-        this.mConnection = connection;
-        mClientTransactions = new HashMap<String, AsyncTransaction>();
-        mServerTransactionListeners = new HashMap<String, ServerTransactionListener>();
-    }
-
-    /**
-     * Sets a ServerTransactionListener on this manager so that it will be
-     * notified when a specified transaction has been initialized by the server.
-     *
-     * @param type the primitive type of the transaction.
-     * @param listener the ServerTransactionListener to be notified, or
-     *            <code>null</code> to clear the listener on specified type.
-     */
-    public void setTransactionListener(String type, ServerTransactionListener listener) {
-        synchronized(mServerTransactionListeners) {
-            if (listener == null) {
-                mServerTransactionListeners.remove(type);
-            } else {
-                mServerTransactionListeners.put(type, listener);
-            }
-        }
-    }
-
-    /**
-     * Originates an async transaction from the client.
-     * @param tx
-     */
-    void beginClientTransaction(AsyncTransaction tx) {
-        synchronized(mClientTransactions) {
-            tx.setTransactionInfo(nextTransactionId(), mConnection);
-            mClientTransactions.put(tx.getId(), tx);
-        }
-    }
-
-    /**
-     * Terminates a transaction which was originated from the client.
-     *
-     * @param tx the transaction to terminate.
-     */
-    void endClientTransaction(AsyncTransaction tx) {
-        synchronized(mClientTransactions) {
-            mClientTransactions.remove(tx.getId());
-        }
-    }
-
-    void reassignTransactionId(Primitive p) {
-        synchronized (mClientTransactions) {
-            AsyncTransaction tx = mClientTransactions.remove(p.getTransactionID());
-            if(tx != null) {
-                String newId = nextTransactionId();
-                tx.setTransactionInfo(newId, mConnection);
-                p.setTransactionId(newId);
-                mClientTransactions.put(newId, tx);
-            }
-        }
-    }
-
-    /**
-     * TODO: This should not be called from the DataChannel thread.
-     *
-     * @param transactionId
-     * @param code
-     * @param info
-     */
-    public void notifyErrorResponse(String transactionId,
-            int code, String info) {
-        AsyncTransaction tx;
-        synchronized(mClientTransactions) {
-            tx = mClientTransactions.get(transactionId);
-        }
-        if (tx != null) {
-            tx.notifyError(new ImErrorInfo(code, info));
-        } else {
-            ImpsLog.log("Ignoring possible server transaction error " + code + info);
-        }
-    }
-
-    /**
-     * Notifies the TransactionManager that a new primitive from the server has
-     * arrived.
-     *
-     * @param primitive the incoming primitive.
-     */
-    public void notifyIncomingPrimitive(Primitive primitive) {
-        String transactionId = primitive.getTransactionID();
-        if (primitive.getTransactionMode() == TransactionMode.Response) {
-
-            AsyncTransaction tx;
-            synchronized(mClientTransactions) {
-                tx = mClientTransactions.get(transactionId);
-            }
-            // The transaction might has been terminated by the client,
-            // just ignore the incoming primitive in that case.
-            if (tx != null) {
-                tx.notifyResponse(primitive);
-            }
-        } else {
-            ServerTransaction serverTx = new ServerTransaction(transactionId,
-                    mConnection, primitive);
-
-            ServerTransactionListener listener;
-            synchronized(mServerTransactionListeners) {
-                listener = mServerTransactionListeners.get(primitive.getType());
-            }
-            if (listener != null) {
-                listener.notifyServerTransaction(serverTx);
-            } else {
-                ImpsLog.log("Unhandled Server transaction: " + primitive.getType());
-            }
-        }
-    }
-
-    /**
-     * Generates a new transaction ID.
-     *
-     * @return a new transaction ID.
-     */
-    private synchronized String nextTransactionId() {
-        if(mTransactionId >= 999) {
-            mTransactionId = 0;
-        }
-        return String.valueOf(++mTransactionId);
-    }
-
-}
diff --git a/src/com/android/im/imps/ImpsUserAddress.java b/src/com/android/im/imps/ImpsUserAddress.java
deleted file mode 100644 (file)
index bb541f8..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import com.android.im.engine.Contact;
-import com.android.im.engine.ContactList;
-import com.android.im.engine.ContactListManager;
-import com.android.im.engine.ImEntity;
-
-public class ImpsUserAddress extends ImpsAddress{
-
-    /**
-     * Default Constructor. Required by AddressParcelHelper.
-     */
-    public ImpsUserAddress() {
-    }
-
-    public ImpsUserAddress(String full, boolean verify) {
-        super(full, verify);
-        if(verify && (mUser == null || mResource != null)) {
-            throw new IllegalArgumentException();
-        }
-    }
-
-    public ImpsUserAddress(String full) {
-        this(full, false);
-    }
-
-    public ImpsUserAddress(String user, String domain) {
-        super(user, null, domain);
-    }
-
-    @Override
-    public PrimitiveElement toPrimitiveElement() {
-        PrimitiveElement user = new PrimitiveElement(ImpsTags.User);
-        user.addChild(ImpsTags.UserID, getFullName());
-        return user;
-    }
-
-    @Override
-    public String getScreenName() {
-        return mUser;
-    }
-
-    @Override
-    public ImEntity getEntity(ImpsConnection connection) {
-        ContactListManager manager = connection.getContactListManager();
-        for(ContactList list : manager.getContactLists()) {
-            Contact contact = list.getContact(this);
-            if(contact != null) {
-                return contact;
-            }
-        }
-        //TODO: add to a stranger list?
-        return new Contact(this, this.getUser());
-    }
-}
diff --git a/src/com/android/im/imps/ImpsUtils.java b/src/com/android/im/imps/ImpsUtils.java
deleted file mode 100644 (file)
index 99de5fa..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Random;
-
-import com.android.im.engine.ImErrorInfo;
-
-public class ImpsUtils {
-
-    private static final HashMap<String, String> sClientInfo;
-    private static String sSessionCookie;
-    private static int sSessionCookieNumber;
-
-    private ImpsUtils() {
-    }
-
-    static {
-        // TODO: v1.2 doesn't support ClientContentLimit
-        sClientInfo = new HashMap<String, String>();
-        sClientInfo.put(ImpsTags.ClientType, ImpsClientCapability.getClientType());
-        sClientInfo.put(ImpsTags.ClientProducer, ImpsConstants.CLIENT_PRODUCER);
-        sClientInfo.put(ImpsTags.ClientVersion, ImpsConstants.CLIENT_VERSION);
-    }
-
-    /**
-     * Checks if a string is a boolean value of true IMPS.
-     *
-     * @param value the string value.
-     * @return <code>true</code> if it's true in IMPS.
-     */
-    public static boolean isTrue(String value) {
-        return ImpsConstants.TRUE.equalsIgnoreCase(value);
-    }
-
-    /**
-     * Checks if a string is a boolean value of false in IMPS.
-     *
-     * @param value the string value.
-     * @return true if it's false in IMPS
-     */
-    public static boolean isFalse(String value) {
-        return ImpsConstants.FALSE.equalsIgnoreCase(value);
-    }
-
-    /**
-     * Return the IMPS String presentation of the boolean value
-     *
-     * @param isTrue the boolean value
-     * @return the String presentation
-     */
-    public static String toImpsBool(boolean isTrue) {
-        if (isTrue) {
-            return ImpsConstants.TRUE;
-        }
-
-        return ImpsConstants.FALSE;
-    }
-
-    /**
-     * Checks if the response primitive indicates successful.
-     *
-     * @param response the response primitive.
-     * @returns <code>null</code> if the status code is 200 or an ImpsErrorInfo instance
-     */
-    public static ImpsErrorInfo checkResultError(Primitive response) {
-        PrimitiveElement result = response.getElement(ImpsTags.Result);
-        if (result == null) {
-            return null;
-        }
-
-        String resultCode = result.getChild(ImpsTags.Code).getContents();
-        if (!ImpsConstants.SUCCESS_CODE.equals(resultCode)) {
-            PrimitiveElement descElem = result.getChild(ImpsTags.Description);
-            String errorDesc = (descElem == null) ? "" : descElem.getContents();
-            int statusCode = parseInt(resultCode, ImErrorInfo.ILLEGAL_SERVER_RESPONSE);
-            return new ImpsErrorInfo(statusCode, errorDesc, response);
-        }
-        return null;
-    }
-
-    /**
-     * Returns a copy of the string, with leading and trailing whitespace
-     * omitted. Unlike the standard trim which just removes '\u0020'(the space
-     * character), it removes all possible leading and trailing whitespace
-     * character.
-     *
-     * @param str the string.
-     * @return a copy of the string, with leading and trailing whitespace
-     *         omitted.
-     */
-    public static String trim(String str) {
-        if (null == str || "".equals(str))
-            return str;
-
-        int strLen = str.length();
-        int start = 0;
-        while (start < strLen && Character.isWhitespace(str.charAt(start)))
-            start++;
-        int end = strLen - 1;
-        while (end >= 0 && Character.isWhitespace(str.charAt(end)))
-            end--;
-        if (end < start)
-            return "";
-        str = str.substring(start, end + 1);
-        return str;
-    }
-
-    /**
-     * Check whether the presence element has a qualified attribute value.
-     * An attribute value is invalid when:
-     *  1. An attribute is authorized but not yet updated for the first time
-     *  2. The user wants to indicate that the value of the attribute is unknown.
-     *
-     * @param elem the presence element
-     * @return <code>true</code> if the value of attribute is valid.
-     */
-    public static boolean isQualifiedPresence(PrimitiveElement elem) {
-        if (null == elem || null == elem.getChild(ImpsTags.Qualifier)) {
-            return false;
-        }
-
-        return ImpsUtils.isTrue(elem.getChildContents(ImpsTags.Qualifier));
-    }
-
-    public static Map<String, String> getClientInfo() {
-        return Collections.unmodifiableMap(sClientInfo);
-    }
-
-    synchronized static String genSessionCookie() {
-        if(sSessionCookie == null) {
-            Random random = new Random();
-            sSessionCookie = System.currentTimeMillis() + "" + random.nextInt();
-        }
-        return sSessionCookie + (sSessionCookieNumber++);
-    }
-
-    public static int parseInt(String s, int defaultValue) {
-        try {
-            return Integer.parseInt(s);
-        } catch (NumberFormatException e) {
-            // ignore
-            return defaultValue;
-        }
-    }
-
-    public static long parseLong(String s, long defaultValue) {
-        try {
-            return Long.parseLong(s);
-        } catch (NumberFormatException e) {
-            // ignore
-            return defaultValue;
-        }
-    }
-}
diff --git a/src/com/android/im/imps/MultiPhaseTransaction.java b/src/com/android/im/imps/MultiPhaseTransaction.java
deleted file mode 100644 (file)
index ba46586..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-abstract class MultiPhaseTransaction extends AsyncTransaction {
-
-    public enum TransactionStatus {
-        TRANSACTION_COMPLETED,
-        TRANSACTION_CONTINUE,
-    }
-
-    /* Multi-phase asynchronous transaction carries no AsyncCompletion.
-     */
-    public MultiPhaseTransaction(ImpsTransactionManager manager) {
-        super(manager);
-    }
-
-    @Override
-    protected void notifySuccessResponse(Primitive response) {
-        TransactionStatus status = processResponse(response);
-        if (status != TransactionStatus.TRANSACTION_CONTINUE) {
-            mTransManager.endClientTransaction(this);
-        }
-    }
-
-    @Override
-    protected void notifyErrorResponse(ImpsErrorInfo error) {
-        TransactionStatus status = processResponseError(error);
-        if (status != TransactionStatus.TRANSACTION_CONTINUE) {
-            mTransManager.endClientTransaction(this);
-        }
-    }
-
-    public abstract TransactionStatus processResponseError(ImpsErrorInfo error);
-    public abstract TransactionStatus processResponse(Primitive response);
-
-    @Override
-    final public void onResponseError(ImpsErrorInfo error) { }
-
-    @Override
-    final public void onResponseOk(Primitive response) { }
-
-}
diff --git a/src/com/android/im/imps/ParserException.java b/src/com/android/im/imps/ParserException.java
deleted file mode 100644 (file)
index c1c021e..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-public class ParserException extends Exception {
-
-    private static final long serialVersionUID = -6202498304209638323L;
-
-    public ParserException(){
-        super();
-    }
-
-    public ParserException(String message){
-        super(message);
-    }
-
-    public ParserException(Throwable t){
-        super(t);
-    }
-}
diff --git a/src/com/android/im/imps/PasswordDigest.java b/src/com/android/im/imps/PasswordDigest.java
deleted file mode 100644 (file)
index d911fc5..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import com.android.im.engine.ImException;
-
-public interface PasswordDigest {
-    /**
-     * Gets an array of supported digest schema.
-     *
-     * @return an array of digest schema
-     */
-    String[] getSupportedDigestSchema();
-
-    /**
-     * Generates digest bytes.
-     *
-     */
-    String digest(String schema, String nonce, String password) throws ImException;
-}
diff --git a/src/com/android/im/imps/PresenceMapping.java b/src/com/android/im/imps/PresenceMapping.java
deleted file mode 100644 (file)
index 04602a9..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.imps;
-
-import java.util.Map;
-
-public interface PresenceMapping {
-    /**
-     * Tells if the mapping needs all presence values sent in protocol. If this
-     * method returns true, the framework will pass all the presence values
-     * received from the server when map to the predefined status.
-     *
-     * @return true if needs; false otherwise.
-     */
-    boolean requireAllPresenceValues();
-
-    /**
-     * Map the presence values sent in protocol to the predefined presence
-     * status.
-     *
-     * @param onlineStatus The value of presence &lt;OnlineStatus&gt; received
-     *            from the server.
-     * @param userAvailability The value of presence &lt;UserAvailibility&gt;
-     *            received from the server.
-     * @param allValues The whole presence values received from the server.
-     * @return a predefined status.
-     * @see #requireAllPresenceValues()
-     */
-    int getPresenceStatus(boolean onlineStatus, String userAvailability,
-             Map<String, Object> allValues);
-
-    /**
-     * Gets the value of &lt;OnlineStatus&gt; will be sent to the server when
-     * update presence to the predefined status.
-     *
-     * @param status the predefined status.
-     * @return The value of &lt;OnlineStatus&gt; will be sent to the server
-     */
-    boolean getOnlineStatus(int status);
-
-    /**
-     * Gets the value of &lt;UserAvaibility&gt; will be sent to the server when
-     * update presence to the predefined status.
-     *
-     * @param status the predefined status.
-     * @return The value of &lt;UserAvaibility&gt; will be sent to the server
-     */
-    String getUserAvaibility(int status);
-
-    /**
-     * Gets the extra presence values other than &lt;OnlineStatus&gt; and
-     * &lt;UserAvaibility&gt; will be sent to the server when update presence to
-     * the predefined status.
-     *
-     * @param status the predefined status.
-     * @return The extra values that will be sent to the server.
-     */
-    Map<String, Object> getExtra(int status);
-
-    /**
-     * Gets an array of the supported presence status. The client can only update
-     * presence to the values in the array.
-     *
-     * @return an array of the supported presence status.
-     */
-    int[] getSupportedPresenceStatus();
-}
diff --git a/src/com/android/im/imps/PresencePollingManager.java b/src/com/android/im/imps/PresencePollingManager.java
deleted file mode 100644 (file)
index e7d917c..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-/**
- * Manage presence polling from the server. If the server does not support
- * subscribing presence change or prefer the client polling presence, the client
- * should send GetPresence-Request periodically. 
- */
-public class PresencePollingManager implements Runnable {
-    private boolean mStopped;
-    private boolean mFinished;
-
-    private long mPollingInterval;
-    private Object mLock = new Object();
-
-    private ImpsAddress[] mPollingAddress;
-    private ImpsAddress[] mContactLists;
-
-    private ImpsContactListManager mManager;
-    private Thread mPollingThread;
-
-    public PresencePollingManager(ImpsContactListManager manager,
-            long pollingIntervalMillis) {
-        mManager = manager;
-        mPollingInterval = pollingIntervalMillis;
-        mStopped = true;
-        mFinished = false;
-    }
-
-    public void resetPollingContacts() {
-        synchronized (mLock) {
-            mContactLists = null;
-        }
-    }
-
-    public void startPolling() {
-        synchronized (mLock) {
-            // Clear the polling address; the polling thread will fetch the
-            // presence of all the contacts in lists.
-            mPollingAddress = null;
-        }
-        doStartPolling();
-    }
-
-    public void startPolling(ImpsUserAddress user){
-        synchronized (mLock) {
-            mPollingAddress = new ImpsAddress[] { user };
-        }
-        doStartPolling();
-    }
-
-    public void stopPolling() {
-        mStopped = true;
-    }
-
-    public void shutdownPolling() {
-        mFinished = true;
-        synchronized (mLock) {
-            mLock.notify();
-        }
-    }
-
-    public void run() {
-        while (!mFinished) {
-            synchronized (mLock) {
-                if (!mStopped) {
-                    ImpsAddress[] pollingAddress = mPollingAddress;
-                    if (pollingAddress == null) {
-                        // Didn't specify of which contacts the presence will
-                        // poll. Fetch the presence of all contacts in list.
-                        pollingAddress = getContactLists();
-                    }
-                    mManager.fetchPresence(pollingAddress);
-                }
-
-                try {
-                    mLock.wait(mPollingInterval);
-                } catch (InterruptedException e) {
-                    // ignore
-                }
-            }
-        }
-    }
-
-    private void doStartPolling() {
-        mStopped = false;
-        if (mPollingThread == null) {
-            mPollingThread = new Thread(this, "PollingThread");
-            mPollingThread.setDaemon(true);
-            mPollingThread.start();
-        } else {
-            synchronized (mLock) {
-                mLock.notify();
-            }
-        }
-    }
-
-    private ImpsAddress[] getContactLists() {
-        if (mContactLists == null) {
-            mContactLists = mManager.getAllListAddress();
-        }
-        return mContactLists;
-    }
-
-}
diff --git a/src/com/android/im/imps/Primitive.java b/src/com/android/im/imps/Primitive.java
deleted file mode 100644 (file)
index 5957a19..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-/**
- * A primitive is the basic packet sent between the IMPS server and the IMPS
- * client. Note that this class is not thread-safe.
- */
-public final class Primitive {
-    private TransactionMode mTransactionMode = TransactionMode.Request;
-    private String mTransactionId;
-
-    private String mSessionId;
-
-    private String mPoll;
-    private String mCir;
-
-    private PrimitiveElement mContentElement;
-
-    /**
-     * Constructs a new Primitive with default value.
-     */
-    public Primitive() {
-    }
-
-    /**
-     * Constructs a new Primitive with a type.
-     *
-     * @param type the type of the primitive.
-     */
-    public Primitive(String type) {
-        mContentElement = new PrimitiveElement(type);
-    }
-
-    /**
-     * Gets the session type of this primitive.
-     *
-     * @return the session type .
-     */
-    public SessionType getSessionType() {
-        return mSessionId == null ? SessionType.Outband : SessionType.Inband;
-    }
-
-    /**
-     * Gets the session ID of this primitive.
-     *
-     * @return the session ID.
-     */
-    public String getSessionId() {
-        return mSessionId;
-    }
-
-    /**
-     * Sets the session ID of this primitive.
-     *
-     * @param sessionId the session ID.
-     */
-    public void setSession(String sessionId) {
-        this.mSessionId = sessionId;
-    }
-
-    /**
-     * Gets the transaction mode of this primitive.
-     *
-     * @return the transaction mode.
-     */
-    public TransactionMode getTransactionMode() {
-        return mTransactionMode;
-    }
-
-    /**
-     * Sets the transaction mode of this primitive.
-     *
-     * @param mode the transaction mode.
-     */
-    public void setTransactionMode(TransactionMode mode) {
-        this.mTransactionMode = mode;
-    }
-
-    /**
-     * Gets the transaction ID of this primitive.
-     *
-     * @return the transaction ID.
-     */
-    public String getTransactionID() {
-        return mTransactionId;
-    }
-
-    /**
-     * Sets the transaction ID of this primitive.
-     * @param transId the transaction ID.
-     */
-    public void setTransactionId(String transId) {
-        this.mTransactionId = transId;
-    }
-
-    public void setTransaction(ImpsTransaction transaction) {
-        this.mTransactionId = transaction.getId();
-    }
-
-    public String getCir() {
-        return mCir;
-    }
-
-    public void setCir(String cir) {
-        this.mCir = cir;
-    }
-
-    public String getPoll() {
-        return mPoll;
-    }
-
-    public void setPoll(String poll) {
-        this.mPoll = poll;
-    }
-
-    public String getType() {
-        return (mContentElement == null) ? null : mContentElement.getTagName();
-    }
-
-    public PrimitiveElement getContentElement() {
-        return mContentElement;
-    }
-
-    public void setContentElement(String type) {
-        mContentElement = new PrimitiveElement(type);
-    }
-
-    public PrimitiveElement addElement(String tag) {
-        return mContentElement.addChild(tag);
-    }
-
-    public void addElement(String tag, String value) {
-        mContentElement.addChild(tag, value);
-    }
-
-    public void addElement(String tag, boolean value) {
-        mContentElement.addChild(tag, value);
-    }
-
-    public void addElement(PrimitiveElement elem) {
-        mContentElement.addChild(elem);
-    }
-
-    public PrimitiveElement getElement(String tag) {
-        return mContentElement.getChild(tag);
-    }
-
-    public String getElementContents(String tag) {
-        PrimitiveElement elem = getElement(tag);
-        return elem == null ? null : elem.getContents();
-    }
-
-    PrimitiveElement createMessage(String versionUri, String transactUri) {
-        PrimitiveElement root = new PrimitiveElement(ImpsTags.WV_CSP_Message);
-
-        root.setAttribute(ImpsTags.XMLNS, versionUri);
-        PrimitiveElement sessionElem = root.addChild(ImpsTags.Session);
-
-        PrimitiveElement sessionDescElem = sessionElem.addChild(
-                ImpsTags.SessionDescriptor);
-        sessionDescElem.addChild(ImpsTags.SessionType,
-                getSessionType().toString());
-        if (getSessionId() != null) {
-            sessionDescElem.addChild(ImpsTags.SessionID, getSessionId());
-        }
-
-        PrimitiveElement transElem = sessionElem.addChild(ImpsTags.Transaction);
-
-        PrimitiveElement transDescElem = transElem.addChild(
-                ImpsTags.TransactionDescriptor);
-        transDescElem.addChild(ImpsTags.TransactionMode,
-                getTransactionMode().toString());
-        if (getTransactionID() != null) {
-            transDescElem.addChild(ImpsTags.TransactionID, getTransactionID());
-        }
-
-        PrimitiveElement transContentElem = transElem.addChild(
-                ImpsTags.TransactionContent);
-        transContentElem.setAttribute(ImpsTags.XMLNS, transactUri);
-        transContentElem.addChild(getContentElement());
-
-        return root;
-    }
-
-    /**
-     * Represents the transaction mode of a primitive.
-     */
-    public static enum TransactionMode {
-        /**
-         * Indicates the primitive is a request in a transaction.
-         */
-        Request,
-
-        /**
-         * Indicates the primitive is a response in a transaction.
-         */
-        Response
-    }
-
-    /**
-     * Represents the session type of a primitive.
-     */
-    public static enum SessionType {
-        /**
-         * Indicates a primitive is sent within a session.
-         */
-        Inband,
-
-        /**
-         * Indicates a primitive is sent without a session.
-         */
-        Outband
-    }
-}
diff --git a/src/com/android/im/imps/PrimitiveContentHandler.java b/src/com/android/im/imps/PrimitiveContentHandler.java
deleted file mode 100644 (file)
index 9d2f99a..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.util.Stack;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.helpers.DefaultHandler;
-
-import com.android.im.imps.Primitive.TransactionMode;
-
-public final class PrimitiveContentHandler extends DefaultHandler {
-    private Primitive mPrimitive;
-    private String mCurTagName;
-    private boolean mIsTransContent;
-    private Stack<PrimitiveElement> mContentElementsStack;
-
-    public PrimitiveContentHandler() {
-        mPrimitive = new Primitive();
-        mContentElementsStack = new Stack<PrimitiveElement>();
-    }
-
-    public void reset() {
-        mPrimitive = new Primitive();
-        mContentElementsStack.clear();
-
-        mIsTransContent = false;
-    }
-
-    public Primitive getPrimitive() {
-        return mPrimitive;
-    }
-
-    @Override
-    public void startElement(String uri, String localName, String qName,
-            Attributes attributes) {
-        if (mIsTransContent) {
-            if (mContentElementsStack.empty()) {
-                mPrimitive.setContentElement(localName);
-                mContentElementsStack.push(mPrimitive.getContentElement());
-            } else {
-                PrimitiveElement parentPrimitive = mContentElementsStack.peek();
-                PrimitiveElement childPrimitive = new PrimitiveElement(
-                        localName);
-
-                parentPrimitive.addChild(childPrimitive);
-                mContentElementsStack.push(childPrimitive);
-            }
-        } else {
-            if (ImpsTags.TransactionContent.equals(localName)) {
-                mIsTransContent = true;
-            }
-        }
-
-        mCurTagName = localName;
-    }
-
-    @Override
-    public void endElement(String uri, String localName, String qName) {
-        if (ImpsTags.TransactionContent.equals(localName)) {
-            mIsTransContent = false;
-        }
-
-        if (mIsTransContent) {
-            if (!mContentElementsStack.empty()) {
-                mContentElementsStack.pop();
-            }
-        }
-        mCurTagName = null;
-    }
-
-    @Override
-    public void characters(char[] ch, int start, int length) {
-        String contentStr = ImpsUtils.trim(new String(ch, start, length));
-        if (contentStr == null || contentStr.length() == 0) {
-            return;
-        }
-        if (mIsTransContent) {
-            if (!ImpsTags.TransactionContent.equals(mCurTagName)) {
-                PrimitiveElement curPrimitive = mContentElementsStack.peek();
-
-                curPrimitive.setContents(contentStr);
-            }
-        } else {
-            if (ImpsTags.TransactionID.equals(mCurTagName)) {
-                mPrimitive.setTransactionId(contentStr);
-            } else if (ImpsTags.TransactionMode.equals(mCurTagName)) {
-                mPrimitive.setTransactionMode(TransactionMode.valueOf(contentStr));
-            } else if (ImpsTags.SessionID.equals(mCurTagName)) {
-                mPrimitive.setSession(contentStr);
-            } else if (ImpsTags.Poll.equals(mCurTagName)) {
-                mPrimitive.setPoll(contentStr);
-            } else if (ImpsTags.CIR.equals(mCurTagName)) {
-                mPrimitive.setCir(contentStr);
-            }
-        }
-    }
-}
diff --git a/src/com/android/im/imps/PrimitiveElement.java b/src/com/android/im/imps/PrimitiveElement.java
deleted file mode 100644 (file)
index dff79d3..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Represents a XML element of Primitive. Note that this class is not
- * thread-safe.
- */
-final public class PrimitiveElement {
-    private String mTagName;
-    private HashMap<String, String> mAttributes;
-    private ArrayList<PrimitiveElement> mChildren;
-    private String mContents;
-
-    public PrimitiveElement(String tagName) {
-        mTagName = tagName;
-    }
-
-    public String getTagName() {
-        return mTagName;
-    }
-
-    public void setTagName(String tagName) {
-        this.mTagName = tagName;
-    }
-
-    public Map<String, String> getAttributes() {
-        if (mAttributes == null) {
-            return null;
-        }
-        return Collections.unmodifiableMap(mAttributes);
-    }
-
-    public void setAttribute(String key, String value) {
-        if (key != null && value != null) {
-            if (mAttributes == null) {
-                mAttributes = new HashMap<String, String>();
-            }
-            mAttributes.put(key, value);
-        }
-    }
-
-    public ArrayList<PrimitiveElement> getChildren() {
-        if (mChildren == null) {
-            mChildren = new ArrayList<PrimitiveElement>();
-        }
-        return mChildren;
-    }
-
-    public ArrayList<PrimitiveElement> getChildren(String tagName) {
-        ArrayList<PrimitiveElement> children = new ArrayList<PrimitiveElement>();
-
-        for (PrimitiveElement child : getChildren()) {
-            if (tagName.equals(child.getTagName())) {
-                children.add(child);
-            }
-        }
-
-        return children;
-    }
-
-    public PrimitiveElement getChild(String tagName) {
-        for (PrimitiveElement child : getChildren()) {
-            if (tagName.equals(child.getTagName())) {
-                return child;
-            }
-        }
-        return null;
-    }
-
-    public String getChildContents(String tagName) {
-        PrimitiveElement child = getChild(tagName);
-        return child == null ? null : child.getContents();
-    }
-
-    public int getChildCount() {
-        if (mChildren == null || mChildren.isEmpty()) {
-            return 0;
-        } else {
-            return mChildren.size();
-        }
-    }
-
-    public PrimitiveElement getFirstChild() {
-        if ((mChildren == null) || mChildren.isEmpty()) {
-            return null;
-        }
-        return mChildren.get(0);
-    }
-
-    public PrimitiveElement addChild(PrimitiveElement child) {
-        if (child != null) {
-            getChildren().add(child);
-        }
-
-        return child;
-    }
-
-    public PrimitiveElement addChild(String tagName) {
-        if (null == tagName) {
-            return null;
-        }
-        PrimitiveElement element = new PrimitiveElement(tagName);
-        getChildren().add(element);
-        return element;
-    }
-
-    public void addChild(String tagName, String contents) {
-        PrimitiveElement element = addChild(tagName);
-        if (null != contents) {
-            element.setContents(contents);
-        }
-    }
-
-    public void addChild(String tagName, boolean value) {
-        addChild(tagName).setContents(value ?
-                ImpsConstants.TRUE : ImpsConstants.FALSE);
-    }
-
-    public void addPropertyChild(String name, String value)
-    {
-        PrimitiveElement ret = addChild(ImpsTags.Property);
-        ret.addChild(ImpsTags.Name, name);
-        ret.addChild(ImpsTags.Value, value);
-    }
-
-    public void addPropertyChild(String name, boolean value)
-    {
-        PrimitiveElement ret = addChild(ImpsTags.Property);
-        ret.addChild(ImpsTags.Name, name);
-        ret.addChild(ImpsTags.Value, value);
-    }
-
-    public String getContents() {
-        return mContents;
-    }
-
-    public void setContents(String contents) {
-        mContents = contents;
-    }
-}
diff --git a/src/com/android/im/imps/PrimitiveParser.java b/src/com/android/im/imps/PrimitiveParser.java
deleted file mode 100644 (file)
index c39aeec..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * The <code>PrimitiveParser</code> is used to parse the data received from
- * the server to a Primitive.
- */
-public interface PrimitiveParser {
-    /**
-     * Parses the data to a primitive.
-     *
-     * @param in the InputStream of the data.
-     * @return a parsed primitive.
-     * @throws ParserException
-     * @throws IOException
-     */
-    public Primitive parse(InputStream in) throws ParserException, IOException;
-}
diff --git a/src/com/android/im/imps/PrimitiveSerializer.java b/src/com/android/im/imps/PrimitiveSerializer.java
deleted file mode 100644 (file)
index 6b82750..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * The <code>PrimitiveSerializer</code> is used format a primitive to expected
- * format such as XML, WBXML or PTS.
- */
-public interface PrimitiveSerializer {
-    /**
-     * Serializes the primitive to the OutputStream in expected format.
-     *
-     * @param primitive the primitive to format.
-     * @param out the OutputStream.
-     * @throws IOException
-     * @throws SerializerException
-     */
-    public void serialize(Primitive primitive, OutputStream out)
-            throws IOException, SerializerException;
-}
diff --git a/src/com/android/im/imps/PtsCodes.java b/src/com/android/im/imps/PtsCodes.java
deleted file mode 100644 (file)
index 1ee46e4..0000000
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map.Entry;
-
-public class PtsCodes {
-
-    private PtsCodes() {
-    }
-
-    private static HashMap<String, String> sCodeToTransaction = new HashMap<String, String>();
-    private static HashMap<String, String> sCodeToElement = new HashMap<String, String>();
-    private static HashMap<String, String> sCodeToCapElement = new HashMap<String, String>();
-    private static HashMap<String, String> sCodeToCapValue= new HashMap<String, String>();
-    private static HashMap<String, String> sCodeToServiceTree = new HashMap<String, String>();
-    private static HashMap<String, String> sCodeToPresenceAttribute = new HashMap<String, String>();
-
-    private static HashMap<String, String> sTransactionToCode = new HashMap<String, String>();
-    private static HashMap<String, String> sElementToCode = new HashMap<String, String>();
-    /*package*/ static HashMap<String, String> sCapElementToCode = new HashMap<String, String>();
-    /*package*/ static HashMap<String, String> sCapValueToCode= new HashMap<String, String>();
-    private static HashMap<String, String> sServiceTreeToCode = new HashMap<String, String>();
-    static HashMap<String, String> sContactListPropsToCode = new HashMap<String, String>();
-    private static HashMap<String, String> sPresenceAttributeToCode = new HashMap<String, String>();
-
-    private static ArrayList<String> sServerRequestTransactionCode = new ArrayList<String>();
-    private static HashMap<String, String> sCodeToPAValue = new HashMap<String, String>();
-    private static HashMap<String, String> sPAValueToCode = new HashMap<String, String>();
-
-    public static String getTransaction(String type) {
-        // not case sensitive
-        return sCodeToTransaction.get(type.toUpperCase());
-    }
-
-    public static String getElement(String type) {
-        // not case sensitive
-        return sCodeToElement.get(type.toUpperCase());
-    }
-
-    public static String getCapElement(String type) {
-        // not case sensitive
-        return sCodeToCapElement.get(type.toUpperCase());
-    }
-
-    public static String getCapValue(String type) {
-        // not case sensitive
-        return sCodeToCapValue.get(type.toUpperCase()) == null ?
-                type : sCodeToCapValue.get(type.toUpperCase());
-    }
-
-    public static String getServiceTreeValue(String type) {
-        // not case sensitive
-        return sCodeToServiceTree.get(type.toUpperCase());
-    }
-
-    public static String getTxCode(String txType) {
-        return sTransactionToCode.get(txType);
-    }
-
-    public static String getElementCode(String elemType, String transactionType) {
-        if (ImpsTags.PresenceSubList.equals(elemType)) {
-            return ImpsTags.UpdatePresence_Request.equals(transactionType) ? "UV" : "PS";
-        }
-
-        return sElementToCode.get(elemType);
-    }
-
-    public static String getCapElementCode(String elemType) {
-        return sCapElementToCode.get(elemType);
-    }
-
-    public static String getCapValueCode(String value) {
-        return sCapValueToCode.get(value);
-    }
-
-    public static String getServiceTreeCode(String elemType) {
-        return sServiceTreeToCode.get(elemType);
-    }
-
-    public static String getPresenceAttributeCode(String elemType){
-        return sPresenceAttributeToCode.get(elemType);
-    }
-
-    public static String getPresenceAttributeElement(String code) {
-        // not case sensitive
-        return sCodeToPresenceAttribute.get(code.toUpperCase());
-    }
-
-    public static String getPAValue(String code) {
-        // not case sensitive
-        String value = sCodeToPAValue.get(code.toUpperCase());
-
-        return value == null ? code : value;
-    }
-
-    public static String getPAValueCode(String value) {
-        // not case sensitive
-        String code = sPAValueToCode.get(value.toUpperCase());
-        return code == null ? value : code;
-    }
-
-    public static boolean isServerRequestCode(String type) {
-        for (String code : sServerRequestTransactionCode) {
-            if (code.equals(type)) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    // Fundamental primitives and transactions
-    public static final String ClientCapability_Response    = "PC";
-    public static final String Disconnect                   = "DI";
-//    public static final String GetList_Request              = "GL";
-    public static final String GetList_Response             = "LG";
-//    public static final String KeepAlive_Request            = "KA";
-    public static final String KeepAlive_Response           = "AK";
-    public static final String Login_Response               = "RL";
-//    public static final String Logout_Request               = "OR";
-//    public static final String Polling_Request              = "PO";
-//    public static final String Service_Request              = "SQ";
-    public static final String Service_Response             = "QS";
-    public static final String Status                       = "ST";   // the same for the element "Status"
-    public static final String ListManage_Response          = "ML";
-    public static final String PresenceNotification         = "PN";
-    public static final String GetPresence_Response         = "PG";
-//    public static final String Disconnect = "Disconnect";
-//    public static final String KeepAlive_Request = "KeepAlive-Request";
-//    public static final String KeepAlive_Response = "KeepAlive-Response";
-//    public static final String Service_Request = "Service-Request";
-//    public static final String Service_Response = "Service-Response";
-
-    // Information elements
-    public static final String AllFunctions          = "AF";
-    public static final String CapabilityList        = "CA";
-    public static final String AgreedCapabilityList  = "AP";
-    public static final String CapabilityRequest     = "CR";
-    public static final String ClientID              = "CI";
-    public static final String ContactList           = "CL";
-    public static final String DefaultContactList    = "DC";
-    public static final String DigestSchema          = "DI";
-    public static final String Nonce                 = "NO";
-    public static final String NotAvailableFunctions = "NF";
-    public static final String KeepAliveTime         = "KA";
-    public static final String SessionID             = "SI";
-    public static final String DefaultList           = "DL";
-    public static final String UserNickList          = "UN";
-    public static final String ContactListProps      = "CP";
-    public static final String Presence              = "PR";
-
-    // Contact list properties
-    public static final String DisplayName = "DN";
-    public static final String Default     = "DE";
-
-    static {
-        sTransactionToCode.put(ImpsTags.Login_Request, "LR");
-        sTransactionToCode.put(ImpsTags.ClientCapability_Request, "CP");
-        sTransactionToCode.put(ImpsTags.Service_Request, "SQ");
-        sTransactionToCode.put(ImpsTags.Logout_Request, "OR");
-        sTransactionToCode.put(ImpsTags.Status, "ST");
-        sTransactionToCode.put(ImpsTags.GetList_Request, "GL");
-        sTransactionToCode.put(ImpsTags.CreateList_Request, "CL");
-        sTransactionToCode.put(ImpsTags.DeleteList_Request, "DL");
-        sTransactionToCode.put(ImpsTags.ListManage_Request, "LM");
-        sTransactionToCode.put(ImpsTags.GetPresence_Request, "GP");
-        sTransactionToCode.put(ImpsTags.SubscribePresence_Request, "SB");
-        sTransactionToCode.put(ImpsTags.GetBlockedList_Request, "GB");
-        sTransactionToCode.put(ImpsTags.CreateAttributeList_Request, "CA");
-        sTransactionToCode.put(ImpsTags.Polling_Request, "PO");
-        sTransactionToCode.put(ImpsTags.UpdatePresence_Request, "UP");
-
-        sElementToCode.put(ImpsTags.ClientID, ClientID);
-        sElementToCode.put(ImpsTags.DigestSchema, "SH");
-        sElementToCode.put(ImpsTags.DigestBytes, "DB");
-        sElementToCode.put(ImpsTags.Password, "PW");
-        sElementToCode.put(ImpsTags.SessionCookie, "SC");
-        sElementToCode.put(ImpsTags.TimeToLive, "TL");
-        sElementToCode.put(ImpsTags.UserID, "UI");
-        sElementToCode.put(ImpsTags.CapabilityList, CapabilityList);
-        sElementToCode.put(ImpsTags.Functions, "RF");
-        sElementToCode.put(ImpsTags.AllFunctionsRequest, "AR");
-        sElementToCode.put(ImpsTags.Result, "ST");
-        sElementToCode.put(ImpsTags.ContactList, "CL");
-        sElementToCode.put(ImpsTags.NickList, "UN");
-        sElementToCode.put(ImpsTags.AddNickList, "AN");
-        sElementToCode.put(ImpsTags.RemoveNickList, "RN");
-        sElementToCode.put(ImpsTags.ContactListProperties, "CP");
-        sElementToCode.put(ImpsTags.ReceiveList, "RL");
-        sElementToCode.put(ImpsTags.PresenceSubList, "PS");
-        sElementToCode.put(ImpsTags.DefaultList, DefaultList);
-        sElementToCode.put(ImpsTags.AutoSubscribe, "AS");
-
-        sCodeToTransaction.put(ClientCapability_Response, ImpsTags.ClientCapability_Response);
-        sCodeToTransaction.put(Disconnect, ImpsTags.Disconnect);
-        sCodeToTransaction.put(GetList_Response, ImpsTags.GetList_Response);
-        sCodeToTransaction.put(KeepAlive_Response, ImpsTags.KeepAlive_Response);
-        sCodeToTransaction.put(Login_Response, ImpsTags.Login_Response);
-        sCodeToTransaction.put(Service_Response, ImpsTags.Service_Response);
-        sCodeToTransaction.put(Status, ImpsTags.Status);
-        sCodeToTransaction.put(ListManage_Response, ImpsTags.ListManage_Response);
-        sCodeToTransaction.put(PresenceNotification, ImpsTags.PresenceNotification_Request);
-        sCodeToTransaction.put(GetPresence_Response, ImpsTags.GetPresence_Response);
-
-        sCodeToElement.put(AllFunctions, ImpsTags.AllFunctions);
-        sCodeToElement.put(CapabilityList, ImpsTags.CapabilityList);
-        sCodeToElement.put(CapabilityRequest, ImpsTags.CapabilityRequest);
-        sCodeToElement.put(ClientID, ImpsTags.ClientID);
-        sCodeToElement.put(ContactList, ImpsTags.ContactList);
-        sCodeToElement.put(DigestSchema, ImpsTags.DigestSchema);
-        sCodeToElement.put(Nonce, ImpsTags.Nonce);
-        sCodeToElement.put(NotAvailableFunctions, ImpsTags.NotAvailableFunctions);
-        sCodeToElement.put(KeepAliveTime, ImpsTags.KeepAliveTime);
-        sCodeToElement.put(SessionID, ImpsTags.SessionID);
-        sCodeToElement.put(Status, ImpsTags.Status);
-        sCodeToElement.put(DefaultList, ImpsTags.DefaultContactList);
-        sCodeToElement.put(UserNickList, ImpsTags.NickList);
-        sCodeToElement.put(Presence, ImpsTags.Presence);
-
-        // Capability element <=> code
-        sCodeToCapElement.put("CT", ImpsTags.ClientType);
-        sCodeToCapElement.put("CI", ImpsTags.CIRHTTPAddress);
-        sCodeToCapElement.put("DL", ImpsTags.DefaultLanguage);
-        sCodeToCapElement.put("ID", ImpsTags.InitialDeliveryMethod);
-        sCodeToCapElement.put("MT", ImpsTags.MultiTrans);
-        sCodeToCapElement.put("PS", ImpsTags.ParserSize);
-        sCodeToCapElement.put("PM", ImpsTags.ServerPollMin);
-        sCodeToCapElement.put("SB", ImpsTags.SupportedBearer);
-        sCodeToCapElement.put("SC", ImpsTags.SupportedCIRMethod);
-        sCodeToCapElement.put("TA", ImpsTags.TCPAddress);
-        sCodeToCapElement.put("TP", ImpsTags.TCPPort);
-        sCodeToCapElement.put("UP", ImpsTags.UDPPort);
-
-        for (Entry<String, String> e : sCodeToCapElement.entrySet()) {
-            sCapElementToCode.put(e.getValue(), e.getKey());
-        }
-
-        // Capability value <=> code
-        sCodeToCapValue.put("SS", "SSMS");
-        sCodeToCapValue.put("ST", "STCP");
-        sCodeToCapValue.put("SU", "SUDP");
-        sCodeToCapValue.put("WS", "WAPSMS");
-        sCodeToCapValue.put("WU", "WAPUDP");
-        // value of ClientType
-        sCodeToCapValue.put("MP", ImpsConstants.PRESENCE_MOBILE_PHONE);
-        sCodeToCapValue.put("CO", ImpsConstants.PRESENCE_COMPUTER);
-        sCodeToCapValue.put("PD", ImpsConstants.PRESENCE_PDA);
-        sCodeToCapValue.put("CL", ImpsConstants.PRESENCE_CLI);
-        sCodeToCapValue.put("OT", ImpsConstants.PRESENCE_OTHER);
-
-        for (Entry<String, String> e : sCodeToCapValue.entrySet()) {
-            sCapValueToCode.put(e.getValue(), e.getKey());
-        }
-
-        // Service Tree <=> code
-        sCodeToServiceTree.put("WV", ImpsTags.WVCSPFeat);
-        sCodeToServiceTree.put("FF", ImpsTags.FundamentalFeat);
-        sCodeToServiceTree.put("PF", ImpsTags.PresenceFeat);
-        sCodeToServiceTree.put("IF", ImpsTags.IMFeat);
-        sCodeToServiceTree.put("GE", ImpsTags.GroupFeat);
-
-        for (Entry<String, String> e : sCodeToServiceTree.entrySet()) {
-            sServiceTreeToCode.put(e.getValue(), e.getKey());
-        }
-
-        sContactListPropsToCode.put(ImpsConstants.DisplayName, "DN");
-        sContactListPropsToCode.put(ImpsConstants.Default, "DE");
-
-        // Presence Attribute <=> code. Only include the attributes our client supports
-        sCodeToPresenceAttribute.put("OS", ImpsTags.OnlineStatus);
-        sCodeToPresenceAttribute.put("CF", ImpsTags.ClientInfo);
-        sCodeToPresenceAttribute.put("UA", ImpsTags.UserAvailability);
-        sCodeToPresenceAttribute.put("ST", ImpsTags.StatusText);
-        sCodeToPresenceAttribute.put("SC", ImpsTags.StatusContent);
-        // sub-element of ClientInfo
-        sCodeToPresenceAttribute.put("CT", ImpsTags.ClientType);
-        sCodeToPresenceAttribute.put("CP", ImpsTags.ClientProducer);
-        sCodeToPresenceAttribute.put("CV", ImpsTags.ClientVersion);
-        // sub-element of StatusContent
-        sCodeToPresenceAttribute.put("RC", ImpsTags.ReferredContent);
-        sCodeToPresenceAttribute.put("CY", ImpsTags.ContentType);
-
-        for (Entry<String, String> e : sCodeToPresenceAttribute.entrySet()) {
-            sPresenceAttributeToCode.put(e.getValue(), e.getKey());
-        }
-
-        sServerRequestTransactionCode.add(PresenceNotification);
-
-        // value of UserAvailability
-        sCodeToPAValue.put("AV", ImpsConstants.PRESENCE_AVAILABLE);
-        sCodeToPAValue.put("DI", ImpsConstants.PRESENCE_DISCREET);
-        sCodeToPAValue.put("NA", ImpsConstants.PRESENCE_NOT_AVAILABLE);
-        // value of ClientType
-        sCodeToPAValue.put("MP", ImpsConstants.PRESENCE_MOBILE_PHONE);
-        sCodeToPAValue.put("CO", ImpsConstants.PRESENCE_COMPUTER);
-        sCodeToPAValue.put("PD", ImpsConstants.PRESENCE_PDA);
-        sCodeToPAValue.put("CL", ImpsConstants.PRESENCE_CLI);
-        sCodeToPAValue.put("OT", ImpsConstants.PRESENCE_OTHER);
-
-        for (Entry<String, String> e : sCodeToPAValue.entrySet()) {
-            sPAValueToCode.put(e.getValue(), e.getKey());
-        }
-    }
-}
diff --git a/src/com/android/im/imps/PtsPrimitiveParser.java b/src/com/android/im/imps/PtsPrimitiveParser.java
deleted file mode 100644 (file)
index dbaabc7..0000000
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map.Entry;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import com.android.im.imps.Primitive.TransactionMode;
-
-/**
- * PTS/SMS encoded IMPS messages parser. Only response transactions and
- * server initiated requests are supported.
- */
-public class PtsPrimitiveParser implements PrimitiveParser {
-
-    // WVaaBBcccDD <parameters>
-    //   aa - version number; 12 for 1.2, 13 for 1.3; "XX" for version discovery
-    //   BB - message type, case insensitive
-    //   ccc - transaction id in range 0-999 without preceding zero
-    //   DD - multiple SMSes identifier
-    private static final Pattern sPreamplePattern =
-        Pattern.compile("\\AWV(\\d{2})(\\p{Alpha}{2})(\\d{1,3})(\\p{Alpha}{2})?(\\z| .*)");
-
-    private char mReadBuf[] = new char[256];
-    private StringBuilder mStringBuf = new StringBuilder();
-    private int mPos;
-
-    private static int UNCERTAIN_GROUP_SIZE = -1;
-
-    public Primitive parse(InputStream in) throws ParserException, IOException {
-        // assuming PTS data is always short
-        BufferedReader reader = new BufferedReader(
-                new InputStreamReader(in, "UTF-8"), 128);
-        mStringBuf.setLength(0);
-        mPos = 0;
-        int len;
-        while ((len = reader.read(mReadBuf)) != -1) {
-            mStringBuf.append(mReadBuf, 0, len);
-        }
-        return parsePrim();
-    }
-
-    private Primitive parsePrim() throws ParserException
-    {
-        Matcher m = sPreamplePattern.matcher(mStringBuf);
-        if (!m.matches()) {
-            throw new ParserException("Invalid PTS encoded message");
-        }
-
-        Primitive p = new Primitive();
-
-        // TODO: handle WV version in m.group(1)
-
-        String type = m.group(2).toUpperCase();
-        String transactionType = PtsCodes.getTransaction(type);
-        if (transactionType == null) {
-            throw new ParserException("Unrecognized transaction code " + type);
-        }
-        p.setContentElement(transactionType);
-
-        if (PtsCodes.isServerRequestCode(type)) {
-            p.setTransactionMode(TransactionMode.Request);
-        } else {
-            p.setTransactionMode(TransactionMode.Response);
-        }
-
-        p.setTransactionId(m.group(3));
-        mPos = m.start(5);
-
-        if (mPos < mStringBuf.length()) {
-            match(' ');
-
-            HashMap<String, ParamValue> params = parseParams();
-            for (Entry<String, ParamValue> param : params.entrySet()) {
-                translateParam(p, param.getKey(), param.getValue());
-            }
-        }
-        return p;
-    }
-
-    private static HashMap<String, Integer> sInfoElemTypeMap;
-    private static final int ELEM_OTHER_SIMPLE         = 0;
-    private static final int ELEM_SESSION_ID           = 1;
-    private static final int ELEM_RESULT               = 2;
-    private static final int ELEM_ALL_FUNCTIONS        = 3;
-    private static final int ELEM_NOT_AVAIL_FUNCS      = 4;
-    private static final int ELEM_CAPABILITY_LIST      = 5;
-    private static final int ELEM_CONTACT_LIST         = 6;
-    private static final int ELEM_DEFAULT_CONTACT_LIST = 7;
-    private static final int ELEM_USER_NICK_LIST       = 8;
-    private static final int ELEM_CONTACT_LIST_PROPS   = 9;
-    private static final int ELEM_PRESENCE             = 10;
-
-    /*
-    private static final int ELEM_RESULT_CLIST  = 3;
-    private static final int ELEM_RESULT_DOMAIN = 4;
-    private static final int ELEM_RESULT_GROUP  = 5;
-    private static final int ELEM_RESULT_MSGID  = 6;
-    private static final int ELEM_RESULT_SCRNAME = 7;
-    private static final int ELEM_RESULT_USER   = 8;
-    */
-
-    static {
-        sInfoElemTypeMap = new HashMap<String, Integer>();
-        sInfoElemTypeMap.put(PtsCodes.SessionID, ELEM_SESSION_ID);
-        sInfoElemTypeMap.put(PtsCodes.Status, ELEM_RESULT);
-        sInfoElemTypeMap.put(PtsCodes.NotAvailableFunctions, ELEM_NOT_AVAIL_FUNCS);
-        sInfoElemTypeMap.put(PtsCodes.AllFunctions, ELEM_ALL_FUNCTIONS);
-        sInfoElemTypeMap.put(PtsCodes.AgreedCapabilityList, ELEM_CAPABILITY_LIST);
-        sInfoElemTypeMap.put(PtsCodes.ContactList, ELEM_CONTACT_LIST);
-        sInfoElemTypeMap.put(PtsCodes.DefaultContactList, ELEM_DEFAULT_CONTACT_LIST);
-        sInfoElemTypeMap.put(PtsCodes.UserNickList, ELEM_USER_NICK_LIST);
-        sInfoElemTypeMap.put(PtsCodes.ContactListProps, ELEM_CONTACT_LIST_PROPS);
-        sInfoElemTypeMap.put(PtsCodes.Presence, ELEM_PRESENCE);
-    }
-
-    private static void translateParam(Primitive p, String elemCode,
-            ParamValue elemValue) throws ParserException {
-        int type;
-        elemCode = elemCode.toUpperCase();
-
-        // FIXME: Should be refactored when we had concrete situation of the null value case
-        if (elemValue == null) {
-            throw new ParserException("Parameter " + elemCode + " must have value.");
-        }
-
-        if (sInfoElemTypeMap.containsKey(elemCode)) {
-            type = sInfoElemTypeMap.get(elemCode);
-            /*
-            if (type == ELEM_RESULT_CLIST && p.getType().equals(ImpsTags.Login_Response)) {
-                // Fix up DigestSchema which shares a same code with
-                // ContactListID. It appears only in Login_Response.
-                type = ELEM_OTHER_SIMPLE;
-            }
-            */
-        } else {
-            type = ELEM_OTHER_SIMPLE;
-        }
-
-        switch (type) {
-        case ELEM_SESSION_ID:
-            if (elemValue.mStrValue == null) {
-                throw new ParserException("Element SessionID must have string value!");
-            }
-
-            if (p.getType().equals(ImpsTags.Login_Response)) {
-                p.addElement(ImpsTags.SessionID, elemValue.mStrValue);
-            } else {
-                p.setSession(elemValue.mStrValue);
-            }
-            break;
-
-        case ELEM_RESULT:
-            // ST=<StatusCode>
-            // ST=(<StatusCode>,<Description>)
-            PrimitiveElement result = p.addElement(ImpsTags.Result);
-
-            if (elemValue.mStrValue != null) {
-                result.addChild(ImpsTags.Code, elemValue.mStrValue);
-            } else {
-                checkGroupValue(elemValue.mValueGroup, 2);
-
-                result.addChild(ImpsTags.Code, elemValue.mValueGroup.get(0).mStrValue);
-                result.addChild(ImpsTags.Description, elemValue.mValueGroup.get(1).mStrValue);
-            }
-            break;
-
-        case ELEM_ALL_FUNCTIONS:
-        case ELEM_NOT_AVAIL_FUNCS:
-            p.addElement(translateServiceTree(elemCode, elemValue));
-            break;
-
-        case ELEM_CAPABILITY_LIST:
-            p.addElement(translateCapabilityList(elemValue));
-            break;
-
-        case ELEM_CONTACT_LIST:
-            if (elemValue.mStrValue != null) {
-                p.addElement(ImpsTags.ContactList, elemValue.mStrValue);
-            } else {
-                checkGroupValue(elemValue.mValueGroup, UNCERTAIN_GROUP_SIZE);
-                for (ParamValue value : elemValue.mValueGroup) {
-                    p.addElement(ImpsTags.ContactList, value.mStrValue);
-                }
-            }
-            break;
-
-        case ELEM_DEFAULT_CONTACT_LIST:
-            if (elemValue.mStrValue == null) {
-                throw new ParserException("Deafult Contact List must have string value!");
-            }
-
-            p.addElement(ImpsTags.DefaultContactList, elemValue.mStrValue);
-            break;
-
-        case ELEM_USER_NICK_LIST:
-        {
-            checkGroupValue(elemValue.mValueGroup, UNCERTAIN_GROUP_SIZE);
-
-            PrimitiveElement nicklistElem = p.addElement(ImpsTags.NickList);
-
-            int groupSize = elemValue.mValueGroup.size();
-            for (int i = 0; i < groupSize; i++) {
-                ArrayList<ParamValue> valueGroup = elemValue.mValueGroup.get(i).mValueGroup;
-                checkGroupValue(valueGroup, 2);
-
-                String nickname = valueGroup.get(0).mStrValue;
-                String address  = valueGroup.get(1).mStrValue;
-                if (nickname == null || address == null) {
-                    throw new ParserException("Null value found for NickName: " + nickname
-                            + "-" + address);
-                }
-
-                PrimitiveElement nicknameElem = nicklistElem.addChild(ImpsTags.NickName);
-                nicknameElem.addChild(ImpsTags.Name, "".equals(nickname) ? null : nickname);
-                nicknameElem.addChild(ImpsTags.UserID, address);
-            }
-        }
-            break;
-
-        case ELEM_CONTACT_LIST_PROPS:
-        {
-            checkGroupValue(elemValue.mValueGroup, UNCERTAIN_GROUP_SIZE);
-
-            PrimitiveElement propertiesElem = p.addElement(ImpsTags.ContactListProperties);
-
-            int groupSize = elemValue.mValueGroup.size();
-            for (int i = 0; i < groupSize; i++) {
-                ArrayList<ParamValue> valueGroup = elemValue.mValueGroup.get(i).mValueGroup;
-                checkGroupValue(valueGroup, 2);
-
-                String name  = valueGroup.get(0).mStrValue;
-                String value = valueGroup.get(1).mStrValue;
-                if (name == null || value == null) {
-                    throw new ParserException("Null value found for property: " + name + "-" + value);
-                }
-
-                if (PtsCodes.DisplayName.equals(name)) {
-                    name = ImpsConstants.DisplayName;
-                } else if (PtsCodes.Default.equals(name)) {
-                    name = ImpsConstants.Default;
-                } else {
-                    throw new ParserException("Unrecognized property " + name);
-                }
-
-                PrimitiveElement propertyElem = propertiesElem.addChild(ImpsTags.Property);
-                propertyElem.addChild(ImpsTags.Name, name);
-                propertyElem.addChild(ImpsTags.Value, value);
-            }
-        }
-            break;
-
-        case ELEM_PRESENCE:
-            //PR=(<UserID>[,<PresenceSubList>])
-            //PR=((<UserID>[,<PresenceSubList>]),(<UserID>[,<PresenceSubList>]))
-            checkGroupValue(elemValue.mValueGroup, UNCERTAIN_GROUP_SIZE);
-
-            if (elemValue.mValueGroup.size() == 1) {
-                // PR=(<UserID>)
-                ParamValue value = elemValue.mValueGroup.get(0);
-                if (value.mStrValue != null) {
-                    p.addElement(ImpsTags.Presence).addChild(ImpsTags.UserID, value.mStrValue);
-                } else {
-                    // workaround for OZ server
-                    p.addElement(translatePresence(value.mValueGroup));
-                }
-
-            } else {
-                if (elemValue.mValueGroup.get(0).mStrValue == null) {
-                    // PR=((<UserID>[,<PresenceSubList>]),(<UserID>[,<PresenceSubList>]))
-                    int groupSize = elemValue.mValueGroup.size();
-                    for (int i = 0; i < groupSize; i++) {
-                        ParamValue value = elemValue.mValueGroup.get(i);
-                        if (value.mStrValue != null) {
-                            p.addElement(ImpsTags.Presence).addChild(ImpsTags.UserID, value.mStrValue);
-                        } else {
-                            p.addElement(translatePresence(value.mValueGroup));
-                        }
-                    }
-                } else {
-                    // PR=(<UserID>,<PresenceSubList>)
-                    p.addElement(translatePresence(elemValue.mValueGroup));
-                }
-            }
-            break;
-
-        case ELEM_OTHER_SIMPLE:
-            p.addElement(translateSimpleElem(elemCode, elemValue));
-            break;
-
-        default:
-            throw new ParserException("Unsupported element " + elemValue);
-        }
-    }
-
-    private static PrimitiveElement translatePresence(ArrayList<ParamValue> valueGroup)
-            throws ParserException {
-        checkGroupValue(valueGroup, UNCERTAIN_GROUP_SIZE);
-
-        PrimitiveElement presence = new PrimitiveElement(ImpsTags.Presence);
-        if (valueGroup.get(0).mStrValue == null) {
-            throw new ParserException("UserID must have string value!");
-        }
-        presence.addChild(ImpsTags.UserID, valueGroup.get(0).mStrValue);
-
-        if (valueGroup.size() > 1) {
-            // has presence sub list
-            presence.addChild(translatePresenceSubList(valueGroup.get(1)));
-        }
-
-        return presence;
-    }
-
-    private static PrimitiveElement translatePresenceSubList(ParamValue value)
-            throws ParserException {
-        checkGroupValue(value.mValueGroup, UNCERTAIN_GROUP_SIZE);
-
-        PrimitiveElement presenceSubList = new PrimitiveElement(ImpsTags.PresenceSubList);
-
-        int groupSize = value.mValueGroup.size();
-        for (int i = 0; i < groupSize; i++) {
-            ParamValue v = value.mValueGroup.get(i);
-            if (v.mStrValue != null) {
-                throw new ParserException("Unexpected string value for presence attribute");
-            }
-
-            presenceSubList.addChild(translatePresenceAttribute(v.mValueGroup));
-        }
-
-        return presenceSubList;
-    }
-
-    // <attribute>[,<qualifier>][,<value>]
-    // <attribute>[,<qualifier>,<sub-attribute>]
-    private static PrimitiveElement translatePresenceAttribute(
-            ArrayList<ParamValue> valueGroup) throws ParserException {
-        String type = valueGroup.get(0).mStrValue;
-        if (type == null) {
-            return null;
-        }
-
-        String tag = PtsCodes.getPresenceAttributeElement(type);
-        if (tag == null) {
-            return null;
-        }
-
-        PrimitiveElement paElem = new PrimitiveElement(tag);
-        if (valueGroup.size() == 2) {
-            // no qualifier
-            translateAttributeValue(paElem, valueGroup.get(1), false);
-        }else if (valueGroup.size() == 3) {
-            // has qualifier, and it should has no group value
-            ParamValue qualifierValue = valueGroup.get(1);
-            if (qualifierValue.mStrValue == null) {
-                throw new ParserException("Qualifier value can't be group value!");
-            }
-
-            if (!"".equals(qualifierValue.mStrValue)) {
-                paElem.addChild(ImpsTags.Qualifier, qualifierValue.mStrValue);
-            }
-
-            translateAttributeValue(paElem, valueGroup.get(2), true);
-        } else {
-            return null;
-        }
-
-        return paElem;
-    }
-
-    private static void translateAttributeValue(PrimitiveElement paElem,
-            ParamValue v, boolean hasQualifier) throws ParserException {
-        if (v.mStrValue == null) {
-            // sub-attribute as value
-            checkGroupValue(v.mValueGroup, UNCERTAIN_GROUP_SIZE);
-            if (v.mValueGroup.get(0).mStrValue != null) {
-                paElem.addChild(translatePresenceAttribute(v.mValueGroup));
-            } else {
-                int groupSize = v.mValueGroup.size();
-                for (int i = 0; i < groupSize; i++) {
-                    ParamValue value = v.mValueGroup.get(i);
-                    if (value.mStrValue != null) {
-                        throw new ParserException("Presence Attribute value error!");
-                    }
-
-                    checkGroupValue(value.mValueGroup, UNCERTAIN_GROUP_SIZE);
-                    paElem.addChild(translatePresenceAttribute(value.mValueGroup));
-                }
-            }
-        } else {
-            // single simple value
-            if (hasQualifier) {
-                paElem.addChild(ImpsTags.PresenceValue, PtsCodes.getPAValue(v.mStrValue));
-            } else {
-                paElem.setContents(PtsCodes.getPAValue(v.mStrValue));
-            }
-        }
-    }
-
-    private static void checkGroupValue(ArrayList<ParamValue> valueGroup,
-            int expectedGroupSize) throws ParserException {
-        if (valueGroup == null
-                || (expectedGroupSize != UNCERTAIN_GROUP_SIZE
-                        && valueGroup.size() != expectedGroupSize)) {
-            throw new ParserException("Invalid group value!");
-        }
-
-        int groupSize = valueGroup.size();
-        for (int i = 0; i < groupSize; i++) {
-            if (valueGroup.get(i) == null) {
-                throw new ParserException("Invalid group value!");
-            }
-        }
-    }
-
-    private static PrimitiveElement translateCapabilityList(ParamValue elemValue)
-            throws ParserException {
-        PrimitiveElement elem = new PrimitiveElement(ImpsTags.AgreedCapabilityList);
-        ArrayList<ParamValue> params = elemValue.mValueGroup;
-        if (params != null) {
-            checkGroupValue(params, UNCERTAIN_GROUP_SIZE);
-            int paramsSize = params.size();
-            for (int i = 0; i < paramsSize; i++) {
-                ArrayList<ParamValue> capElemGroup = params.get(i).mValueGroup;
-                checkGroupValue(capElemGroup, 2);
-
-                String capElemCode = capElemGroup.get(0).mStrValue;
-                String capElemName;
-                if (capElemCode == null
-                        || (capElemName = PtsCodes.getCapElement(capElemCode)) == null) {
-                    throw new ParserException("Unknown capability element "
-                            + capElemCode);
-                }
-                String capElemValue = capElemGroup.get(1).mStrValue;
-                if (capElemValue == null) {
-                    throw new ParserException("Illegal capability value for "
-                            + capElemCode);
-                }
-                capElemValue = PtsCodes.getCapValue(capElemValue);
-
-                elem.addChild(capElemName, capElemValue);
-            }
-        }
-        return elem;
-    }
-
-    private static PrimitiveElement translateServiceTree(String elemCode,
-            ParamValue elemValue) throws ParserException {
-        String elemName = PtsCodes.getElement(elemCode);
-        PrimitiveElement elem = new PrimitiveElement(elemName);
-        // TODO: translate the service tree.
-        return elem;
-    }
-
-    private static PrimitiveElement translateSimpleElem(String elemCode, ParamValue value)
-            throws ParserException {
-        String elemName = PtsCodes.getElement(elemCode);
-        if (elemName == null) {
-            throw new ParserException("Unrecognized parameter " + elemCode);
-        }
-
-        PrimitiveElement elem = new PrimitiveElement(elemName);
-        if (value.mStrValue != null) {
-            elem.setContents(value.mStrValue);
-        } else {
-            throw new ParserException("Don't know how to handle parameters for "
-                    + elemName);
-        }
-
-        return elem;
-    }
-
-    private HashMap<String, ParamValue> parseParams() throws ParserException {
-        int pos = mPos;
-        StringBuilder buf = mStringBuf;
-        int len = buf.length();
-        HashMap<String, ParamValue> ret = new HashMap<String, ParamValue>();
-
-        String paramName;
-        ParamValue paramValue;
-
-        while (pos < len) {
-            int nameStart = pos;
-            while (pos < len) {
-                char ch = buf.charAt(pos);
-                if (ch == ' ' || ch == '=') {
-                    break;
-                }
-                pos++;
-            }
-            if (nameStart == pos) {
-                throw new ParserException("Missing parameter name near " + pos);
-            }
-            paramName = buf.substring(nameStart, pos);
-            if (pos < len && buf.charAt(pos) == '=') {
-                pos++;
-                mPos = pos;
-                paramValue = parseParamValue();
-                pos = mPos;
-            } else {
-                paramValue = null;
-            }
-            ret.put(paramName, paramValue);
-
-            if (pos < len) {
-                // more parameters ahead
-                match(' ');
-                pos = mPos;
-            }
-        }
-
-        return ret;
-    }
-
-    private ParamValue parseParamValue() throws ParserException {
-        int pos = mPos;
-        StringBuilder buf = mStringBuf;
-        int len = buf.length();
-
-        if (pos == len) {
-            throw new ParserException("Missing parameter value near " + pos);
-        }
-        ParamValue value = new ParamValue();
-
-        char ch = buf.charAt(pos);
-        if (ch == '(') {
-            // value list
-            pos++;
-            ArrayList<ParamValue> valueGroup = new ArrayList<ParamValue>();
-            while (pos < len) {
-                mPos = pos;
-                valueGroup.add(parseParamValue());
-                pos = mPos;
-                if (pos == len) {
-                    throw new ParserException("Unexpected parameter end");
-                }
-                if (buf.charAt(pos) != ',') {
-                    break;
-                }
-                pos++;
-            }
-            mPos = pos;
-            match(')');
-            if (valueGroup.isEmpty()) {
-                throw new ParserException("Empty value group near " + mPos);
-            }
-            value.mValueGroup = valueGroup;
-        } else {
-            // single value
-            if (ch == '"') {
-                // quoted value
-                pos++;
-                StringBuilder escapedValue = new StringBuilder();
-                boolean quotedEnd = false;
-                while (pos < len) {
-                    ch = buf.charAt(pos);
-                    pos++;
-                    if (ch == '"') {
-                        if (pos < len && buf.charAt(pos) == '"') {
-                            // "doubled" quote
-                            pos++;
-                        } else {
-                            quotedEnd = true;
-                            break;
-                        }
-                    }
-                    escapedValue.append(ch);
-                }
-                if (!quotedEnd) {
-                    throw new ParserException("Unexpected quoted parameter end");
-                }
-                value.mStrValue = escapedValue.toString();
-            } else {
-                int valueStart = pos;
-                while (pos < len) {
-                    ch = buf.charAt(pos);
-                    if (ch == ',' || ch == ')' || ch == ' ') {
-                        break;
-                    }
-                    if ("\"(=&".indexOf(ch) != -1) {
-                        throw new ParserException("Special character " + ch
-                                + " must be quoted");
-                    }
-                    pos++;
-                }
-                value.mStrValue = buf.substring(valueStart, pos);
-            }
-            mPos = pos;
-        }
-
-        return value;
-    }
-
-    private void match(char c) throws ParserException {
-        if (mStringBuf.charAt(mPos) != c) {
-            throw new ParserException("Expected " + c + " at pos " + mPos);
-        }
-        mPos++;
-    }
-
-    /**
-     * Detect if this short message is a PTS encoded WV-primitive.
-     */
-    public static boolean isPtsPrimitive(CharSequence msg)
-    {
-        if (msg == null) {
-            return false;
-        }
-        Matcher m = sPreamplePattern.matcher(msg);
-        return m.matches();
-    }
-
-    static final class ParamValue {
-        public String mStrValue;
-        public ArrayList<ParamValue> mValueGroup;
-    }
-}
diff --git a/src/com/android/im/imps/PtsPrimitiveSerializer.java b/src/com/android/im/imps/PtsPrimitiveSerializer.java
deleted file mode 100644 (file)
index 1e9982a..0000000
+++ /dev/null
@@ -1,549 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import com.android.im.imps.ImpsConstants.ImpsVersion;
-
-public class PtsPrimitiveSerializer implements PrimitiveSerializer {
-
-    private final String mPreampleHead;
-
-    // The ccc is the Transaction-ID in range 0-999 without preceding zero.
-    private static final Pattern sTxIdPattern = Pattern.compile("(0|[1-9]\\d{0,2})");
-
-    // If the value of the parameter contains spaces ( ), quotes ("),
-    // commas (,),parentheses (()),equal (=) or ampersand (&) characters,
-    // it SHALL be wrapped with quotes (").
-    private static final Pattern sCharsToBeQuoted = Pattern.compile("[ \",\\(\\)=&]");
-
-    public PtsPrimitiveSerializer(ImpsVersion impsVersion) throws SerializerException {
-        if (impsVersion == ImpsVersion.IMPS_VERSION_11) {
-            mPreampleHead = "WV11";
-        }else if (impsVersion == ImpsVersion.IMPS_VERSION_12) {
-            mPreampleHead = "WV12";
-        } else if (impsVersion == ImpsVersion.IMPS_VERSION_13) {
-            mPreampleHead = "WV13";
-        } else {
-            throw new SerializerException("Unsupported IMPS version");
-        }
-    }
-
-    public void serialize(Primitive p, OutputStream out)
-            throws IOException, SerializerException {
-        String txId = p.getTransactionID();
-        if (txId == null) {
-            if (!ImpsTags.Polling_Request.equals(p.getType())) {
-                throw new SerializerException("null Transaction-ID for non polling request");
-            }
-            // FIXME: what should this be? Temporarily use 0
-            txId = "0";
-        } else {
-            Matcher m = sTxIdPattern.matcher(txId);
-            if (!m.matches()) {
-                throw new SerializerException(
-                        "Transaction-ID must be in range 0-999 without preceding zero");
-            }
-        }
-
-        // TODO: use buffered writer?
-        Writer writer = new OutputStreamWriter(out, "UTF-8");
-        writer.write(mPreampleHead);
-
-        String code = PtsCodes.getTxCode(p.getType());
-        if (code == null) {
-            throw new SerializerException("Unsupported transaction type "
-                    + p.getType());
-        }
-        writer.write(code);
-        writer.write(txId);
-
-        if (p.getSessionId() != null) {
-            writer.write(" SI=");
-            writer.write(p.getSessionId());
-        }
-
-        PrimitiveElement content = p.getContentElement();
-        if (content != null && content.getChildCount() > 0) {
-            ArrayList<PrimitiveElement> infoElems = content.getChildren();
-            ArrayList<String> users = new ArrayList<String>();
-            ArrayList<String> lists = new ArrayList<String>();
-
-            int len = infoElems.size();
-            for (int i = 0; i < len; i++) {
-                PrimitiveElement elem = infoElems.get(i);
-                String elemName = elem.getTagName();
-
-                // workaround for multiple elements
-                if (ImpsTags.User.equals(elemName)) {
-                    users.add(elem.getChildContents(ImpsTags.UserID));
-                    continue;
-                } else if (ImpsTags.UserID.equals(elemName)) {
-                    users.add(elem.getContents());
-                    continue;
-                } else if (ImpsTags.ContactList.equals(elemName)) {
-                    lists.add(elem.getContents());
-                    continue;
-                }
-
-                String elemCode = PtsCodes.getElementCode(elemName, p.getType());
-                if (elemCode == null) {
-                    throw new SerializerException("Don't know how to encode element "
-                            + elemName);
-                }
-                writer.write(' ');
-                writer.write(elemCode);
-                // so far all top level information elements have values.
-                writer.write('=');
-
-                String value;
-                ElemValueEncoder encoder = ElemValueEncoder.getEncoder(elemName);
-                if (encoder == null) {
-                    // default simple value
-                    value = escapeValueString(elem.getContents());
-                } else {
-                    value = encoder.encodeValue(p, elem);
-                }
-                if (value == null) {
-                    throw new SerializerException("Empty value for element "
-                            + elemName);
-                }
-                writer.write(value);
-            }
-
-            writeMultiValue(writer, PtsCodes.getElementCode(ImpsTags.UserID, p.getType()), users);
-            writeMultiValue(writer, PtsCodes.getElementCode(ImpsTags.ContactList, p.getType()), lists);
-        }
-        writer.close();
-    }
-
-    private void writeMultiValue(Writer writer, String code, ArrayList<String> values)
-            throws IOException {
-        if (values.size() == 0) {
-            return;
-        }
-
-        writer.write(' ');
-        writer.write(code);
-        writer.write('=');
-        if (values.size() == 1) {
-            writer.write(escapeValueString(values.get(0)));
-        } else {
-            writer.write('(');
-            int valueCount = values.size();
-            for (int i = 0; i < valueCount; i++) {
-                if (i > 0) {
-                    writer.write(',');
-                }
-                writer.write(escapeValueString(values.get(i)));
-            }
-            writer.write(')');
-        }
-    }
-
-    static String escapeValueString(String contents) {
-        Matcher m = sCharsToBeQuoted.matcher(contents);
-        if (m.find()) {
-            if (contents.indexOf('"') != -1) {
-                contents = contents.replace("\"", "\"\"");
-            }
-            return "\"" + contents + "\"";
-        }
-        return contents;
-    }
-
-    static void appendPairValue(StringBuilder buf, String first, String second) {
-        buf.append('(');
-        if (first != null) {
-            buf.append(first);
-        }
-        buf.append(',');
-        buf.append(second);
-        buf.append(')');
-    }
-
-    /**
-     * Appends a name and value pair like "(<name>,<value>)".
-     */
-    static boolean appendNameAndValue(StringBuilder buf, String name, String value,
-            HashMap<String, String> nameCodes, HashMap<String, String> valueCodes,
-            boolean ignoreUnsupportedValue) {
-        String nameCode = nameCodes.get(name);
-        if (nameCode == null) {
-            ImpsLog.log("PTS: Ignoring value " + name);
-            return false;
-        }
-        String valueCode = null;
-        if (valueCodes != null) {
-            valueCode = valueCodes.get(value);
-        }
-        if (valueCode != null) {
-            value = valueCode;
-        } else {
-            if (ignoreUnsupportedValue) {
-                return false;
-            }
-
-            value = escapeValueString(value);
-        }
-        appendPairValue(buf, nameCode, value);
-
-        return true;
-    }
-
-    static abstract class ElemValueEncoder {
-        public abstract String encodeValue(Primitive p, PrimitiveElement elem)
-                throws SerializerException;
-
-        public static ElemValueEncoder getEncoder(String elemName) {
-            return sEncoders.get(elemName);
-        }
-
-        private static HashMap<String, ElemValueEncoder> sEncoders;
-        static {
-            sEncoders = new HashMap<String, ElemValueEncoder>();
-
-            sEncoders.put(ImpsTags.ClientID, new ClientIdEncoder());
-            sEncoders.put(ImpsTags.CapabilityList, new CapabilityEncoder());
-            sEncoders.put(ImpsTags.Functions, new ServiceTreeEncoder());
-            sEncoders.put(ImpsTags.Result, new ResultEncoder());
-            sEncoders.put(ImpsTags.ContactListProperties, new ProperitiesEncoder(
-                    PtsCodes.sContactListPropsToCode));
-            sEncoders.put(ImpsTags.PresenceSubList, new PresenceSubListEncoder());
-
-            ElemValueEncoder nickListEncoder = new NickListEncoder();
-            sEncoders.put(ImpsTags.NickList, nickListEncoder);
-            sEncoders.put(ImpsTags.AddNickList, nickListEncoder);
-            sEncoders.put(ImpsTags.RemoveNickList, nickListEncoder);
-        }
-    }
-
-    static class PresenceSubListEncoder extends ElemValueEncoder {
-        private boolean mEncodePresenceValue;
-        @Override
-        public String encodeValue(Primitive p, PrimitiveElement elem)
-                throws SerializerException {
-            if (elem.getChildCount() == 0) {
-                throw new SerializerException("No presence in the PresenceSubList");
-            }
-
-            StringBuilder buf = new StringBuilder();
-            mEncodePresenceValue = ImpsTags.UpdatePresence_Request.equals(p.getType());
-
-            ArrayList<PrimitiveElement> presences = elem.getChildren();
-            int presenceCount = presences.size();
-            if (presenceCount == 1) {
-                if (mEncodePresenceValue) {
-                    // Append an extra pair of braces according to the Spec
-                    buf.append('(');
-                    encodePresence(buf, presences.get(0));
-                    buf.append(')');
-                } else {
-                    encodePresence(buf, presences.get(0));
-                }
-            } else {
-                buf.append('(');
-                for (int i = 0; i < presenceCount; i++) {
-                    if (i > 0) {
-                        buf.append(',');
-                    }
-                    encodePresence(buf, presences.get(i));
-                }
-                buf.append(')');
-            }
-
-            return buf.toString();
-        }
-
-        private void encodePresence(StringBuilder buf, PrimitiveElement p)
-                throws SerializerException {
-            boolean hasQualifier = p.getChild(ImpsTags.Qualifier) != null;
-            String presenceName = p.getTagName();
-            String presenceNameCode = getPresenceCode(presenceName);
-
-            if (!mEncodePresenceValue) {
-                encodeNoValuePresence(buf, p);
-            } else {
-                buf.append('(');
-                buf.append(presenceNameCode);
-                buf.append(',');
-                if (hasQualifier) {
-                    buf.append(p.getChildContents(ImpsTags.Qualifier));
-                    buf.append(',');
-                }
-                // All the presences with value have this kind of structure:
-                // <name, qualifier, value>
-                // And for the values, there are three different hierarchies:
-                // 1. Simply use PresenceValue to indicate the value, most of the
-                //    presences has adapted this way. -> SingleValue
-                // 2. Use special tags for multiple values of this presence, eg. ClientInfo
-                //    has adapted this way. -> MultiValue
-                // 3. Has one or more children for the presence, and each child have
-                //    multiple values. eg. CommCap has adapted this way. -> ExtMultiValue
-                if (isMultiValuePresence(presenceName)) {
-                    // condition 2: multiple value
-                    int emptyValueSize = hasQualifier ? 1 : 0;
-
-                    ArrayList<PrimitiveElement> children = p.getChildren();
-                    if (children.size() > emptyValueSize) {
-                        buf.append('(');
-                        int childCount = children.size();
-                        int j = 0;  // used for first value check
-                        for (int i = 0; i < childCount; i++, j++) {
-                            PrimitiveElement value = children.get(i);
-                            if (ImpsTags.Qualifier.equals(value.getTagName())) {
-                                j--;
-                                continue;
-                            }
-
-                            if (j > 0) {
-                                buf.append(',');
-                            }
-                            buf.append('(');
-                            buf.append(getPresenceCode(value.getTagName()));
-                            buf.append(',');
-                            buf.append(PtsCodes.getPAValueCode(value.getContents()));
-                            buf.append(')');
-                        }
-                        buf.append(')');
-                    }
-                } else if (isExtMultiValuePresence(presenceName)) {
-                    // condition 3: extended multiple value
-                    // TODO: Implementation
-                } else {
-                    // Condition 1: single value
-                    if (p.getChild(ImpsTags.PresenceValue) == null) {
-                        throw new SerializerException("Can't find presence value for " + presenceName);
-                    }
-                    buf.append(PtsCodes.getPAValueCode(p.getChildContents(ImpsTags.PresenceValue)));
-                }
-                buf.append(')');
-            }
-        }
-
-        private void encodeNoValuePresence(StringBuilder buf, PrimitiveElement p)
-                throws SerializerException {
-            if (p.getChildCount() == 0) {
-                buf.append(getPresenceCode(p.getTagName()));
-            } else {
-                ArrayList<PrimitiveElement> children = p.getChildren();
-                int childCount = children.size();
-                buf.append('(');
-                buf.append(getPresenceCode(p.getTagName()));
-                buf.append(",(");
-                for (int i = 0; i < childCount; i++) {
-                    if (i > 0) {
-                        buf.append(',');
-                    }
-
-                    encodeNoValuePresence(buf, children.get(i));
-                }
-                buf.append("))");
-            }
-        }
-
-        private String getPresenceCode(String tagname) throws SerializerException {
-            String code = PtsCodes.getPresenceAttributeCode(tagname);
-            if (code == null) {
-                throw new SerializerException("Unsupport presence attribute: " + tagname);
-            }
-
-            return code;
-        }
-
-        private boolean isMultiValuePresence(String presenceName) {
-            if (ImpsTags.ClientInfo.equals(presenceName)) {
-                return true;
-            }
-
-            // TODO: Add more supported extended multiple presence here
-            return false;
-        }
-
-        private boolean isExtMultiValuePresence(String presenceName) {
-            // TODO: Add supported extended multiple presence here
-            return false;
-        }
-    }
-
-    static class ClientIdEncoder extends ElemValueEncoder {
-        @Override
-        public String encodeValue(Primitive p, PrimitiveElement elem)
-                throws SerializerException {
-            String value = elem.getChildContents(ImpsTags.URL);
-            if (value == null) {
-                value = elem.getChildContents(ImpsTags.MSISDN);
-            }
-
-            return escapeValueString(value);
-        }
-    }
-
-    static class CapabilityEncoder extends ElemValueEncoder {
-        @Override
-        public String encodeValue(Primitive p, PrimitiveElement elem)
-                throws SerializerException {
-            ArrayList<PrimitiveElement> caps = elem.getChildren();
-            int i, len;
-            StringBuilder result = new StringBuilder();
-            result.append('(');
-            for (i = 0, len = caps.size(); i < len; i++) {
-                PrimitiveElement capElem = caps.get(i);
-                String capName = capElem.getTagName();
-                String capValue = capElem.getContents();
-
-                if (i > 0) {
-                    result.append(',');
-                }
-                if (!appendNameAndValue(result, capName, capValue,
-                        PtsCodes.sCapElementToCode, PtsCodes.sCapValueToCode,
-                        ImpsTags.SupportedCIRMethod.equals(capName))) {
-                    result.deleteCharAt(result.length() - 1);
-                }
-            }
-            result.append(')');
-            return result.toString();
-        }
-    }
-
-    static class ServiceTreeEncoder extends ElemValueEncoder {
-        @Override
-        public String encodeValue(Primitive p, PrimitiveElement elem)
-                throws SerializerException {
-            StringBuilder buf = new StringBuilder();
-            buf.append('(');
-            appendFeature(buf, elem.getFirstChild());
-            buf.append(')');
-            return buf.toString();
-        }
-
-        private void appendFeature(StringBuilder buf, PrimitiveElement elem)
-                throws SerializerException {
-            int childCount = elem.getChildCount();
-            if (childCount > 0) {
-                ArrayList<PrimitiveElement> children = elem.getChildren();
-                for (int i = 0; i < childCount; i++) {
-                    appendFeature(buf, children.get(i));
-                }
-            } else {
-                String code = PtsCodes.getServiceTreeCode(elem.getTagName());
-                if (code == null) {
-                    throw new SerializerException("Invalid service tree tag:"
-                            + elem.getTagName());
-                }
-                if (buf.length() > 1) {
-                    buf.append(',');
-                }
-                buf.append(code);
-            }
-        }
-    }
-
-    static class ResultEncoder extends ElemValueEncoder {
-        @Override
-        public String encodeValue(Primitive p, PrimitiveElement elem)
-                throws SerializerException {
-            String code = elem.getChildContents(ImpsTags.Code);
-            String desc = elem.getChildContents(ImpsTags.Description);
-            // Client never sends partial success result, the DetailedResult is
-            // ignored.
-            if (desc == null) {
-                return code;
-            } else {
-                StringBuilder res = new StringBuilder();
-                appendPairValue(res, code, escapeValueString(desc));
-                return res.toString();
-            }
-        }
-    }
-
-    static class NickListEncoder extends ElemValueEncoder {
-        @Override
-        public String encodeValue(Primitive p, PrimitiveElement elem)
-                throws SerializerException {
-            StringBuilder buf = new StringBuilder();
-            ArrayList<PrimitiveElement> children = elem.getChildren();
-            int count = children.size();
-            buf.append('(');
-            for (int i = 0; i < count; i++) {
-                PrimitiveElement child = children.get(i);
-                String tagName = child.getTagName();
-                String nickName = null;
-                String userId = null;
-                if (tagName.equals(ImpsTags.NickName)) {
-                    nickName = child.getChildContents(ImpsTags.Name);
-                    userId = child.getChildContents(ImpsTags.UserID);
-                } else if (tagName.equals(ImpsTags.UserID)) {
-                    userId = child.getContents();
-                }
-                if (i > 0) {
-                    buf.append(',');
-                }
-                if (nickName != null) {
-                    nickName = escapeValueString(nickName);
-                }
-                appendPairValue(buf, nickName, escapeValueString(userId));
-            }
-            buf.append(')');
-            return buf.toString();
-        }
-    }
-
-    static class ProperitiesEncoder extends ElemValueEncoder {
-        private HashMap<String, String> mPropNameCodes;
-
-        public ProperitiesEncoder(HashMap<String, String> propNameCodes) {
-            mPropNameCodes = propNameCodes;
-        }
-
-        @Override
-        public String encodeValue(Primitive p, PrimitiveElement elem)
-                throws SerializerException {
-            ArrayList<PrimitiveElement> props = elem.getChildren();
-            StringBuilder result = new StringBuilder();
-            result.append('(');
-            int count = props.size();
-            for (int i = 0; i < count; i++) {
-                PrimitiveElement property = props.get(i);
-                String name;
-                String value;
-                if (property.getTagName().equals(ImpsTags.Property)) {
-                    name = property.getChildContents(ImpsTags.Name);
-                    value = property.getChildContents(ImpsTags.Value);
-                } else {
-                    name = property.getTagName();
-                    value = property.getContents();
-                }
-                if (i > 0) {
-                    result.append(',');
-                }
-                appendNameAndValue(result, name, value, mPropNameCodes, null, false);
-            }
-            result.append(')');
-            return result.toString();
-        }
-    }
-}
diff --git a/src/com/android/im/imps/SerializerException.java b/src/com/android/im/imps/SerializerException.java
deleted file mode 100644 (file)
index fe73b66..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-public class SerializerException extends Exception {
-
-    private static final long serialVersionUID = 7224994582791351605L;
-
-    public SerializerException(){
-        super();
-    }
-
-    public SerializerException(String message){
-        super(message);
-    }
-
-    public SerializerException(Throwable t){
-        super(t);
-    }
-
-}
diff --git a/src/com/android/im/imps/ServerTransaction.java b/src/com/android/im/imps/ServerTransaction.java
deleted file mode 100644 (file)
index 2a3229d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import com.android.im.imps.Primitive.TransactionMode;
-
-final class ServerTransaction extends ImpsTransaction {
-    private Primitive mRequest;
-
-    ServerTransaction(String id, ImpsConnection connection, Primitive request) {
-        setTransactionInfo(id, connection);
-        mRequest = request;
-        request.setTransaction(this);
-    }
-
-    /**
-     * Gets the request of this server transaction.
-     *
-     * @return the request.
-     */
-    public Primitive getRequest() {
-        return mRequest;
-    }
-
-    /**
-     * Sends a response of this transaction back to the server.
-     *
-     * @param response the response to send.
-     */
-    public void sendResponse(Primitive response) {
-        response.setTransactionMode(TransactionMode.Response);
-        sendPrimitive(response);
-    }
-
-    /**
-     * Sends a Status response of this transaction back to the server.
-     *
-     * @param response the response to send.
-     */
-    public void sendStatusResponse(String code) {
-        Primitive status = new Primitive(ImpsTags.Status);
-        status.setTransactionMode(TransactionMode.Response);
-        status.addElement(ImpsTags.Result).addChild(ImpsTags.Code, code);
-
-        sendPrimitive(status);
-    }
-
-}
diff --git a/src/com/android/im/imps/ServerTransactionListener.java b/src/com/android/im/imps/ServerTransactionListener.java
deleted file mode 100644 (file)
index c6e8c31..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-/**
- * An IMPS transaction is a basic communication mechanism between an IMPS client
- * and an IMPS server. It may originate from either IMPS client or IMPS server.
- */
-interface ServerTransactionListener {
-    /**
-     * Called when a new transaction originated from the IMPS server received.
-     *
-     * @param transation the new transaction.
-     */
-    public void notifyServerTransaction(ServerTransaction transaction);
-}
diff --git a/src/com/android/im/imps/SimpleAsyncTransaction.java b/src/com/android/im/imps/SimpleAsyncTransaction.java
deleted file mode 100644 (file)
index ad41584..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-/**
- * A default implementation of AsyncTransaction for some simple transactions.
- * It might be convenient for a subclass to extend this class instead of
- * AsyncTransaction so it doesn't have to override both onResponseError and
- * onResponseOk but it could as well be missing either of them when doing so.
- * Therefore we make this class final to prevent that from happening.
- */
-final class SimpleAsyncTransaction extends AsyncTransaction {
-
-    public SimpleAsyncTransaction(ImpsTransactionManager manager,
-            AsyncCompletion completion) {
-        super(manager, completion);
-        if (completion == null) {
-            // Since SimpleAsyncTransaction does nothing in onResponseOk
-            // and onResponseError, we must have a completion object to
-            // be able to notify someone.
-            throw new NullPointerException();
-        }
-    }
-
-    @Override
-    public void onResponseError(ImpsErrorInfo error) {
-        // do nothing
-    }
-
-    @Override
-    public void onResponseOk(Primitive response) {
-        // do nothing
-    }
-}
diff --git a/src/com/android/im/imps/SmsAssembler.java b/src/com/android/im/imps/SmsAssembler.java
deleted file mode 100644 (file)
index 644b517..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.imps;
-
-import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import com.android.im.engine.SmsService.SmsListener;
-
-public class SmsAssembler implements SmsListener {
-    // WVaaBBcccDD
-    //   aa - version number; 12 for 1.2, 13 for 1.3; "XX" for version discovery
-    //   BB - message type, case insensitive
-    //   ccc - transaction id in range 0-999 without preceding zero
-    //   DD - multiple SMSes identifier
-    private static final Pattern sPreamplePattern =
-        Pattern.compile("\\AWV(\\d{2})(\\p{Alpha}{2})(\\d{1,3})(\\p{Alpha}{2})?");
-
-    private SmsListener mListener;
-    private HashMap<String, RawPtsData> mPtsCache;
-
-    public SmsAssembler() {
-        mPtsCache = new HashMap<String, RawPtsData>();
-    }
-
-    public void setSmsListener(SmsListener listener) {
-        mListener = listener;
-    }
-
-    public void onIncomingSms(byte[] data) {
-        String preamble = extractPreamble(data);
-        if (preamble == null) {
-            ImpsLog.logError("Received non PTS SMS");
-            return;
-        }
-
-        Matcher m = sPreamplePattern.matcher(preamble);
-        if (!m.matches()) {
-            ImpsLog.logError("Received non PTS SMS");
-            return;
-        }
-        String dd = m.group(4);
-        if (dd == null || dd.length() == 0) {
-            notifyAssembledSms(data);
-        } else {
-            int totalSegmentsCount = dd.charAt(1) - 'a' + 1;
-            int index = dd.charAt(0) - 'a';
-            if (index < 0 || index >= totalSegmentsCount) {
-                ImpsLog.logError("Invalid multiple SMSes identifier");
-                return;
-            }
-
-            String transId = m.group(3);
-            RawPtsData pts = mPtsCache.get(transId);
-            if (pts == null) {
-                pts = new RawPtsData(preamble.length(), totalSegmentsCount);
-                mPtsCache.put(transId, pts);
-            }
-
-            pts.setSegment(index, data);
-            if (pts.isAllSegmentsReceived()) {
-                mPtsCache.remove(transId);
-                notifyAssembledSms(pts.assemble());
-            }
-        }
-    }
-
-    private String extractPreamble(byte[] data) {
-        int N = data.length;
-        int preambleIndex = 0;
-        while (data[preambleIndex] != ' ' && preambleIndex < N) {
-            preambleIndex++;
-        }
-
-        if (preambleIndex >= N) {
-            return null;
-        }
-
-        try {
-            return new String(data, 0, preambleIndex, "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            // impossible
-            return null;
-        }
-    }
-
-    private void notifyAssembledSms(byte[] data) {
-        if (mListener != null) {
-            mListener.onIncomingSms(data);
-        }
-    }
-
-    private static class RawPtsData {
-        private int mOrigPreambeLen;
-        private byte[][] mSegments;
-
-        public RawPtsData(int origPreambleLen, int totalSegments) {
-            mOrigPreambeLen = origPreambleLen;
-            mSegments = new byte[totalSegments][];
-        }
-
-        public void setSegment(int index, byte[] segment) {
-            mSegments[index] = segment;
-        }
-
-        public boolean isAllSegmentsReceived() {
-            for (byte[] segment : mSegments) {
-                if (segment == null) {
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        public byte[] assemble() {
-            int len = calculateLength();
-            byte[] res = new byte[len];
-            int index = 0;
-            // copy the preamble
-            System.arraycopy(mSegments[0], 0, res, index, mOrigPreambeLen - 2);
-            index += mOrigPreambeLen - 2;
-            res[index++] = ' ';
-
-            for (byte[] segment : mSegments) {
-                int payloadStart = mOrigPreambeLen + 1;
-                int payloadLen = segment.length - payloadStart;
-                System.arraycopy(segment, payloadStart, res, index, payloadLen);
-                index += payloadLen;
-            }
-            return res;
-        }
-
-        private int calculateLength() {
-            // don't have 'dd' in assembled data
-            int preambleLen = mOrigPreambeLen - 2;
-
-            int total = preambleLen + 1;// a space after preamble
-            for (byte[] segment : mSegments) {
-                int segmentPayload = segment.length - (mOrigPreambeLen + 1);
-                total += segmentPayload;
-            }
-            return total;
-        }
-    }
-
-}
diff --git a/src/com/android/im/imps/SmsCirChannel.java b/src/com/android/im/imps/SmsCirChannel.java
deleted file mode 100644 (file)
index 84f01ee..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.imps;
-
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.ImException;
-import com.android.im.engine.SmsService;
-import com.android.im.engine.SystemService;
-import com.android.im.engine.SmsService.SmsListener;
-import com.android.im.engine.SmsService.SmsSendFailureCallback;
-import com.android.internal.telephony.gsm.EncodeException;
-import com.android.internal.telephony.gsm.GsmAlphabet;
-
-public class SmsCirChannel extends CirChannel
-        implements SmsListener, SmsSendFailureCallback {
-    private String mAddr;
-    private int mPort;
-
-    private SmsService mSmsService;
-
-    protected SmsCirChannel(ImpsConnection connection) {
-        super(connection);
-        ImpsConnectionConfig cfg = connection.getConfig();
-        mAddr = cfg.getSmsCirAddr();
-        mPort = cfg.getSmsCirPort();
-    }
-
-    @Override
-    public void connect() throws ImException {
-        if (mAddr == null || mAddr.length() == 0) {
-            throw new ImException(ImpsErrorInfo.UNKNOWN_SERVER,
-                    "Invalid sms addr");
-        }
-        mSmsService = SystemService.getDefault().getSmsService();
-        mSmsService.addSmsListener(mAddr, mPort, this);
-        sendHelo();
-    }
-
-    @Override
-    public void shutdown() {
-        mSmsService.removeSmsListener(this);
-    }
-
-    public void onIncomingSms(byte[] data) {
-        // It's safe to assume that each character is encoded into 7-bit since
-        // all characters in CIR are in gsm 7-bit alphabet.
-        int lengthSeptets = data.length * 8 / 7;
-        int numPaddingBits = data.length * 8 % 7;
-        String s = GsmAlphabet.gsm7BitPackedToString(data, 0,
-                lengthSeptets, numPaddingBits);
-        // CIR format: WVCI <version> <session cookie>
-        if (!s.startsWith("WVCI")) {
-            // not a valid CIR, ignore.
-            return;
-        }
-        String[] fields = s.split(" ");
-        if (fields.length != 3) {
-            // Not a valid CIR, ignore
-            return;
-        }
-        String sessionCookie = mConnection.getSession().getCookie();
-        if (sessionCookie.equalsIgnoreCase(fields[2])) {
-            mConnection.sendPollingRequest();
-        }
-    }
-
-    public void onFailure(int errorCode) {
-        mConnection.shutdownOnError(new ImErrorInfo(ImpsErrorInfo.NETWORK_ERROR,
-                "Could not establish SMS CIR channel"));
-    }
-
-    private void sendHelo() {
-        String data = "HELO " + mConnection.getSession().getID();
-        try {
-            byte[] bytes = GsmAlphabet.stringToGsm7BitPacked(data);
-            mSmsService.sendSms(mAddr, mPort, bytes, this);
-        } catch (EncodeException ignore) {
-        }
-    }
-
-}
diff --git a/src/com/android/im/imps/SmsDataChannel.java b/src/com/android/im/imps/SmsDataChannel.java
deleted file mode 100644 (file)
index a5f8d6b..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.imps;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import android.os.SystemClock;
-
-import com.android.im.engine.HeartbeatService;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.ImException;
-import com.android.im.engine.SmsService;
-import com.android.im.engine.SystemService;
-import com.android.im.engine.SmsService.SmsListener;
-import com.android.im.engine.SmsService.SmsSendFailureCallback;
-
-public class SmsDataChannel extends DataChannel
-        implements SmsListener, HeartbeatService.Callback {
-    private SmsService mSmsService;
-    private String mSmsAddr;
-    private short mSmsPort;
-
-    private long mLastActive;
-
-    private SmsSplitter mSplitter;
-    private SmsAssembler mAssembler;
-
-    private LinkedBlockingQueue<Primitive> mReceiveQueue;
-
-    private ImpsTransactionManager mTxManager;
-    private boolean mConnected;
-    private long mKeepAliveMillis;
-    private Primitive mKeepAlivePrimitive;
-
-    private long mReplyTimeout;
-    private LinkedList<PendingTransaction> mPendingTransactions;
-    private Timer mTimer;
-
-    protected SmsDataChannel(ImpsConnection connection) throws ImException {
-        super(connection);
-
-        mTxManager = connection.getTransactionManager();
-
-        ImpsConnectionConfig config = connection.getConfig();
-        mReplyTimeout = config.getReplyTimeout();
-        mSmsAddr = config.getSmsAddr();
-        mSmsPort = (short) config.getSmsPort();
-        mSmsService = SystemService.getDefault().getSmsService();
-
-        mParser = new PtsPrimitiveParser();
-        try {
-            mSerializer = new PtsPrimitiveSerializer(config.getImpsVersion());
-        } catch (SerializerException e) {
-            throw new ImException(e);
-        }
-        mSplitter = new SmsSplitter(mSmsService.getMaxSmsLength());
-        mAssembler = new SmsAssembler();
-        mAssembler.setSmsListener(this);
-    }
-
-    @Override
-    public void connect() throws ImException {
-        mSmsService.addSmsListener(mSmsAddr, mSmsPort, mAssembler);
-        mReceiveQueue = new LinkedBlockingQueue<Primitive>();
-        mPendingTransactions = new LinkedList<PendingTransaction>();
-        mTimer = new Timer(mReplyTimeout);
-        new Thread(mTimer, "SmsDataChannel timer").start();
-        mConnected = true;
-    }
-
-    @Override
-    public long getLastActiveTime() {
-        return mLastActive;
-    }
-
-    @Override
-    public boolean isSendingQueueEmpty() {
-        // Always true since we don't have a sending queue.
-        return true;
-    }
-
-    @Override
-    public Primitive receivePrimitive() throws InterruptedException {
-        return mReceiveQueue.take();
-    }
-
-    @Override
-    public void sendPrimitive(Primitive p) {
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        try {
-            mSerializer.serialize(p, out);
-            mSplitter.split(out.toByteArray());
-            SmsService smsService =  SystemService.getDefault().getSmsService();
-            SendFailureCallback sendFailureCallback
-                    = new SendFailureCallback(p.getTransactionID());
-            while (mSplitter.hasNext()) {
-                smsService.sendSms(mSmsAddr, mSmsPort, mSplitter.getNext(),
-                        sendFailureCallback);
-            }
-            mLastActive = SystemClock.elapsedRealtime();
-            addPendingTransaction(p.getTransactionID());
-        } catch (IOException e) {
-            mTxManager.notifyErrorResponse(p.getTransactionID(),
-                    ImpsErrorInfo.SERIALIZER_ERROR, e.getLocalizedMessage());
-        } catch (SerializerException e) {
-            mTxManager.notifyErrorResponse(p.getTransactionID(),
-                    ImpsErrorInfo.SERIALIZER_ERROR, e.getLocalizedMessage());
-        }
-    }
-
-    @Override
-    public void shutdown() {
-        mSmsService.removeSmsListener(this);
-        mTimer.stop();
-        mConnected = false;
-    }
-
-    @Override
-    public void startKeepAlive(long interval) {
-        if (!mConnected) {
-            throw new IllegalStateException();
-        }
-
-        if (interval <= 0) {
-            interval = mConnection.getConfig().getDefaultKeepAliveInterval();
-        }
-
-        mKeepAliveMillis = interval * 1000;
-        if (mKeepAliveMillis < 0) {
-            ImpsLog.log("Negative keep alive time. Won't send keep-alive");
-        }
-        mKeepAlivePrimitive = new Primitive(ImpsTags.KeepAlive_Request);
-
-        HeartbeatService heartbeatService
-            = SystemService.getDefault().getHeartbeatService();
-        if (heartbeatService != null) {
-            heartbeatService.startHeartbeat(this, mKeepAliveMillis);
-        }
-    }
-
-    public long sendHeartbeat() {
-        if (!mConnected) {
-            return 0;
-        }
-
-        long inactiveTime = SystemClock.elapsedRealtime() - mLastActive;
-        if (needSendKeepAlive(inactiveTime)) {
-            sendKeepAlive();
-            return mKeepAliveMillis;
-        } else {
-            return mKeepAliveMillis - inactiveTime;
-        }
-    }
-
-    private void sendKeepAlive() {
-        ImpsTransactionManager tm = mConnection.getTransactionManager();
-        AsyncTransaction tx = new AsyncTransaction(tm) {
-            @Override
-            public void onResponseError(ImpsErrorInfo error) {
-            }
-
-            @Override
-            public void onResponseOk(Primitive response) {
-                // Since we never request a new timeout value, the response
-                // can be ignored
-            }
-        };
-        tx.sendRequest(mKeepAlivePrimitive);
-    }
-
-    private boolean needSendKeepAlive(long inactiveTime) {
-        return mKeepAliveMillis - inactiveTime <= 500;
-    }
-
-    @Override
-    public boolean resume() {
-        return true;
-    }
-
-    @Override
-    public void suspend() {
-        // do nothing.
-    }
-
-    public void onIncomingSms(byte[] data) {
-        try {
-            Primitive p = mParser.parse(new ByteArrayInputStream(data));
-            mReceiveQueue.put(p);
-            removePendingTransaction(p.getTransactionID());
-        } catch (ParserException e) {
-            handleError(data, ImpsErrorInfo.PARSER_ERROR, e.getLocalizedMessage());
-        } catch (IOException e) {
-            handleError(data, ImpsErrorInfo.PARSER_ERROR, e.getLocalizedMessage());
-        } catch (InterruptedException e) {
-            handleError(data, ImpsErrorInfo.UNKNOWN_ERROR, e.getLocalizedMessage());
-        }
-    }
-
-    private void handleError(byte[] data, int errCode, String info) {
-        String trId = extractTrId(data);
-        if (trId != null) {
-            mTxManager.notifyErrorResponse(trId, errCode, info);
-            removePendingTransaction(trId);
-        }
-    }
-
-    private String extractTrId(byte[] data) {
-        int transIdStart = 4;
-        int index = transIdStart;
-        while(Character.isDigit(data[index])) {
-            index++;
-        }
-        int transIdLen = index - transIdStart;
-        try {
-            return new String(data, transIdStart, transIdLen, "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            return null;
-        }
-    }
-
-    private void addPendingTransaction(String transId) {
-        synchronized (mPendingTransactions) {
-            mPendingTransactions.add(new PendingTransaction(transId));
-        }
-    }
-
-    private void removePendingTransaction(String transId) {
-        synchronized (mPendingTransactions) {
-            Iterator<PendingTransaction> iter = mPendingTransactions.iterator();
-            while (iter.hasNext()) {
-                PendingTransaction tx = iter.next();
-                if (tx.mTransId.equals(transId)) {
-                    iter.remove();
-                    break;
-                }
-            }
-        }
-    }
-
-    /*package*/void checkTimeout() {
-        synchronized (mPendingTransactions) {
-            Iterator<PendingTransaction> iter = mPendingTransactions.iterator();
-            while (iter.hasNext()) {
-                PendingTransaction tx = iter.next();
-                if (tx.isExpired(mReplyTimeout)) {
-                    notifyTimeout(tx);
-                } else {
-                    break;
-                }
-            }
-        }
-    }
-
-    private void notifyTimeout(PendingTransaction tx) {
-        String transId = tx.mTransId;
-        mTxManager.notifyErrorResponse(transId, ImpsErrorInfo.TIMEOUT,
-                "Timeout");
-        removePendingTransaction(transId);
-    }
-
-    private class SendFailureCallback implements SmsSendFailureCallback {
-        private String mTransId;
-
-        public SendFailureCallback(String transId) {
-            mTransId = transId;
-        }
-
-        public void onFailure(int errorCode) {
-            mTxManager.notifyErrorResponse(mTransId, ImErrorInfo.NETWORK_ERROR, null);
-        }
-    }
-
-    private class Timer implements Runnable {
-        private boolean mStopped;
-        private long mInterval;
-
-        public Timer(long interval) {
-            mInterval = interval;
-            mStopped = false;
-        }
-
-        public void stop() {
-            mStopped = true;
-        }
-
-        public void run() {
-            while (!mStopped) {
-                try {
-                    Thread.sleep(mInterval);
-                } catch (InterruptedException e) {
-                    continue;
-                }
-                checkTimeout();
-            }
-        }
-    }
-
-    private static class PendingTransaction {
-        private String mTransId;
-        private long mSentTime;
-
-        public PendingTransaction(String transId) {
-            mTransId = transId;
-        }
-
-        public boolean isExpired(long timeout) {
-            return SystemClock.elapsedRealtime() - mSentTime >= timeout;
-        }
-    }
-}
diff --git a/src/com/android/im/imps/SmsSplitter.java b/src/com/android/im/imps/SmsSplitter.java
deleted file mode 100644 (file)
index 5c262fa..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.imps;
-
-import java.nio.ByteBuffer;
-
-/**
- * A helper class to split the payload into several segments to meet the size
- * constraint of the sms.
- *
- */
-public class SmsSplitter {
-    private static final int MAX_SEGMENT_COUNT = 26;
-
-    private ByteBuffer mOutBuffer;
-    private int mMaxSegmentLen;
-
-    private byte[] mData;
-    private int mPreambleEnd;
-
-    private int mCurrentSegment;
-    private int mSegmentCount;
-
-    public SmsSplitter(int maxLen) {
-        mMaxSegmentLen = maxLen;
-        mOutBuffer = ByteBuffer.allocate(maxLen);
-    }
-
-    /**
-     * Split the data into several segments to meet the size constraint.
-     *
-     * @param data
-     *            The data to split. MUST be a valid PTS primitive.
-     * @return The count of segments of the result or -1 if the data is too long.
-     */
-    public int split(byte[] data) {
-        mData = data;
-        mCurrentSegment = 0;
-        calculateSegments();
-        if (mSegmentCount > MAX_SEGMENT_COUNT) {
-            mSegmentCount = -1;
-        }
-        return mSegmentCount;
-    }
-
-    public boolean hasNext() {
-        return mCurrentSegment < mSegmentCount;
-    }
-
-    /**
-     * Gets the next segment.
-     *
-     * @return The next segment.
-     * @throws IndexOutOfBoundsException
-     */
-    public byte[] getNext() {
-        if (mCurrentSegment >= mSegmentCount) {
-            throw new IndexOutOfBoundsException();
-        }
-        byte[] segment;
-        if (mSegmentCount == 1) {
-            segment = mData;
-        } else {
-            mOutBuffer.clear();
-            // The original preamble
-            mOutBuffer.put(mData, 0, mPreambleEnd);
-            // Two character of DD
-            mOutBuffer.put((byte) ('a' + mCurrentSegment));
-            mOutBuffer.put((byte) ('a' + mSegmentCount - 1));
-            // The space after preamble
-            mOutBuffer.put((byte) ' ');
-
-            // The payload
-            int segmentPayload = mMaxSegmentLen - mPreambleEnd - 3;
-            int offset = mPreambleEnd + 1 + segmentPayload * mCurrentSegment;
-            int len = (offset + segmentPayload > mData.length) ?
-                    mData.length - offset : segmentPayload;
-            mOutBuffer.put(mData, offset, len);
-
-            mOutBuffer.flip();
-            segment = new byte[mOutBuffer.limit()];
-            mOutBuffer.get(segment);
-        }
-        mCurrentSegment++;
-        return segment;
-    }
-
-    private void calculateSegments() {
-        int totalLen = mData.length;
-        if (totalLen < mMaxSegmentLen) {
-            mSegmentCount = 1;
-        } else {
-            searchPreambleEnd();
-            int newPreambleLen = mPreambleEnd + 2;
-            int segmentPayload = mMaxSegmentLen - newPreambleLen - 1;
-            int totalPayload = totalLen - mPreambleEnd - 1;
-            mSegmentCount = (totalPayload + segmentPayload -1) / segmentPayload;
-        }
-    }
-
-    private void searchPreambleEnd() {
-        byte[] data = mData;
-        int index = 0;
-        while(index < data.length && data[index] != ' ') {
-            index++;
-        }
-        mPreambleEnd = index;
-    }
-}
\ No newline at end of file
diff --git a/src/com/android/im/imps/StandardPasswordDigest.java b/src/com/android/im/imps/StandardPasswordDigest.java
deleted file mode 100644 (file)
index dd7bbaf..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import com.android.im.engine.ImException;
-
-import org.apache.commons.codec.binary.Base64;
-
-import android.security.MessageDigest;
-
-import java.io.UnsupportedEncodingException;
-import java.security.NoSuchAlgorithmException;
-
-public class StandardPasswordDigest implements PasswordDigest {
-
-    public String digest(String schema, String nonce, String password) throws ImException {
-        byte[] digestBytes;
-        byte[] inputBytes;
-
-        try {
-            inputBytes = (nonce + password).getBytes("ISO-8859-1");
-        } catch (UnsupportedEncodingException e) {
-            throw new ImException(e);
-        }
-
-        try {
-            if ("SHA".equals(schema))
-                schema = "SHA-1";
-            MessageDigest md = MessageDigest.getInstance(schema);
-            digestBytes = md.digest(inputBytes);
-        } catch (NoSuchAlgorithmException e) {
-            throw new ImException("Unsupported schema: " + schema);
-        }
-        return new String(Base64.encodeBase64(digestBytes));
-    }
-
-    public String[] getSupportedDigestSchema() {
-        return new String[] {"MD5", "SHA"};
-    }
-
-}
diff --git a/src/com/android/im/imps/TcpCirChannel.java b/src/com/android/im/imps/TcpCirChannel.java
deleted file mode 100644 (file)
index 6679a0a..0000000
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.Socket;
-import java.net.UnknownHostException;
-import com.android.im.engine.HeartbeatService;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.ImException;
-import com.android.im.engine.SystemService;
-
-import android.os.SystemClock;
-import android.util.Log;
-
-/**
- * An implementation of CIR channel with standalone TCP/IP banding.
- */
-class TcpCirChannel extends CirChannel implements Runnable, HeartbeatService.Callback {
-    public static final int PING_INTERVAL = 20 * 60 * 1000; // 20 min
-
-    private static final int OK_TIMEOUT = 30000;
-
-    private String mAddress;
-    private int mPort;
-    private boolean mDone;
-    private boolean mReconnecting;
-    private Object mReconnectLock = new Object();
-    private Socket mSocket;
-
-    private boolean mWaitForOK;
-    private long mLastActive;
-    private String mUser;
-    private BufferedReader mReader;
-
-    private Thread mCirThread;
-
-    protected TcpCirChannel(ImpsConnection connection) {
-        super(connection);
-        mAddress = connection.getSession().getCirTcpAddress();
-        mPort = connection.getSession().getCirTcpPort();
-        mUser = connection.getSession().getLoginUser().getName();
-    }
-
-    @Override
-    public synchronized void connect() throws ImException {
-        try {
-            connectServer();
-            mCirThread = new Thread(this, "TcpCirChannel");
-            mCirThread.setDaemon(true);
-            mCirThread.start();
-            HeartbeatService heartbeatService
-                    = SystemService.getDefault().getHeartbeatService();
-            if (heartbeatService != null) {
-                heartbeatService.startHeartbeat(this, PING_INTERVAL);
-            }
-        } catch (UnknownHostException e) {
-            throw new ImException(ImErrorInfo.UNKNOWN_SERVER,
-                    "Can't find the TCP CIR server");
-        } catch (IOException e) {
-            throw new ImException(ImErrorInfo.CANT_CONNECT_TO_SERVER,
-                    "Can't connect to the TCP CIR server");
-        }
-    }
-
-    @Override
-    public synchronized void shutdown() {
-        if (Log.isLoggable(ImpsLog.TAG, Log.DEBUG)) {
-            ImpsLog.log(mUser + " Shutting down CIR channel");
-        }
-        mDone = true;
-        synchronized (mReconnectLock) {
-            if (mReconnecting) {
-                mReconnecting = false;
-                mReconnectLock.notify();
-            }
-        }
-        try {
-            if(mSocket != null) {
-                mSocket.close();
-            }
-        } catch (IOException e) {
-            // ignore
-        }
-        HeartbeatService heartbeatService
-                = SystemService.getDefault().getHeartbeatService();
-        if (heartbeatService != null) {
-            heartbeatService.stopHeartbeat(this);
-        }
-    }
-
-    public void run() {
-        while (!mDone) {
-            try {
-                if (mWaitForOK && SystemClock.elapsedRealtime() - mLastActive
-                        > OK_TIMEOUT) {
-                    // OMA-TS-IMPS_CSP_Transport-V1_3-20070123-A 8.1.3:
-                    // If client doesn't receive an "OK" message or detects
-                    // that the connection is broken, it MUST open a new
-                    // TCP/IP connection and send the "HELO" message again.
-                    reconnectAndWait();
-                }
-
-                String line = mReader.readLine();
-                mLastActive = SystemClock.elapsedRealtime();
-
-                if (line == null) {
-                    if (Log.isLoggable(ImpsLog.TAG, Log.DEBUG)) {
-                        ImpsLog.log(mUser + " TCP CIR: socket closed by server.");
-                    }
-                    reconnectAndWait();
-                } else if ("OK".equals(line)) {
-                    mWaitForOK = false;
-                    if (Log.isLoggable(ImpsLog.TAG, Log.DEBUG)) {
-                        ImpsLog.log(mUser + " << TCP CIR: OK Received");
-                    }
-                    // TODO: Since we just have one thread per TCP CIR
-                    // connection now, the session cookie is ignored.
-                } else if (line.startsWith("WVCI")) {
-                    if (Log.isLoggable(ImpsLog.TAG, Log.DEBUG)) {
-                        ImpsLog.log(mUser + " << TCP CIR: CIR Received");
-                    }
-                    if (!mDone) {
-                        mConnection.sendPollingRequest();
-                    }
-                }
-            } catch (IOException e) {
-                ImpsLog.logError("TCP CIR channel get:" + e);
-                if(!mDone){
-                    reconnectAndWait();
-                }
-            }
-        }
-        if (mReader != null) {
-            try {
-                mReader.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        if (Log.isLoggable(ImpsLog.TAG, Log.DEBUG)) {
-            ImpsLog.log(mUser + " CIR channel thread quit");
-        }
-    }
-
-    @Override
-    public void reconnect() {
-        synchronized (mReconnectLock) {
-            if (mReconnecting) {
-                return;
-            } else {
-                mReconnecting = true;
-            }
-        }
-
-        if (Log.isLoggable(ImpsLog.TAG, Log.DEBUG)) {
-            ImpsLog.log(mUser + " CIR channel reconnecting");
-        }
-        long waitTime = 3000;
-        while (!mDone) { // Keep trying to connect the server until shutdown
-            try {
-                try {
-                    Thread.sleep(waitTime);
-                } catch (InterruptedException e) {
-                }
-                connectServer();
-                // Send a polling request to make sure we don't miss anything
-                // while CIR is down.
-                if(!mDone) {
-                    mConnection.sendPollingRequest();
-                }
-                break;
-            } catch (IOException e) {
-                waitTime *= 3;
-                if(waitTime > 27000) {
-                    waitTime = 3000;
-                    if(!mDone){
-                        mConnection.sendPollingRequest();
-                    }
-                }
-                if (Log.isLoggable(ImpsLog.TAG, Log.DEBUG)) {
-                    ImpsLog.log(mUser + " CIR channel reconnect fail, retry after "
-                        + waitTime / 1000 + " seconds");
-                }
-            }
-        }
-        synchronized (mReconnectLock) {
-            mReconnecting = false;
-            mReconnectLock.notify();
-        }
-    }
-
-    private void reconnectAndWait() {
-        reconnect();
-        // in case reconnect() has already been called in another thread, wait
-        // for it to finish
-        while (!mDone) {
-            synchronized (mReconnectLock) {
-                if (mReconnecting) {
-                    try {
-                        mReconnectLock.wait();
-                    } catch (InterruptedException e) {
-                        // ignore
-                    }
-                } else {
-                    break;
-                }
-            }
-        }
-    }
-
-    private synchronized void connectServer() throws IOException {
-        if(!mDone) {
-            if (mSocket != null) {
-                if (Log.isLoggable(ImpsLog.TAG, Log.DEBUG)) {
-                    ImpsLog.log(mUser + " TCP CIR: close previous socket");
-                }
-                try {
-                    mSocket.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-
-            mSocket = new Socket(mAddress, mPort);
-            if (Log.isLoggable(ImpsLog.TAG, Log.DEBUG)) {
-                ImpsLog.log(mUser + " >> TCP CIR: HELO");
-            }
-            sendData("HELO " + mConnection.getSession().getID() + "\r\n");
-            if (mReader != null) {
-                try {
-                    mReader.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-            mReader = new BufferedReader(
-                    new InputStreamReader(mSocket.getInputStream(), "UTF-8"),
-                    8192);
-        }
-    }
-
-    public synchronized long sendHeartbeat() {
-        if (mDone) {
-            return 0;
-        }
-
-        long inactiveTime = SystemClock.elapsedRealtime() - mLastActive;
-        if(needSendPing(inactiveTime)) {
-            if (Log.isLoggable(ImpsLog.TAG, Log.DEBUG)) {
-                ImpsLog.log(mUser + " >> TCP CIR: PING");
-            }
-            try {
-                sendData("PING \r\n");
-            } catch (IOException e) {
-                if (Log.isLoggable(ImpsLog.TAG, Log.DEBUG)) {
-                    ImpsLog.log("Failed to send PING, try to reconnect");
-                }
-                reconnect();
-            }
-            return PING_INTERVAL;
-        } else {
-            return PING_INTERVAL - inactiveTime;
-        }
-    }
-
-    private boolean needSendPing(long inactiveTime) {
-        return (PING_INTERVAL - inactiveTime) < 500;
-    }
-
-    private void sendData(String s) throws IOException {
-        mSocket.getOutputStream().write(s.getBytes("UTF-8"));
-        mWaitForOK = true;
-        mLastActive = SystemClock.elapsedRealtime();
-    }
-
-}
diff --git a/src/com/android/im/imps/WbxmlParser.java b/src/com/android/im/imps/WbxmlParser.java
deleted file mode 100644 (file)
index 80997b5..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/*
- * NOT thread-safe. Always use this in one thread.
- */
-final class WbxmlParser {
-    private static final int BUFFER_SIZE = 1024;
-
-    private ContentHandler mContentHandler;
-    private int mNativeParser;
-    private AttributesImpl atts;
-
-    public WbxmlParser() {
-        atts = new AttributesImpl();
-        mNativeParser = nativeCreate("UTF-8");
-        if (mNativeParser == 0) {
-            throw new OutOfMemoryError();
-        }
-    }
-
-    @Override
-    protected void finalize() {
-        if (mNativeParser != 0) {
-            nativeRelease(mNativeParser);
-        }
-    }
-
-    public void setContentHandler(ContentHandler contentHandler) {
-        mContentHandler = contentHandler;
-    }
-
-    public void reset() {
-        if (mNativeParser != 0) {
-            nativeReset(mNativeParser);
-        }
-        atts.names = null;
-        atts.values = null;
-        mContentHandler = null;
-    }
-
-    public void parse(InputSource in) throws ParserException, SAXException, IOException {
-        InputStream byteStream = in.getByteStream();
-        byte[] buffer = new byte[BUFFER_SIZE];
-        int length;
-        // FIXME: nativeParse should throw ParserException but the dalvik
-        // seems to have problem throwing non-system exceptions from JNI
-        // code. Use IAE for now and file a bug report for this.
-        try {
-            while ((length = byteStream.read(buffer)) != -1) {
-                nativeParse(mNativeParser, buffer, length, false);
-            }
-            nativeParse(mNativeParser, new byte[1], 0, true);
-        } catch (IllegalArgumentException e) {
-            throw new ParserException(e);
-        }
-    }
-
-    void startElement(String name, String[] attrNames, String[] attrValues)
-            throws SAXException {
-        atts.names = attrNames;
-        atts.values = attrValues;
-        if(mContentHandler != null) {
-            mContentHandler.startElement("", name, name, atts);
-        }
-    }
-
-    void endElement(String name) throws SAXException {
-        if(mContentHandler != null) {
-            mContentHandler.endElement("", name, name);
-        }
-    }
-
-    void characters(char[] ch, int length) throws SAXException {
-        if(mContentHandler != null) {
-            mContentHandler.characters(ch, 0, length);
-        }
-    }
-
-    static native void nativeStaticInitialize();
-
-    native int nativeCreate(String encoding);
-
-    native void nativeRelease(int nativeParser);
-
-    native void nativeReset(int nativeParser);
-
-    // XXX: nativeParse should throw ParserException but the dalvik seems to
-    // have problem throwing non-system exceptions from JNI code. Use IAE
-    // for now and file a bug report for this.
-    native void nativeParse(int nativeParser, byte[] ch, int length,
-            boolean isEnd) throws IllegalArgumentException, SAXException, IOException;
-
-    static {
-        try {
-            System.loadLibrary("wbxml_jni");
-            nativeStaticInitialize();
-        } catch (UnsatisfiedLinkError ule) {
-            System.err.println("WARNING: Could not load library libwbxml_jni.so");
-        }
-    }
-
-    static class AttributesImpl implements Attributes {
-        String[] names = null;
-        String[] values = null;
-
-        public int getIndex(String qName) {
-            if(names == null) {
-                return -1;
-            }
-            for (int i = 0; i < names.length; i++) {
-                if (names[i].equals(qName)) {
-                    return i;
-                }
-            }
-            return -1;
-        }
-
-        public int getIndex(String uri, String localName) {
-            if(!"".equals(uri)) {
-                return -1;
-            }
-            return getIndex(localName);
-        }
-
-        public int getLength() {
-            return names == null ? 0 : names.length;
-        }
-
-        public String getLocalName(int index) {
-            if(index < 0 || index >= getLength()) {
-                return null;
-            }
-            return names[index];
-        }
-
-        public String getQName(int index) {
-            if(index < 0 || index >= getLength()) {
-                return null;
-            }
-            return names[index];
-        }
-
-        public String getType(int index) {
-            if(index < 0 || index >= getLength()) {
-                return null;
-            }
-            return "CDATA";
-        }
-
-        public String getType(String qName) {
-            return getIndex(qName) == -1 ? null : "CDATA";
-        }
-
-        public String getType(String uri, String localName) {
-            return getIndex(uri, localName) == -1 ? null : "CDATA";
-        }
-
-        public String getURI(int index) {
-            if(index < 0 || index >= getLength()) {
-                return null;
-            }
-            return "";
-        }
-
-        public String getValue(int index) {
-            if(index < 0 || index >= getLength()) {
-                return null;
-            }
-            return values[index];
-        }
-
-        public String getValue(String qName) {
-            int index = getIndex(qName);
-            return index == -1 ? null : values[index];
-        }
-
-        public String getValue(String uri, String localName) {
-            int index = getIndex(uri, localName);
-            return index == -1 ? null : values[index];
-        }
-    }
-}
diff --git a/src/com/android/im/imps/WbxmlPrimitiveParser.java b/src/com/android/im/imps/WbxmlPrimitiveParser.java
deleted file mode 100644 (file)
index 7c8f936..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-public class WbxmlPrimitiveParser implements PrimitiveParser{
-    private WbxmlParser mParser;
-    private PrimitiveContentHandler mContentHandler;
-
-    public WbxmlPrimitiveParser() {
-        mParser= new WbxmlParser();
-        mContentHandler = new PrimitiveContentHandler();
-    }
-
-    public Primitive parse(InputStream in) throws ParserException, IOException {
-        mContentHandler.reset();
-        mParser.reset();
-        mParser.setContentHandler(mContentHandler);
-        try {
-            mParser.parse(new InputSource(in));
-        } catch (SAXException e) {
-            throw new ParserException(e);
-        }
-        return mContentHandler.getPrimitive();
-    }
-
-}
diff --git a/src/com/android/im/imps/WbxmlPrimitiveSerializer.java b/src/com/android/im/imps/WbxmlPrimitiveSerializer.java
deleted file mode 100644 (file)
index 3d2992f..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Map;
-
-import com.android.im.imps.ImpsConstants.ImpsVersion;
-
-public class WbxmlPrimitiveSerializer implements PrimitiveSerializer {
-
-    private String mVersionNs;
-    private String mTransacNs;
-
-    public WbxmlPrimitiveSerializer(ImpsVersion impsVersion, String versionNs,
-            String transacNs) {
-        mVersionNs = versionNs;
-        mTransacNs = transacNs;
-        mWbxmlSerializer = new WbxmlSerializer(impsVersion);
-    }
-
-    private WbxmlSerializer mWbxmlSerializer;
-
-    public void serialize(Primitive primitive, OutputStream out) throws IOException,
-            SerializerException {
-        mWbxmlSerializer.reset();
-        mWbxmlSerializer.setOutput(out);
-        PrimitiveElement elem = primitive.createMessage(mVersionNs, mTransacNs);
-        writeElement(elem);
-    }
-
-    private void writeElement(PrimitiveElement element) throws IOException,
-            SerializerException {
-        String name = element.getTagName();
-        String[] atts = null;
-        Map<String, String> attrMap = element.getAttributes();
-        if(attrMap != null && attrMap.size() > 0) {
-            atts = new String[attrMap.size() * 2];
-            int index = 0;
-            for (Map.Entry<String, String> entry : attrMap.entrySet()) {
-                atts[index++] = entry.getKey();
-                atts[index++] = entry.getValue();
-            }
-        }
-
-        mWbxmlSerializer.startElement(name, atts);
-
-        String contents = element.getContents();
-        if(contents != null) {
-            mWbxmlSerializer.characters(contents);
-        }
-        if(element.getChildCount() > 0) {
-            for(PrimitiveElement child : element.getChildren()) {
-                writeElement(child);
-            }
-        }
-        mWbxmlSerializer.endElement();
-    }
-}
diff --git a/src/com/android/im/imps/WbxmlSerializer.java b/src/com/android/im/imps/WbxmlSerializer.java
deleted file mode 100644 (file)
index 55e53a9..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-import com.android.im.imps.ImpsConstants.ImpsVersion;
-
-/*
- * NOT thread-safe. Always use this in one thread.
- */
-final class WbxmlSerializer {
-    private OutputStream mOut;
-    private int mNativeHandle;
-
-    private static int PUBLIC_ID_IMPS_11 = 0x10;
-    private static int PUBLIC_ID_IMPS_12 = 0x11;
-    private static int PUBLIC_ID_IMPS_13 = 0x12;
-
-    public WbxmlSerializer(ImpsVersion impsVersion) {
-        if (impsVersion == ImpsVersion.IMPS_VERSION_11) {
-            mNativeHandle = nativeCreate(PUBLIC_ID_IMPS_11);
-        } else if (impsVersion == ImpsVersion.IMPS_VERSION_12) {
-            mNativeHandle = nativeCreate(PUBLIC_ID_IMPS_12);
-        } else if (impsVersion == ImpsVersion.IMPS_VERSION_13) {
-            mNativeHandle = nativeCreate(PUBLIC_ID_IMPS_13);
-        } else {
-            throw new IllegalArgumentException("Unsupported IMPS version");
-        }
-        if (mNativeHandle == 0) {
-            throw new OutOfMemoryError();
-        }
-    }
-
-    @Override
-    protected void finalize() {
-        if (mNativeHandle != 0) {
-            nativeRelease(mNativeHandle);
-        }
-    }
-
-    public void reset() {
-        nativeReset(mNativeHandle);
-        mOut = null;
-    }
-
-    public void setOutput(OutputStream out) {
-        mOut = out;
-    }
-
-    // XXX: These should throw ParserException but the dalvik seems to have
-    // problem throwing non-system exceptions from JNI code. Use IAE for now
-    // and file a bug report for this.
-    public void startElement(String name, String[] atts) throws IOException,
-            SerializerException {
-        try {
-            nativeStartElement(mNativeHandle, name, atts);
-        } catch (IllegalArgumentException e) {
-            throw new SerializerException(e);
-        }
-    }
-
-    public void characters(String chars) throws IOException, SerializerException {
-        try {
-            nativeCharacters(mNativeHandle, chars);
-        } catch (IllegalArgumentException e) {
-            throw new SerializerException(e);
-        }
-    }
-
-    public void endElement() throws IOException, SerializerException {
-        try {
-            nativeEndElement(mNativeHandle);
-        } catch (IllegalArgumentException e) {
-            throw new SerializerException(e);
-        }
-    }
-
-    /**
-     * Called by native encoder to send result data.
-     * @param data
-     * @param len
-     * @throws IOException
-     */
-    void onWbxmlData(byte[] data, int len) throws IOException {
-        if (mOut != null) {
-            mOut.write(data, 0, len);
-        }
-    }
-
-    native int nativeCreate(int publicId);
-
-    native void nativeReset(int nativeHandle);
-    native void nativeRelease(int nativeHandle);
-
-    // FIXME: These should throw ParserException but the dalvik seems to have
-    // problem throwing non-system exceptions from JNI code. Use IAE for now
-    // and file a bug report for this.
-    native void nativeStartElement(int nativeHandle, String name, String[] atts)
-            throws IOException, IllegalArgumentException;
-    native void nativeCharacters(int nativeHandle, String characters)
-            throws IOException, IllegalArgumentException;
-    native void nativeEndElement(int nativeHandle)
-            throws IOException, IllegalArgumentException;
-
-    static {
-        try {
-            System.loadLibrary("wbxml_jni");
-        }catch(UnsatisfiedLinkError ule) {
-            System.err.println("WARNING: Could not load library libwbxml_jni.so");
-        }
-    }
-}
diff --git a/src/com/android/im/imps/XmlPrimitiveParser.java b/src/com/android/im/imps/XmlPrimitiveParser.java
deleted file mode 100644 (file)
index 1e24f00..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.io.IOException;
-import java.io.InputStream;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-
-import org.xml.sax.helpers.XMLReaderFactory;
-
-import com.android.im.engine.ImException;
-
-public class XmlPrimitiveParser implements
-        PrimitiveParser {
-    private XMLReader mXmlReader;
-    private PrimitiveContentHandler mContentHandler;
-
-    public XmlPrimitiveParser() throws ImException {
-        //FIXME: Now we don't have the SAXParser wrapped inside,
-        //       use the Driver class temporarily.
-        System.setProperty("org.xml.sax.driver", "org.xmlpull.v1.sax2.Driver");
-
-        try {
-            mXmlReader = XMLReaderFactory.createXMLReader();
-            mContentHandler = new PrimitiveContentHandler();
-            mXmlReader.setContentHandler(mContentHandler);
-        } catch (SAXException e) {
-            throw new ImException(e);
-        }
-    }
-
-    public Primitive parse(InputStream in) throws ParserException, IOException {
-        mContentHandler.reset();
-
-        try {
-            mXmlReader.parse(new InputSource(in));
-        } catch (SAXException e) {
-            throw new ParserException(e);
-        }
-
-        return mContentHandler.getPrimitive();
-    }
-}
diff --git a/src/com/android/im/imps/XmlPrimitiveSerializer.java b/src/com/android/im/imps/XmlPrimitiveSerializer.java
deleted file mode 100644 (file)
index 2da0fd6..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2007 Esmertec AG.
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.imps;
-
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.util.Map;
-
-public class XmlPrimitiveSerializer implements PrimitiveSerializer {
-    private String mVersionNs;
-    private String mTransacNs;
-
-    public XmlPrimitiveSerializer(String versionNs, String transacNs) {
-        mVersionNs = versionNs;
-        mTransacNs = transacNs;
-    }
-
-    public void serialize(Primitive primitive, OutputStream out) throws IOException {
-        try {
-            Writer writer = 
-                new BufferedWriter(new OutputStreamWriter(out, "UTF-8"), 8192);
-
-            PrimitiveElement elem = primitive.createMessage(mVersionNs,
-                    mTransacNs);
-            writeElement(writer, elem);
-            writer.flush();
-        } catch (UnsupportedEncodingException e) {
-            // Impossible. UTF-8 is always supported
-            ImpsLog.logError(e);
-        }
-    }
-
-    private void writeElement(Writer writer, PrimitiveElement element)
-            throws IOException {
-        writer.write('<');
-        writer.write(element.getTagName());
-
-        Map<String, String> attrMap = element.getAttributes();
-        if(attrMap != null && attrMap.size() > 0) {
-            for (Map.Entry<String, String> entry : attrMap.entrySet()) {
-                writer.write(' ');
-                writer.write(entry.getKey());
-                writer.write("=\"");
-                writeEncoded(writer, entry.getValue());
-                writer.write('"');
-            }
-        }
-
-        if (element.getContents() != null) {
-            writer.write('>');
-            writeEncoded(writer, element.getContents());
-
-            writer.write("</");
-            writer.write(element.getTagName());
-            writer.write('>');
-        } else if (element.getChildCount() > 0) {
-            writer.write('>');
-
-            for (PrimitiveElement child : element.getChildren()) {
-                writeElement(writer, child);
-            }
-            writer.write("</");
-            writer.write(element.getTagName());
-            writer.write('>');
-        } else {
-            writer.write("/>");
-        }
-    }
-
-    private void writeEncoded(Writer writer, String str) throws IOException {
-        int len = str.length();
-        for (int i = 0; i < len; i++) {
-            char ch = str.charAt(i);
-
-            switch (ch) {
-                case '<':
-                    writer.write("&lt;");
-                    break;
-
-                case '>':
-                    writer.write("&gt;");
-                    break;
-
-                case '&':
-                    writer.write("&amp;");
-                    break;
-
-                case '"':
-                    writer.write("&quot;");
-                    break;
-
-                case '\'':
-                    writer.write("&apos;");
-                    break;
-
-                default:
-                    writer.write(ch);
-            }
-        }
-    }
-}
diff --git a/src/com/android/im/receiver/ImServiceAutoStarter.java b/src/com/android/im/receiver/ImServiceAutoStarter.java
deleted file mode 100644 (file)
index 7f1992f..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.receiver;
-
-import com.android.im.service.ImServiceConstants;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.BroadcastReceiver;
-import android.database.Cursor;
-import android.provider.Im;
-import android.util.Log;
-
-public class ImServiceAutoStarter extends BroadcastReceiver {
-    static final String TAG = "ImServiceAutoStarter";
-
-    @Override
-    public void onReceive(Context context, Intent intent) {
-        // Received intent only when the system boot is completed
-        Log.d(TAG, "onReceiveIntent");
-
-        String selection = Im.Account.KEEP_SIGNED_IN + "=1 AND "
-                + Im.Account.ACTIVE + "=1";
-        Cursor cursor = context.getContentResolver().query(Im.Account.CONTENT_URI,
-                new String[]{Im.Account._ID}, selection, null, null);
-        if (cursor != null) {
-            if (cursor.getCount() > 0) {
-                Log.d(TAG, "start service");
-                Intent serviceIntent = new Intent();
-                serviceIntent.setComponent(ImServiceConstants.IM_SERVICE_COMPONENT);
-                serviceIntent.putExtra(ImServiceConstants.EXTRA_CHECK_AUTO_LOGIN, true);
-                context.startService(serviceIntent);
-            }
-            cursor.close();
-        }
-    }
-
-}
diff --git a/src/com/android/im/service/AndroidHeartBeatService.java b/src/com/android/im/service/AndroidHeartBeatService.java
deleted file mode 100644 (file)
index fe7aa29..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.service;
-
-import com.android.im.engine.HeartbeatService;
-
-import android.app.AlarmManager;
-import android.app.PendingIntent;
-import android.content.BroadcastReceiver;
-import android.content.ContentUris;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.net.Uri;
-import android.os.PowerManager;
-import android.os.SystemClock;
-import android.util.SparseArray;
-
-public class AndroidHeartBeatService extends BroadcastReceiver
-        implements HeartbeatService {
-
-    private static final String WAKELOCK_TAG = "IM_HEARTBEAT";
-
-    private static final String HEARTBEAT_INTENT_ACTION
-            = "com.android.im.intent.action.HEARTBEAT";
-    private static final Uri HEARTBEAT_CONTENT_URI
-            = Uri.parse("content://im/heartbeat");
-    private static final String HEARTBEAT_CONTENT_TYPE
-            = "vnd.android.im/heartbeat";
-
-    private Context mContext;
-    private AlarmManager mAlarmManager;
-    private PowerManager.WakeLock mWakeLock;
-
-    static class Alarm {
-        public PendingIntent mAlaramSender;
-        public Callback mCallback;
-    }
-
-    private SparseArray<Alarm> mAlarms;
-
-    public AndroidHeartBeatService(Context context) {
-        mContext = context;
-        mAlarmManager = (AlarmManager)context.getSystemService(
-                Context.ALARM_SERVICE);
-        PowerManager powerManager = (PowerManager)context.getSystemService(
-                Context.POWER_SERVICE);
-        mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
-                WAKELOCK_TAG);
-        mAlarms = new SparseArray<Alarm>();
-    }
-
-    public synchronized void startHeartbeat(Callback callback, long triggerTime) {
-        Alarm alarm = findAlarm(callback);
-        if (alarm == null) {
-            alarm = new Alarm();
-            int id = nextId();
-            alarm.mCallback = callback;
-            Uri data = ContentUris.withAppendedId(HEARTBEAT_CONTENT_URI, id);
-            Intent i = new Intent().setDataAndType(data, HEARTBEAT_CONTENT_TYPE);
-            alarm.mAlaramSender = PendingIntent.getBroadcast(mContext, 0, i, 0);
-            if (mAlarms.size() == 0) {
-                mContext.registerReceiver(this, IntentFilter.create(
-                        HEARTBEAT_INTENT_ACTION, HEARTBEAT_CONTENT_TYPE));
-            }
-            mAlarms.append(id, alarm);
-        }
-        setAlarm(alarm, triggerTime);
-    }
-
-    public synchronized void stopHeartbeat(Callback callback) {
-        Alarm alarm = findAlarm(callback);
-        if (alarm != null) {
-            cancelAlarm(alarm);
-        }
-    }
-
-    public synchronized void stopAll() {
-        for (int i = 0; i < mAlarms.size(); i++) {
-            Alarm alarm = mAlarms.valueAt(i);
-            cancelAlarm(alarm);
-        }
-    }
-
-    @Override
-    public void onReceive(Context context, Intent intent) {
-        mWakeLock.acquire();
-        try {
-            int id = (int)ContentUris.parseId(intent.getData());
-            Alarm alarm = mAlarms.get(id);
-            if (alarm == null) {
-                return;
-            }
-            Callback callback = alarm.mCallback;
-            long nextSchedule = callback.sendHeartbeat();
-            if (nextSchedule <= 0) {
-                cancelAlarm(alarm);
-            } else {
-                setAlarm(alarm, nextSchedule);
-            }
-        } finally {
-            mWakeLock.release();
-        }
-    }
-
-    private Alarm findAlarm(Callback callback) {
-        for (int i = 0; i < mAlarms.size(); i++) {
-            Alarm alarm = mAlarms.valueAt(i);
-            if (alarm.mCallback == callback) {
-                return alarm;
-            }
-        }
-        return null;
-    }
-
-    private void setAlarm(Alarm alarm, long offset) {
-        long triggerAtTime = SystemClock.elapsedRealtime() + offset;
-        mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, triggerAtTime,
-                alarm.mAlaramSender);
-    }
-
-    private void cancelAlarm(Alarm alarm) {
-        mAlarmManager.cancel(alarm.mAlaramSender);
-        int index = mAlarms.indexOfValue(alarm);
-        if (index >= 0) {
-            mAlarms.delete(mAlarms.keyAt(index));
-        }
-
-        // Unregister the BroadcastReceiver if there isn't a alarm anymore.
-        if (mAlarms.size() == 0) {
-            mContext.unregisterReceiver(this);
-        }
-    }
-
-    private static int sNextId = 0;
-    private static synchronized int nextId() {
-        return sNextId++;
-    }
-}
diff --git a/src/com/android/im/service/AndroidSmsService.java b/src/com/android/im/service/AndroidSmsService.java
deleted file mode 100644 (file)
index d1dda41..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.service;
-
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import android.app.PendingIntent;
-import android.content.BroadcastReceiver;
-import android.content.ContentUris;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.net.Uri;
-import android.provider.Telephony;
-import static android.provider.Telephony.Sms.Intents.DATA_SMS_RECEIVED_ACTION;
-import android.telephony.PhoneNumberUtils;
-import android.telephony.gsm.SmsManager;
-import android.telephony.gsm.SmsMessage;
-import android.util.Log;
-
-import com.android.im.engine.SmsService;
-
-public class AndroidSmsService implements SmsService {
-    private static final String TAG = RemoteImService.TAG;
-
-    private static final String SMS_STATUS_RECEIVED_ACTION =
-        "com.android.im.SmsService.SMS_STATUS_RECEIVED";
-
-    private static final int sMaxSmsLength =
-        SmsMessage.MAX_USER_DATA_BYTES - 7/* UDH size */;
-
-    private Context mContext;
-    private SmsReceiver mSmsReceiver;
-    private IntentFilter mIntentFilter;
-    /*package*/HashMap<Integer, ListenerList> mListeners;
-    /*package*/HashMap<Long, SmsSendFailureCallback> mFailureCallbacks;
-
-    public AndroidSmsService(Context context) {
-        mContext = context;
-        mSmsReceiver = new SmsReceiver();
-        mIntentFilter = new IntentFilter(
-                Telephony.Sms.Intents.DATA_SMS_RECEIVED_ACTION);
-        mIntentFilter.addDataScheme("sms");
-        mListeners = new HashMap<Integer, ListenerList>();
-        mFailureCallbacks = new HashMap<Long, SmsSendFailureCallback>();
-    }
-
-    public int getMaxSmsLength() {
-        return sMaxSmsLength;
-    }
-
-    public void sendSms(String dest, int port, byte[] data) {
-        sendSms(dest, port, data, null);
-    }
-
-    public void sendSms(String dest, int port, byte[] data,
-            SmsSendFailureCallback callback) {
-        if (Log.isLoggable(TAG, Log.DEBUG)) {
-            try {
-                log(dest + ":" + port + " >>> " + new String(data, "UTF-8"));
-            } catch (UnsupportedEncodingException e) {
-            }
-        }
-        if (data.length > sMaxSmsLength) {
-            Log.e(TAG, "SMS data message can only contain " + sMaxSmsLength
-                    + " bytes");
-            return;
-        }
-
-        SmsManager smsManager = SmsManager.getDefault();
-        PendingIntent sentIntent;
-        if (callback == null) {
-            sentIntent = null;
-        } else {
-            long msgId = genMsgId();
-            mFailureCallbacks.put(msgId, callback);
-
-            sentIntent = PendingIntent.getBroadcast(mContext, 0,
-                new Intent(
-                        SMS_STATUS_RECEIVED_ACTION,
-                        Uri.parse("content://sms/" + msgId), /*uri*/
-                        mContext, SmsReceiver.class),
-                0);
-        }
-        smsManager.sendDataMessage(dest, null/*use the default SMSC*/,
-                (short) port, data,
-                sentIntent,
-                null/*do not require delivery report*/);
-    }
-
-    public void addSmsListener(String from, int port, SmsListener listener) {
-        ListenerList l = mListeners.get(port);
-        if (l == null) {
-            l = new ListenerList(port);
-            mListeners.put(port, l);
-
-            // We didn't listen on the port yet, register the receiver with the
-            // additional port.
-            mIntentFilter.addDataAuthority("*", String.valueOf(port));
-            mContext.registerReceiver(mSmsReceiver, mIntentFilter);
-        }
-        l.addListener(from, listener);
-    }
-
-    public void removeSmsListener(SmsListener listener) {
-        Iterator<ListenerList> iter = mListeners.values().iterator();
-        while (iter.hasNext()) {
-            ListenerList l = iter.next();
-            l.removeListener(listener);
-            if (l.isEmpty()) {
-                iter.remove();
-            }
-        }
-    }
-
-    public void stop() {
-        mContext.unregisterReceiver(mSmsReceiver);
-    }
-
-    private static long sNextMsgId = 0;
-    private static synchronized long genMsgId() {
-        return sNextMsgId++;
-    }
-
-    private static void log(String msg) {
-        Log.d(TAG, "[SmsService]" + msg);
-    }
-
-    private final class SmsReceiver extends BroadcastReceiver {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            if (SMS_STATUS_RECEIVED_ACTION.equals(intent.getAction())) {
-                if (Log.isLoggable(TAG, Log.DEBUG)) {
-                    log("send status received");
-                }
-                long id = ContentUris.parseId(intent.getData());
-                SmsSendFailureCallback callback = mFailureCallbacks.get(id);
-                if (callback == null) {
-                    return;
-                }
-
-                int resultCode = getResultCode();
-                if (resultCode == SmsManager.RESULT_ERROR_GENERIC_FAILURE) {
-                    callback.onFailure(SmsSendFailureCallback.ERROR_GENERIC_FAILURE);
-                } else if (resultCode == SmsManager.RESULT_ERROR_RADIO_OFF) {
-                    callback.onFailure(SmsSendFailureCallback.ERROR_RADIO_OFF);
-                }
-                mFailureCallbacks.remove(id);
-            } else if (DATA_SMS_RECEIVED_ACTION.equals(intent.getAction())){
-                Uri uri = intent.getData();
-                int port = uri.getPort();
-                ListenerList listeners = mListeners.get(port);
-                if (listeners == null) {
-                    if (Log.isLoggable(TAG, Log.DEBUG)) {
-                        log("No listener on port " + port + ", ignore");
-                    }
-                    return;
-                }
-
-                SmsMessage[] receivedSms
-                    = Telephony.Sms.Intents.getMessagesFromIntent(intent);
-
-                for (SmsMessage msg : receivedSms) {
-                    String from = msg.getOriginatingAddress();
-                    byte[] data = msg.getUserData();
-                    if (Log.isLoggable(TAG, Log.DEBUG)) {
-                        try {
-                            log(from + ":" + port + " <<< " + new String(data, "UTF-8"));
-                        } catch (UnsupportedEncodingException e) {
-                        }
-                    }
-                    listeners.notifySms(from, data);
-                }
-            }
-        }
-    }
-
-    private final static class ListenerList {
-        private int mPort;
-        private ArrayList<String> mAddrList;
-        private ArrayList<SmsListener> mListenerList;
-
-        public ListenerList(int port) {
-            mPort = port;
-            mAddrList = new ArrayList<String>();
-            mListenerList = new ArrayList<SmsListener>();
-        }
-
-        public synchronized void addListener(String addr, SmsListener listener) {
-            mAddrList.add(addr);
-            mListenerList.add(listener);
-        }
-
-        public synchronized void removeListener(SmsListener listener) {
-            int index = -1;
-            while ((index = mListenerList.indexOf(listener)) != -1) {
-                mAddrList.remove(index);
-                mListenerList.remove(index);
-            }
-        }
-
-        public void notifySms(String addr, byte[] data) {
-            int N = mListenerList.size();
-            for (int i = 0; i < N; i++) {
-                if (PhoneNumberUtils.compare(addr, mAddrList.get(i))) {
-                    mListenerList.get(i).onIncomingSms(data);
-                }
-            }
-        }
-
-        public boolean isEmpty() {
-            return mListenerList.isEmpty();
-        }
-
-        public int getPort() {
-            return mPort;
-        }
-    }
-}
diff --git a/src/com/android/im/service/AndroidSystemService.java b/src/com/android/im/service/AndroidSystemService.java
deleted file mode 100644 (file)
index e908924..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.im.service;
-
-import android.content.Context;
-
-import com.android.im.engine.HeartbeatService;
-import com.android.im.engine.SmsService;
-import com.android.im.engine.SystemService;
-
-public class AndroidSystemService extends SystemService {
-    private static AndroidSystemService sInstance;
-
-    private AndroidSystemService() {
-    }
-
-    public static AndroidSystemService getInstance() {
-        if (sInstance == null) {
-            sInstance = new AndroidSystemService();
-        }
-        return sInstance;
-    }
-
-    private Context mContext;
-    private AndroidHeartBeatService mHeartbeatServcie;
-    private AndroidSmsService mSmsService;
-
-    public void initialize(Context context) {
-        mContext = context;
-    }
-
-    public void shutdown() {
-        if (mHeartbeatServcie != null) {
-            mHeartbeatServcie.stopAll();
-        }
-        if (mSmsService != null) {
-            mSmsService.stop();
-        }
-    }
-
-    @Override
-    public HeartbeatService getHeartbeatService() {
-        if(mContext == null) {
-            throw new IllegalStateException("Hasn't been initialized yet");
-        }
-        if (mHeartbeatServcie == null) {
-            mHeartbeatServcie = new AndroidHeartBeatService(mContext);
-        }
-        return mHeartbeatServcie;
-    }
-
-    @Override
-    public SmsService getSmsService() {
-        if(mContext == null) {
-            throw new IllegalStateException("Hasn't been initialized yet");
-        }
-        if (mSmsService == null) {
-            mSmsService = new AndroidSmsService(mContext);
-        }
-        return mSmsService;
-    }
-
-}
diff --git a/src/com/android/im/service/ChatSessionAdapter.java b/src/com/android/im/service/ChatSessionAdapter.java
deleted file mode 100644 (file)
index 35c3825..0000000
+++ /dev/null
@@ -1,635 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.service;
-
-import com.android.im.IChatListener;
-import com.android.im.IChatSession;
-import com.android.im.engine.ChatGroup;
-import com.android.im.engine.ChatGroupManager;
-import com.android.im.engine.ChatSession;
-import com.android.im.engine.Contact;
-import com.android.im.engine.GroupListener;
-import com.android.im.engine.GroupMemberListener;
-import com.android.im.engine.ImConnection;
-import com.android.im.engine.ImEntity;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.Message;
-import com.android.im.engine.MessageListener;
-import com.android.im.engine.Presence;
-
-import android.content.ContentResolver;
-import android.content.ContentValues;
-import android.content.ContentUris;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.RemoteCallbackList;
-import android.os.RemoteException;
-import android.provider.BaseColumns;
-import android.provider.Im;
-import android.util.Log;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-public class ChatSessionAdapter extends IChatSession.Stub {
-
-    private static final String NON_CHAT_MESSAGE_SELECTION = Im.BaseMessageColumns.TYPE
-            + "!=" + Im.MessageType.INCOMING + " AND " + Im.BaseMessageColumns.TYPE
-            + "!=" + Im.MessageType.OUTGOING;
-
-    static final String TAG = RemoteImService.TAG;
-
-    /**
-     * The registered remote listeners.
-     */
-    final RemoteCallbackList<IChatListener> mRemoteListeners
-            = new RemoteCallbackList<IChatListener>();
-
-    ImConnectionAdapter mConnection;
-    ChatSessionManagerAdapter mChatManager;
-    ChatSession mAdaptee;
-    ListenerAdapter mListenerAdapter;
-    boolean mIsGroupChat;
-    StatusBarNotifier mStatusBarNotifier;
-
-    private ContentResolver mContentResolver;
-    /*package*/Uri mChatURI;
-    private Uri mMessageURI;
-
-    private boolean mConvertingToGroupChat;
-
-    private static final int MAX_HISTORY_COPY_COUNT = 10;
-
-    private HashMap<String, Integer> mContactStatusMap
-        = new HashMap<String, Integer>();
-
-    private boolean mHasUnreadMessages;
-
-    public ChatSessionAdapter(ChatSession adaptee,
-            ImConnectionAdapter connection) {
-        mAdaptee = adaptee;
-        mConnection = connection;
-        RemoteImService service = connection.getContext();
-        mContentResolver = service.getContentResolver();
-        mStatusBarNotifier = service.getStatusBarNotifier();
-        mChatManager = (ChatSessionManagerAdapter) connection.getChatSessionManager();
-
-        mListenerAdapter = new ListenerAdapter();
-        mAdaptee.addMessageListener(mListenerAdapter);
-
-        ImEntity participant = mAdaptee.getParticipant();
-
-        if(participant instanceof ChatGroup) {
-            init((ChatGroup)participant);
-        } else {
-            init((Contact)participant);
-        }
-    }
-
-    private void init(ChatGroup group) {
-        mIsGroupChat = true;
-        long groupId = insertGroupContactInDb(group);
-        group.addMemberListener(mListenerAdapter);
-        mMessageURI = ContentUris.withAppendedId(
-                Im.GroupMessages.CONTENT_URI_GROUP_MESSAGES_BY, groupId);
-        mChatURI = ContentUris.withAppendedId(Im.Chats.CONTENT_URI, groupId);
-        insertOrUpdateChat(null);
-
-        for (Contact c : group.getMembers()) {
-            mContactStatusMap.put(c.getName(), c.getPresence().getStatus());
-        }
-    }
-
-    private void init(Contact contact) {
-        mIsGroupChat = false;
-        ContactListManagerAdapter listManager =
-            (ContactListManagerAdapter) mConnection.getContactListManager();
-        long contactId = listManager.queryOrInsertContact(contact);
-
-        long provider = mConnection.getProviderId();
-        long account  = mConnection.getAccountId();
-        String address = contact.getAddress().getFullName();
-        mMessageURI = Im.Messages.getContentUriByContact(provider, account, address);
-        mChatURI = ContentUris.withAppendedId(Im.Chats.CONTENT_URI, contactId);
-        insertOrUpdateChat(null);
-
-        mContactStatusMap.put(contact.getName(), contact.getPresence().getStatus());
-    }
-
-    private ChatGroupManager getGroupManager() {
-        return mConnection.getAdaptee().getChatGroupManager();
-    }
-
-    public ChatSession getAdaptee() {
-        return mAdaptee;
-    }
-
-    public Uri getChatUri() {
-        return mChatURI;
-    }
-
-    public String[] getPariticipants() {
-        if (mIsGroupChat) {
-            Contact self = mConnection.getLoginUser();
-            ChatGroup group = (ChatGroup)mAdaptee.getParticipant();
-            List<Contact> members = group.getMembers();
-            String[] result = new String[members.size() - 1];
-            int index = 0;
-            for (Contact c : members) {
-                if (!c.equals(self)) {
-                    result[index++] = c.getAddress().getFullName();
-                }
-            }
-            return result;
-        } else {
-            return new String[] {mAdaptee.getParticipant().getAddress().getFullName()};
-        }
-    }
-
-    /**
-     * Convert this chat session to a group chat. If it's already a group chat,
-     * nothing will happen. The method works in async mode and the registered
-     * listener will be notified when it's converted to group chat successfully.
-     *
-     * Note that the method is not thread-safe since it's always called from
-     * the UI and Android uses single thread mode for UI.
-     */
-    public void convertToGroupChat() {
-        if (mIsGroupChat || mConvertingToGroupChat) {
-            return;
-        }
-
-        mConvertingToGroupChat = true;
-        new ChatConvertor().convertToGroupChat();
-    }
-
-    public boolean isGroupChatSession() {
-        return mIsGroupChat;
-    }
-
-    public String getName() {
-        return mAdaptee.getParticipant().getAddress().getScreenName();
-    }
-
-    public String getAddress() {
-        return mAdaptee.getParticipant().getAddress().getFullName();
-    }
-
-    public long getId() {
-        return ContentUris.parseId(mChatURI);
-    }
-
-    public void inviteContact(String contact) {
-        if(!mIsGroupChat){
-            return;
-        }
-        ContactListManagerAdapter listManager =
-            (ContactListManagerAdapter) mConnection.getContactListManager();
-        Contact invitee = listManager.getContactByAddress(contact);
-        if(invitee == null) {
-            ImErrorInfo error = new ImErrorInfo(ImErrorInfo.ILLEGAL_CONTACT_ADDRESS,
-                "Cannot find contact with address: " + contact);
-            mListenerAdapter.onError((ChatGroup)mAdaptee.getParticipant(), error);
-        } else {
-            getGroupManager().inviteUserAsync((ChatGroup)mAdaptee.getParticipant(),
-                    invitee);
-        }
-    }
-
-    public void leave() {
-        if (mIsGroupChat) {
-            getGroupManager().leaveChatGroupAsync((ChatGroup)mAdaptee.getParticipant());
-            mContentResolver.delete(mMessageURI, null, null);
-        } else {
-            mContentResolver.delete(mMessageURI, null, null);
-        }
-        mContentResolver.delete(mChatURI, null, null);
-        mStatusBarNotifier.dismissChatNotification(
-                mConnection.getProviderId(), getAddress());
-        mChatManager.closeChatSession(this);
-    }
-
-    public void leaveIfInactive() {
-        if (mAdaptee.getHistoryMessages().isEmpty()) {
-            leave();
-        }
-    }
-
-    public void sendMessage(String text) {
-        if (mConnection.getState() == ImConnection.SUSPENDED) {
-            // connection has been suspended, save the message without send it
-            insertMessageInDb(null, text, -1, Im.MessageType.POSTPONED);
-            return;
-        }
-
-        Message msg = new Message(text);
-        mAdaptee.sendMessageAsync(msg);
-        long now = System.currentTimeMillis();
-        insertMessageInDb(null, text, now, Im.MessageType.OUTGOING);
-    }
-
-    void sendPostponedMessages() {
-        String[] projection = new String[] {
-            BaseColumns._ID,
-            Im.BaseMessageColumns.BODY,
-            Im.BaseMessageColumns.DATE,
-            Im.BaseMessageColumns.TYPE,
-        };
-        String selection = Im.BaseMessageColumns.TYPE + "=?";
-
-        Cursor c = mContentResolver.query(mMessageURI, projection, selection,
-                new String[]{Integer.toString(Im.MessageType.POSTPONED)}, null);
-        if (c == null) {
-            Log.e(TAG, "Query error while querying postponed messages");
-            return;
-        }
-
-        while (c.moveToNext()) {
-            String body = c.getString(1);
-            mAdaptee.sendMessageAsync(new Message(body));
-
-            c.updateLong(2, System.currentTimeMillis());
-            c.updateInt(3, Im.MessageType.OUTGOING);
-        }
-        c.commitUpdates();
-        c.close();
-    }
-
-    public void registerChatListener(IChatListener listener) {
-        if (listener != null) {
-            mRemoteListeners.register(listener);
-        }
-    }
-
-    public void unregisterChatListener(IChatListener listener) {
-        if (listener != null) {
-            mRemoteListeners.unregister(listener);
-        }
-    }
-
-    public void markAsRead() {
-        if (mHasUnreadMessages) {
-            ContentValues values = new ContentValues(1);
-            values.put(Im.Chats.LAST_UNREAD_MESSAGE, (String) null);
-            mConnection.getContext().getContentResolver().update(mChatURI, values, null, null);
-
-            mStatusBarNotifier.dismissChatNotification(mConnection.getProviderId(), getAddress());
-
-            mHasUnreadMessages = false;
-        }
-    }
-
-    String getNickName(String username) {
-        ImEntity participant = mAdaptee.getParticipant();
-        if (mIsGroupChat) {
-            ChatGroup group = (ChatGroup)participant;
-            List<Contact> members = group.getMembers();
-            for (Contact c : members) {
-                if (username.equals(c.getAddress().getFullName())) {
-                    return c.getName();
-                }
-            }
-            // not found, impossible
-            return username;
-        } else {
-            return ((Contact)participant).getName();
-        }
-    }
-
-    void onConvertToGroupChatSuccess(ChatGroup group) {
-        Contact oldParticipant = (Contact)mAdaptee.getParticipant();
-        String oldAddress = getAddress();
-        mAdaptee.setParticipant(group);
-        mChatManager.updateChatSession(oldAddress, this);
-
-        Uri oldChatUri = mChatURI;
-        Uri oldMessageUri = mMessageURI;
-        init(group);
-        copyHistoryMessages(oldParticipant);
-
-        mContentResolver.delete(oldMessageUri, NON_CHAT_MESSAGE_SELECTION, null);
-        mContentResolver.delete(oldChatUri, null, null);
-
-        mListenerAdapter.notifyChatSessionConverted();
-        mConvertingToGroupChat = false;
-    }
-
-    private void copyHistoryMessages(Contact oldParticipant) {
-        List<Message> historyMessages = mAdaptee.getHistoryMessages();
-        int total = historyMessages.size();
-        int start = total > MAX_HISTORY_COPY_COUNT ? total - MAX_HISTORY_COPY_COUNT : 0;
-        for (int i = start; i < total; i++) {
-            Message msg = historyMessages.get(i);
-            boolean incoming = msg.getFrom().equals(oldParticipant.getAddress());
-            String contact = incoming ? oldParticipant.getName() : null;
-            long time = msg.getDateTime().getTime();
-            insertMessageInDb(contact, msg.getBody(), time,
-                    incoming ? Im.MessageType.INCOMING : Im.MessageType.OUTGOING);
-        }
-    }
-
-    void insertOrUpdateChat(String message) {
-        ContentValues values = new ContentValues(2);
-
-        values.put(Im.Chats.LAST_MESSAGE_DATE, System.currentTimeMillis());
-        values.put(Im.Chats.LAST_UNREAD_MESSAGE, message);
-        // ImProvider.insert() will replace the chat if it already exist.
-        mContentResolver.insert(mChatURI, values);
-    }
-
-    private long insertGroupContactInDb(ChatGroup group) {
-        // Insert a record in contacts table
-        ContentValues values = new ContentValues(4);
-        values.put(Im.Contacts.USERNAME, group.getAddress().getFullName());
-        values.put(Im.Contacts.NICKNAME, group.getName());
-        values.put(Im.Contacts.CONTACTLIST, ContactListManagerAdapter.FAKE_TEMPORARY_LIST_ID);
-        values.put(Im.Contacts.TYPE, Im.Contacts.TYPE_GROUP);
-
-        Uri contactUri = ContentUris.withAppendedId(ContentUris.withAppendedId(
-                Im.Contacts.CONTENT_URI, mConnection.mProviderId), mConnection.mAccountId);
-        long id = ContentUris.parseId(mContentResolver.insert(contactUri, values));
-
-        ArrayList<ContentValues> memberValues = new ArrayList<ContentValues>();
-        Contact self = mConnection.getLoginUser();
-        for (Contact member : group.getMembers()) {
-            if (!member.equals(self)) { // avoid to insert the user himself
-                ContentValues memberValue = new ContentValues(2);
-                memberValue.put(Im.GroupMembers.USERNAME,
-                        member.getAddress().getFullName());
-                memberValue.put(Im.GroupMembers.NICKNAME,
-                        member.getName());
-                memberValues.add(memberValue);
-            }
-        }
-        if (!memberValues.isEmpty()) {
-            ContentValues[] result = new ContentValues[memberValues.size()];
-            memberValues.toArray(result);
-            Uri memberUri = ContentUris.withAppendedId(Im.GroupMembers.CONTENT_URI, id);
-            mContentResolver.bulkInsert(memberUri, result);
-        }
-        return id;
-    }
-
-    void insertGroupMemberInDb(Contact member) {
-        ContentValues values1 = new ContentValues(2);
-        values1.put(Im.GroupMembers.USERNAME, member.getAddress().getFullName());
-        values1.put(Im.GroupMembers.NICKNAME, member.getName());
-        ContentValues values = values1;
-
-        long groupId = ContentUris.parseId(mChatURI);
-        Uri uri = ContentUris.withAppendedId(Im.GroupMembers.CONTENT_URI, groupId);
-        mContentResolver.insert(uri, values);
-
-        insertMessageInDb(member.getName(), null, System.currentTimeMillis(),
-                Im.MessageType.PRESENCE_AVAILABLE);
-    }
-
-    void deleteGroupMemberInDb(Contact member) {
-        String where = Im.GroupMembers.USERNAME + "=?";
-        String[] selectionArgs = { member.getAddress().getFullName() };
-        long groupId = ContentUris.parseId(mChatURI);
-        Uri uri = ContentUris.withAppendedId(Im.GroupMembers.CONTENT_URI, groupId);
-        mContentResolver.delete(uri, where, selectionArgs);
-
-        insertMessageInDb(member.getName(), null, System.currentTimeMillis(),
-                Im.MessageType.PRESENCE_UNAVAILABLE);
-    }
-
-    void insertPresenceUpdatesMsg(String contact, Presence presence) {
-        int status = presence.getStatus();
-
-        Integer previousStatus = mContactStatusMap.get(contact);
-        if (previousStatus != null && previousStatus == status) {
-            // don't insert the presence message if it's the same status
-            // with the previous presence update notification
-            return;
-        }
-
-        mContactStatusMap.put(contact, status);
-        int messageType;
-        switch (status) {
-            case Presence.AVAILABLE:
-                messageType = Im.MessageType.PRESENCE_AVAILABLE;
-                break;
-
-            case Presence.AWAY:
-            case Presence.IDLE:
-                messageType = Im.MessageType.PRESENCE_AWAY;
-                break;
-
-            case Presence.DO_NOT_DISTURB:
-                messageType = Im.MessageType.PRESENCE_DND;
-                break;
-
-            default:
-                messageType = Im.MessageType.PRESENCE_UNAVAILABLE;
-                break;
-        }
-
-        if(mIsGroupChat) {
-            insertMessageInDb(contact, null, System.currentTimeMillis(), messageType);
-        } else {
-            insertMessageInDb(null, null, System.currentTimeMillis(), messageType);
-        }
-    }
-
-    void removeMessageInDb(int type) {
-        mContentResolver.delete(mMessageURI, Im.BaseMessageColumns.TYPE + "=?",
-                new String[]{Integer.toString(type)});
-    }
-
-    Uri insertMessageInDb(String contact, String body, long time, int type) {
-        return insertMessageInDb(contact, body, time, type, 0/*No error*/);
-    }
-
-    Uri insertMessageInDb(String contact, String body, long time, int type, int errCode) {
-        ContentValues values = new ContentValues(mIsGroupChat ? 4 : 3);
-        values.put(Im.BaseMessageColumns.BODY, body);
-        values.put(Im.BaseMessageColumns.DATE, time);
-        values.put(Im.BaseMessageColumns.TYPE, type);
-        values.put(Im.BaseMessageColumns.ERROR_CODE, errCode);
-        if (mIsGroupChat) {
-            values.put(Im.BaseMessageColumns.CONTACT, contact);
-        }
-
-        return mContentResolver.insert(mMessageURI, values);
-    }
-
-    class ListenerAdapter implements MessageListener, GroupMemberListener {
-
-        public void onIncomingMessage(ChatSession ses, final Message msg) {
-            String body = msg.getBody();
-            String username = msg.getFrom().getFullName();
-            String nickname = getNickName(username);
-            long time = msg.getDateTime().getTime();
-            if(mIsGroupChat) {
-                insertOrUpdateChat(nickname + ": " + body);
-            } else {
-                insertOrUpdateChat(body);
-            }
-            insertMessageInDb(nickname, body, time, Im.MessageType.INCOMING);
-
-            int N = mRemoteListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IChatListener listener = mRemoteListeners.getBroadcastItem(i);
-                try {
-                    listener.onIncomingMessage(ChatSessionAdapter.this, msg);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteListeners.finishBroadcast();
-
-            mStatusBarNotifier.notifyChat(mConnection.getProviderId(),
-                    mConnection.getAccountId(), getId(), username, nickname, body, N > 0);
-
-            mHasUnreadMessages = true;
-        }
-
-        public void onSendMessageError(ChatSession ses, final Message msg,
-                final ImErrorInfo error) {
-            insertMessageInDb(null, null, System.currentTimeMillis(),
-                    Im.MessageType.OUTGOING, error.getCode());
-
-            final int N = mRemoteListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IChatListener listener = mRemoteListeners.getBroadcastItem(i);
-                try {
-                    listener.onSendMessageError(ChatSessionAdapter.this, msg, error);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteListeners.finishBroadcast();
-        }
-
-        public void onMemberJoined(ChatGroup group, final Contact contact) {
-            insertGroupMemberInDb(contact);
-
-            final int N = mRemoteListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IChatListener listener = mRemoteListeners.getBroadcastItem(i);
-                try {
-                    listener.onContactJoined(ChatSessionAdapter.this, contact);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteListeners.finishBroadcast();
-        }
-
-        public void onMemberLeft(ChatGroup group, final Contact contact) {
-            deleteGroupMemberInDb(contact);
-
-            final int N = mRemoteListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IChatListener listener = mRemoteListeners.getBroadcastItem(i);
-                try {
-                    listener.onContactLeft(ChatSessionAdapter.this, contact);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteListeners.finishBroadcast();
-        }
-
-        public void onError(ChatGroup group, final ImErrorInfo error) {
-            // TODO: insert an error message?
-            final int N = mRemoteListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IChatListener listener = mRemoteListeners.getBroadcastItem(i);
-                try {
-                    listener.onInviteError(ChatSessionAdapter.this, error);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteListeners.finishBroadcast();
-        }
-
-        public void notifyChatSessionConverted() {
-            final int N = mRemoteListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IChatListener listener = mRemoteListeners.getBroadcastItem(i);
-                try {
-                    listener.onConvertedToGroupChat(ChatSessionAdapter.this);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteListeners.finishBroadcast();
-        }
-    }
-
-    class ChatConvertor implements GroupListener, GroupMemberListener {
-        private ChatGroupManager mGroupMgr;
-        private String mGroupName;
-
-        public ChatConvertor() {
-            mGroupMgr = mConnection.mGroupManager;
-        }
-
-        public void convertToGroupChat() {
-            mGroupMgr.addGroupListener(this);
-            mGroupName = "G" + System.currentTimeMillis();
-            mGroupMgr.createChatGroupAsync(mGroupName);
-        }
-
-        public void onGroupCreated(ChatGroup group) {
-            if (mGroupName.equalsIgnoreCase(group.getName())) {
-                mGroupMgr.removeGroupListener(this);
-                group.addMemberListener(this);
-                mGroupMgr.inviteUserAsync(group, (Contact)mAdaptee.getParticipant());
-            }
-        }
-
-        public void onMemberJoined(ChatGroup group, Contact contact) {
-            if (mAdaptee.getParticipant().equals(contact)) {
-                onConvertToGroupChatSuccess(group);
-            }
-
-            mContactStatusMap.put(contact.getName(), contact.getPresence().getStatus());
-        }
-
-        public void onGroupDeleted(ChatGroup group) {
-        }
-
-        public void onGroupError(int errorType, String groupName, ImErrorInfo error) {
-        }
-
-        public void onJoinedGroup(ChatGroup group) {
-        }
-
-        public void onLeftGroup(ChatGroup group) {
-        }
-
-        public void onError(ChatGroup group, ImErrorInfo error) {
-        }
-
-        public void onMemberLeft(ChatGroup group, Contact contact) {
-            mContactStatusMap.remove(contact.getName());
-        }
-    }
-}
diff --git a/src/com/android/im/service/ChatSessionManagerAdapter.java b/src/com/android/im/service/ChatSessionManagerAdapter.java
deleted file mode 100644 (file)
index eb7ae83..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import android.os.RemoteCallbackList;
-import android.os.RemoteException;
-
-import com.android.im.IChatSession;
-import com.android.im.IChatSessionListener;
-import com.android.im.IChatSessionManager;
-import com.android.im.engine.Address;
-import com.android.im.engine.ChatGroup;
-import com.android.im.engine.ChatGroupManager;
-import com.android.im.engine.ChatSession;
-import com.android.im.engine.ChatSessionListener;
-import com.android.im.engine.ChatSessionManager;
-import com.android.im.engine.Contact;
-import com.android.im.engine.GroupListener;
-import com.android.im.engine.ImConnection;
-import com.android.im.engine.ImErrorInfo;
-
-public class ChatSessionManagerAdapter extends IChatSessionManager.Stub {
-    static final String TAG = RemoteImService.TAG;
-
-    ImConnectionAdapter mConnection;
-    ChatSessionManager mSessionManager;
-    ChatGroupManager mGroupManager;
-    HashMap<String, ChatSessionAdapter> mActiveSessions;
-    ChatSessionListenerAdapter mSessionListenerAdapter;
-    final RemoteCallbackList<IChatSessionListener> mRemoteListeners
-            = new RemoteCallbackList<IChatSessionListener>();
-
-    public ChatSessionManagerAdapter(ImConnectionAdapter connection) {
-        mConnection = connection;
-        ImConnection connAdaptee = connection.getAdaptee();
-        mSessionManager = connAdaptee.getChatSessionManager();
-        mActiveSessions = new HashMap<String, ChatSessionAdapter>();
-        mSessionListenerAdapter = new ChatSessionListenerAdapter();
-        mSessionManager.addChatSessionListener(mSessionListenerAdapter);
-
-        if((connAdaptee.getCapability() & ImConnection.CAPABILITY_GROUP_CHAT) != 0) {
-            mGroupManager = connAdaptee.getChatGroupManager();
-            mGroupManager.addGroupListener(new ChatGroupListenerAdpater());
-        }
-    }
-
-    public IChatSession createChatSession(String contactAddress) {
-        ContactListManagerAdapter listManager =
-            (ContactListManagerAdapter) mConnection.getContactListManager();
-        Contact contact = listManager.getContactByAddress(contactAddress);
-        if(contact == null) {
-            try {
-                contact = listManager.createTemporaryContact(contactAddress);
-            } catch (IllegalArgumentException e) {
-                mSessionListenerAdapter.notifyChatSessionCreateFailed(contactAddress,
-                        new ImErrorInfo(ImErrorInfo.ILLEGAL_CONTACT_ADDRESS,
-                                "Invalid contact address:" + contactAddress));
-                return null;
-            }
-        }
-        ChatSession session = mSessionManager.createChatSession(contact);
-        return getChatSessionAdapter(session);
-    }
-
-    public void closeChatSession(ChatSessionAdapter adapter) {
-        synchronized (mActiveSessions) {
-            ChatSession session = adapter.getAdaptee();
-            mSessionManager.closeChatSession(session);
-            mActiveSessions.remove(adapter.getAddress());
-        }
-    }
-
-    public void closeAllChatSessions() {
-        synchronized (mActiveSessions) {
-            ArrayList<ChatSessionAdapter> sessions =
-                new ArrayList<ChatSessionAdapter>(mActiveSessions.values());
-            for (ChatSessionAdapter ses : sessions) {
-                ses.leave();
-            }
-        }
-    }
-
-    public void updateChatSession(String oldAddress, ChatSessionAdapter adapter) {
-        synchronized (mActiveSessions) {
-            mActiveSessions.remove(oldAddress);
-            mActiveSessions.put(adapter.getAddress(), adapter);
-        }
-    }
-
-    public IChatSession getChatSession(String address) {
-        synchronized (mActiveSessions) {
-            return mActiveSessions.get(address);
-        }
-    }
-
-    public List getActiveChatSessions() {
-        synchronized (mActiveSessions) {
-            return new ArrayList<ChatSessionAdapter>(mActiveSessions.values());
-        }
-    }
-
-    public int getChatSessionCount() {
-        synchronized (mActiveSessions) {
-            return mActiveSessions.size();
-        }
-    }
-
-    public void registerChatSessionListener(IChatSessionListener listener) {
-        if (listener != null) {
-            mRemoteListeners.register(listener);
-        }
-    }
-
-    public void unregisterChatSessionListener(IChatSessionListener listener) {
-        if (listener != null) {
-            mRemoteListeners.unregister(listener);
-        }
-    }
-
-    ChatSessionAdapter getChatSessionAdapter(ChatSession session) {
-        synchronized (mActiveSessions) {
-            Address participantAddress = session.getParticipant().getAddress();
-            String key = participantAddress.getFullName();
-            ChatSessionAdapter adapter = mActiveSessions.get(key);
-            if (adapter == null) {
-                adapter = new ChatSessionAdapter(session, mConnection);
-                mActiveSessions.put(key, adapter);
-            }
-            return adapter;
-        }
-    }
-
-    class ChatSessionListenerAdapter implements ChatSessionListener {
-
-        public void onChatSessionCreated(ChatSession session) {
-            final IChatSession sessionAdapter = getChatSessionAdapter(session);
-            final int N = mRemoteListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IChatSessionListener listener = mRemoteListeners.getBroadcastItem(i);
-                try {
-                    listener.onChatSessionCreated(sessionAdapter);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteListeners.finishBroadcast();
-        }
-
-        public void notifyChatSessionCreateFailed(final String name, final ImErrorInfo error) {
-            final int N = mRemoteListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IChatSessionListener listener = mRemoteListeners.getBroadcastItem(i);
-                try {
-                    listener.onChatSessionCreateError(name, error);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteListeners.finishBroadcast();
-        }
-    }
-
-    class ChatGroupListenerAdpater implements GroupListener {
-        public void onGroupCreated(ChatGroup group) {
-        }
-
-        public void onGroupDeleted(ChatGroup group) {
-            closeSession(group);
-        }
-
-        public void onGroupError(int errorType, String name, ImErrorInfo error) {
-            if(errorType == ERROR_CREATING_GROUP) {
-                mSessionListenerAdapter.notifyChatSessionCreateFailed(name, error);
-            }
-        }
-
-        public void onJoinedGroup(ChatGroup group) {
-            mSessionManager.createChatSession(group);
-        }
-
-        public void onLeftGroup(ChatGroup group) {
-            closeSession(group);
-        }
-
-        private void closeSession(ChatGroup group) {
-            String address = group.getAddress().getFullName();
-            IChatSession session = getChatSession(address);
-            if(session != null) {
-                closeChatSession((ChatSessionAdapter) session);
-            }
-        }
-    }
-}
diff --git a/src/com/android/im/service/ContactListAdapter.java b/src/com/android/im/service/ContactListAdapter.java
deleted file mode 100644 (file)
index d899f48..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.service;
-
-
-import android.util.Log;
-
-import com.android.im.IContactList;
-import com.android.im.engine.Address;
-import com.android.im.engine.Contact;
-import com.android.im.engine.ContactList;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.ImException;
-
-public class ContactListAdapter extends IContactList.Stub {
-    private ContactList mAdaptee;
-    private long mDataBaseId;
-
-    public ContactListAdapter(ContactList adaptee, long dataBaseId) {
-        mAdaptee = adaptee;
-        mDataBaseId = dataBaseId;
-    }
-
-    public long getDataBaseId() {
-        return mDataBaseId;
-    }
-
-    public Address getAddress() {
-        return mAdaptee.getAddress();
-    }
-
-    public int addContact(String address) {
-        if (address == null) {
-            Log.e(RemoteImService.TAG, "Address can't be null!");
-            return ImErrorInfo.ILLEGAL_CONTACT_ADDRESS;
-        }
-
-        try {
-            mAdaptee.addContact(address);
-        } catch (IllegalArgumentException e) {
-            return ImErrorInfo.ILLEGAL_CONTACT_ADDRESS;
-        } catch (ImException e) {
-            return e.getImError().getCode();
-        }
-
-        return ImErrorInfo.NO_ERROR;
-    }
-
-    public String getName() {
-        return mAdaptee.getName();
-    }
-
-    public int removeContact(String address) {
-        Contact contact = mAdaptee.getContact(address);
-        if (contact == null) {
-            return ImErrorInfo.ILLEGAL_CONTACT_ADDRESS;
-        }
-
-        try {
-            mAdaptee.removeContact(contact);
-        } catch (ImException e) {
-            return e.getImError().getCode();
-        }
-
-        return ImErrorInfo.NO_ERROR;
-    }
-
-    public void setDefault(boolean isDefault) {
-        mAdaptee.setDefault(isDefault);
-    }
-
-    public boolean isDefault() {
-        return mAdaptee.isDefault();
-    }
-
-    public void setName(String name) {
-        if (name == null) {
-            Log.e(RemoteImService.TAG, "Name can't be null!");
-            return;
-        }
-
-        mAdaptee.setName(name);
-    }
-}
diff --git a/src/com/android/im/service/ContactListManagerAdapter.java b/src/com/android/im/service/ContactListManagerAdapter.java
deleted file mode 100644 (file)
index eaa0a48..0000000
+++ /dev/null
@@ -1,1145 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.service;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.Intent;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.RemoteCallbackList;
-import android.os.RemoteException;
-import android.provider.Im;
-import android.util.Log;
-import android.widget.Toast;
-
-import com.android.im.IChatListener;
-import com.android.im.IContactList;
-import com.android.im.IContactListListener;
-import com.android.im.IContactListManager;
-import com.android.im.ISubscriptionListener;
-import com.android.im.R;
-import com.android.im.engine.Address;
-import com.android.im.engine.Contact;
-import com.android.im.engine.ContactList;
-import com.android.im.engine.ContactListListener;
-import com.android.im.engine.ContactListManager;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.ImException;
-import com.android.im.engine.Presence;
-import com.android.im.engine.SubscriptionRequestListener;
-
-public class ContactListManagerAdapter extends IContactListManager.Stub {
-    static final String TAG = RemoteImService.TAG;
-
-    ImConnectionAdapter mConn;
-    ContentResolver     mResolver;
-
-    private ContactListManager          mAdaptee;
-    private ContactListListenerAdapter  mContactListListenerAdapter;
-    private SubscriptionRequestListenerAdapter mSubscriptionListenerAdapter;
-
-    final RemoteCallbackList<IContactListListener> mRemoteContactListeners
-            = new RemoteCallbackList<IContactListListener>();
-    final RemoteCallbackList<ISubscriptionListener> mRemoteSubscriptionListeners
-            = new RemoteCallbackList<ISubscriptionListener>();
-
-    HashMap<Address, ContactListAdapter> mContactLists;
-    HashMap<String, Contact> mTemporaryContacts;
-
-    HashSet<String> mValidatedContactLists;
-    HashSet<String> mValidatedContacts;
-    HashSet<String> mValidatedBlockedContacts;
-
-    private long mAccountId;
-    private long mProviderId;
-
-    private Uri mAvatarUrl;
-    private Uri mContactUrl;
-
-    static final long FAKE_TEMPORARY_LIST_ID = -1;
-    static final String[] CONTACT_LIST_ID_PROJECTION  = { Im.ContactList._ID };
-
-    RemoteImService mContext;
-
-    public ContactListManagerAdapter(ImConnectionAdapter conn) {
-        mAdaptee  = conn.getAdaptee().getContactListManager();
-        mConn     = conn;
-        mContext  = conn.getContext();
-        mResolver = mContext.getContentResolver();
-
-        mContactListListenerAdapter = new ContactListListenerAdapter();
-        mSubscriptionListenerAdapter = new SubscriptionRequestListenerAdapter();
-        mContactLists = new HashMap<Address, ContactListAdapter>();
-        mTemporaryContacts = new HashMap<String, Contact>();
-        mValidatedContacts = new HashSet<String>();
-        mValidatedContactLists = new HashSet<String>();
-        mValidatedBlockedContacts = new HashSet<String>();
-
-        mAdaptee.addContactListListener(mContactListListenerAdapter);
-        mAdaptee.setSubscriptionRequestListener(mSubscriptionListenerAdapter);
-
-        mAccountId  = mConn.getAccountId();
-        mProviderId = mConn.getProviderId();
-
-        Uri.Builder builder = Im.Avatars.CONTENT_URI_AVATARS_BY.buildUpon();
-        ContentUris.appendId(builder, mProviderId);
-        ContentUris.appendId(builder, mAccountId);
-
-        mAvatarUrl = builder.build();
-
-        builder = Im.Contacts.CONTENT_URI_CONTACTS_BY.buildUpon();
-        ContentUris.appendId(builder, mProviderId);
-        ContentUris.appendId(builder, mAccountId);
-
-        mContactUrl = builder.build();
-    }
-
-    public int createContactList(String name, List<Contact> contacts) {
-        try {
-            mAdaptee.createContactListAsync(name, contacts);
-        } catch (ImException e) {
-            return e.getImError().getCode();
-        }
-
-        return ImErrorInfo.NO_ERROR;
-    }
-
-    public int deleteContactList(String name) {
-        try {
-            mAdaptee.deleteContactListAsync(name);
-        } catch (ImException e) {
-            return e.getImError().getCode();
-        }
-
-        return ImErrorInfo.NO_ERROR;
-    }
-
-    public List getContactLists() {
-        synchronized (mContactLists) {
-            return new ArrayList<ContactListAdapter>(mContactLists.values());
-        }
-    }
-
-    public int removeContact(String address) {
-        if(isTemporary(address)) {
-            // For temporary contact, just close the session and delete him in
-            // database.
-            closeChatSession(address);
-
-            String selection = Im.Contacts.USERNAME + "=?";
-            String[] selectionArgs = { address };
-            mResolver.delete(mContactUrl, selection, selectionArgs);
-            synchronized (mTemporaryContacts) {
-                mTemporaryContacts.remove(address);
-            }
-        } else {
-            synchronized (mContactLists) {
-                for(ContactListAdapter list : mContactLists.values()) {
-                    int resCode = list.removeContact(address);
-                    if (ImErrorInfo.ILLEGAL_CONTACT_ADDRESS == resCode) {
-                        // Did not find in this list, continue to remove from
-                        // other list.
-                        continue;
-                    }
-                    if (ImErrorInfo.NO_ERROR != resCode) {
-                        return resCode;
-                    }
-                }
-            }
-        }
-
-        return ImErrorInfo.NO_ERROR;
-    }
-
-    public void approveSubscription(String address) {
-        mAdaptee.approveSubscriptionRequest(address);
-    }
-
-    public void declineSubscription(String address) {
-        mAdaptee.declineSubscriptionRequest(address);
-    }
-
-    public int blockContact(String address) {
-        try {
-            mAdaptee.blockContactAsync(address);
-        } catch (ImException e) {
-            return e.getImError().getCode();
-        }
-
-        return ImErrorInfo.NO_ERROR;
-    }
-
-    public int unBlockContact(String address) {
-        try {
-            mAdaptee.unblockContactAsync(address);
-        } catch (ImException e) {
-            Log.e(TAG, e.getMessage());
-            return e.getImError().getCode();
-        }
-
-        return ImErrorInfo.NO_ERROR;
-    }
-
-    public boolean isBlocked(String address) {
-        try {
-            return mAdaptee.isBlocked(address);
-        } catch (ImException e) {
-            Log.e(TAG, e.getMessage());
-            return false;
-        }
-    }
-
-    public void registerContactListListener(IContactListListener listener) {
-        if (listener != null) {
-            mRemoteContactListeners.register(listener);
-        }
-    }
-
-    public void unregisterContactListListener(IContactListListener listener) {
-        if (listener != null) {
-            mRemoteContactListeners.unregister(listener);
-        }
-    }
-
-    public void registerSubscriptionListener(ISubscriptionListener listener) {
-        if (listener != null) {
-            mRemoteSubscriptionListeners.register(listener);
-        }
-    }
-
-    public void unregisterSubscriptionListener(ISubscriptionListener listener) {
-        if (listener != null) {
-            mRemoteSubscriptionListeners.unregister(listener);
-        }
-    }
-
-    public IContactList getContactList(String name) {
-        return getContactListAdapter(name);
-    }
-
-    public void loadContactLists() {
-        if(mAdaptee.getState() == ContactListManager.LISTS_NOT_LOADED){
-            clearValidatedContactsAndLists();
-            mAdaptee.loadContactListsAsync();
-        }
-    }
-
-    public int getState() {
-        return mAdaptee.getState();
-    }
-
-    public Contact getContactByAddress(String address) {
-        Contact c = mAdaptee.getContact(address);
-        if(c == null) {
-            synchronized (mTemporaryContacts) {
-                return mTemporaryContacts.get(address);
-            }
-        } else {
-            return c;
-        }
-    }
-
-    public Contact createTemporaryContact(String address) {
-        Contact c = mAdaptee.createTemporaryContact(address);
-        insertTemporary(c);
-        return c;
-    }
-
-    public long queryOrInsertContact(Contact c) {
-        long result;
-
-        String username = c.getAddress().getFullName();
-        String selection = Im.Contacts.USERNAME + "=?";
-        String[] selectionArgs = { username };
-        String[] projection = {Im.Contacts._ID};
-
-        Cursor cursor = mResolver.query(mContactUrl, projection, selection,
-                selectionArgs, null);
-
-        if(cursor != null && cursor.moveToFirst()) {
-            result = cursor.getLong(0);
-        } else {
-            result = insertTemporary(c);
-        }
-
-        if(cursor != null) {
-            cursor.close();
-        }
-        return result;
-    }
-
-    private long insertTemporary(Contact c) {
-        synchronized (mTemporaryContacts) {
-            mTemporaryContacts.put(c.getAddress().getFullName(), c);
-        }
-        Uri uri = insertContactContent(c, FAKE_TEMPORARY_LIST_ID);
-        return ContentUris.parseId(uri);
-    }
-
-    /**
-     * Tells if a contact is a temporary one which is not in the list of
-     * contacts that we subscribe presence for. Usually created because of the
-     * user is having a chat session with this contact.
-     *
-     * @param address
-     *            the address of the contact.
-     * @return <code>true</code> if it's a temporary contact;
-     *         <code>false</code> otherwise.
-     */
-    public boolean isTemporary(String address) {
-        synchronized (mTemporaryContacts) {
-            return mTemporaryContacts.containsKey(address);
-        }
-    }
-
-    ContactListAdapter getContactListAdapter(String name) {
-        synchronized (mContactLists) {
-            for (ContactListAdapter list : mContactLists.values()) {
-                if (name.equals(list.getName())) {
-                    return list;
-                }
-            }
-
-            return null;
-        }
-    }
-
-    ContactListAdapter getContactListAdapter(Address address) {
-        synchronized (mContactLists) {
-            return mContactLists.get(address);
-        }
-    }
-
-    private class Exclusion {
-        private StringBuilder mSelection;
-        private List mSelectionArgs;
-        private String mExclusionColumn;
-
-        Exclusion(String exclusionColumn, Collection<String> items) {
-            mSelection = new StringBuilder();
-            mSelectionArgs = new ArrayList();
-            mExclusionColumn = exclusionColumn;
-            for (String s : items) {
-                add(s);
-            }
-        }
-
-        public void add(String exclusionItem) {
-            if (mSelection.length()==0) {
-                mSelection.append(mExclusionColumn + "!=?");
-            } else {
-                mSelection.append(" AND " + mExclusionColumn + "!=?");
-            }
-            mSelectionArgs.add(exclusionItem);
-        }
-
-        public String getSelection() {
-            return mSelection.toString();
-        }
-
-        public String[] getSelectionArgs() {
-            return (String []) mSelectionArgs.toArray(new String[0]);
-        }
-    }
-
-    private void removeObsoleteContactsAndLists() {
-        // remove all contacts for this provider & account which have not been
-        // added since login, yet still exist in db from a prior login
-        Exclusion exclusion = new Exclusion(Im.Contacts.USERNAME, mValidatedContacts);
-        mResolver.delete(mContactUrl, exclusion.getSelection(), exclusion.getSelectionArgs());
-
-        // remove all blocked contacts for this provider & account which have not been
-        // added since login, yet still exist in db from a prior login
-        exclusion = new Exclusion(Im.BlockedList.USERNAME, mValidatedBlockedContacts);
-        Uri.Builder builder = Im.BlockedList.CONTENT_URI.buildUpon();
-        ContentUris.appendId(builder, mProviderId);
-        ContentUris.appendId(builder, mAccountId);
-        Uri uri = builder.build();
-        mResolver.delete(uri, exclusion.getSelection(), exclusion.getSelectionArgs());
-
-        // remove all contact lists for this provider & account which have not been
-        // added since login, yet still exist in db from a prior login
-        exclusion = new Exclusion(Im.ContactList.NAME, mValidatedContactLists);
-        builder = Im.ContactList.CONTENT_URI.buildUpon();
-        ContentUris.appendId(builder, mProviderId);
-        ContentUris.appendId(builder, mAccountId);
-        uri = builder.build();
-        mResolver.delete(uri, exclusion.getSelection(), exclusion.getSelectionArgs());
-
-    }
-
-    final class ContactListListenerAdapter implements ContactListListener {
-        private boolean mAllContactsLoaded;
-
-        // class to hold contact changes made before mAllContactsLoaded
-        private class StoredContactChange {
-            int mType;
-            ContactList mList;
-            Contact mContact;
-
-            StoredContactChange(int type, ContactList list, Contact contact) {
-                mType = type;
-                mList = list;
-                mContact = contact;
-            }
-        }
-        private Vector<StoredContactChange> mDelayedContactChanges =
-                new Vector<StoredContactChange>();
-
-        public void onContactsPresenceUpdate(final Contact[] contacts) {
-            // The client listens only to presence updates for now. Update
-            // the avatars first to ensure it can get the new avatar when
-            // presence updated.
-            // TODO: Don't update avatar now since none of the server supports it
-            // updateAvatarsContent(contacts);
-            updatePresenceContent(contacts);
-
-            final int N = mRemoteContactListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IContactListListener listener =
-                        mRemoteContactListeners.getBroadcastItem(i);
-                try {
-                    listener.onContactsPresenceUpdate(contacts);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteContactListeners.finishBroadcast();
-        }
-
-        public void onContactChange(final int type, final ContactList list,
-                final Contact contact) {
-            ContactListAdapter removed = null;
-            String notificationText = null;
-
-            switch (type) {
-            case LIST_LOADED:
-            case LIST_CREATED:
-                addContactListContent(list);
-                break;
-
-            case LIST_DELETED:
-                removed = removeContactListFromDataBase(list.getName());
-                // handle case where a list is deleted before mAllContactsLoaded
-                if (!mAllContactsLoaded) {
-                    // if a cached contact list is deleted before the actual contact list is
-                    // downloaded from the server, we will have to remove the list again once
-                    // once mAllContactsLoaded is true
-                    if (!mValidatedContactLists.contains(list.getName())) {
-                        mDelayedContactChanges.add(new StoredContactChange(type, list, contact));
-                    }
-                }
-                break;
-
-            case LIST_CONTACT_ADDED:
-                long listId = getContactListAdapter(list.getAddress()).getDataBaseId();
-                String contactAddress = contact.getAddress().getFullName();
-                if(isTemporary(contactAddress)){
-                    moveTemporaryContactToList(contactAddress, listId);
-                } else {
-                    insertContactContent(contact, listId);
-                }
-                notificationText = mContext.getResources().getString(
-                        R.string.add_contact_success, contact.getName());
-                // handle case where a contact is added before mAllContactsLoaded
-                if (!mAllContactsLoaded) {
-                    // if a contact is added to a cached contact list before the actual contact
-                    // list is downloaded from the server, we will have to add the contact to
-                    // the contact list once mAllContactsLoaded is true
-                    if (!mValidatedContactLists.contains(list.getName())) {
-                        mDelayedContactChanges.add(new StoredContactChange(type, list, contact));
-                    }
-                }
-                break;
-
-            case LIST_CONTACT_REMOVED:
-                deleteContactFromDataBase(contact, list);
-                // handle case where a contact is removed before mAllContactsLoaded
-                if (!mAllContactsLoaded) {
-                    // if a contact is added to a cached contact list before the actual contact
-                    // list is downloaded from the server, we will have to add the contact to
-                    // the contact list once mAllContactsLoaded is true
-                    if (!mValidatedContactLists.contains(list.getName())) {
-                        mDelayedContactChanges.add(new StoredContactChange(type, list, contact));
-                    }
-                }
-
-                // Clear ChatSession if any.
-                String address = contact.getAddress().getFullName();
-                closeChatSession(address);
-
-                notificationText = mContext.getResources().getString(
-                        R.string.delete_contact_success, contact.getName());
-                break;
-
-            case LIST_RENAMED:
-                updateListNameInDataBase(list);
-                // handle case where a list is renamed before mAllContactsLoaded
-                if (!mAllContactsLoaded) {
-                    // if a contact list name is updated before the actual contact list is
-                    // downloaded from the server, we will have to update the list name again
-                    // once mAllContactsLoaded is true
-                    if (!mValidatedContactLists.contains(list.getName())) {
-                        mDelayedContactChanges.add(new StoredContactChange(type, list, contact));
-                    }
-                }
-                break;
-
-            case CONTACT_BLOCKED:
-                insertBlockedContactToDataBase(contact);
-                address = contact.getAddress().getFullName();
-                updateContactType(address, Im.Contacts.TYPE_BLOCKED);
-                closeChatSession(address);
-                notificationText = mContext.getResources().getString(
-                        R.string.block_contact_success, contact.getName());
-                break;
-
-            case CONTACT_UNBLOCKED:
-                removeBlockedContactFromDataBase(contact);
-                notificationText = mContext.getResources().getString(
-                        R.string.unblock_contact_success, contact.getName());
-                // handle case where a contact is unblocked before mAllContactsLoaded
-                if (!mAllContactsLoaded) {
-                    // if a contact list name is updated before the actual contact list is
-                    // downloaded from the server, we will have to update the list name again
-                    // once mAllContactsLoaded is true
-                    if (!mValidatedBlockedContacts.contains(contact.getName())) {
-                        mDelayedContactChanges.add(new StoredContactChange(type, list, contact));
-                    }
-                }
-                break;
-
-            default:
-                Log.e(TAG, "Unknown list update event!");
-                break;
-            }
-
-            final ContactListAdapter listAdapter;
-            if (type == LIST_DELETED) {
-                listAdapter = removed;
-            } else {
-                listAdapter = (list == null) ? null
-                        : getContactListAdapter(list.getAddress());
-            }
-            final int N = mRemoteContactListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IContactListListener listener =
-                        mRemoteContactListeners.getBroadcastItem(i);
-                try {
-                    listener.onContactChange(type, listAdapter, contact);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteContactListeners.finishBroadcast();
-
-            if (mAllContactsLoaded && notificationText != null) {
-                mContext.showToast(notificationText, Toast.LENGTH_SHORT);
-            }
-        }
-
-        public void onContactError(final int errorType, final ImErrorInfo error,
-                final String listName, final Contact contact) {
-            final int N = mRemoteContactListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IContactListListener listener =
-                        mRemoteContactListeners.getBroadcastItem(i);
-                try {
-                    listener.onContactError(errorType, error, listName, contact);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteContactListeners.finishBroadcast();
-        }
-
-        public void handleDelayedContactChanges() {
-            for (StoredContactChange change : mDelayedContactChanges) {
-                onContactChange(change.mType, change.mList, change.mContact);
-            }
-        }
-
-        public void onAllContactListsLoaded() {
-            mAllContactsLoaded = true;
-            handleDelayedContactChanges();
-            removeObsoleteContactsAndLists();
-            final int N = mRemoteContactListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IContactListListener listener =
-                        mRemoteContactListeners.getBroadcastItem(i);
-                try {
-                    listener.onAllContactListsLoaded();
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteContactListeners.finishBroadcast();
-        }
-    }
-
-    final class SubscriptionRequestListenerAdapter
-            implements SubscriptionRequestListener {
-
-        public void onSubScriptionRequest(final Contact from) {
-            String username = from.getAddress().getFullName();
-            String nickname = from.getName();
-            Uri uri = insertOrUpdateSubscription(username, nickname,
-                    Im.Contacts.SUBSCRIPTION_TYPE_FROM,
-                    Im.Contacts.SUBSCRIPTION_STATUS_SUBSCRIBE_PENDING);
-            mContext.getStatusBarNotifier().notifySubscriptionRequest(mProviderId, mAccountId,
-                    ContentUris.parseId(uri), username, nickname);
-            final int N = mRemoteSubscriptionListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                ISubscriptionListener listener =
-                    mRemoteSubscriptionListeners.getBroadcastItem(i);
-                try {
-                    listener.onSubScriptionRequest(from);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteSubscriptionListeners.finishBroadcast();
-        }
-
-        public void onSubscriptionApproved(final String contact) {
-            insertOrUpdateSubscription(contact, null,
-                    Im.Contacts.SUBSCRIPTION_TYPE_NONE,
-                    Im.Contacts.SUBSCRIPTION_STATUS_NONE);
-
-            final int N = mRemoteSubscriptionListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                ISubscriptionListener listener =
-                    mRemoteSubscriptionListeners.getBroadcastItem(i);
-                try {
-                    listener.onSubscriptionApproved(contact);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteSubscriptionListeners.finishBroadcast();
-        }
-
-        public void onSubscriptionDeclined(final String contact) {
-            insertOrUpdateSubscription(contact, null,
-                    Im.Contacts.SUBSCRIPTION_TYPE_NONE,
-                    Im.Contacts.SUBSCRIPTION_STATUS_NONE);
-
-            final int N = mRemoteSubscriptionListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                ISubscriptionListener listener =
-                    mRemoteSubscriptionListeners.getBroadcastItem(i);
-                try {
-                    listener.onSubscriptionDeclined(contact);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteSubscriptionListeners.finishBroadcast();
-        }
-
-        public void onApproveSubScriptionError(final String contact, final ImErrorInfo error) {
-            String displayableAddress = getDisplayableAddress(contact);
-            String msg = mContext.getString(R.string.approve_subscription_error, displayableAddress);
-            mContext.showToast(msg, Toast.LENGTH_SHORT);
-        }
-
-        public void onDeclineSubScriptionError(final String contact, final ImErrorInfo error) {
-            String displayableAddress = getDisplayableAddress(contact);
-            String msg = mContext.getString(R.string.decline_subscription_error, displayableAddress);
-            mContext.showToast(msg, Toast.LENGTH_SHORT);
-        }
-    }
-
-    String getDisplayableAddress(String impsAddress) {
-        if (impsAddress.startsWith("wv:")) {
-            return impsAddress.substring(3);
-        }
-        return impsAddress;
-    }
-
-    void insertBlockedContactToDataBase(Contact contact) {
-        // Remove the blocked contact if it already exists, to avoid duplicates and
-        // handle the odd case where a blocked contact's nickname has changed
-        removeBlockedContactFromDataBase(contact);
-
-        Uri.Builder builder = Im.BlockedList.CONTENT_URI.buildUpon();
-        ContentUris.appendId(builder, mProviderId);
-        ContentUris.appendId(builder, mAccountId);
-        Uri uri = builder.build();
-
-        String username = contact.getAddress().getFullName();
-        ContentValues values = new ContentValues(2);
-        values.put(Im.BlockedList.USERNAME, username);
-        values.put(Im.BlockedList.NICKNAME, contact.getName());
-
-        mResolver.insert(uri, values);
-
-        mValidatedBlockedContacts.add(username);
-    }
-
-    void removeBlockedContactFromDataBase(Contact contact) {
-        String address = contact.getAddress().getFullName();
-
-        Uri.Builder builder = Im.BlockedList.CONTENT_URI.buildUpon();
-        ContentUris.appendId(builder, mProviderId);
-        ContentUris.appendId(builder, mAccountId);
-
-        Uri uri = builder.build();
-        mResolver.delete(uri, Im.BlockedList.USERNAME + "=?", new String[]{ address });
-
-        int type = isTemporary(address) ? Im.Contacts.TYPE_TEMPORARY
-                : Im.Contacts.TYPE_NORMAL;
-        updateContactType(address, type);
-    }
-
-    void moveTemporaryContactToList(String address, long listId) {
-        synchronized (mTemporaryContacts) {
-            mTemporaryContacts.remove(address);
-        }
-        ContentValues values = new ContentValues(2);
-        values.put(Im.Contacts.TYPE, Im.Contacts.TYPE_NORMAL);
-        values.put(Im.Contacts.CONTACTLIST, listId);
-
-        String selection = Im.Contacts.USERNAME + "=? AND " + Im.Contacts.TYPE + "="
-                + Im.Contacts.TYPE_TEMPORARY;
-        String[] selectionArgs = { address };
-
-        mResolver.update(mContactUrl, values, selection, selectionArgs);
-    }
-
-    void updateContactType(String address, int type) {
-        ContentValues values = new ContentValues(1);
-        values.put(Im.Contacts.TYPE, type);
-        updateContact(address, values);
-    }
-
-    /**
-     * Insert or update subscription request from user into the database.
-     *
-     * @param username
-     * @param nickname
-     * @param subscriptionType
-     * @param subscriptionStatus
-     */
-    Uri insertOrUpdateSubscription(String username, String nickname, int subscriptionType,
-            int subscriptionStatus) {
-        Cursor cursor = mResolver.query(mContactUrl, new String[]{ Im.Contacts._ID },
-                Im.Contacts.USERNAME + "=?", new String[]{username}, null);
-        if (cursor == null) {
-            Log.w(TAG, "query contact " + username + " failed");
-            return null;
-        }
-
-        Uri uri;
-        if (cursor.moveToFirst()) {
-            ContentValues values = new ContentValues(2);
-            values.put(Im.Contacts.SUBSCRIPTION_TYPE, subscriptionType);
-            values.put(Im.Contacts.SUBSCRIPTION_STATUS, subscriptionStatus);
-
-            long contactId = cursor.getLong(0);
-            uri = ContentUris.withAppendedId(Im.Contacts.CONTENT_URI, contactId);
-            mResolver.update(uri, values, null, null);
-        } else {
-            ContentValues values = new ContentValues(6);
-            values.put(Im.Contacts.USERNAME, username);
-            values.put(Im.Contacts.NICKNAME, nickname);
-            values.put(Im.Contacts.TYPE, Im.Contacts.TYPE_NORMAL);
-            values.put(Im.Contacts.CONTACTLIST, FAKE_TEMPORARY_LIST_ID);
-            values.put(Im.Contacts.SUBSCRIPTION_TYPE, subscriptionType);
-            values.put(Im.Contacts.SUBSCRIPTION_STATUS, subscriptionStatus);
-
-            uri = mResolver.insert(mContactUrl, values);
-        }
-        cursor.close();
-        return uri;
-    }
-
-    void updateContact(String username, ContentValues values) {
-        String selection = Im.Contacts.USERNAME + "=?";
-        String[] selectionArgs = { username };
-        mResolver.update(mContactUrl, values, selection, selectionArgs);
-    }
-
-    void updatePresenceContent(Contact[] contacts) {
-        ArrayList<String> usernames = new ArrayList<String>();
-        ArrayList<String> statusArray = new ArrayList<String>();
-        ArrayList<String> customStatusArray = new ArrayList<String>();
-        ArrayList<String> clientTypeArray = new ArrayList<String>();
-
-        for(Contact c : contacts) {
-            String username = c.getAddress().getFullName();
-            Presence p = c.getPresence();
-            int status = convertPresenceStatus(p);
-            String customStatus = p.getStatusText();
-            int clientType = translateClientType(p);
-
-            usernames.add(username);
-            statusArray.add(String.valueOf(status));
-            customStatusArray.add(customStatus);
-            clientTypeArray.add(String.valueOf(clientType));
-        }
-
-        ContentValues values = new ContentValues();
-        values.put(Im.Contacts.ACCOUNT, mAccountId);
-        values.putStringArrayList(Im.Contacts.USERNAME, usernames);
-        values.putStringArrayList(Im.Presence.PRESENCE_STATUS, statusArray);
-        values.putStringArrayList(Im.Presence.PRESENCE_CUSTOM_STATUS, customStatusArray);
-        values.putStringArrayList(Im.Presence.CONTENT_TYPE, clientTypeArray);
-
-        mResolver.update(Im.Presence.BULK_CONTENT_URI, values, null, null);
-    }
-
-    void updateAvatarsContent(Contact[] contacts) {
-        ArrayList<ContentValues> avatars = new ArrayList<ContentValues>();
-        ArrayList<String> usernames = new ArrayList<String>();
-
-        for (Contact contact : contacts) {
-            byte[] avatarData = contact.getPresence().getAvatarData();
-            if (avatarData == null) {
-                continue;
-            }
-
-            String username = contact.getAddress().getFullName();
-
-            ContentValues values = new ContentValues(2);
-            values.put(Im.Avatars.CONTACT, username);
-            values.put(Im.Avatars.DATA, avatarData);
-            avatars.add(values);
-            usernames.add(username);
-        }
-        if (avatars.size() > 0) {
-            // ImProvider will replace the avatar content if it already exist.
-            mResolver.bulkInsert(mAvatarUrl, avatars.toArray(
-                    new ContentValues[avatars.size()]));
-
-            // notify avatar changed
-            Intent i = new Intent(ImServiceConstants.ACTION_AVATAR_CHANGED);
-            i.putExtra(ImServiceConstants.EXTRA_INTENT_FROM_ADDRESS, usernames);
-            i.putExtra(ImServiceConstants.EXTRA_INTENT_PROVIDER_ID, mProviderId);
-            i.putExtra(ImServiceConstants.EXTRA_INTENT_ACCOUNT_ID, mAccountId);
-            mContext.sendBroadcast(i);
-        }
-    }
-
-    ContactListAdapter removeContactListFromDataBase(String name) {
-        ContactListAdapter listAdapter = getContactListAdapter(name);
-        if (listAdapter == null) {
-            return null;
-        }
-        long id = listAdapter.getDataBaseId();
-
-        // delete contacts of this list first
-        mResolver.delete(mContactUrl,
-            Im.Contacts.CONTACTLIST + "=?", new String[]{Long.toString(id)});
-
-        mResolver.delete(ContentUris.withAppendedId(Im.ContactList.CONTENT_URI, id), null, null);
-        synchronized (mContactLists) {
-            return mContactLists.remove(listAdapter.getAddress());
-        }
-    }
-
-    void addContactListContent(ContactList list) {
-        String selection = Im.ContactList.NAME + "=? AND "
-                + Im.ContactList.PROVIDER + "=? AND "
-                + Im.ContactList.ACCOUNT + "=?";
-        String[] selectionArgs = { list.getName(),
-                Long.toString(mProviderId),
-                Long.toString(mAccountId) };
-        Cursor cursor = mResolver.query(Im.ContactList.CONTENT_URI,
-                                        CONTACT_LIST_ID_PROJECTION,
-                                        selection,
-                                        selectionArgs,
-                                        null); // no sort order
-        long listId = 0;
-        Uri uri = null;
-        try {
-            if (cursor.moveToFirst()) {
-                listId = cursor.getLong(0);
-                uri = ContentUris.withAppendedId(Im.ContactList.CONTENT_URI, listId);
-                //Log.d(TAG,"Found and removing ContactList with name "+list.getName());
-            }
-        } finally {
-            cursor.close();
-        }
-        if (uri != null) {
-            // remove existing ContactList and Contacts of that list for replacement by the newly
-            // downloaded list
-            mResolver.delete(mContactUrl, Im.Contacts.CONTACTLIST + "=?",
-                    new String[]{Long.toString(listId)});
-            mResolver.delete(uri, selection, selectionArgs);
-        }
-
-        ContentValues contactListValues = new ContentValues(3);
-        contactListValues.put(Im.ContactList.NAME, list.getName());
-        contactListValues.put(Im.ContactList.PROVIDER, mProviderId);
-        contactListValues.put(Im.ContactList.ACCOUNT, mAccountId);
-
-        //Log.d(TAG, "Adding ContactList name="+list.getName());
-        mValidatedContactLists.add(list.getName());
-        uri = mResolver.insert(Im.ContactList.CONTENT_URI, contactListValues);
-        listId = ContentUris.parseId(uri);
-
-        synchronized (mContactLists) {
-            mContactLists.put(list.getAddress(),
-                    new ContactListAdapter(list, listId));
-        }
-
-        Collection<Contact> contacts = list.getContacts();
-        if (contacts == null || contacts.size() == 0) {
-            return;
-        }
-
-        Iterator<Contact> iter = contacts.iterator();
-        while(iter.hasNext()) {
-            Contact c = iter.next();
-            String address = c.getAddress().getFullName();
-            if(isTemporary(address)) {
-                moveTemporaryContactToList(address, listId);
-                iter.remove();
-            }
-            mValidatedContacts.add(address);
-        }
-
-        ArrayList<String> usernames = new ArrayList<String>();
-        ArrayList<String> nicknames = new ArrayList<String>();
-        ArrayList<String> contactTypeArray = new ArrayList<String>();
-        for (Contact c : contacts) {
-            String username = c.getAddress().getFullName();
-            String nickname = c.getName();
-            int type = Im.Contacts.TYPE_NORMAL;
-            if(isTemporary(username)) {
-                type = Im.Contacts.TYPE_TEMPORARY;
-            }
-            if (isBlocked(username)) {
-                type = Im.Contacts.TYPE_BLOCKED;
-            }
-
-            usernames.add(username);
-            nicknames.add(nickname);
-            contactTypeArray.add(String.valueOf(type));
-        }
-        ContentValues values = new ContentValues(6);
-
-        values.put(Im.Contacts.PROVIDER, mProviderId);
-        values.put(Im.Contacts.ACCOUNT, mAccountId);
-        values.put(Im.Contacts.CONTACTLIST, listId);
-        values.putStringArrayList(Im.Contacts.USERNAME, usernames);
-        values.putStringArrayList(Im.Contacts.NICKNAME, nicknames);
-        values.putStringArrayList(Im.Contacts.TYPE, contactTypeArray);
-
-        mResolver.insert(Im.Contacts.BULK_CONTENT_URI, values);
-    }
-
-    void updateListNameInDataBase(ContactList list) {
-        ContactListAdapter listAdapter = getContactListAdapter(list.getAddress());
-
-        Uri uri = ContentUris.withAppendedId(Im.ContactList.CONTENT_URI, listAdapter.getDataBaseId());
-        ContentValues values = new ContentValues(1);
-        values.put(Im.ContactList.NAME, list.getName());
-
-        mResolver.update(uri, values, null, null);
-    }
-
-    void deleteContactFromDataBase(Contact contact, ContactList list) {
-        String selection = Im.Contacts.USERNAME
-                + "=? AND " + Im.Contacts.CONTACTLIST + "=?";
-        long listId = getContactListAdapter(list.getAddress()).getDataBaseId();
-        String username = contact.getAddress().getFullName();
-        String[] selectionArgs = {username, Long.toString(listId)};
-
-        mResolver.delete(mContactUrl, selection, selectionArgs);
-
-        // clear the history message if the contact doesn't exist in any list
-        // anymore.
-        if(mAdaptee.getContact(contact.getAddress()) == null) {
-            clearHistoryMessages(username);
-        }
-    }
-
-    Uri insertContactContent(Contact contact, long listId) {
-        ContentValues values = getContactContentValues(contact, listId);
-
-        Uri uri = mResolver.insert(mContactUrl, values);
-
-        ContentValues presenceValues = getPresenceValues(ContentUris.parseId(uri),
-                contact.getPresence());
-
-        mResolver.insert(Im.Presence.CONTENT_URI, presenceValues);
-
-        return uri;
-    }
-
-    private ContentValues getContactContentValues(Contact contact, long listId) {
-        final String username = contact.getAddress().getFullName();
-        final String nickname = contact.getName();
-        int type = Im.Contacts.TYPE_NORMAL;
-        if(isTemporary(username)) {
-            type = Im.Contacts.TYPE_TEMPORARY;
-        }
-        if (isBlocked(username)) {
-            type = Im.Contacts.TYPE_BLOCKED;
-        }
-
-        ContentValues values = new ContentValues(4);
-        values.put(Im.Contacts.USERNAME, username);
-        values.put(Im.Contacts.NICKNAME, nickname);
-        values.put(Im.Contacts.CONTACTLIST, listId);
-        values.put(Im.Contacts.TYPE, type);
-        return values;
-    }
-
-    void clearHistoryMessages(String contact) {
-        Uri uri = Im.Messages.getContentUriByContact(mProviderId,
-            mAccountId, contact);
-        mResolver.delete(uri, null, null);
-    }
-
-    private ContentValues getPresenceValues(long contactId, Presence p) {
-        ContentValues values = new ContentValues(3);
-        values.put(Im.Presence.CONTACT_ID, contactId);
-        values.put(Im.Contacts.PRESENCE_STATUS, convertPresenceStatus(p));
-        values.put(Im.Contacts.PRESENCE_CUSTOM_STATUS, p.getStatusText());
-        values.put(Im.Presence.CLIENT_TYPE, translateClientType(p));
-        return values;
-    }
-
-    private int translateClientType(Presence presence) {
-        int clientType = presence.getClientType();
-        switch (clientType) {
-            case Presence.CLIENT_TYPE_MOBILE:
-                return Im.Presence.CLIENT_TYPE_MOBILE;
-            default:
-                return Im.Presence.CLIENT_TYPE_DEFAULT;
-        }
-    }
-
-    /**
-     * Converts the presence status to the value defined for ImProvider.
-     *
-     * @param presence The presence from the IM engine.
-     * @return The status value defined in for ImProvider.
-     */
-    public static int convertPresenceStatus(Presence presence) {
-        switch (presence.getStatus()) {
-        case Presence.AVAILABLE:
-            return Im.Presence.AVAILABLE;
-
-        case Presence.IDLE:
-            return Im.Presence.IDLE;
-
-        case Presence.AWAY:
-            return Im.Presence.AWAY;
-
-        case Presence.DO_NOT_DISTURB:
-            return Im.Presence.DO_NOT_DISTURB;
-
-        case Presence.OFFLINE:
-            return Im.Presence.OFFLINE;
-        }
-
-        // impossible...
-        Log.e(TAG, "Illegal presence status value " + presence.getStatus());
-        return Im.Presence.AVAILABLE;
-    }
-
-    public void clearOnLogout() {
-        clearValidatedContactsAndLists();
-        clearTemporaryContacts();
-        clearPresence();
-    }
-
-    /**
-     * Clears the list of validated contacts and contact lists.
-     * As contacts and contacts lists are added after login, contacts and contact lists are
-     * stored as "validated contacts". After initial download of contacts is complete, any contacts
-     * and contact lists that remain in the database, but are not in the validated list, are
-     * obsolete and should be removed.  This function resets that list for use upon login.
-     */
-    private void clearValidatedContactsAndLists() {
-        // clear the list of validated contacts, contact lists, and blocked contacts
-        mValidatedContacts.clear();
-        mValidatedContactLists.clear();
-        mValidatedBlockedContacts.clear();
-    }
-
-    /**
-     * Clear the temporary contacts in the database. As contacts are persist between
-     * IM sessions, the temporary contacts need to be cleared after logout.
-     */
-    private void clearTemporaryContacts() {
-        String selection = Im.Contacts.CONTACTLIST + "=" + FAKE_TEMPORARY_LIST_ID;
-        mResolver.delete(mContactUrl, selection, null);
-    }
-
-    /**
-     * Clears the presence of the all contacts. As contacts are persist between
-     * IM sessions, the presence need to be cleared after logout.
-     */
-    void clearPresence() {
-        StringBuilder where = new StringBuilder();
-        where.append(Im.Presence.CONTACT_ID);
-        where.append(" in (select _id from contacts where ");
-        where.append(Im.Contacts.ACCOUNT);
-        where.append("=");
-        where.append(mAccountId);
-        where.append(")");
-        mResolver.delete(Im.Presence.CONTENT_URI, where.toString(), null);
-    }
-
-    void closeChatSession(String address) {
-        ChatSessionManagerAdapter sessionManager =
-            (ChatSessionManagerAdapter) mConn.getChatSessionManager();
-        ChatSessionAdapter session =
-            (ChatSessionAdapter) sessionManager.getChatSession(address);
-        if(session != null) {
-            session.leave();
-        }
-    }
-
-    void updateChatPresence(String address, String nickname, Presence p) {
-        ChatSessionManagerAdapter sessionManager =
-            (ChatSessionManagerAdapter) mConn.getChatSessionManager();
-        // TODO: This only find single chat sessions, we need to go through all
-        // active chat sessions and find if the contact is a participant of the
-        // session.
-        ChatSessionAdapter session =
-            (ChatSessionAdapter) sessionManager.getChatSession(address);
-        if(session != null) {
-            session.insertPresenceUpdatesMsg(nickname, p);
-        }
-    }
-
-
-}
diff --git a/src/com/android/im/service/ImConnectionAdapter.java b/src/com/android/im/service/ImConnectionAdapter.java
deleted file mode 100644 (file)
index 7b97ac6..0000000
+++ /dev/null
@@ -1,477 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.service;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.RemoteCallbackList;
-import android.os.RemoteException;
-import android.provider.Im;
-import android.util.Log;
-
-import com.android.im.IChatSessionManager;
-import com.android.im.IConnectionListener;
-import com.android.im.IContactListManager;
-import com.android.im.IImConnection;
-import com.android.im.IInvitationListener;
-import com.android.im.engine.ChatGroupManager;
-import com.android.im.engine.ConnectionListener;
-import com.android.im.engine.Contact;
-import com.android.im.engine.ContactListManager;
-import com.android.im.engine.ImConnection;
-import com.android.im.engine.ImErrorInfo;
-import com.android.im.engine.ImException;
-import com.android.im.engine.Invitation;
-import com.android.im.engine.InvitationListener;
-import com.android.im.engine.LoginInfo;
-import com.android.im.engine.Presence;
-
-public class ImConnectionAdapter extends IImConnection.Stub {
-    private static final String TAG = RemoteImService.TAG;
-
-    private static final String[] SESSION_COOKIE_PROJECTION = {
-        Im.SessionCookies.NAME,
-        Im.SessionCookies.VALUE,
-    };
-
-    private static final int COLUMN_SESSION_COOKIE_NAME = 0;
-    private static final int COLUMN_SESSION_COOKIE_VALUE = 1;
-
-    ImConnection mConnection;
-    private ConnectionListenerAdapter mConnectionListener;
-    private InvitationListenerAdapter mInvitationListener;
-
-    final RemoteCallbackList<IConnectionListener> mRemoteConnListeners
-            = new RemoteCallbackList<IConnectionListener>();
-
-    ChatSessionManagerAdapter mChatSessionManager;
-    ContactListManagerAdapter mContactListManager;
-
-    ChatGroupManager mGroupManager;
-    RemoteImService mService;
-
-    long mProviderId = -1;
-    long mAccountId = -1;
-    boolean mAutoLoadContacts;
-    int mConnectionState = ImConnection.DISCONNECTED;
-
-    public ImConnectionAdapter(long providerId, ImConnection connection,
-            RemoteImService service) {
-        mProviderId = providerId;
-        mConnection = connection;
-        mService = service;
-        mConnectionListener = new ConnectionListenerAdapter();
-        mConnection.addConnectionListener(mConnectionListener);
-        if ((connection.getCapability() & ImConnection.CAPABILITY_GROUP_CHAT) != 0) {
-            mGroupManager = mConnection.getChatGroupManager();
-            mInvitationListener = new InvitationListenerAdapter();
-            mGroupManager.setInvitationListener(mInvitationListener);
-        }
-    }
-
-    public ImConnection getAdaptee() {
-        return mConnection;
-    }
-
-    public RemoteImService getContext() {
-        return mService;
-    }
-
-    public long getProviderId() {
-        return mProviderId;
-    }
-
-    public long getAccountId() {
-        return mAccountId;
-    }
-
-    public int[] getSupportedPresenceStatus() {
-        return mConnection.getSupportedPresenceStatus();
-    }
-
-    public void networkTypeChanged() {
-        mConnection.networkTypeChanged();
-    }
-
-    void reestablishSession() {
-        mConnectionState = ImConnection.LOGGING_IN;
-
-        ContentResolver cr = mService.getContentResolver();
-        if ((mConnection.getCapability() & ImConnection.CAPABILITY_SESSION_REESTABLISHMENT) != 0) {
-            HashMap<String, String> cookie = querySessionCookie(cr);
-            if (cookie != null) {
-                Log.d(TAG, "re-establish session");
-                try {
-                    mConnection.reestablishSessionAsync(cookie);
-                } catch (IllegalArgumentException e) {
-                    Log.e(TAG, "Invalid session cookie, probably modified by others.");
-                    clearSessionCookie(cr);
-                }
-            }
-        }
-    }
-
-    private Uri getSessionCookiesUri() {
-        Uri.Builder builder = Im.SessionCookies.CONTENT_URI_SESSION_COOKIES_BY.buildUpon();
-        ContentUris.appendId(builder, mProviderId);
-        ContentUris.appendId(builder, mAccountId);
-
-        return builder.build();
-    }
-
-    public void login(long accountId, String userName, String password,
-            boolean autoLoadContacts) {
-        mAccountId = accountId;
-        mAutoLoadContacts = autoLoadContacts;
-        mConnectionState = ImConnection.LOGGING_IN;
-
-        mConnection.loginAsync(new LoginInfo(userName, password));
-
-        mChatSessionManager = new ChatSessionManagerAdapter(this);
-        mContactListManager = new ContactListManagerAdapter(this);
-    }
-
-    private HashMap<String, String> querySessionCookie(ContentResolver cr) {
-        Cursor c = cr.query(getSessionCookiesUri(), SESSION_COOKIE_PROJECTION, null, null, null);
-        if (c == null) {
-            return null;
-        }
-
-        HashMap<String, String> cookie = null;
-        if (c.getCount() > 0) {
-            cookie = new HashMap<String, String>();
-            while(c.moveToNext()) {
-                cookie.put(c.getString(COLUMN_SESSION_COOKIE_NAME),
-                    c.getString(COLUMN_SESSION_COOKIE_VALUE));
-            }
-        }
-
-        c.close();
-        return cookie;
-    }
-
-    public void logout() {
-        mConnectionState = ImConnection.LOGGING_OUT;
-        mConnection.logoutAsync();
-    }
-
-    public synchronized void cancelLogin() {
-        if (mConnectionState >= ImConnection.LOGGED_IN) {
-            // too late
-            return;
-        }
-
-        logout();
-    }
-
-    void suspend() {
-        mConnectionState = ImConnection.SUSPENDING;
-        mConnection.suspend();
-    }
-
-    public void registerConnectionListener(IConnectionListener listener) {
-        if (listener != null) {
-            mRemoteConnListeners.register(listener);
-        }
-    }
-
-    public void unregisterConnectionListener(IConnectionListener listener) {
-        if (listener != null) {
-            mRemoteConnListeners.unregister(listener);
-        }
-    }
-
-    public void setInvitationListener(IInvitationListener listener) {
-        if(mInvitationListener != null) {
-            mInvitationListener.mRemoteListener = listener;
-        }
-    }
-
-    public IChatSessionManager getChatSessionManager() {
-        return mChatSessionManager;
-    }
-
-    public IContactListManager getContactListManager() {
-        return mContactListManager;
-    }
-
-    public int getChatSessionCount() {
-        if (mChatSessionManager == null) {
-            return 0;
-        }
-        return mChatSessionManager.getChatSessionCount();
-    }
-
-    public Contact getLoginUser() {
-        return mConnection.getLoginUser();
-    }
-
-    public Presence getUserPresence() {
-        return mConnection.getUserPresence();
-    }
-
-    public int updateUserPresence(Presence newPresence) {
-        try {
-            mConnection.updateUserPresenceAsync(newPresence);
-        } catch (ImException e) {
-            return e.getImError().getCode();
-        }
-
-        return ImErrorInfo.NO_ERROR;
-    }
-
-    public int getState() {
-        return mConnectionState;
-    }
-
-    public void rejectInvitation(long id){
-        handleInvitation(id, false);
-    }
-
-    public void acceptInvitation(long id) {
-        handleInvitation(id, true);
-    }
-
-    private void handleInvitation(long id, boolean accept) {
-        if(mGroupManager == null) {
-            return;
-        }
-        ContentResolver cr = mService.getContentResolver();
-        Cursor c = cr.query(ContentUris.withAppendedId(Im.Invitation.CONTENT_URI, id), null, null, null, null);
-        if(c == null) {
-            return;
-        }
-        if(c.moveToFirst()) {
-            String inviteId = c.getString(c.getColumnIndexOrThrow(Im.Invitation.INVITE_ID));
-            int status;
-            if(accept) {
-                mGroupManager.acceptInvitationAsync(inviteId);
-                status = Im.Invitation.STATUS_ACCEPTED;
-            } else {
-                mGroupManager.rejectInvitationAsync(inviteId);
-                status = Im.Invitation.STATUS_REJECTED;
-            }
-            c.updateInt(c.getColumnIndexOrThrow(Im.Invitation.STATUS), status);
-            c.commitUpdates();
-        }
-        c.close();
-    }
-
-    void saveSessionCookie(ContentResolver cr) {
-        HashMap<String, String> cookies = mConnection.getSessionContext();
-
-        int i = 0;
-        ContentValues[] valuesList = new ContentValues[cookies.size()];
-
-        for(Map.Entry<String,String> entry : cookies.entrySet()){
-            ContentValues values = new ContentValues(2);
-
-            values.put(Im.SessionCookies.NAME, entry.getKey());
-            values.put(Im.SessionCookies.VALUE, entry.getValue());
-
-            valuesList[i++] = values;
-        }
-
-        cr.bulkInsert(getSessionCookiesUri(), valuesList);
-    }
-
-    void clearSessionCookie(ContentResolver cr) {
-        cr.delete(getSessionCookiesUri(), null, null);
-    }
-
-    void updateAccountStatusInDb() {
-        Presence p = getUserPresence();
-        int presenceStatus = Im.Presence.OFFLINE;
-        int connectionStatus = convertConnStateForDb(mConnectionState);
-
-        if (p != null) {
-            presenceStatus = ContactListManagerAdapter.convertPresenceStatus(p);
-        }
-
-        ContentResolver cr = mService.getContentResolver();
-        Uri uri = Im.AccountStatus.CONTENT_URI;
-        ContentValues values = new ContentValues();
-
-        values.put(Im.AccountStatus.ACCOUNT, mAccountId);
-        values.put(Im.AccountStatus.PRESENCE_STATUS, presenceStatus);
-        values.put(Im.AccountStatus.CONNECTION_STATUS, connectionStatus);
-
-        cr.insert(uri, values);
-    }
-
-    private static int convertConnStateForDb(int state) {
-        switch (state) {
-        case ImConnection.DISCONNECTED:
-        case ImConnection.LOGGING_OUT:
-            return Im.ConnectionStatus.OFFLINE;
-
-        case ImConnection.LOGGING_IN:
-            return Im.ConnectionStatus.CONNECTING;
-
-        case ImConnection.LOGGED_IN:
-            return Im.ConnectionStatus.ONLINE;
-
-        case ImConnection.SUSPENDED:
-        case ImConnection.SUSPENDING:
-            return Im.ConnectionStatus.SUSPENDED;
-
-        default:
-            return Im.ConnectionStatus.OFFLINE;
-        }
-    }
-
-    final class ConnectionListenerAdapter implements ConnectionListener{
-        public void onStateChanged(final int state, final ImErrorInfo error) {
-            synchronized (this) {
-                if (state == ImConnection.LOGGED_IN
-                        && mConnectionState == ImConnection.LOGGING_OUT) {
-                    // A bit tricky here. The engine did login successfully
-                    // but the notification comes a bit late; user has already
-                    // issued a cancelLogin() and that cannot be undone. Here
-                    // we have to ignore the LOGGED_IN event and wait for
-                    // the upcoming DISCONNECTED.
-                    return;
-                }
-
-                if (state != ImConnection.DISCONNECTED) {
-                    mConnectionState = state;
-                }
-            }
-
-            ContentResolver cr = mService.getContentResolver();
-            if(state == ImConnection.LOGGED_IN) {
-                if ((mConnection.getCapability() & ImConnection.CAPABILITY_SESSION_REESTABLISHMENT) != 0){
-                    saveSessionCookie(cr);
-                }
-
-                if(mAutoLoadContacts && mContactListManager.getState()
-                        != ContactListManager.LISTS_LOADED) {
-                    mContactListManager.loadContactLists();
-                }
-
-                for (ChatSessionAdapter session : mChatSessionManager.mActiveSessions.values()) {
-                    session.sendPostponedMessages();
-                }
-            } else if (state == ImConnection.LOGGING_OUT) {
-                // The engine has started to logout the connection, remove it
-                // from the active connection list.
-                mService.removeConnection(ImConnectionAdapter.this);
-            } else if(state == ImConnection.DISCONNECTED) {
-                mService.removeConnection(ImConnectionAdapter.this);
-
-                clearSessionCookie(cr);
-                // mContactListManager might still be null if we fail
-                // immediately in loginAsync (say, an invalid host URL)
-                if (mContactListManager != null) {
-                    mContactListManager.clearOnLogout();
-                }
-                if (mChatSessionManager != null) {
-                    mChatSessionManager.closeAllChatSessions();
-                }
-
-                mConnectionState = state;
-            } else if(state == ImConnection.SUSPENDED && error != null) {
-                // re-establish failed, schedule to retry
-                // TODO increase delay after retry failed.
-                mService.scheduleReconnect(15000);
-            }
-
-            updateAccountStatusInDb();
-
-            final int N = mRemoteConnListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
-                try {
-                    listener.onStateChanged(ImConnectionAdapter.this, state, error);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteConnListeners.finishBroadcast();
-        }
-
-        public void onUserPresenceUpdated() {
-            updateAccountStatusInDb();
-
-            final int N = mRemoteConnListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
-                try {
-                    listener.onUserPresenceUpdated(ImConnectionAdapter.this);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteConnListeners.finishBroadcast();
-        }
-
-        public void onUpdatePresenceError(final ImErrorInfo error) {
-            final int N = mRemoteConnListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IConnectionListener listener = mRemoteConnListeners.getBroadcastItem(i);
-                try {
-                    listener.onUpdatePresenceError(ImConnectionAdapter.this, error);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteConnListeners.finishBroadcast();
-        }
-    }
-
-    final class InvitationListenerAdapter implements InvitationListener {
-        IInvitationListener mRemoteListener;
-
-        public void onGroupInvitation(Invitation invitation) {
-            String sender = invitation.getSender().getScreenName();
-            ContentValues values = new ContentValues(7);
-            values.put(Im.Invitation.PROVIDER, mProviderId);
-            values.put(Im.Invitation.ACCOUNT, mAccountId);
-            values.put(Im.Invitation.INVITE_ID, invitation.getInviteID());
-            values.put(Im.Invitation.SENDER, sender);
-            values.put(Im.Invitation.GROUP_NAME, invitation.getGroupAddress().getScreenName());
-            values.put(Im.Invitation.NOTE, invitation.getReason());
-            values.put(Im.Invitation.STATUS, Im.Invitation.STATUS_PENDING);
-            ContentResolver resolver = mService.getContentResolver();
-            Uri uri = resolver.insert(Im.Invitation.CONTENT_URI, values);
-            long id = ContentUris.parseId(uri);
-            try {
-                if (mRemoteListener != null) {
-                    mRemoteListener.onGroupInvitation(id);
-                    return;
-                }
-            } catch (RemoteException e) {
-                Log.i(TAG, "onGroupInvitation: dead listener "
-                        + mRemoteListener +"; removing");
-                mRemoteListener = null;
-            }
-            // No listener registered or failed to notify the listener, send a
-            // notification instead.
-            mService.getStatusBarNotifier().notifyGroupInvitation(mProviderId, mAccountId, id, sender);
-        }
-    }
-}
diff --git a/src/com/android/im/service/ImServiceConstants.java b/src/com/android/im/service/ImServiceConstants.java
deleted file mode 100644 (file)
index 4906501..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.service;
-
-import android.content.ComponentName;
-
-public class ImServiceConstants {
-    /**
-     * RemoteImService name, used for start or stop the IM service.
-     */
-    public static final ComponentName IM_SERVICE_COMPONENT = new ComponentName(
-            "com.android.im",
-            "com.android.im.service.RemoteImService");
-
-    /**
-     * Broadcast action: broadcast event for avatar changed.
-     */
-    public static final String ACTION_AVATAR_CHANGED =
-            "android.intent.action.IM_AVATAR_CHANGED";
-
-    /**
-     * Intent action for managing a subscription request.
-     */
-    public static final String ACTION_MANAGE_SUBSCRIPTION =
-            "android.intent.action.IM_MANAGE_SUBSCRIPTION";
-
-    /**
-     * Use EXTRA_INTENT_FROM_ADDRESS to include the from address of a contact in an intent.
-     */
-    public static final String EXTRA_INTENT_FROM_ADDRESS = "from";
-
-    /**
-     * Use EXTRA_INTENT_PROVIDER_ID to include the provider id in an intent.
-     */
-    public static final String EXTRA_INTENT_PROVIDER_ID = "providerId";
-
-    /**
-     * Use EXTRA_INTENT_ACCOUNT_ID to include the account id in an intent.
-     */
-    public static final String EXTRA_INTENT_ACCOUNT_ID = "accountId";
-
-    /**
-     * Use EXTRA_INTENT_LIST_NAME to include the contact list name in an intent.
-     */
-    public static final String EXTRA_INTENT_LIST_NAME = "listName";
-
-    public static final String EXTRA_CHECK_AUTO_LOGIN = "autologin";
-
-    /**
-     * USE EXTRA_INTENT_SHOW_MULTIPLE to inform the activity to show multiple chat notifications
-     */
-    public static final String EXTRA_INTENT_SHOW_MULTIPLE = "show_multiple";
-}
diff --git a/src/com/android/im/service/RemoteImService.java b/src/com/android/im/service/RemoteImService.java
deleted file mode 100644 (file)
index c7ed6f7..0000000
+++ /dev/null
@@ -1,596 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.service;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import android.app.Service;
-import android.content.BroadcastReceiver;
-import android.content.ContentResolver;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.content.pm.ServiceInfo;
-import android.database.Cursor;
-import android.net.ConnectivityManager;
-import android.net.NetworkConnectivityListener;
-import android.net.Uri;
-import android.net.NetworkConnectivityListener.State;
-import android.net.NetworkInfo;
-import android.os.Bundle;
-import android.os.RemoteCallbackList;
-import android.os.RemoteException;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.os.SystemProperties;
-import android.provider.Im;
-import android.telephony.TelephonyManager;
-import android.text.TextUtils;
-import android.util.Log;
-import android.widget.Toast;
-
-import com.android.im.IConnectionCreationListener;
-import com.android.im.IImConnection;
-import com.android.im.IRemoteImService;
-import com.android.im.engine.ConnectionFactory;
-import com.android.im.engine.ImConnection;
-import com.android.im.engine.ImException;
-import com.android.im.imps.ImpsConnectionConfig;
-import com.android.im.plugin.IImPlugin;
-import com.android.im.plugin.ImConfigNames;
-import com.android.im.plugin.ImPluginConstants;
-import com.android.im.plugin.ImPluginInfo;
-import com.android.im.plugin.ImpsConfigNames;
-import dalvik.system.PathClassLoader;
-
-public class RemoteImService extends Service {
-
-    private static final String[] ACCOUNT_PROJECTION = {
-        Im.Account._ID,
-        Im.Account.PROVIDER,
-        Im.Account.USERNAME,
-        Im.Account.PASSWORD,
-    };
-    private static final int ACCOUNT_ID_COLUMN = 0;
-    private static final int ACCOUNT_PROVIDER_COLUMN = 1;
-    private static final int ACCOUNT_USERNAME_COLUMN = 2;
-    private static final int ACCOUNT_PASSOWRD_COLUMN = 3;
-
-    static final String TAG = "ImService";
-
-    private static final int EVENT_SHOW_TOAST = 100;
-    private static final int EVENT_NETWORK_STATE_CHANGED = 200;
-
-    private StatusBarNotifier mStatusBarNotifier;
-    private Handler mServiceHandler;
-    NetworkConnectivityListener mNetworkConnectivityListener;
-    private int mNetworkType;
-    private boolean mNeedCheckAutoLogin;
-
-    private boolean mBackgroundDataEnabled;
-
-    private SettingsMonitor mSettingsMonitor;
-
-    Vector<ImConnectionAdapter> mConnections;
-    final RemoteCallbackList<IConnectionCreationListener> mRemoteListeners
-            = new RemoteCallbackList<IConnectionCreationListener>();
-
-    private HashMap<Long, ImPluginInfo> mPlugins;
-
-    public RemoteImService() {
-        mConnections = new Vector<ImConnectionAdapter>();
-        mPlugins = new HashMap<Long, ImPluginInfo>();
-    }
-
-    @Override
-    public void onCreate() {
-        Log.d(TAG, "ImService started");
-        mStatusBarNotifier = new StatusBarNotifier(this);
-        mServiceHandler = new ServiceHandler();
-        mNetworkConnectivityListener = new NetworkConnectivityListener();
-        mNetworkConnectivityListener.registerHandler(mServiceHandler, EVENT_NETWORK_STATE_CHANGED);
-        mNetworkConnectivityListener.startListening(this);
-
-        mSettingsMonitor = new SettingsMonitor();
-
-        IntentFilter intentFilter = new IntentFilter();
-        intentFilter.addAction(ConnectivityManager.ACTION_BACKGROUND_DATA_SETTING_CHANGED);
-        registerReceiver(mSettingsMonitor, intentFilter);
-
-        ConnectivityManager manager
-            = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
-        setBackgroundData(manager.getBackgroundDataSetting());
-
-        findAvaiablePlugins();
-        AndroidSystemService.getInstance().initialize(this);
-    }
-
-    private void findAvaiablePlugins() {
-        PackageManager pm = getPackageManager();
-        List<ResolveInfo> plugins = pm.queryIntentServices(
-                new Intent(ImPluginConstants.PLUGIN_ACTION_NAME), PackageManager.GET_META_DATA);
-        for (ResolveInfo info : plugins) {
-            Log.d(TAG, "Found plugin " + info);
-
-            ServiceInfo serviceInfo = info.serviceInfo;
-            if (serviceInfo == null) {
-                Log.e(TAG, "Ignore bad IM plugin: " + info);
-                continue;
-            }
-            String providerName = null;
-            String providerFullName = null;
-            String signUpUrl = null;
-            Bundle metaData = serviceInfo.metaData;
-            if (metaData != null) {
-                providerName = metaData.getString(ImPluginConstants.METADATA_PROVIDER_NAME);
-                providerFullName = metaData.getString(ImPluginConstants.METADATA_PROVIDER_FULL_NAME);
-                signUpUrl = metaData.getString(ImPluginConstants.METADATA_SIGN_UP_URL);
-            }
-            if (TextUtils.isEmpty(providerName) || TextUtils.isEmpty(providerFullName)) {
-                Log.e(TAG, "Ignore bad IM plugin: " + info + ". Lack of required meta data");
-                continue;
-            }
-
-            ImPluginInfo pluginInfo = new ImPluginInfo(providerName, serviceInfo.packageName,
-                    serviceInfo.name, serviceInfo.applicationInfo.sourceDir);
-
-            Map<String, String> config = loadProviderConfigFromPlugin(pluginInfo);
-            if (config == null) {
-                Log.e(TAG, "Ignore bad IM plugin");
-                break;
-            }
-
-            config.put(ImConfigNames.PLUGIN_PATH, pluginInfo.mSrcPath);
-            config.put(ImConfigNames.PLUGIN_CLASS, pluginInfo.mClassName);
-            long providerId = updateProviderDb(providerName, providerFullName, signUpUrl,
-                    config);
-            mPlugins.put(providerId, pluginInfo);
-        }
-    }
-
-    private Map<String, String> loadProviderConfigFromPlugin(ImPluginInfo pluginInfo) {
-        // XXX Load the plug-in implementation directly from the apk rather than
-        // binding to the service and call through IPC Binder API. This is much
-        // more effective since we don't need to start the service in other
-        // process. We can not run the plug-in service in the same process as a
-        // local service because that the interface is defined in a shared
-        // library in order to compile the plug-in separately. In this case, the
-        // interface will be loaded by two class loader separately and a
-        // ClassCastException will be thrown if we cast the binder to the
-        // interface.
-        PathClassLoader loader = new PathClassLoader(pluginInfo.mSrcPath, getClassLoader());
-        try {
-            Class cls = loader.loadClass(pluginInfo.mClassName);
-            Method m = cls.getMethod("onBind", Intent.class);
-            IImPlugin plugin = (IImPlugin)m.invoke(cls.newInstance(), new Object[]{null});
-            return plugin.getProviderConfig();
-        } catch (ClassNotFoundException e) {
-            Log.e(TAG, "Could not find plugin class", e);
-        } catch (IllegalAccessException e) {
-            Log.e(TAG, "Could not create plugin instance", e);
-        } catch (InstantiationException e) {
-            Log.e(TAG, "Could not create plugin instance", e);
-        } catch (SecurityException e) {
-            Log.e(TAG, "Could not load config from the plugin", e);
-        } catch (NoSuchMethodException e) {
-            Log.e(TAG, "Could not load config from the plugin", e);
-        } catch (IllegalArgumentException e) {
-            Log.e(TAG, "Could not load config from the plugin", e);
-        } catch (InvocationTargetException e) {
-            Log.e(TAG, "Could not load config from the plugin", e);
-        } catch (RemoteException e) {
-            Log.e(TAG, "Could not load config from the plugin", e);
-        }
-        return null;
-    }
-
-    private long updateProviderDb(String providerName, String providerFullName,
-            String signUpUrl, Map<String, String> config) {
-        long providerId = -1;
-        ContentResolver cr = getContentResolver();
-        String where = Im.Provider.NAME + "=?";
-        String[] selectionArgs = new String[]{providerName};
-        Cursor c = cr.query(Im.Provider.CONTENT_URI,
-                null /* projection */,
-                where,
-                selectionArgs,
-                null /* sort order */);
-        String pluginVersion = config.get(ImConfigNames.PLUGIN_VERSION);
-        boolean versionChanged;
-        try {
-            if (c.moveToFirst()) {
-                providerId = c.getLong(c.getColumnIndexOrThrow(Im.Provider._ID));
-                versionChanged = isPluginVersionChanged(cr, providerId, pluginVersion);
-                if (versionChanged) {
-                    // Update the full name, signup url and category each time when the plugin change
-                    // instead of specific version change because this is called only once.
-                    // It's ok to update them even the values are not changed.
-                    // Note that we don't update the provider name because it's used as
-                    // identifier at some place and the plugin should never change it.
-                    ContentValues values = new ContentValues(3);
-                    values.put(Im.Provider.FULLNAME, providerFullName);
-                    values.put(Im.Provider.SIGNUP_URL, signUpUrl);
-                    values.put(Im.Provider.CATEGORY, "com.android.im.IMPS_CATEGORY");
-                    Uri uri = ContentUris.withAppendedId(Im.Provider.CONTENT_URI, providerId);
-                    cr.update(uri, values, null, null);
-                }
-            } else {
-                ContentValues values = new ContentValues(3);
-                values.put(Im.Provider.NAME, providerName);
-                values.put(Im.Provider.FULLNAME, providerFullName);
-                values.put(Im.Provider.CATEGORY, "com.android.im.IMPS_CATEGORY");
-                values.put(Im.Provider.SIGNUP_URL, signUpUrl);
-
-                Uri result = cr.insert(Im.Provider.CONTENT_URI, values);
-                providerId = ContentUris.parseId(result);
-                versionChanged = true;
-            }
-        } finally {
-            c.close();
-        }
-
-        if (versionChanged) {
-            ContentValues[] settingValues = new ContentValues[config.size()];
-
-            int index = 0;
-            for (Map.Entry<String, String> entry : config.entrySet()) {
-                ContentValues settingValue = new ContentValues();
-                settingValue.put(Im.ProviderSettings.PROVIDER, providerId);
-                settingValue.put(Im.ProviderSettings.NAME, entry.getKey());
-                settingValue.put(Im.ProviderSettings.VALUE, entry.getValue());
-                settingValues[index++] = settingValue;
-            }
-            cr.bulkInsert(Im.ProviderSettings.CONTENT_URI, settingValues);
-        }
-
-        return providerId;
-    }
-
-    private boolean isPluginVersionChanged(ContentResolver cr, long providerId,
-            String newVersion) {
-        String oldVersion = Im.ProviderSettings.getStringValue(cr, providerId,
-                ImConfigNames.PLUGIN_VERSION);
-        if (oldVersion == null) {
-            return true;
-        }
-        return !oldVersion.equals(newVersion);
-    }
-
-    @Override
-    public void onStart(Intent intent, int startId) {
-        super.onStart(intent, startId);
-        mNeedCheckAutoLogin = intent.getBooleanExtra(ImServiceConstants.EXTRA_CHECK_AUTO_LOGIN, false);
-
-        Log.d(TAG, "ImService.onStart, checkAutoLogin=" + mNeedCheckAutoLogin);
-
-        // Check and login accounts if network is ready, otherwise it's checked
-        // when the network becomes available.
-        if (mNeedCheckAutoLogin &&
-                mNetworkConnectivityListener.getState() == State.CONNECTED) {
-            mNeedCheckAutoLogin = false;
-            autoLogin();
-        }
-    }
-
-    private void autoLogin() {
-        Log.d(TAG, "Scaning accounts and login automatically");
-
-        ContentResolver resolver = getContentResolver();
-
-        String where = Im.Account.KEEP_SIGNED_IN + "=1 AND " + Im.Account.ACTIVE + "=1";
-        Cursor cursor = resolver.query(Im.Account.CONTENT_URI,
-                ACCOUNT_PROJECTION, where, null, null);
-        if (cursor == null) {
-            Log.w(TAG, "Can't query account!");
-            return;
-        }
-        while (cursor.moveToNext()) {
-            long accountId = cursor.getLong(ACCOUNT_ID_COLUMN);
-            long providerId = cursor.getLong(ACCOUNT_PROVIDER_COLUMN);
-            String username = cursor.getString(ACCOUNT_USERNAME_COLUMN);
-            String password = cursor.getString(ACCOUNT_PASSOWRD_COLUMN);
-
-            IImConnection conn = createConnection(providerId);
-
-            try {
-                conn.login(accountId, username, password, true);
-            } catch (RemoteException e) {
-                Log.w(TAG, "Logging error while automatically login!");
-            }
-        }
-        cursor.close();
-    }
-
-    private Map<String, String> loadProviderSettings(long providerId) {
-        ContentResolver cr = getContentResolver();
-        Map<String, String> settings = Im.ProviderSettings.queryProviderSettings(cr, providerId);
-
-        NetworkInfo networkInfo = mNetworkConnectivityListener.getNetworkInfo();
-        // Insert a fake msisdn on emulator. We don't need this on device
-        // because the mobile network will take care of it.
-        if ("1".equals(SystemProperties.get("ro.kernel.qemu"))) {
-            settings.put(ImpsConfigNames.MSISDN, "1231231234");
-        } else if (networkInfo != null
-                && networkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
-            if (!TextUtils.isEmpty(settings.get(ImpsConfigNames.SMS_ADDR))) {
-                // Send authentication through sms if SMS data channel is
-                // supported and WiFi is used.
-                settings.put(ImpsConfigNames.SMS_AUTH, "true");
-                settings.put(ImpsConfigNames.SECURE_LOGIN, "false");
-            } else {
-                // Wi-Fi network won't insert a MSISDN, we should get from the SIM
-                // card. Assume we can always get the correct MSISDN from SIM, otherwise,
-                // the sign in would fail and an error message should be shown to warn
-                // the user to contact their operator.
-                String msisdn = TelephonyManager.getDefault().getLine1Number();
-                if (!TextUtils.isEmpty(msisdn)) {
-                    settings.put(ImpsConfigNames.MSISDN, msisdn);
-                }
-            }
-        }
-        return settings;
-    }
-
-    @Override
-    public void onDestroy() {
-        Log.w(TAG, "ImService stopped.");
-        for (ImConnectionAdapter conn : mConnections) {
-            conn.logout();
-        }
-
-        AndroidSystemService.getInstance().shutdown();
-
-        mNetworkConnectivityListener.unregisterHandler(mServiceHandler);
-        mNetworkConnectivityListener.stopListening();
-        mNetworkConnectivityListener = null;
-
-        unregisterReceiver(mSettingsMonitor);
-    }
-
-    @Override
-    public IBinder onBind(Intent intent) {
-        return mBinder;
-    }
-
-    public void showToast(CharSequence text, int duration) {
-        Message msg = Message.obtain(mServiceHandler, EVENT_SHOW_TOAST, duration, 0, text);
-        msg.sendToTarget();
-    }
-
-    public StatusBarNotifier getStatusBarNotifier() {
-        return mStatusBarNotifier;
-    }
-
-    public void scheduleReconnect(long delay) {
-        if (!isNetworkAvailable()) {
-            // Don't schedule reconnect if no network available. We will try to
-            // reconnect when network state become CONNECTED.
-            return;
-        }
-        mServiceHandler.postDelayed(new Runnable() {
-            public void run() {
-                reestablishConnections();
-            }
-        }, delay);
-    }
-
-    IImConnection createConnection(long providerId) {
-        Map<String, String> settings = loadProviderSettings(providerId);
-        String protocol = settings.get(ImConfigNames.PROTOCOL_NAME);
-        if(!"IMPS".equals(protocol)) {
-            Log.e(TAG, "Unsupported protocol: " + protocol);
-            return null;
-        }
-        ImpsConnectionConfig config = new ImpsConnectionConfig(settings);
-        ConnectionFactory factory = ConnectionFactory.getInstance();
-        try {
-            ImConnection conn = factory.createConnection(config);
-            ImConnectionAdapter result = new ImConnectionAdapter(providerId,
-                    conn, this);
-            mConnections.add(result);
-
-            final int N = mRemoteListeners.beginBroadcast();
-            for (int i = 0; i < N; i++) {
-                IConnectionCreationListener listener = mRemoteListeners.getBroadcastItem(i);
-                try {
-                    listener.onConnectionCreated(result);
-                } catch (RemoteException e) {
-                    // The RemoteCallbackList will take care of removing the
-                    // dead listeners.
-                }
-            }
-            mRemoteListeners.finishBroadcast();
-            return result;
-        } catch (ImException e) {
-            Log.e(TAG, "Error creating connection", e);
-            return null;
-        }
-    }
-
-    void removeConnection(IImConnection connection) {
-        mConnections.remove(connection);
-    }
-
-    private boolean isNetworkAvailable() {
-        return mNetworkConnectivityListener.getState() == State.CONNECTED;
-    }
-
-    private boolean isBackgroundDataEnabled() {
-        return mBackgroundDataEnabled;
-    }
-
-    private void setBackgroundData(boolean flag) {
-        mBackgroundDataEnabled = flag;
-    }
-
-    void handleBackgroundDataSettingChange(){
-        if (!isBackgroundDataEnabled()) {
-            for (ImConnectionAdapter conn : mConnections) {
-                conn.logout();
-            }
-        }
-    }
-
-    void networkStateChanged() {
-        if (mNetworkConnectivityListener == null) {
-            return;
-        }
-        NetworkInfo networkInfo = mNetworkConnectivityListener.getNetworkInfo();
-        NetworkInfo.State state = networkInfo.getState();
-
-        Log.d(TAG, "networkStateChanged:" + state);
-
-        int oldType = mNetworkType;
-        mNetworkType = networkInfo.getType();
-
-        // Notify the connection that network type has changed. Note that this
-        // only work for connected connections, we need to reestablish if it's
-        // suspended.
-        if (mNetworkType != oldType
-                && isNetworkAvailable()) {
-            for (ImConnectionAdapter conn : mConnections) {
-                conn.networkTypeChanged();
-            }
-        }
-
-        switch (state) {
-            case CONNECTED:
-                if (mNeedCheckAutoLogin) {
-                    mNeedCheckAutoLogin = false;
-                    autoLogin();
-                    break;
-                }
-                reestablishConnections();
-                break;
-
-            case DISCONNECTED:
-                if (!isNetworkAvailable()) {
-                    suspendConnections();
-                }
-                break;
-        }
-    }
-
-    // package private for inner class access
-    void reestablishConnections() {
-        if (!isNetworkAvailable()) {
-            return;
-        }
-
-        for (ImConnectionAdapter conn : mConnections) {
-            int connState = conn.getState();
-            if (connState == ImConnection.SUSPENDED) {
-                conn.reestablishSession();
-            }
-        }
-    }
-
-    private void suspendConnections() {
-        for (ImConnectionAdapter conn : mConnections) {
-            if (conn.getState() != ImConnection.LOGGED_IN) {
-                continue;
-            }
-            conn.suspend();
-        }
-    }
-
-    private final IRemoteImService.Stub mBinder = new IRemoteImService.Stub() {
-
-        public List getAllPlugins() {
-            return new ArrayList(mPlugins.values());
-        }
-
-        public void addConnectionCreatedListener(IConnectionCreationListener listener) {
-            if (listener != null) {
-                mRemoteListeners.register(listener);
-            }
-        }
-
-        public void removeConnectionCreatedListener(IConnectionCreationListener listener) {
-            if (listener != null) {
-                mRemoteListeners.unregister(listener);
-            }
-        }
-
-        public IImConnection createConnection(long providerId) {
-            return RemoteImService.this.createConnection(providerId);
-        }
-
-        public List getActiveConnections() {
-            ArrayList<IBinder> result = new ArrayList<IBinder>(mConnections.size());
-            for(IImConnection conn : mConnections) {
-                result.add(conn.asBinder());
-            }
-            return result;
-        }
-
-        public void dismissNotifications(long providerId) {
-            mStatusBarNotifier.dismissNotifications(providerId);
-        }
-
-        public void dismissChatNotification(long providerId, String username) {
-            mStatusBarNotifier.dismissChatNotification(providerId, username);
-        }
-    };
-
-    private final class SettingsMonitor extends BroadcastReceiver {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            String action = intent.getAction();
-
-            if (ConnectivityManager.ACTION_BACKGROUND_DATA_SETTING_CHANGED.equals(action)) {
-                ConnectivityManager manager =
-                    (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
-                setBackgroundData(manager.getBackgroundDataSetting());
-                handleBackgroundDataSettingChange();
-            }
-        }
-    }
-
-    private final class ServiceHandler extends Handler {
-        public ServiceHandler() {
-        }
-
-        @Override
-        public void handleMessage(Message msg) {
-            switch (msg.what) {
-                case EVENT_SHOW_TOAST:
-                    Toast.makeText(RemoteImService.this,
-                            (CharSequence) msg.obj, msg.arg1).show();
-                    break;
-
-                case EVENT_NETWORK_STATE_CHANGED:
-                    networkStateChanged();
-                    break;
-
-                default:
-            }
-        }
-    }
-}
diff --git a/src/com/android/im/service/StatusBarNotifier.java b/src/com/android/im/service/StatusBarNotifier.java
deleted file mode 100644 (file)
index fb3d1ba..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Esmertec AG.
- * Copyright (C) 2007-2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.im.service;
-
-import java.util.HashMap;
-
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.content.ContentUris;
-import android.content.Context;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Handler;
-import android.os.SystemClock;
-import android.provider.Im;
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.android.im.R;
-import com.android.im.app.ContactListActivity;
-import com.android.im.app.NewChatActivity;
-
-public class StatusBarNotifier {
-    private static final boolean DBG = false;
-
-    private static final long SUPPRESS_SOUND_INTERVAL_MS = 3000L;
-
-    static final long[] VIBRATE_PATTERN = new long[] {0, 250, 250, 250};
-
-    private Context mContext;
-    private NotificationManager mNotificationManager;
-
-    private HashMap<Long, Im.ProviderSettings.QueryMap> mSettings;
-    private Handler mHandler;
-    private HashMap<Long, NotificationInfo> mNotificationInfos;
-    private long mLastSoundPlayedMs;
-
-    public StatusBarNotifier(Context context) {
-        mContext = context;
-        mNotificationManager = (NotificationManager) context.getSystemService(
-                Context.NOTIFICATION_SERVICE);
-        mSettings = new HashMap<Long, Im.ProviderSettings.QueryMap>();
-        mHandler = new Handler();
-        mNotificationInfos = new HashMap<Long, NotificationInfo>();
-    }
-
-    public void onServiceStop() {
-        for(Im.ProviderSettings.QueryMap queryMap : mSettings.values()) {
-            queryMap.close();
-        }
-    }
-
-    public void notifyChat(long providerId, long accountId, long chatId,
-            String username, String nickname, String msg, boolean lightWeightNotify) {
-        if (!isNotificationEnabled(providerId)) {
-            if (DBG) log("notification for chat " + username + " is not enabled");
-            return;
-        }
-
-        String title = nickname;
-        String snippet = nickname + ": " + msg;
-        Intent intent = new Intent(Intent.ACTION_VIEW,
-                ContentUris.withAppendedId(Im.Chats.CONTENT_URI, chatId));
-        intent.addCategory(com.android.im.app.ImApp.IMPS_CATEGORY);
-        notify(username, title, snippet, msg, providerId, accountId, intent, lightWeightNotify);
-    }
-
-    public void notifySubscriptionRequest(long providerId, long accountId,
-            long contactId, String username, String nickname) {
-        if (!isNotificationEnabled(providerId)) {
-            if (DBG) log("notification for subscription request " + username + " is not enabled");
-            return;
-        }
-        String title = nickname;
-        String message = mContext.getString(R.string.subscription_notify_text, nickname);
-        Intent intent = new Intent(ImServiceConstants.ACTION_MANAGE_SUBSCRIPTION,
-                ContentUris.withAppendedId(Im.Contacts.CONTENT_URI, contactId));
-        intent.putExtra(ImServiceConstants.EXTRA_INTENT_PROVIDER_ID, providerId);
-        intent.putExtra(ImServiceConstants.EXTRA_INTENT_FROM_ADDRESS, username);
-        notify(username, title, message, message, providerId, accountId, intent, false);
-    }
-
-    public void notifyGroupInvitation(long providerId, long accountId,
-            long invitationId, String username) {
-
-        Intent intent = new Intent(Intent.ACTION_VIEW,
-                ContentUris.withAppendedId(Im.Invitation.CONTENT_URI, invitationId));
-
-        String title = mContext.getString(R.string.notify_groupchat_label);
-        String message = mContext.getString(
-                R.string.group_chat_invite_notify_text, username);
-        notify(username, title, message, message, providerId, accountId, intent, false);
-    }
-
-    public void dismissNotifications(long providerId) {
-        synchronized (mNotificationInfos) {
-            NotificationInfo info = mNotificationInfos.get(providerId);
-            if (info != null) {
-                mNotificationManager.cancel(info.computeNotificationId());
-                mNotificationInfos.remove(providerId);
-            }
-        }
-    }
-
-    public void dismissChatNotification(long providerId, String username) {
-        NotificationInfo info;
-        boolean removed;
-        synchronized (mNotificationInfos) {
-            info = mNotificationInfos.get(providerId);
-            if (info == null) {
-                return;
-            }
-            removed = info.removeItem(username);
-        }
-
-        if (removed) {
-            if (info.getMessage() == null) {
-                if (DBG) log("dismissChatNotification: removed notification for " + providerId);
-                mNotificationManager.cancel(info.computeNotificationId());
-            } else {
-                if (DBG) {
-                    log("cancelNotify: new notification" +
-                            " mTitle=" + info.getTitle() +
-                            " mMessage=" + info.getMessage() +
-                            " mIntent=" + info.getIntent());
-                }
-                mNotificationManager.notify(info.computeNotificationId(),
-                        info.createNotification("", true));
-            }
-        }
-    }
-
-    private Im.ProviderSettings.QueryMap getProviderSettings(long providerId) {
-        Im.ProviderSettings.QueryMap res = mSettings.get(providerId);
-        if (res == null) {
-            res = new Im.ProviderSettings.QueryMap(mContext.getContentResolver(),
-                    providerId, true, mHandler);
-            mSettings.put(providerId, res);
-        }
-        return res;
-    }
-
-    private boolean isNotificationEnabled(long providerId) {
-        Im.ProviderSettings.QueryMap settings = getProviderSettings(providerId);
-        return settings.getEnableNotification();
-    }
-
-    private void notify(String sender, String title, String tickerText, String message,
-            long providerId, long accountId, Intent intent, boolean lightWeightNotify) {
-        NotificationInfo info;
-        synchronized (mNotificationInfos) {
-            info = mNotificationInfos.get(providerId);
-            if (info == null) {
-                info = new NotificationInfo(providerId, accountId);
-                mNotificationInfos.put(providerId, info);
-            }
-            info.addItem(sender, title, message, intent);
-        }
-
-        mNotificationManager.notify(info.computeNotificationId(),
-                info.createNotification(tickerText, lightWeightNotify));
-    }
-
-    private void setRinger(long providerId, Notification notification) {
-        Im.ProviderSettings.QueryMap settings = getProviderSettings(providerId);
-        String ringtoneUri = settings.getRingtoneURI();
-        boolean vibrate = settings.getVibrate();
-
-        notification.sound = TextUtils.isEmpty(ringtoneUri) ? null : Uri.parse(ringtoneUri);
-        if (notification.sound != null) {
-            mLastSoundPlayedMs = SystemClock.elapsedRealtime();
-        }
-
-        if (DBG) log("setRinger: notification.sound = " + notification.sound);
-
-        if (vibrate) {
-            notification.defaults |= Notification.DEFAULT_VIBRATE;
-            if (DBG) log("setRinger: defaults |= vibrate");
-        }
-    }
-
-    class NotificationInfo {
-        class Item {
-            String mTitle;
-            String mMessage;
-            Intent mIntent;
-
-            public Item(String title, String message, Intent intent) {
-                mTitle = title;
-                mMessage = message;
-                mIntent = intent;
-            }
-        }
-
-        private HashMap<String, Item> mItems;
-
-        private long mProviderId;
-        private long mAccountId;
-
-        public NotificationInfo(long providerId, long accountId) {
-            mProviderId = providerId;
-            mAccountId = accountId;
-            mItems = new HashMap<String, Item>();
-        }
-
-        public int computeNotificationId() {
-            return (int)mProviderId;
-        }
-
-        public synchronized void addItem(String sender, String title, String message, Intent intent) {
-            Item item = mItems.get(sender);
-            if (item == null) {
-                item = new Item(title, message, intent);
-                mItems.put(sender, item);
-            } else {
-                item.mTitle = title;
-                item.mMessage = message;
-                item.mIntent = intent;
-            }
-        }
-
-        public synchronized boolean removeItem(String sender) {
-            Item item =  mItems.remove(sender);
-            if (item != null) {
-                return true;
-            }
-            return false;
-        }
-
-        public Notification createNotification(String tickerText, boolean lightWeightNotify) {
-            Notification notification = new Notification(
-                    android.R.drawable.stat_notify_chat,
-                    lightWeightNotify ? null : tickerText,
-                    System.currentTimeMillis());
-
-            Intent intent = getIntent();
-
-            notification.setLatestEventInfo(mContext, getTitle(), getMessage(),
-                    PendingIntent.getActivity(mContext, 0, intent, 0));
-            notification.flags |= Notification.FLAG_AUTO_CANCEL;
-            if (!(lightWeightNotify || shouldSuppressSoundNotification())) {
-                setRinger(mProviderId, notification);
-            }
-            return notification;
-        }
-
-        private Intent getDefaultIntent() {
-            Intent intent = new Intent(Intent.ACTION_VIEW);
-            intent.setType(Im.Contacts.CONTENT_TYPE);
-            intent.setClass(mContext, ContactListActivity.class);
-            intent.putExtra(ImServiceConstants.EXTRA_INTENT_ACCOUNT_ID, mAccountId);
-
-            return intent;
-        }
-
-        private Intent getMultipleNotificationIntent() {
-            Intent intent = new Intent(Intent.ACTION_VIEW);
-            intent.setClass(mContext, NewChatActivity.class);
-            intent.putExtra(ImServiceConstants.EXTRA_INTENT_PROVIDER_ID, mProviderId);
-            intent.putExtra(ImServiceConstants.EXTRA_INTENT_ACCOUNT_ID, mAccountId);
-            intent.putExtra(ImServiceConstants.EXTRA_INTENT_SHOW_MULTIPLE, true);
-            return intent;
-        }
-
-        public String getTitle() {
-            int count = mItems.size();
-            if (count == 0) {
-                return null;
-            } else if (count == 1) {
-                Item item = mItems.values().iterator().next();
-                return item.mTitle;
-            } else {
-                return mContext.getString(R.string.newMessages_label,
-                        Im.Provider.getProviderNameForId(mContext.getContentResolver(), mProviderId));
-            }
-        }
-
-        public String getMessage() {
-            int count = mItems.size();
-            if (count == 0) {
-                return null;
-            } else if (count == 1) {
-                Item item = mItems.values().iterator().next();
-                return item.mMessage;
-            } else {
-                return mContext.getString(R.string.num_unread_chats, count);
-            }
-        }
-
-        public Intent getIntent() {
-            int count = mItems.size();
-            if (count == 0) {
-                return getDefaultIntent();
-            } else if (count == 1) {
-                Item item = mItems.values().iterator().next();
-                return item.mIntent;
-            } else {
-                return getMultipleNotificationIntent();
-            }
-        }
-    }
-
-    private static void log(String msg) {
-        Log.d(RemoteImService.TAG, "[StatusBarNotify] " + msg);
-    }
-
-    private boolean shouldSuppressSoundNotification() {
-        return (SystemClock.elapsedRealtime() - mLastSoundPlayedMs < SUPPRESS_SOUND_INTERVAL_MS);
-    }
-}