Android Open Source - steamchat Steam Service Handler






From Project

Back to project page steamchat.

License

The source code is released under:

Apache License

If you think the Android project steamchat listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.kevelbreh.steamchat.steam;
/* w  ww . java2  s  .c o m*/
import android.os.Handler;
import android.os.Message;

import com.kevelbreh.steamchat.SteamChat;

/**
 * Steam service handler is responsible for relaying data between the Steam android service
 * {@link com.kevelbreh.steamchat.steam.SteamService} and any other activity or fragment wanting to
 * send or receive information.
 *
 * This handler is used on both ends of communication.
 */
public class SteamServiceHandler extends Handler {

    public static final int ARG_NORMAL                                  = 0;
    public static final int ARG_BROADCAST                               = -1;

    public static final int HANDLER_ADD                                 = 101;
    public static final int HANDLER_REMOVE                              = 102;

    public static final int CONNECTION_REFUSED                          = 201;
    public static final int CONNECTION_TERMINATED                       = 202;
    public static final int CONNECTION_TERMINATE                        = 203;
    public static final int CONNECTION_ESTABLISHED                      = 204;
    public static final int CONNECTION_RETRY                            = 205;
    public static final int CONNECTION_SHUFFLE_TARGET                   = 206;

    public static final int AUTHENTICATION_REQUIRED                     = 301;
    public static final int AUTHENTICATE_NOW                            = 302;
    public static final int AUTHENTICATION_GUARDED                      = 303;
    public static final int AUTHENTICATION_SUCCESS                      = 304;
    public static final int AUTHENTICATION_FAILED                       = 305;
    public static final int AUTHENTICATION_INVALID_PASSWORD             = 306;
    public static final int IS_AUTHENTICATED                            = 307;
    public static final int GET_AUTHENTICATOR                           = 308;
    public static final int GOT_AUTHENTICATOR                           = 309;

    @Override
    public void handleMessage(Message message) {
        if (message.arg1 == ARG_BROADCAST) {
            onBroadcast(message);
        }

        switch (message.what) {
            case HANDLER_ADD: onAddHandler(message); break;
            case HANDLER_REMOVE: onRemoveHandler(message); break;
            case CONNECTION_REFUSED: onConnectionRefused(message); break;
            case CONNECTION_TERMINATED: onConnectionTerminated(message); break;
            case CONNECTION_ESTABLISHED: onConnectionEstablished(message); break;
            case AUTHENTICATION_REQUIRED: onAuthenticationRequired(message); break;
            case AUTHENTICATE_NOW: onAuthenticateNow(message); break;
            case AUTHENTICATION_GUARDED: onAuthenticationGuarded(message); break;
            case AUTHENTICATION_SUCCESS: onAuthenticationSuccess(message); break;
            case AUTHENTICATION_FAILED: onAuthenticationFailed(message); break;
            case AUTHENTICATION_INVALID_PASSWORD: onAuthenticationInvalidPassword(message); break;
            case IS_AUTHENTICATED: onIsAuthenticated(message); break;
            case GET_AUTHENTICATOR: onGetAuthenticator(message); break;
            case GOT_AUTHENTICATOR: onGetAuthenticator(message); break;
            default:
                super.handleMessage(message);
        }
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onBroadcast(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onAddHandler(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onRemoveHandler(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onConnectionRefused(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onConnectionTerminated(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onConnectionEstablished(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onAuthenticationRequired(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onAuthenticateNow(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onAuthenticationGuarded(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onAuthenticationSuccess(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onAuthenticationFailed(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onAuthenticationInvalidPassword(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onIsAuthenticated(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onGetAuthenticator(Message message) {
        // This needs to be overridden to to be handled.
    }

    /**
     *
     * @param message being received via the handler.
     */
    public void onGotAuthenticator(Message message) {
        // This needs to be overridden to to be handled.
    }

}




Java Source Code List

com.kevelbreh.steamchat.SteamChat.java
com.kevelbreh.steamchat.account.AuthenticatorService.java
com.kevelbreh.steamchat.account.Authenticator.java
com.kevelbreh.steamchat.account.SteamAccount.java
com.kevelbreh.steamchat.activity.AuthenticationActivity.java
com.kevelbreh.steamchat.activity.ConversationActivity.java
com.kevelbreh.steamchat.activity.FriendsActivity.java
com.kevelbreh.steamchat.activity.InteractionsActivity.java
com.kevelbreh.steamchat.activity.LauncherActivity.java
com.kevelbreh.steamchat.activity.SettingsActivity.java
com.kevelbreh.steamchat.fragment.ConversationFragment.java
com.kevelbreh.steamchat.fragment.FriendsFragment.java
com.kevelbreh.steamchat.fragment.InteractionsFragment.java
com.kevelbreh.steamchat.fragment.SettingsFragment.java
com.kevelbreh.steamchat.provider.SteamProviderUtils.java
com.kevelbreh.steamchat.provider.SteamProvider.java
com.kevelbreh.steamchat.provider.content.InteractionContentItem.java
com.kevelbreh.steamchat.provider.content.PersonaContentItem.java
com.kevelbreh.steamchat.provider.content.UserContentItem.java
com.kevelbreh.steamchat.steam2.SteamConnection.java
com.kevelbreh.steamchat.steam2.SteamEventBus.java
com.kevelbreh.steamchat.steam2.SteamService.java
com.kevelbreh.steamchat.steam2.handler.ConnectionHandler.java
com.kevelbreh.steamchat.steam2.handler.FriendHandler.java
com.kevelbreh.steamchat.steam2.handler.MessageHandler.java
com.kevelbreh.steamchat.steam2.handler.UserHandler.java
com.kevelbreh.steamchat.steam2.packet.Packet.java
com.kevelbreh.steamchat.steam2.packet.ProtoPacket.java
com.kevelbreh.steamchat.steam.SteamClient.java
com.kevelbreh.steamchat.steam.SteamID.java
com.kevelbreh.steamchat.steam.SteamServiceHandler.java
com.kevelbreh.steamchat.steam.SteamService.java
com.kevelbreh.steamchat.steam.handler2.ConnectionHandler.java
com.kevelbreh.steamchat.steam.handler2.FriendHandler.java
com.kevelbreh.steamchat.steam.handler2.Handler.java
com.kevelbreh.steamchat.steam.handler2.UserHandler.java
com.kevelbreh.steamchat.steam.handler.AEventHandler.java
com.kevelbreh.steamchat.steam.handler.AuthenticationHandler.java
com.kevelbreh.steamchat.steam.handler.FriendsHandler.java
com.kevelbreh.steamchat.steam.handler.IEventHandler.java
com.kevelbreh.steamchat.steam.handler.IHandler.java
com.kevelbreh.steamchat.steam.handler.MessageDebugHandler.java
com.kevelbreh.steamchat.steam.language.Language.java
com.kevelbreh.steamchat.steam.language.Message.java
com.kevelbreh.steamchat.steam.network.TCPConnection.java
com.kevelbreh.steamchat.steam.network.packet.ChannelEncryptRequest.java
com.kevelbreh.steamchat.steam.network.packet.ChannelEncryptResponse.java
com.kevelbreh.steamchat.steam.network.packet.ChannelEncryptResult.java
com.kevelbreh.steamchat.steam.network.packet.ClientLogOnResponse.java
com.kevelbreh.steamchat.steam.network.packet.ClientLogOn.java
com.kevelbreh.steamchat.steam.network.packet.HeartBeat.java
com.kevelbreh.steamchat.steam.network.packet.MultiPacket.java
com.kevelbreh.steamchat.steam.network.packet.Packet.java
com.kevelbreh.steamchat.steam.network.packet.ProtoPacket.java
com.kevelbreh.steamchat.steam.proto.DescriptorsProto.java
com.kevelbreh.steamchat.steam.proto.EncryptedAppTicketProto.java
com.kevelbreh.steamchat.steam.proto.SteamMessagesBaseProto.java
com.kevelbreh.steamchat.steam.proto.SteamMessagesClientServerProto.java
com.kevelbreh.steamchat.steam.security.AsnKeyParser.java
com.kevelbreh.steamchat.steam.security.AsnParser.java
com.kevelbreh.steamchat.steam.security.BerDecodeException.java
com.kevelbreh.steamchat.steam.security.Cryptography.java
com.kevelbreh.steamchat.steam.security.NetEncryption.java
com.kevelbreh.steamchat.steam.security.PublicKey.java
com.kevelbreh.steamchat.steam.security.RSA.java
com.kevelbreh.steamchat.steam.util.BinaryReader.java
com.kevelbreh.steamchat.steam.util.BinaryWriter.java
com.kevelbreh.steamchat.steam.util.BitVector64.java
com.kevelbreh.steamchat.steam.util.JenkinsHash.java
com.kevelbreh.steamchat.util.AServiceActivity.java
com.kevelbreh.steamchat.util.Dump.java
com.kevelbreh.steamchat.util.MiscUtils.java
com.kevelbreh.steamchat.widget.adapter.ChatAdapter.java
com.kevelbreh.steamchat.widget.adapter.ConversationAdapter.java
com.kevelbreh.steamchat.widget.adapter.FriendAdapter.java
com.kevelbreh.steamchat.widget.view.AvatarView.java
com.kevelbreh.steamchat.widget.view.FriendInteractionsView.java