Example usage for android.os RemoteException getLocalizedMessage

List of usage examples for android.os RemoteException getLocalizedMessage

Introduction

In this page you can find the example usage for android.os RemoteException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

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

void declineInvitation(long providerId, long invitationId) {
    try {//from   w w w  .ja va 2  s  .  c o  m
        IImConnection conn = mApp.getConnection(providerId);
        if (conn != null) {
            conn.rejectInvitation(invitationId);
        }
    } catch (RemoteException e) {

        mHandler.showServiceErrorAlert(e.getLocalizedMessage());
        LogCleaner.error(ImApp.LOG_TAG, "decline invite error", e);
    }
}

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

void acceptInvitation(long providerId, long invitationId) {
    try {/*www.  java2  s  .  com*/

        IImConnection conn = mApp.getConnection(providerId);
        if (conn != null) {
            conn.acceptInvitation(invitationId);
        }
    } catch (RemoteException e) {

        mHandler.showServiceErrorAlert(e.getLocalizedMessage());
        LogCleaner.error(ImApp.LOG_TAG, "accept invite error", e);
    }
}

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

private IChatSessionManager getChatSessionManager(long providerId) {
    IImConnection conn = mApp.getConnection(providerId);

    if (conn != null) {
        try {/*  w  w  w  .  j ava 2  s  . com*/
            return conn.getChatSessionManager();
        } catch (RemoteException e) {
            mHandler.showServiceErrorAlert(e.getLocalizedMessage());
            LogCleaner.error(ImApp.LOG_TAG, "send message error", e);
        }
    }
    return null;
}

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

void declineSubscription(long providerId, String userName) {
    IImConnection conn = mApp.getConnection(providerId);

    if (conn != null) {
        try {/*from   w w w.  java  2  s. c  o m*/
            IContactListManager manager = conn.getContactListManager();
            manager.declineSubscription(new Contact(new XmppAddress(userName), userName));
        } catch (RemoteException e) {
            mHandler.showServiceErrorAlert(e.getLocalizedMessage());
            LogCleaner.error(ImApp.LOG_TAG, "decline sub error", e);
        }
    }
}

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

void approveSubscription(long providerId, String userName) {
    IImConnection conn = mApp.getConnection(providerId);

    if (conn != null) {
        try {//from w  w  w . j av  a 2  s. c  o m
            IContactListManager manager = conn.getContactListManager();

            manager.approveSubscription(new Contact(new XmppAddress(userName), userName));
        } catch (RemoteException e) {

            mHandler.showServiceErrorAlert(e.getLocalizedMessage());
            LogCleaner.error(ImApp.LOG_TAG, "approve sub error", e);
        }
    }
}

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

IChatSession getCurrentChatSession() {
    int currentPos = mChatPager.getCurrentItem();
    if (currentPos == 0)
        return null;
    Cursor cursorChats = mChatPagerAdapter.getCursor();
    cursorChats.moveToPosition(currentPos - 1);
    long providerId = cursorChats.getLong(ChatView.PROVIDER_COLUMN);
    String username = cursorChats.getString(ChatView.USERNAME_COLUMN);
    IChatSessionManager sessionMgr = getChatSessionManager(providerId);
    if (sessionMgr != null) {
        try {/*from www . j  a v a  2  s  .  co m*/
            IChatSession session = sessionMgr.getChatSession(username);

            if (session == null)
                session = sessionMgr.createChatSession(username, false);

            return session;
        } catch (RemoteException e) {

            mHandler.showServiceErrorAlert(e.getLocalizedMessage());
            LogCleaner.error(ImApp.LOG_TAG, "send message error", e);
        }
    }

    return null;
}

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

private void userActionDetected() {
    // Check that we have a chat session and that our fragment is resumed
    // The latter filters out bogus TextWatcher events on restore from saved
    if (getChatSession() != null && mIsListening) {
        try {//  w  w w  .  j a va 2  s. c o  m
            getChatSession().markAsRead();

            //  updateWarningView();

        } catch (RemoteException e) {

            mHandler.showServiceErrorAlert(e.getLocalizedMessage());
            LogCleaner.error(ImApp.LOG_TAG, "send message error", e);
        }
    }
}

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

public void closeChatSession(boolean doDelete) {
    if (getChatSession() != null) {
        try {/*from w  w  w . j av  a  2s  . co m*/

            if (doDelete)
                setOTRState(false);

            updateWarningView();
            getChatSession().leave();

        } catch (RemoteException e) {

            mHandler.showServiceErrorAlert(e.getLocalizedMessage());
            LogCleaner.error(ImApp.LOG_TAG, "send message error", e);
        }
    }

    if (doDelete)
        deleteChat();

}

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

private void userActionDetected() {
    // Check that we have a chat session and that our fragment is resumed
    // The latter filters out bogus TextWatcher events on restore from saved
    if (getChatSession() != null && mIsListening) {
        try {//from   w w w .j a va 2s.  co m
            getChatSession().markAsRead();
            //updateWarningView();

        } catch (RemoteException e) {

            mHandler.showServiceErrorAlert(e.getLocalizedMessage());
            LogCleaner.error(ImApp.LOG_TAG, "send message error", e);
        }
    }

    toggleInputMode();

}

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

public void closeChatSession(boolean doDelete) {
    if (getChatSession() != null) {
        try {/* w ww . ja v  a 2s .co m*/

            setOTRState(false);
            updateWarningView();
            getChatSession().leave();

        } catch (RemoteException e) {

            mHandler.showServiceErrorAlert(e.getLocalizedMessage());
            LogCleaner.error(ImApp.LOG_TAG, "send message error", e);
        }
    }

    if (doDelete)
        deleteChat();

}