Example usage for android.util Log DEBUG

List of usage examples for android.util Log DEBUG

Introduction

In this page you can find the example usage for android.util Log DEBUG.

Prototype

int DEBUG

To view the source code for android.util Log DEBUG.

Click Source Link

Document

Priority constant for the println method; use Log.d.

Usage

From source file:info.guardianproject.otr.app.im.app.ChatView.java

public void bindChat(long chatId) {
    log("bind " + this + " " + chatId);
    mLastChatId = chatId;//from  w  w  w .  j av  a2 s.  co m

    Uri contactUri = ContentUris.withAppendedId(Imps.Contacts.CONTENT_URI, chatId);
    Cursor c = mNewChatActivity.getContentResolver().query(contactUri, CHAT_PROJECTION, null, null, null);

    if (c == null)
        return;

    if (!c.moveToFirst()) {
        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
            log("Failed to query chat: " + chatId);
        }
        mLastChatId = -1;

        c.close();

    } else {

        updateSessionInfo(c);

        if (mRemoteAvatar == null) {
            try {
                mRemoteAvatar = DatabaseUtils.getAvatarFromCursor(c, AVATAR_COLUMN, ImApp.DEFAULT_AVATAR_WIDTH,
                        ImApp.DEFAULT_AVATAR_HEIGHT);
            } catch (Exception e) {
            }

            if (mRemoteAvatar == null) {
                mRemoteAvatar = new RoundedAvatarDrawable(
                        BitmapFactory.decodeResource(getResources(), R.drawable.avatar_unknown));

            }

            updatePresenceDisplay();

        }

        c.close();

        mCurrentChatSession = getChatSession();

        if (mCurrentChatSession == null)
            mCurrentChatSession = createChatSession();

        if (mCurrentChatSession != null) {
            isServiceUp = true;

        }

        updateChat();
    }

}

From source file:com.irccloud.android.fragment.MessageViewFragment.java

@Override
public void onLowMemory() {
    super.onLowMemory();
    Crashlytics.log(Log.DEBUG, "IRCCloud",
            "Received low memory warning in the foreground, cleaning backlog in other buffers");
    for (BuffersDataSource.Buffer b : BuffersDataSource.getInstance().getBuffers()) {
        if (b != buffer)
            EventsDataSource.getInstance().pruneEvents(b.bid);
    }/*from   w ww.  ja  v  a 2s  . co  m*/
}

From source file:info.guardianproject.otr.app.im.app.ChatView.java

public void bindInvitation(long invitationId) {
    Uri uri = ContentUris.withAppendedId(Imps.Invitation.CONTENT_URI, invitationId);
    ContentResolver cr = mNewChatActivity.getContentResolver();
    Cursor cursor = cr.query(uri, INVITATION_PROJECT, null, null, null);
    try {/*  w w  w  .  jav a  2  s.  c  o m*/
        if (!cursor.moveToFirst()) {
            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
                log("Failed to query invitation: " + invitationId);
            }
            //  mNewChatActivity.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));
            //  mNewChatActivity.setTitle(mContext.getString(R.string.chat_with, sender));
        }
    } finally {
        cursor.close();
    }

}

From source file:info.guardianproject.otr.app.im.app.ChatView.java

private synchronized void startQuery(long chatId) {
    if (mQueryHandler == null) {
        mQueryHandler = new QueryHandler(mContext);
    } else {// ww w .  jav a  2  s.com
        // Cancel any pending queries
        mQueryHandler.cancelOperation(QUERY_TOKEN);
    }

    Uri uri = Imps.Messages.getContentUriByThreadId(chatId);

    if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
        log("queryCursor: uri=" + uri);
    }

    mQueryHandler.startQuery(QUERY_TOKEN, null, uri, null, null /* selection */, null /* selection args */,
            "date");
}

From source file:info.guardianproject.otr.app.im.app.ChatView.java

void scheduleRequery(long interval) {
    if (mRequeryCallback == null) {
        mRequeryCallback = new RequeryCallback();
    } else {/*  w ww. j a  va2 s  . c o m*/
        mHandler.removeCallbacks(mRequeryCallback);
    }

    if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
        log("scheduleRequery");
    }
    mHandler.postDelayed(mRequeryCallback, interval);
}

From source file:info.guardianproject.otr.app.im.app.ChatView.java

void cancelRequery() {
    if (mRequeryCallback != null) {
        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
            log("cancelRequery");
        }/* w ww . ja  va  2  s .c o  m*/
        mHandler.removeCallbacks(mRequeryCallback);
        mRequeryCallback = null;
    }
}

From source file:org.awesomeapp.messenger.ui.ConversationView.java

public void bindChat(long chatId, String address, String name) {
    //log("bind " + this + " " + chatId);

    mLastChatId = chatId;/* w w  w  . j a  v a2s  . com*/

    setViewType(VIEW_TYPE_CHAT);

    Uri contactUri = ContentUris.withAppendedId(Imps.Contacts.CONTENT_URI, chatId);
    Cursor c = mActivity.getContentResolver().query(contactUri, CHAT_PROJECTION, null, null, null);

    if (c == null)
        return;

    if (!c.moveToFirst()) {
        if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
            log("Failed to query chat: " + chatId);
        }
        mLastChatId = -1;

        c.close();

    } else {

        updateSessionInfo(c);

        if (mRemoteAvatar == null) {
            try {
                mRemoteAvatar = DatabaseUtils.getAvatarFromCursor(c, AVATAR_COLUMN, ImApp.DEFAULT_AVATAR_WIDTH,
                        ImApp.DEFAULT_AVATAR_HEIGHT);
            } catch (Exception e) {
            }

            if (mRemoteAvatar == null) {
                mRemoteAvatar = new RoundedAvatarDrawable(
                        BitmapFactory.decodeResource(mActivity.getResources(), R.drawable.avatar_unknown));

            }

            updatePresenceDisplay();

        }

        if (mRemoteHeader == null) {
            try {
                mRemoteHeader = DatabaseUtils.getHeaderImageFromCursor(c, AVATAR_COLUMN,
                        ImApp.DEFAULT_AVATAR_WIDTH, ImApp.DEFAULT_AVATAR_HEIGHT);
            } catch (Exception e) {
            }
        }

        c.close();

        mCurrentChatSession = getChatSession();

        if (mCurrentChatSession == null)
            mCurrentChatSession = createChatSession();

        if (mCurrentChatSession != null) {
            isServiceUp = true;

        }

        updateChat();

        if (mRemoteNickname == null)
            if (TextUtils.isEmpty(name))
                setGroupTitle();
            else
                mRemoteNickname = name;

        try {
            mRemoteNickname = mRemoteNickname.split("@")[0].split("\\.")[0];
        } catch (Exception e) {
            //handle glitches in unicode nicknames
        }
    }

}

From source file:org.awesomeapp.messenger.ui.ConversationView.java

public void bindInvitation(long invitationId) {
    Uri uri = ContentUris.withAppendedId(Imps.Invitation.CONTENT_URI, invitationId);
    ContentResolver cr = mActivity.getContentResolver();
    Cursor cursor = cr.query(uri, INVITATION_PROJECT, null, null, null);
    try {/*from w  ww.  j  a  v a 2 s  .c om*/
        if (!cursor.moveToFirst()) {
            if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) {
                log("Failed to query invitation: " + invitationId);
            }
            //  mNewChatActivity.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) mActivity.findViewById(R.id.txtInvitation);
            mInvitationText.setText(mContext.getString(R.string.invitation_prompt, sender));
            //  mNewChatActivity.setTitle(mContext.getString(R.string.chat_with, sender));
        }
    } finally {
        cursor.close();
    }

}

From source file:com.irccloud.android.data.collection.NotificationsList.java

public NotificationCompat.Builder alert(int bid, String title, String body) {
    Crashlytics.log(Log.DEBUG, "IRCCloud", "Posting alert notification");
    NotificationCompat.Builder builder = new NotificationCompat.Builder(
            IRCCloudApplication.getInstance().getApplicationContext()).setContentTitle(title)
                    .setContentText(body).setTicker(body).setAutoCancel(true)
                    .setColor(IRCCloudApplication.getInstance().getApplicationContext().getResources()
                            .getColor(R.color.ic_background))
                    .setSmallIcon(R.drawable.ic_stat_notify);

    Intent i = new Intent();
    i.setComponent(new ComponentName(IRCCloudApplication.getInstance().getApplicationContext().getPackageName(),
            "com.irccloud.android.MainActivity"));
    i.putExtra("bid", bid);
    i.setData(Uri.parse("bid://" + bid));
    builder.setContentIntent(/*  w  w w  .j av a  2s.  co  m*/
            PendingIntent.getActivity(IRCCloudApplication.getInstance().getApplicationContext(), 0, i,
                    PendingIntent.FLAG_UPDATE_CURRENT));

    NotificationManagerCompat.from(IRCCloudApplication.getInstance().getApplicationContext()).notify(bid,
            builder.build());

    return builder;
}