public class

KddiPacketSMSManager

extends Object
java.lang.Object
   ↳ com.kddi.android.internal.telephony.cdma.KddiPacketSMSManager

Summary

Nested Classes
class KddiPacketSMSManager.AddressAlreadyInUseException Solution 1 Start ** protected boolean kddiConnectSocket() { if(KDDI_OUTPUT_VERBOSE_LOG) { Log.v(KDDI_TAG, "kddiConnectSocket Start"); } try { mLocalPort++; if (mLocalPort < 5000 || mLocalPort > 6999) { mLocalPort = 5000; } Log.d(KDDI_TAG, "local port: " + mLocalPort); mSocket = new Socket(mKddiChatGateWayIP, KDDI_CHGW_PORT, null, mLocalPort); mErrorCount = 0; // reset error count mIn = mSocket.getInputStream(); mOut = mSocket.getOutputStream(); // Create result receive thread mRetReceiver = new KddiResultReceiver(); mRetRevThread = new Thread(mRetReceiver, "KddiResultReceiver"); } // +[hTC]Kelvin, change source port if the port is using catch (java.net.BindException ex) { //ex.printStackTrace(); String es = ex.getMessage(); if (KDDI_OUTPUT_DEBUG_LOG) { Log.d(KDDI_TAG, "bindexception: " + es); } if (es.startsWith("Address already in use")) { if (KDDI_OUTPUT_DEBUG_LOG) { Log.d(KDDI_TAG, "change source port"); } mErrorCount++; if (mErrorCount > 50) { Log.d(KDDI_TAG, "error count limit!" + mErrorCount); mErrorCount = 0; return false; } else { return kddiConnectSocket(); } } else { ex.printStackTrace(); return false; } } // -[hTC]Kelvin, change source port if the port is using catch(UnknownHostException e) { e.printStackTrace(); if(KDDI_OUTPUT_DEBUG_LOG) { Log.d( KDDI_TAG, e.toString()); } return false; } catch(IOException e) { e.printStackTrace(); if(KDDI_OUTPUT_DEBUG_LOG) { Log.d( KDDI_TAG, e.toString()); } return false; } if(KDDI_OUTPUT_VERBOSE_LOG) { Log.v(KDDI_TAG, "kddiConnectSocket End"); } return true; } /** Solution1 End  
class KddiPacketSMSManager.KddiBgHandler  
Constants
long HTC_RETRY_INTERVAL_TIMER
int HTC_RETRY_MAX_TIMES
int KDDI_EVENT_CLOSE_SESSION
int KDDI_EVENT_CLOSE_SOCKET
int KDDI_EVENT_DATA_STATE_CHANGED
int KDDI_EVENT_MULTIPLE_SEND_ERROR
int KDDI_EVENT_PACKETSMSMGR_SYS_ERROR
int KDDI_EVENT_REQ_CONNECT
int KDDI_EVENT_REQ_SEND_MSG
int KDDI_EVENT_SEND
int KDDI_EVENT_SEND_CANCEL
int KDDI_SEND_SMS
int KDDI_SEND_SMS_IN_QUEUE
long SEND_DELAY_MILIIS
Public Methods
static KddiPacketSMSManager kddiGetInstance()
Get instance of KddiPacketSMSManager Return instance of KddiPacketSMSManager.
boolean kddiSendCancel(PendingIntent sentIntent)
Message send cancel The send cancellation is done when context in the request origin and context under processing agree.
void kddiSendSmsMessage(KddiPacketSMSManager.PacketTracker tracker)
remove original KDDI's codes ** public void kddiSendSmsMessage(Context context, String destAddr, String message, PendingIntent sentIntent, int sendingMode) { //** +[hTC]Kelvin, handle multiple send request
void kddiSendSmsMessage(Context context, String destAddr, String message, PendingIntent sentIntent, int sendingMode)
Send PacketSMS message PacketSMS message send request is received, and message send request is done.
static int lookupHost(String hostname)
Look up a host name and return the result as an int.
void setISmsInterface(ISms isms)
Protected Methods
void finalize()
boolean htcConnectSocket()
void htcCreateSocket()
boolean isRadioState(Context context)
Check radio state The state of the radio is checked.
boolean isServiceState(Context context)
boolean kddiChangeNwDevice()
remove original codes ** int ipAddress = NetworkUtils.lookupHost(mKddiChatGateWayIP); return mConnectivityManager.requestRouteToHost (mConnectivityManager.TYPE_MOBILE, ipAddress); } /** -[hTC]Kelvin110329, remove End
int kddiCheckCmailProfile()
int kddiConnectSession()
remove original codes ** return 0; } /** -[hTC]Kelvin110329, remove original codes End
boolean kddiConnectSocket()
int kddiDisconnectSession()
remove original codes ** return 0; } /** -[hTC]Kelvin110329, remove original codes End
boolean kddiIsCallState()
Check on calling state Call state is acquired, and on calling or idle is returned.
void kddiRelease()
Release The following processing is executed as release processing.
void kddiSetIntentFilter()
remove original codes ** if(KDDI_OUTPUT_VERBOSE_LOG) { Log.v(KDDI_TAG, "kddiSetIntentFilter End"); } } if(null == mDataConnectIntentfilter) { if(KDDI_OUTPUT_VERBOSE_LOG) { Log.v(KDDI_TAG, "setIntentFilter Start for data state change"); } mDataConnectIntentfilter = new IntentFilter(); // Set action mDataConnectIntentfilter.addAction(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED); // registration of receiver Intent intent = mContext.registerReceiver(mPsmsSender.mDataConnectIntentRev, mDataConnectIntentfilter); if(KDDI_OUTPUT_VERBOSE_LOG) { Log.v(KDDI_TAG, "DataConnectIntent Register return Intent["+ intent +"]"); } if(KDDI_OUTPUT_VERBOSE_LOG) { Log.v(KDDI_TAG, "setIntentFilter End for data state change"); } } return; } /** remove original codes End
void kddiWriteSocket()
Message writing request for socket convert into the IRC format.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

protected static final long HTC_RETRY_INTERVAL_TIMER

Constant Value: 5000 (0x0000000000001388)

protected static final int HTC_RETRY_MAX_TIMES

Constant Value: 6 (0x00000006)

protected static final int KDDI_EVENT_CLOSE_SESSION

Constant Value: 2 (0x00000002)

protected static final int KDDI_EVENT_CLOSE_SOCKET

Constant Value: 3 (0x00000003)

protected static final int KDDI_EVENT_DATA_STATE_CHANGED

Constant Value: 1 (0x00000001)

protected static final int KDDI_EVENT_MULTIPLE_SEND_ERROR

Constant Value: 7 (0x00000007)

protected static final int KDDI_EVENT_PACKETSMSMGR_SYS_ERROR

Constant Value: 8 (0x00000008)

protected static final int KDDI_EVENT_REQ_CONNECT

Constant Value: 4 (0x00000004)

protected static final int KDDI_EVENT_REQ_SEND_MSG

Constant Value: 0 (0x00000000)

protected static final int KDDI_EVENT_SEND

Constant Value: 5 (0x00000005)

protected static final int KDDI_EVENT_SEND_CANCEL

Constant Value: 6 (0x00000006)

protected static final int KDDI_SEND_SMS

Constant Value: 1 (0x00000001)

protected static final int KDDI_SEND_SMS_IN_QUEUE

Constant Value: 0 (0x00000000)

protected static final long SEND_DELAY_MILIIS

Constant Value: 200 (0x00000000000000c8)

Public Methods

public static KddiPacketSMSManager kddiGetInstance ()

Get instance of KddiPacketSMSManager Return instance of KddiPacketSMSManager.

Returns
  • Instance of KddiPacketSMSManager

public boolean kddiSendCancel (PendingIntent sentIntent)

Message send cancel The send cancellation is done when context in the request origin and context under processing agree.

Parameters
sentIntent Cancel result notification intent
Returns
  • The cancel request is accepted and the result is returned. True is when the cancel is accepted, and false is returned when not accepting. And the cancellation processing result is returned by using sentIntent when the request is accepted.

public void kddiSendSmsMessage (KddiPacketSMSManager.PacketTracker tracker)

remove original KDDI's codes ** public void kddiSendSmsMessage(Context context, String destAddr, String message, PendingIntent sentIntent, int sendingMode) { //** +[hTC]Kelvin, handle multiple send request

public void kddiSendSmsMessage (Context context, String destAddr, String message, PendingIntent sentIntent, int sendingMode)

Send PacketSMS message PacketSMS message send request is received, and message send request is done.

Parameters
context Context
destAddr Destination address
message Message body
sentIntent Result notification intent
sendingMode Send mode identifier(transaction/store)

public static int lookupHost (String hostname)

Look up a host name and return the result as an int. Works if the argument is an IP address in dot notation. Obviously, this can only be used for IPv4 addresses.

Parameters
hostname the name of the host (or the IP address)
Returns
  • the IP address as an int in network byte order

public void setISmsInterface (ISms isms)

Protected Methods

protected void finalize ()

Since: API Level

Throws
Throwable

protected boolean htcConnectSocket ()

protected boolean isRadioState (Context context)

Check radio state The state of the radio is checked.

Parameters
context Context
Returns
  • State of service.When there is service, true is returned.

protected boolean isServiceState (Context context)

protected boolean kddiChangeNwDevice ()

remove original codes ** int ipAddress = NetworkUtils.lookupHost(mKddiChatGateWayIP); return mConnectivityManager.requestRouteToHost (mConnectivityManager.TYPE_MOBILE, ipAddress); } /** -[hTC]Kelvin110329, remove End

protected int kddiCheckCmailProfile ()

protected int kddiConnectSession ()

remove original codes ** return 0; } /** -[hTC]Kelvin110329, remove original codes End

protected boolean kddiConnectSocket ()

protected int kddiDisconnectSession ()

remove original codes ** return 0; } /** -[hTC]Kelvin110329, remove original codes End

protected boolean kddiIsCallState ()

Check on calling state Call state is acquired, and on calling or idle is returned.

Returns
  • Check result of call state.At on calling state, true is returned.

protected void kddiRelease ()

Release The following processing is executed as release processing. - Deletion of registered message event - Release socket - Disconnect session - Network connectivity state listener stop - Send result is notified to the application - Change send state - result receive thread stop

protected void kddiSetIntentFilter ()

remove original codes ** if(KDDI_OUTPUT_VERBOSE_LOG) { Log.v(KDDI_TAG, "kddiSetIntentFilter End"); } } if(null == mDataConnectIntentfilter) { if(KDDI_OUTPUT_VERBOSE_LOG) { Log.v(KDDI_TAG, "setIntentFilter Start for data state change"); } mDataConnectIntentfilter = new IntentFilter(); // Set action mDataConnectIntentfilter.addAction(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED); // registration of receiver Intent intent = mContext.registerReceiver(mPsmsSender.mDataConnectIntentRev, mDataConnectIntentfilter); if(KDDI_OUTPUT_VERBOSE_LOG) { Log.v(KDDI_TAG, "DataConnectIntent Register return Intent["+ intent +"]"); } if(KDDI_OUTPUT_VERBOSE_LOG) { Log.v(KDDI_TAG, "setIntentFilter End for data state change"); } } return; } /** remove original codes End

protected void kddiWriteSocket ()

Message writing request for socket convert into the IRC format. converted message is written in the socket and send request is done to the CHAT server.