1 /* 2 * Copyright (C) 2007-2008 Esmertec AG. 3 * Copyright (C) 2007-2008 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package com.android.im.app.adapter; 19 20 import android.util.Log; 21 22 import com.android.im.IChatListener; 23 import com.android.im.IChatSession; 24 import com.android.im.app.ImApp; 25 import com.android.im.engine.Contact; 26 import com.android.im.engine.ImErrorInfo; 27 import com.android.im.engine.Message; 28 29 public class ChatListenerAdapter extends IChatListener.Stub { 30 31 private static final String TAG = ImApp.LOG_TAG; 32 onContactJoined(IChatSession ses, Contact contact)33 public void onContactJoined(IChatSession ses, Contact contact) { 34 if (Log.isLoggable(TAG, Log.DEBUG)) { 35 Log.d(TAG, "onContactJoined(" + ses + ", " + contact + ")"); 36 } 37 } 38 onContactLeft(IChatSession ses, Contact contact)39 public void onContactLeft(IChatSession ses, Contact contact) { 40 if (Log.isLoggable(TAG, Log.DEBUG)) { 41 Log.d(TAG, "onContactLeft(" + ses + ", " + contact + ")"); 42 } 43 } 44 onIncomingMessage(IChatSession ses, Message msg)45 public void onIncomingMessage(IChatSession ses, Message msg) { 46 if (Log.isLoggable(TAG, Log.DEBUG)) { 47 Log.d(TAG, "onIncomingMessage(" + ses + ", " + msg + ")"); 48 } 49 } 50 onSendMessageError(IChatSession ses, Message msg, ImErrorInfo error)51 public void onSendMessageError(IChatSession ses, Message msg, 52 ImErrorInfo error) { 53 if (Log.isLoggable(TAG, Log.DEBUG)) { 54 Log.d(TAG, "onSendMessageError(" + ses + ", " + msg + ", " + error + ")"); 55 } 56 } 57 onInviteError(IChatSession ses, ImErrorInfo error)58 public void onInviteError(IChatSession ses, ImErrorInfo error) { 59 if (Log.isLoggable(TAG, Log.DEBUG)) { 60 Log.d(TAG, "onInviteError(" + ses + ", " + error + ")"); 61 } 62 } 63 onConvertedToGroupChat(IChatSession ses)64 public void onConvertedToGroupChat(IChatSession ses) { 65 if (Log.isLoggable(TAG, Log.DEBUG)) { 66 Log.d(TAG, "onConvertedToGroupChat(" + ses + ")"); 67 } 68 } 69 70 } 71